Esempio n. 1
0
                break;
                /*
                |--------------------------------------------------------------------------
                | Auth 2. Touch auth file
                |--------------------------------------------------------------------------
                |
                */
            /*
            |--------------------------------------------------------------------------
            | Auth 2. Touch auth file
            |--------------------------------------------------------------------------
            |
            */
            case 'authtouch':
                if (Sentinel::isAuthSet() === true) {
                    $path = Sentinel::getAuthFilePath();
                    $return['notice'] = sprintf(__('File <code>%s</code> already exists!'), AUTH_CONFIGURATION_FILE) . '<br/><br/>' . __('Please remove it from the root directory:') . '<div class="row">' . '  <div class="col-md-10"><pre class="clipboardcontent">' . 'mv \'' . $path . '\' \'' . $path . '.bck\'</pre></div>' . '  <div class="col-md-2"><a class="btn btn-primary clipboard">' . __('Copy to clipboard') . '</a><script>clipboard_enable("a.clipboard","pre.clipboardcontent" , "top" , "' . __('Command copied!') . '");</script></div>' . '</div>';
                    $return['reload'] = true;
                } else {
                    if (Sentinel::create() === true) {
                        $return['authform'] = '<h2>' . __('Setup admin account') . '</h2>' . '<br/>' . __('Please choose a username and a password for the admin account.') . '<br/><br/>' . '<form id="authsave" autocomplete="off">' . '<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="' . htmlentities(__('Username is required')) . '">
								<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
								<input type="text" id="username" class="form-control" placeholder="' . __('Username') . '" autofocus="autofocus">
							</div>' . '<br/>' . '</div>' . '<div class="row">' . '<div class="input-group col-sm-6 col-md-4" id="passwordgroup" data-toggle="tooltip" data-placement="bottom" title="' . htmlentities(__('Password must contain at least 6 chars')) . '">
								<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
								<input type="password" id="password" class="form-control" placeholder="' . __('Password') . '">
							</div>' . '<br/>' . '</div>' . '<div class="row">' . '<div class="input-group col-sm-6 col-md-4" id="password2group" data-toggle="tooltip" data-placement="bottom" title="' . htmlentities(__('Password is not the same')) . '">
								<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
								<input type="password" id="password2" class="form-control" placeholder="' . __('Password Confirmation') . '">
							</div>' . '</div>' . '</div>' . '<br/><br/>' . '<input type="submit" class="btn btn-primary" value="' . __('Continue') . '"/>' . '</form>';
                    } else {
Esempio n. 2
0
                    $return = '<br/><div class="alert alert-success" role="alert">' . __('Authentication has been enabled and admin account has been created!') . '</div>';
                }
            }
        }
    }
    if (Sentinel::isAuthSet()) {
        echo $return;
        ?>
<br><div class="alert alert-info" role="alert"><?php 
        _e('Authentication is currently enabled');
        ?>
</div><br><div class="row"><div class="col-xs-12"><div class="alert alert-danger"><?php 
        _e('Please remove this file on your server to disable authentication');
        ?>
</div></div><br><br><div class="col-md-8"><pre class="clipboard4content">rm '<?php 
        echo Sentinel::getAuthFilePath();
        ?>
'</pre></div><?php 
        echo '<div class="col-md-4"><a class="btn btn-primary clipboard" data-source=".clipboard4content" data-placement="right" data-text="' . h("Command has been copied to your clipboard!") . '">' . __('Copy to clipboard') . '</a></div>';
        ?>
</div><?php 
    } else {
        echo $return;
        ?>
<br><div class="alert alert-warning" role="alert"><?php 
        _e('Authentication is currently disabled');
        ?>
</div><h4><?php 
        _e('Setup admin account');
        ?>
</h4><form id="authsave" autocomplete="off" method="POST" action="?#authactivation"><input type="hidden" name="action" value="authactivation"><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