当前位置: 首页>>代码示例>>PHP>>正文


PHP Sentinel::getAuthFilePath方法代码示例

本文整理汇总了PHP中Sentinel::getAuthFilePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentinel::getAuthFilePath方法的具体用法?PHP Sentinel::getAuthFilePath怎么用?PHP Sentinel::getAuthFilePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sentinel的用法示例。


在下文中一共展示了Sentinel::getAuthFilePath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sprintf

                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 {
开发者ID:abhijith444,项目名称:enroll,代码行数:31,代码来源:configure.php

示例2: __

                    $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 
开发者ID:abhijith444,项目名称:enroll,代码行数:31,代码来源:test.php


注:本文中的Sentinel::getAuthFilePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。