1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 04:07:59 +02:00

Users Plugin: fixes

This commit is contained in:
Awilum
2014-05-02 21:06:36 +04:00
parent 23360d4c42
commit a115a51fd9
3 changed files with 16 additions and 17 deletions

View File

@@ -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();
});
}
};

View File

@@ -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'));

View File

@@ -1,17 +1,16 @@
<h2 class="margin-bottom-1"><?php echo __('Users', 'users'); ?></h2>
<?php echo Html::anchor(__('Register New User', 'users'), 'index.php?id=users&action=add', array('title' => __('Register New User', 'users'), 'class' => 'btn btn-primary')); ?>
<div class="pull-right margin-bottom-1">
<?php echo Form::open(null, array('name' => 'users_frontend')); ?>
<?php echo Form::hidden('csrf', Security::token()); ?>
<div class="checkbox">
<label>
<?php echo Form::checkbox('users_frontend_registration', null, $users_frontend_registration); ?> <?php echo __('Allow user registration', 'users') ?>
</label>
</div>
<?php echo Form::input('users_frontend_submit', 'users_frontend_submit', array('style' => 'display:none;')); ?>
<?php echo Form::close();?>
<div class="vertical-align margin-bottom-1">
<div class="text-left">
<?php echo Html::anchor(__('Register New User', 'users'), 'index.php?id=users&action=add', array('title' => __('Register New User', 'users'), 'class' => 'btn btn-primary')); ?>
</div>
<div class="text-right">
<?php echo Form::open(null, array('name' => 'users_frontend')); ?>
<?php echo Form::hidden('csrf', Security::token()); ?>
<?php echo Form::checkbox('users_frontend_registration', 'users_frontend_registration', $users_frontend_registration); ?> <?php echo __('Allow user registration', 'users') ?>
<?php echo Form::input('users_frontend_submit', 'users_frontend_submit', array('style' => 'display:none;')); ?>
<?php echo Form::close();?>
</div>
</div>
<!-- Users_list -->