Added message when private form is accessed
This commit is contained in:
parent
6afa2b5e24
commit
c59060b658
|
@ -173,8 +173,8 @@ exports.readForRender = function(req, res) {
|
|||
var newForm = req.form.toJSON();
|
||||
|
||||
if (!newForm.isLive && !req.user) {
|
||||
return res.status(404).send({
|
||||
message: 'Form Does Not Exist'
|
||||
return res.status(401).send({
|
||||
message: 'Form is Not Public'
|
||||
});
|
||||
}
|
||||
|
||||
|
|
626
public/dist/application.js
vendored
626
public/dist/application.js
vendored
File diff suppressed because one or more lines are too long
7
public/dist/application.min.js
vendored
7
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
63
public/dist/form-application.js
vendored
63
public/dist/form-application.js
vendored
File diff suppressed because one or more lines are too long
3
public/dist/form-application.min.js
vendored
3
public/dist/form-application.min.js
vendored
File diff suppressed because one or more lines are too long
22
public/dist/form_populate_template_cache.js
vendored
22
public/dist/form_populate_template_cache.js
vendored
File diff suppressed because one or more lines are too long
26
public/dist/vendor.min.js
vendored
26
public/dist/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
26
public/dist/vendor_forms_uglified.js
vendored
26
public/dist/vendor_forms_uglified.js
vendored
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,6 @@ angular.module('view-form').controller('SubmitFormController', [
|
|||
'$scope', '$rootScope', '$state', '$translate', 'myForm',
|
||||
function($scope, $rootScope, $state, $translate, myForm) {
|
||||
$scope.myform = myForm;
|
||||
$translate.use(myForm.language);
|
||||
$translate.use(myForm.language);
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<section class="auth sigin-view valign-wrapper">
|
||||
<div class="row valign">
|
||||
<h3 class="col-md-12 text-center">Not Authorized to Access Form</h3>
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="col-md-12 text-center" style="padding-bottom: 50px;">
|
||||
The form you are trying to access is currently private and not accesible publically. <br> If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
|
@ -10,12 +10,26 @@ angular.module('view-form').config(['$stateProvider',
|
|||
templateUrl: '/static/form_modules/forms/base/views/submit-form.client.view.html',
|
||||
resolve: {
|
||||
Forms: 'Forms',
|
||||
myForm: function (Forms, $stateParams) {
|
||||
return Forms.get({formId: $stateParams.formId}).$promise;
|
||||
myForm: function (Forms, $q, $state, $stateParams) {
|
||||
var deferred = $q.defer();
|
||||
console.log(Forms.get({formId: $stateParams.formId}).$promise);
|
||||
return Forms.get({formId: $stateParams.formId}).$promise.then(function(data) {
|
||||
console.log(data);
|
||||
return data;
|
||||
}, function(reason) {
|
||||
console.log(reason);
|
||||
$state.go('unauthorizedFormAccess');
|
||||
return deferred.reject({redirectTo: 'unauthorizedFormAccess'});
|
||||
});
|
||||
//return Forms.get({formId: $stateParams.formId}).$promise;
|
||||
}
|
||||
},
|
||||
controller: 'SubmitFormController',
|
||||
controllerAs: 'ctrl'
|
||||
});
|
||||
}
|
||||
}).
|
||||
state('unauthorizedFormAccess', {
|
||||
url: '/forms/unauthorized',
|
||||
templateUrl: '/static/form_modules/forms/base/views/form-unauthorized.client.view.html',
|
||||
});
|
||||
}
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue