break;
     /*
     |--------------------------------------------------------------------------
     | Profile save
     |--------------------------------------------------------------------------
     |
     */
 /*
 |--------------------------------------------------------------------------
 | Profile save
 |--------------------------------------------------------------------------
 |
 */
 case 'profile_save':
     if (@$_POST['regenerate'] === '1') {
         Sentinel::setUser($current_user, null, null, null, true);
         Sentinel::save();
     }
     break;
     /*
     |--------------------------------------------------------------------------
     | Unknown action...
     |--------------------------------------------------------------------------
     |
     */
 /*
 |--------------------------------------------------------------------------
 | Unknown action...
 |--------------------------------------------------------------------------
 |
 */
Beispiel #2
0
        ?>
<br><h4><?php 
        _e('Please fill an existing username and a new password');
        ?>
</h4><?php 
        if (@$_POST['action'] === 'passwordtab') {
            if (!Sentinel::userExists($_POST['username'])) {
                echo '<div class="alert alert-danger" role="alert">' . sprintf(__('User %s does not exist!'), '<code>' . $_POST['username'] . '</code>') . '</div>';
            } else {
                if ($_POST['password'] !== $_POST['password2']) {
                    echo '<div class="alert alert-danger" role="alert">' . __('Password confirmation is not the same') . '</div>';
                } else {
                    if (mb_strlen($_POST['password']) < 6) {
                        echo '<div class="alert alert-danger" role="alert">' . __('Password must contain at least 6 chars') . '</div>';
                    } else {
                        Sentinel::setUser($_POST['username'], $_POST['password']);
                        Sentinel::save();
                        echo '<div class="alert alert-success" role="alert">' . sprintf(__('Password has been updated for user %s!'), '<code>' . $_POST['username'] . '</code>') . '</div>';
                    }
                }
            }
        }
        ?>
<form id="authsave" autocomplete="off" method="POST" action="?#passwordtab"><input type="hidden" name="action" value="passwordtab"><div class="container"><div class="row"><div class="input-group col-sm-6 col-md-4" id="usernamegroup" data-toggle="tooltip" data-placement="top" title="<?php 
        _h('Username is required');
        ?>
"><span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> <input type="text" id="username" name="username" class="form-control" value="<?php 
        echo h(@$_POST['username']);
        ?>
" placeholder="<?php 
        _h('Username');