本文整理汇总了PHP中AuthUser::isLoggedIn方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthUser::isLoggedIn方法的具体用法?PHP AuthUser::isLoggedIn怎么用?PHP AuthUser::isLoggedIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthUser
的用法示例。
在下文中一共展示了AuthUser::isLoggedIn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _checkPermission
private static function _checkPermission()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
}
示例2: browse
public function browse()
{
$this->_checkPermission();
$params = func_get_args();
$this->path = join('/', $params);
// make sure there's a / at the end
if (substr($this->path, -1, 1) != '/') {
$this->path .= '/';
}
//security
// we dont allow back link
if (strpos($this->path, '..') !== false) {
if (Plugin::isEnabled('statistics_api')) {
$user = null;
if (AuthUser::isLoggedIn()) {
$user = AuthUser::getUserName();
}
$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
$event = array('event_type' => 'hack_attempt', 'description' => __('A possible hack attempt was detected.'), 'ipaddress' => $ip, 'username' => $user);
Observer::notify('stats_file_manager_hack_attempt', $event);
}
}
$this->fullpath = FILES_DIR . '/sidebarlink/images/';
// clean up nicely
$this->fullpath = preg_replace('/\\/\\//', '/', $this->fullpath);
$this->display('sidebarlink/index', array('dir' => $this->path, 'files' => $this->_getListFiles(), 'sidebarlinks' => Record::findAllFrom('SidebarLink', '1=1 ORDER BY id desc'), 'pages' => Record::findAllFrom('Page', 'parent_id=1 OR parent_id=0 order by parent_id,position')));
}
示例3: submit_address
public function submit_address($fields = array())
{
$checkout = $this->config['checkoutPath'];
$out = null;
// wolf authentication
if (!AuthUser::isLoggedIn() && (!isset($_SESSION['shipping_address']) || empty($_SESSION['shipping_address'])) || 1 == 1) {
$out .= "<div class=\"shipping_address_form\">";
$out .= "<div id=\"form_response\"><h2 class=\"checkout-error error-message\">Please provide the following information!</h2></div>";
//$out .= "<div id=\"form_response\"><h2 class=\"checkout-error error-message\">Please provide the following information!</h2><div>";
//$this->disablePaypalCheckout = " disabled='disabled'";
$out .= " <form id=\"shipping_address\" name=\"shipping_address\" action=\"" . $_SERVER['REQUEST_URI'] . "\" method=\"post\">";
$out .= " <p><label>Delivery Address</label></p><br/><br/>";
if (!empty($fields)) {
foreach ($fields['label'] as $k => $label) {
$out .= $this->draw_field($k, $fields);
}
}
//$out .= " <input onclick=\"submit_any_form('#submit_address');\" name=\"submit_address\" id=\"submit_address\" type=\"submit\" value=\"Save Addres\" />";
$out .= " <input class=\"ajaxsubmit\" name=\"submit_address\" id=\"submit_address\" type=\"submit\" value=\"Save Addres\" />";
$out .= " </form>";
$out .= "</div>";
} else {
$out = '';
}
// display shipping address form
if ($checkout != $this->config['checkoutPath'] || 1 == 1) {
return $out;
} else {
return null;
}
}
示例4: _checkLog
public static function _checkLog()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
}
示例5: login
/**
* Allows a user to login.
*/
function login()
{
// already log in ?
if (AuthUser::isLoggedIn()) {
if (Flash::get('redirect') != null) {
redirect(Flash::get('redirect'));
} else {
redirect(get_url());
}
}
if (get_request_method() == 'POST') {
$data = isset($_POST['login']) ? $_POST['login'] : array('username' => '', 'password' => '');
Flash::set('username', $data['username']);
if (AuthUser::login($data['username'], $data['password'], isset($data['remember']))) {
Observer::notify('admin_login_success', $data['username']);
$this->_checkVersion();
// redirect to defaut controller and action
if ($data['redirect'] != null && $data['redirect'] != 'null') {
redirect($data['redirect']);
} else {
redirect(get_url());
}
} else {
Flash::set('error', __('Login failed. Please check your login data and try again.'));
Observer::notify('admin_login_failed', $data['username']);
}
}
// not find or password is wrong
if ($data['redirect'] != null && $data['redirect'] != 'null') {
redirect($data['redirect']);
} else {
redirect(get_url('login'));
}
}
示例6: __construct
public function __construct()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
}
示例7: __construct
public function __construct()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
$this->assignToLayout('sidebar', new View('translate/sidebar'));
}
示例8: __construct
function __construct()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
$this->setLayout('backend');
}
示例9: __construct
public function __construct()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
echo 'Please Login';
header('location:index.php?job=login');
}
}
示例10: __construct
public function __construct()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
$this->setLayout('backend');
$this->assignToLayout('sidebar', new View('../../plugins/frog_tags/views/sidebar'));
}
示例11: __construct
function __construct()
{
if (defined('CMS_BACKEND')) {
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
}
}
示例12: indexAction
function indexAction()
{
global $tpl;
if (AuthUser::isLoggedIn()) {
//echo 'You have logged in!';
header('location:index.php?job=admin_article');
} else {
$tpl->display('admin/login.html');
}
}
示例13: beforeSave
public function beforeSave()
{
$this->created_on = date("Y-m-d H:i:s");
if (!AuthUser::isLoggedIn()) {
$this->username = "system";
} else {
$this->username = AuthUser::getRecord()->name;
}
return true;
}
示例14: __construct
function __construct()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
redirect(get_url('login'));
}
$_SESSION['assets_folder'] = isset($_SESSION['assets_folder']) ? $_SESSION['assets_folder'] : assets_default_folder();
$this->setLayout('backend');
$this->assignToLayout('sidebar', new View('../../plugins/assets/views/sidebar'));
}
示例15: __construct
public function __construct()
{
AuthUser::load();
if (!AuthUser::isLoggedIn()) {
echo 'Please Login';
header('location:index.php?job=login');
}
//首页最近文章
//$this->recent_post = Article::getPost(5, true);
//侧栏分类
$this->categories = Category::findAll();
if (is_array($this->categories) && count($this->categories) > 0) {
$temp = array();
foreach ($this->categories as $k => $v) {
$temp[$v->id] = get_object_vars($v);
}
$this->cahce_categories = $temp;
$temp = array();
}
//Tags 后期改进为热词形式
$hot_tags = Tag::findAll(20);
//mprint_r($hot_tags, '$hot_tags');
if (count($hot_tags) > 0) {
$first = current($hot_tags);
$last = end($hot_tags);
foreach ($hot_tags as $k => $v) {
$tags_list[$k]['word'] = $v->name;
$tags_list[$k]['size'] = tagClouds($v->count, $first->count, $last->count);
}
}
$this->tags_list = $tags_list;
$tags = Tag::findAll();
//var_dump($tags);
$content_tag = Record::findAllFrom('ContentTag');
//var_dump($content_tag);
//关系表中存在的文章ID以及tag集合到一个数组中tag_cache 避免在遍历生成文章静态页时重复读取数据库
//遍历所有tag 组合出方便调用的形式
if (is_array($tags) && count($tags) > 0) {
$temp_tags = array();
foreach ($tags as $k => $v) {
$temp_tags[$v->id] = $v->name;
}
}
//遍历关系表
if (is_array($content_tag) && count($content_tag) > 0) {
$this->cahce_tags = array();
foreach ($content_tag as $k => $v) {
if (isset($temp_tags[$v->tag_id])) {
$this->cahce_tags[$v->content_id][] = $temp_tags[$v->tag_id];
}
}
}
//清空临时数据
$tags = $content_tag = $temp_tags = array();
}