1
0
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:
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,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();
}); });
} }

View File

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

View File

@@ -1,18 +1,17 @@
<h2 class="margin-bottom-1"><?php echo __('Users', 'users'); ?></h2> <h2 class="margin-bottom-1"><?php echo __('Users', 'users'); ?></h2>
<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')); ?> <?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="pull-right margin-bottom-1"> <div class="text-right">
<?php echo Form::open(null, array('name' => 'users_frontend')); ?> <?php echo Form::open(null, array('name' => 'users_frontend')); ?>
<?php echo Form::hidden('csrf', Security::token()); ?> <?php echo Form::hidden('csrf', Security::token()); ?>
<div class="checkbox"> <?php echo Form::checkbox('users_frontend_registration', 'users_frontend_registration', $users_frontend_registration); ?> <?php echo __('Allow user registration', 'users') ?>
<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::input('users_frontend_submit', 'users_frontend_submit', array('style' => 'display:none;')); ?>
<?php echo Form::close();?> <?php echo Form::close();?>
</div> </div>
</div>
<!-- Users_list --> <!-- Users_list -->
<table class="table table-bordered"> <table class="table table-bordered">