mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-05 04:37:51 +02:00
Users Plugin: fixes
This commit is contained in:
@@ -7,8 +7,8 @@ $.monstra.users = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
usersFrontendRegistration: function() {
|
usersFrontendRegistration: function() {
|
||||||
$("[name=users_frontend_registration]").click(function() {
|
$('#users_frontend_registration').on('ifChanged', function(event){
|
||||||
$("[name=users_frontend]").submit();
|
$("form[name=users_frontend]").submit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ class UsersAdmin extends Backend
|
|||||||
// Get uses table
|
// Get uses table
|
||||||
$users = new Table('users');
|
$users = new Table('users');
|
||||||
|
|
||||||
if (Option::get('users_frontend_registration') == 'true') {
|
if (Option::get('users_frontend_registration') == '1') {
|
||||||
$users_frontend_registration = true;
|
$users_frontend_registration = true;
|
||||||
} else {
|
} else {
|
||||||
$users_frontend_registration = false;
|
$users_frontend_registration = false;
|
||||||
@@ -31,7 +31,7 @@ class UsersAdmin extends Backend
|
|||||||
|
|
||||||
if (Security::check(Request::post('csrf'))) {
|
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)) {
|
if (Option::update('users_frontend_registration', $users_frontend_registration)) {
|
||||||
Notification::set('success', __('Your changes have been saved.', 'users'));
|
Notification::set('success', __('Your changes have been saved.', 'users'));
|
||||||
|
@@ -1,17 +1,16 @@
|
|||||||
<h2 class="margin-bottom-1"><?php echo __('Users', 'users'); ?></h2>
|
<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="vertical-align margin-bottom-1">
|
||||||
|
<div class="text-left">
|
||||||
<div class="pull-right margin-bottom-1">
|
<?php echo Html::anchor(__('Register New User', 'users'), 'index.php?id=users&action=add', array('title' => __('Register New User', 'users'), 'class' => 'btn btn-primary')); ?>
|
||||||
<?php echo Form::open(null, array('name' => 'users_frontend')); ?>
|
</div>
|
||||||
<?php echo Form::hidden('csrf', Security::token()); ?>
|
<div class="text-right">
|
||||||
<div class="checkbox">
|
<?php echo Form::open(null, array('name' => 'users_frontend')); ?>
|
||||||
<label>
|
<?php echo Form::hidden('csrf', Security::token()); ?>
|
||||||
<?php echo Form::checkbox('users_frontend_registration', null, $users_frontend_registration); ?> <?php echo __('Allow user registration', 'users') ?>
|
<?php echo Form::checkbox('users_frontend_registration', 'users_frontend_registration', $users_frontend_registration); ?> <?php echo __('Allow user registration', 'users') ?>
|
||||||
</label>
|
<?php echo Form::input('users_frontend_submit', 'users_frontend_submit', array('style' => 'display:none;')); ?>
|
||||||
</div>
|
<?php echo Form::close();?>
|
||||||
<?php echo Form::input('users_frontend_submit', 'users_frontend_submit', array('style' => 'display:none;')); ?>
|
</div>
|
||||||
<?php echo Form::close();?>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Users_list -->
|
<!-- Users_list -->
|
||||||
|
Reference in New Issue
Block a user