From a115a51fd97f18277cae87a84ca28f79b6ffe711 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 2 May 2014 21:06:36 +0400 Subject: [PATCH] Users Plugin: fixes --- plugins/box/users/js/users.js | 6 ++--- plugins/box/users/users.admin.php | 4 ++-- .../box/users/views/backend/index.view.php | 23 +++++++++---------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/plugins/box/users/js/users.js b/plugins/box/users/js/users.js index 36cf08f..cc96c07 100644 --- a/plugins/box/users/js/users.js +++ b/plugins/box/users/js/users.js @@ -7,9 +7,9 @@ $.monstra.users = { }, usersFrontendRegistration: function() { - $("[name=users_frontend_registration]").click(function() { - $("[name=users_frontend]").submit(); - }); + $('#users_frontend_registration').on('ifChanged', function(event){ + $("form[name=users_frontend]").submit(); + }); } }; diff --git a/plugins/box/users/users.admin.php b/plugins/box/users/users.admin.php index 7611422..1b4906d 100755 --- a/plugins/box/users/users.admin.php +++ b/plugins/box/users/users.admin.php @@ -21,7 +21,7 @@ class UsersAdmin extends Backend // Get uses table $users = new Table('users'); - if (Option::get('users_frontend_registration') == 'true') { + if (Option::get('users_frontend_registration') == '1') { $users_frontend_registration = true; } else { $users_frontend_registration = false; @@ -31,7 +31,7 @@ class UsersAdmin extends Backend if (Security::check(Request::post('csrf'))) { - if (Request::post('users_frontend_registration')) $users_frontend_registration = 'true'; else $users_frontend_registration = 'false'; + if (Request::post('users_frontend_registration')) $users_frontend_registration = '1'; else $users_frontend_registration = '0'; if (Option::update('users_frontend_registration', $users_frontend_registration)) { Notification::set('success', __('Your changes have been saved.', 'users')); diff --git a/plugins/box/users/views/backend/index.view.php b/plugins/box/users/views/backend/index.view.php index 68da8f0..66a0a0c 100755 --- a/plugins/box/users/views/backend/index.view.php +++ b/plugins/box/users/views/backend/index.view.php @@ -1,17 +1,16 @@

- __('Register New User', 'users'), 'class' => 'btn btn-primary')); ?> - -
- 'users_frontend')); ?> - -
- -
- 'display:none;')); ?> - +
+
+ __('Register New User', 'users'), 'class' => 'btn btn-primary')); ?> +
+
+ 'users_frontend')); ?> + + + 'display:none;')); ?> + +