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


PHP AuthUser::isLoggedIn方法代码示例

本文整理汇总了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'));
     }
 }
开发者ID:julpi,项目名称:FreshCMS,代码行数:7,代码来源:CommentController.php

示例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')));
 }
开发者ID:sindotnet,项目名称:cona,代码行数:27,代码来源:SidebarlinkController.php

示例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;
     }
 }
开发者ID:ariksavage,项目名称:template2.adsourorg,代码行数:31,代码来源:shipping.php

示例4: _checkLog

 public static function _checkLog()
 {
     AuthUser::load();
     if (!AuthUser::isLoggedIn()) {
         redirect(get_url('login'));
     }
 }
开发者ID:nowotny,项目名称:Fancy-Image-Gallery,代码行数:7,代码来源:FancyImageGalleryController.php

示例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'));
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:37,代码来源:LoginController.php

示例6: __construct

 public function __construct()
 {
     AuthUser::load();
     if (!AuthUser::isLoggedIn()) {
         redirect(get_url('login'));
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:7,代码来源:PageController.php

示例7: __construct

 public function __construct()
 {
     AuthUser::load();
     if (!AuthUser::isLoggedIn()) {
         redirect(get_url('login'));
     }
     $this->assignToLayout('sidebar', new View('translate/sidebar'));
 }
开发者ID:chaobj001,项目名称:tt,代码行数:8,代码来源:TranslateController.php

示例8: __construct

 function __construct()
 {
     AuthUser::load();
     if (!AuthUser::isLoggedIn()) {
         redirect(get_url('login'));
     }
     $this->setLayout('backend');
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:8,代码来源:CommentController.php

示例9: __construct

 public function __construct()
 {
     AuthUser::load();
     if (!AuthUser::isLoggedIn()) {
         echo 'Please Login';
         header('location:index.php?job=login');
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:8,代码来源:AdminUserController.class.php

示例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'));
 }
开发者ID:harendt,项目名称:frog_tags,代码行数:9,代码来源:FrogTagsController.php

示例11: __construct

 function __construct()
 {
     if (defined('CMS_BACKEND')) {
         AuthUser::load();
         if (!AuthUser::isLoggedIn()) {
             redirect(get_url('login'));
         }
     }
 }
开发者ID:ariksavage,项目名称:superior-optical-eyewear,代码行数:9,代码来源:PluginController.php

示例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');
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:10,代码来源:LoginController.class.php

示例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;
 }
开发者ID:pawedWolf,项目名称:wolfcms-dashboard,代码行数:10,代码来源:DashboardLogEntry.php

示例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'));
 }
开发者ID:julpi,项目名称:freshcms_assets,代码行数:10,代码来源:AssetsController.php

示例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();
 }
开发者ID:chaobj001,项目名称:tt,代码行数:55,代码来源:AdminCacheController.class.php


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