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();
|
var newForm = req.form.toJSON();
|
||||||
|
|
||||||
if (!newForm.isLive && !req.user) {
|
if (!newForm.isLive && !req.user) {
|
||||||
return res.status(404).send({
|
return res.status(401).send({
|
||||||
message: 'Form Does Not Exist'
|
message: 'Form is Not Public'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
624
public/dist/application.js
vendored
624
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
57
public/dist/form-application.js
vendored
57
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
10
public/dist/form_populate_template_cache.js
vendored
10
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
|
@ -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',
|
templateUrl: '/static/form_modules/forms/base/views/submit-form.client.view.html',
|
||||||
resolve: {
|
resolve: {
|
||||||
Forms: 'Forms',
|
Forms: 'Forms',
|
||||||
myForm: function (Forms, $stateParams) {
|
myForm: function (Forms, $q, $state, $stateParams) {
|
||||||
return Forms.get({formId: $stateParams.formId}).$promise;
|
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',
|
controller: 'SubmitFormController',
|
||||||
controllerAs: 'ctrl'
|
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