當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserSession::getSessionInfo方法代碼示例

本文整理匯總了PHP中UserSession::getSessionInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserSession::getSessionInfo方法的具體用法?PHP UserSession::getSessionInfo怎麽用?PHP UserSession::getSessionInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserSession的用法示例。


在下文中一共展示了UserSession::getSessionInfo方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMenuShortCuts

 public static function getMenuShortCuts()
 {
     $user_info = UserSession::getSessionInfo();
     //功能菜單
     $data = array();
     $data = Module::getAllModule();
     $user_info = UserSession::getSessionInfo();
     //用戶的權限
     $access = MenuUrl::getMenuByRole($user_info['user_role']);
     foreach ($data as $k => $module) {
         $list = MenuUrl::getlistByModuleId('shortcut', $module['module_id']);
         if (!$list) {
             unset($data[$k]);
             continue;
         }
         //去除無權限訪問的
         foreach ($list as $key => $value) {
             if (!in_array($value['menu_url'], $access)) {
                 unset($list[$key]);
             }
         }
         $data[$k]['menu_list'] = $list;
     }
     return $data;
 }
開發者ID:nantmpeter,項目名稱:s-complaints,代碼行數:25,代碼來源:SideBar.class.php

示例2: getProvince

 public static function getProvince($format = false)
 {
     $db = new Medoo(OSA_DB_ID);
     $r = $db->select('province', '*', array('ORDER' => 'pinyin'));
     $tmp = array();
     foreach ($r as $key => $value) {
         $tmp[$value['id']] = $value;
     }
     $r = $tmp;
     if ($format) {
         $user_info = UserSession::getSessionInfo();
         $html = '<select name="province" id="DropDownTimezone"><option value="0" id="DropDownTimezone-0">全部</option>';
         if ($user_info && $user_info['province_id'] > 0) {
             $html .= '<option value="' . $user_info['province_id'] . '" id="DropDownTimezone-0">' . $r[$user_info['province_id']]['name'] . '</option>';
         } else {
             foreach ($r as $key => $value) {
                 $html .= '<option value="' . $value['id'] . '" id="DropDownTimezone-0">' . $value['name'] . '</option>';
             }
         }
         $html .= '</select>';
         $r = $html;
     }
     return $r;
 }
開發者ID:nantmpeter,項目名稱:s-complaints,代碼行數:24,代碼來源:Info.class.php

示例3: header

<?php

header("Content-Type:text/html;charset=utf-8");
require '../include/init.inc.php';
$arr = array('start_date', 'end_date', 'province_id', 'buss_name', 'sp_name', 'sp_corp_code', 'complaint_type', 'question_type', 'complaint_level', 'buss_type', 'sp_code', 'case_id', 'dispute_phone');
$start_date = $end_date = $page_no = $province_id = $buss_name = $sp_name = $sp_corp_code = $complaint_type = $question_type = $complaint_level = $buss_type = $sp_code = $start_date = $end_date = $case_id = $dispute_phone = "";
extract($_GET, EXTR_IF_EXISTS);
$user_info = UserSession::getSessionInfo();
$province_id = $user_info['province_id'] ? $user_info['province_id'] : $province_id;
$menus = MenuUrl::getMenuByIds($user_info['shortcuts']);
foreach ($arr as $key => $value) {
    if (${$value}) {
        $param[$value] = ${$value};
    }
}
$start_date = $param['start_date'] = $_GET['start_date'] = $_GET['start_date'] ? $_GET['start_date'] : date('Y-m');
// if (Common::isPost ()) {
// if($start_date != '' && $end_date !=''){
$page_size = PAGE_SIZE;
$page_no = $page_no < 1 ? 1 : $page_no;
$start = ($page_no - 1) * $page_size;
if ($_GET['download'] == 1) {
    $data['result'] = Complaint::complaintsAnalayze($param, $start, 0);
} else {
    $data['result'] = Complaint::complaintsAnalayze($param, $start, $page_size);
    foreach ($data['result'] as $key => $value) {
        $total['num'] += $value['num'];
        $total['cos'] += $value['cos'];
        $total['wan'] += $value['wan'];
        $total['month'] = date('Y-m', $value['month']);
    }
開發者ID:nantmpeter,項目名稱:s-complaints,代碼行數:31,代碼來源:complaints_analyze.php

示例4: checkActionAccess

 public static function checkActionAccess()
 {
     $action_url = Common::getActionUrl();
     $user_info = UserSession::getSessionInfo();
     $role_menu_url = MenuUrl::getMenuByRole($user_info['user_role']);
     $search_result = in_array($action_url, $role_menu_url);
     if (!$search_result) {
         Common::exitWithMessage('您當前沒有權限訪問該功能,如需訪問請聯係管理員開通權限', 'index.php');
         return true;
     }
 }
開發者ID:ZhHong,項目名稱:OSAdmin,代碼行數:11,代碼來源:User.class.php

示例5: array

if (Common::isPost()) {
    if ($real_name == "" || $mobile == "" || $email == "" || $user_id != 1 && $user_group <= 0) {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        $update_data = array('real_name' => $real_name, 'mobile' => $mobile, 'email' => $email, 'user_desc' => $user_desc);
        if ($user_id > 1) {
            $update_data["user_group"] = $user_group;
        }
        if (!empty($password)) {
            if (!preg_match("/^(([a-z]+[0-9]+)|([0-9]+[a-z]+))[a-z0-9]*\$/i", $password)) {
                Common::exitWithError('密碼必須由數字和字母的組合而成', '');
            }
            $update_data = array_merge($update_data, array('password' => md5($password)));
        }
        $result = User::updateUser($user_id, $update_data);
        if ($result >= 0) {
            $current_user = UserSession::getSessionInfo();
            $ip = Common::getIp();
            $update_data['ip'] = $ip;
            SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'User', $user_id, json_encode($update_data));
            Common::exitWithSuccess('更新完成', 'complaint/user.php');
        } else {
            OSAdmin::alert("error");
        }
    }
}
$group_options = UserGroup::getGroupForOptions();
unset($group_options[1]);
Template::assign('user', $user);
Template::assign('group_options', $group_options);
Template::display('panel/user_modify.tpl');
開發者ID:nantmpeter,項目名稱:s-complaints,代碼行數:31,代碼來源:user_modify.php

示例6: md5

            } else {
                $user_data['password'] = md5($new);
                User::updateUser($current_user_id, $user_data);
                SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'User', $current_user_id);
                Common::exitWithSuccess(ErrorMessage::PWD_UPDATE_SUCCESS, '/index.php');
            }
        } else {
            OSAdmin::alert("error", ErrorMessage::OLD_PWD_WRONG);
        }
    } else {
        $user_data['real_name'] = $real_name;
        $user_data['mobile'] = $mobile;
        $user_data['email'] = $email;
        $user_data['user_desc'] = $user_desc;
        $user_data['show_quicknote'] = $show_quicknote;
        User::updateUser($current_user_id, $user_data);
        UserSession::reload();
        SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'User', $current_user_id, json_encode($user_data));
        Common::exitWithSuccess('資料修改成功', '/index.php');
    }
}
$quicknoteOptions = array("1" => "顯示", "0" => "不顯示");
//更新Session裏的用戶信息
Template::assign("change_password", $change_password);
Template::assign("user_info", UserSession::getSessionInfo());
Template::assign("quicknoteOptions", $quicknoteOptions);
Template::display('panel/profile.tpl');
?>


開發者ID:hongweipeng,項目名稱:screen,代碼行數:28,代碼來源:profile.php

示例7:

    //for login.php logout.php etc....
} else {
    //else之後 需要驗證登錄信息
    if (empty($_SESSION[UserSession::SESSION_NAME])) {
        $user_id = User::getCookieRemember();
        if ($user_id > 0) {
            User::loginDoSomething($user_id);
        }
    }
    User::checkLogin();
    User::checkActionAccess();
    $current_user_info = UserSession::getSessionInfo();
    //如果非ajax請求
    if (stripos($_SERVER['SCRIPT_NAME'], "/ajax") === false) {
        //顯示菜單、導航條、模板
        $sidebar = SideBar::getTree();
        //是否顯示quick note
        if ($current_user_info['show_quicknote']) {
            OSAdmin::showQuickNote();
        }
        $menu = MenuUrl::getMenuByUrl(Common::getActionUrl());
        Template::assign('page_title', $menu['menu_name']);
        Template::assign('content_header', $menu);
        Template::assign('sidebar', $sidebar);
        Template::assign('current_module_id', $menu['module_id']);
        Template::assign('user_info', UserSession::getSessionInfo());
    }
}
Template::assign('osa_templates', $OSA_TEMPLATES);
$sidebarStatus = $_COOKIE['sidebarStatus'] == null ? "yes" : $_COOKIE['sidebarStatus'];
Template::assign('sidebarStatus', $sidebarStatus);
開發者ID:leohdr,項目名稱:OSAdmin,代碼行數:31,代碼來源:init.inc.php


注:本文中的UserSession::getSessionInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。