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


PHP USER::is_logged方法代码示例

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


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

示例1: prefered

 public static function prefered($type, $name, $identifier = 0)
 {
     $prefered = '';
     if (USER::is_logged()) {
         $identifier = $identifier == 0 ? USER::get('id') : $identifier;
         $check = OPTIONS::get($type, $name, $identifier);
         if ($check === false) {
             $prefered = OPTIONS::get($type, $name);
         } else {
             $prefered = $check;
         }
     } else {
         $prefered = OPTIONS::get($type, $name);
     }
     return $prefered;
 }
开发者ID:double-web,项目名称:drawline,代码行数:16,代码来源:include_options.php

示例2: switch

<?php

if (!defined("DRAWLINE_RUN_FROM_INDEX")) {
    die;
}
if (isset($_GET['do'])) {
    switch ($_GET['do']) {
        /*
         * login user
         */
        case "login":
            // check if already logged
            if (USER::is_logged()) {
                redirect(LINKS::get("admin_home"));
            }
            // check if sent data
            if (isset($_POST['username'], $_POST['password'])) {
                if (USER::login($_POST['username'], $_POST['password'])) {
                    TPL::message("Perfect! You'll be redirected in 2 seconds..", "success");
                    redirect(isset($_GET['redirect']) ? urldecode($_GET['redirect']) : LINKS::get("admin_home"), 2);
                } else {
                    switch (LOGS::get_error()['log_text']) {
                        case "wrong_username":
                            TPL::message("You entered a wrong username..");
                            break;
                        case "wrong_password":
                            TPL::message("You entered a wrong password..");
                            break;
                    }
                }
            }
开发者ID:double-web,项目名称:drawline,代码行数:31,代码来源:controller_login.php

示例3: urlencode

<?php

// check if logged
if (!USER::is_logged() && !LINKS::on_link("admin_login")) {
    $link = LINKS::get("admin_login") . (LINKS::on_link("admin_home") ? '' : '?redirect=' . urlencode(URL::get_full_url()));
    redirect($link);
}
// check if has permission to access Admin Panel
if (USER::is_logged() && !PERMISSIONS::check("access_admin") && !LINKS::on_link("admin_login") && !LINKS::on_link("admin_logout")) {
    redirect(LINKS::get("base_home"));
}
/* REWRITING */
if (file_exists(FOLDER_ADMIN . "routes.php")) {
    include FOLDER_ADMIN . "routes.php";
}
ob_start();
/*
 * Set default admin menu
 */
/*
 * CONTENT
 */
DRAWLINE::admin_menu('content', array("title" => "Content", "icon" => "book", "link" => "admin_content"));
DRAWLINE::admin_menu('add_page', array("title" => "Add page", "icon" => "plus", "link" => array("admin_pages_add"), "item_active_on_link" => "admin_pages_add", "parent" => "content"));
DRAWLINE::admin_menu('pages_list', array("title" => "Pages list", "icon" => "list", "link" => "admin_pages", "parent" => "content"));
DRAWLINE::admin_menu('categories', array("title" => "Categories", "icon" => "tags", "link" => "admin_categories", "parent" => "content", "item_separator_bottom" => true));
DRAWLINE::admin_menu('media', array("title" => "Media", "icon" => "picture-o", "link" => "admin_media", "parent" => "content"));
DRAWLINE::admin_menu('menus', array("title" => "Menus", "icon" => "plane", "link" => "admin_menus", "parent" => "content", "item_separator_bottom" => true));
DRAWLINE::admin_menu('trash', array("title" => "Trash", "icon" => "trash", "link" => "admin_trash", "parent" => "content"));
/*
 * DESIGN
开发者ID:double-web,项目名称:drawline,代码行数:31,代码来源:index.php


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