diff options
author | itchief <alex.malcev1980@gmail.com> | 2017-08-27 15:23:15 +0300 |
---|---|---|
committer | itchief <alex.malcev1980@gmail.com> | 2017-08-27 15:23:15 +0300 |
commit | 203a6c8be5a9b7f052d2db3e3aedcf96bceb1ef2 (patch) | |
tree | b5cac5477b7abd19b7ab66f7abefbaadaa2c2cc3 /feedback | |
parent | e176a37ef8cc45c2cb49942ea532f1e9ca22d9c4 (diff) |
fix for user agreement
Diffstat (limited to 'feedback')
-rw-r--r-- | feedback/js/main.js | 13 | ||||
-rw-r--r-- | feedback/uploads/.htaccess | 13 |
2 files changed, 21 insertions, 5 deletions
diff --git a/feedback/js/main.js b/feedback/js/main.js index 025f03b..16700ec 100644 --- a/feedback/js/main.js +++ b/feedback/js/main.js @@ -20,7 +20,7 @@ $(function () { // допустимые разрешения файлов this.validFileExtensions = parameters['validFileExtensions'] || ['jpg', 'jpeg', 'bmp', 'gif', 'png']; // флажок о принятии пользовательского соглашения перед отправкой формы - this.agreeCheckbox = parameters['agreeCheckbox'] || true; + this.disableAgreement = parameters['disableAgreement'] || false; // инициализация this.init = function () { @@ -39,15 +39,18 @@ $(function () { $(document).on('change', '#' + this.idForm + ' input[name="attachment[]"]', $.proxy(this.changeInputFile, this)); } - if (this.agreeCheckbox) { // добавление новых элементов input с type="file" - // добавление нового элемента input с type="file" + if (!this.disableAgreement) { $(document).on('change', '#' + this.idForm + ' input[name="agree"]', $.proxy(this.changeAgreement, this)); } if (this.hideForm) { + var self = this; $(submitForm).parent().find('.show-form').click(function (e) { e.preventDefault(); $(this).closest('.success-message').addClass('hidden'); + if (self.disableAgreement) { + self.changeStateSubmit(false); + } $(submitForm).show(); }); } @@ -175,7 +178,7 @@ $(function () { cache: false, beforeSend: function () { $('#' + _this.idForm + ' .progress').show(); - _this.changeStateSubmit(true); + _this.changeStateSubmit(true); }, xhr: function () { @@ -336,7 +339,7 @@ $(function () { validFileExtensions - допустимые расширения файлов (по умолчанию 'jpg','jpeg','bmp','gif','png') existenceCaptcha - наличие у формы капчи (по умолчанию true) hideForm - скрыть форму после отправки данных - agreeCheckbox - флажок о принятии пользовательского соглашения перед отправкой формы (по умолчанию true) + disableAgreement - отключить проверку пользовательского соглашения (по умолчанию false) */ var formFeedback = new ProcessForm({idForm: 'feedbackForm', maxSizeFile: 524288}); diff --git a/feedback/uploads/.htaccess b/feedback/uploads/.htaccess new file mode 100644 index 0000000..cf9c02f --- /dev/null +++ b/feedback/uploads/.htaccess @@ -0,0 +1,13 @@ +# line below if for Apache 2.4 +<ifModule mod_authz_core.c> + Require all denied +</ifModule> + +# line below if for Apache 2.2 +<ifModule !mod_authz_core.c> + deny from all + Satisfy All +</ifModule> + +# section for Apache 2.2 and 2.4 +IndexIgnore *
\ No newline at end of file |