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


PHP sess函數代碼示例

本文整理匯總了PHP中sess函數的典型用法代碼示例。如果您正苦於以下問題:PHP sess函數的具體用法?PHP sess怎麽用?PHP sess使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: c

 public function c($rq = null)
 {
     $type = ['employee' => 1, 'agency' => 2, 'doctor' => 3];
     $rq = rq();
     $rq['senderid'] = uid();
     $rq['sendername'] = username();
     if (he_is('agency')) {
         $rq['org'] = sess('org');
     }
     if (he_is('employee')) {
         $rq['org'] = sess('org');
     }
     // return his_chara()[0];
     $rq['sendertype'] = $type[his_chara()[0]];
     if (his_chara()[0] == 'agency') {
         $rq['recipienttype'] = 1;
         $rq['recipientid'] = 1;
         $rq['recipientname'] = 'admin';
     } elseif (his_chara()[0] == 'employee') {
         $rq['recipienttype'] = $type[$rq['recipienttype']];
     }
     // 驗證發信規則
     $valid = $this->verify($rq);
     if (!$valid) {
         return ee(2);
     }
     $rq['sendtime'] = date("Y-m-d H:i:s");
     return parent::c($rq);
 }
開發者ID:newset,項目名稱:robot,代碼行數:29,代碼來源:IMessage.php

示例2: depQueryToResend

 public function depQueryToResend()
 {
     $username = sess();
     $d = M('Department');
     $data = $d->select();
     return $data;
     //$this->assign('username', $username);
     //$this->assign('data', $data);
     //$this->display('ListByUser:resend');
 }
開發者ID:xiaoshuishuihuohuo,項目名稱:crud_mail_php,代碼行數:10,代碼來源:DepartmentAction.class.php

示例3: login

 /**
  * 登入方法
  * @param null $input
  * @return array
  */
 public function login($input = null)
 {
     $input = $input ? $input : rq();
     if (!empty($input['user_type']) && $input['user_type'] == 'doctor' && !empty($input['cust_id'])) {
         $d = M('doctor');
         $d = $d->where('cust_id', $input['cust_id'])->first();
         if ($d) {
             log_him_in(['uid' => $d->id]);
             add_chara($input['user_type']);
             return ss();
         }
         return $d ? ss($d) : ee(2);
     }
     if (!empty($input['user_type']) && !empty($input['username']) && !empty($input['password'])) {
         $input['password'] = hash_password($input['password']);
         $user = $this->user_exists($input['user_type'], array_only($input, ['username', 'password']));
         if ($user) {
             $lifetime = 6000;
             log_him_in(['username' => $user->username, 'uid' => $user->id], $lifetime);
             add_chara($input['user_type']);
             if ($input['user_type'] == 'employee') {
                 sess('permission', $user->permissions);
             } else {
                 sess('permission', []);
             }
             if ($input['user_type'] == 'agency') {
                 sess('org', $user->name);
                 sess('name_in_charge', $user->name_in_charge);
             }
             if ($input['user_type'] == 'department') {
                 sess('org', $user->hospital_name . ':' . $user->name);
             }
             if ($input['user_type'] == 'employee') {
                 sess('org', $user->name);
             }
             // 添加日誌
             ILog::login($input['user_type'], $user);
             return ss($user);
         }
     } else {
         return ee(2);
     }
     return ee(2);
 }
開發者ID:newset,項目名稱:robot,代碼行數:49,代碼來源:AuthTrait.php

示例4: front

 public function front()
 {
     $cache = Cache::get('i_settings', null);
     $per_page = array_get($cache, 'user.per_page');
     $d = ['debug' => debugging(), 'is_logged_in' => sess('is_logged_in'), 'his_chara' => sess('his_chara'), 'username' => sess('username'), 'uid' => sess('uid'), 'per_page' => $per_page, 'agency_end' => $this->retrieve('system.agency_end')];
     $type = ['employee' => 1, 'agency' => 2, 'doctor' => 3];
     // 獲取未讀通知
     if (uid()) {
         $d['unread'] = M('message')->where('recipientid', uid())->where('recipienttype', $type[his_chara()[0]])->where('read', 0)->count();
     } else {
         $d['unread'] = 0;
     }
     $d['org'] = '';
     if (he_is('agency')) {
         $org = DB::table(table_name('agency'))->select('name')->where('id', uid())->first();
         sess('org', $org->name);
         $d['org'] = sess('org');
     }
     if (he_is('employee')) {
         $d['org'] = sess('org');
     }
     return ss($d);
 }
開發者ID:Aaronqcd,項目名稱:robot,代碼行數:23,代碼來源:IInit.php

示例5: date_default_timezone_set

<?php

date_default_timezone_set("Europe/Moscow");
//подключение
include "includes/kernel.php";
db_connect();
$noclose = 0;
if (strpos($_REQUEST[action], "/") !== false || strpos($_REQUEST[action], "\\") !== false) {
    die("error");
}
sess($noclose);
//страница
if ($_REQUEST[action]) {
    $action = $_REQUEST[action];
} else {
    die("error");
}
//проверка наличия страницы
if (!file_exists("actions/" . $action . ".php")) {
    die("error");
}
//залогинен ли?
$user = islogin();
if (!$user && ($action != 'login' && $action != 'autologin' && $action != 'reg')) {
    redirect("index.php");
}
header('Content-Type: text/html; charset=windows-1251');
include "actions/" . $action . ".php";
開發者ID:romanov95,項目名稱:car,代碼行數:28,代碼來源:action.php

示例6: json_decode

    if ($q->status == 200) {
        return json_decode($q->body, true);
    }
    return array();
}
$result = verify(REQUEST_URI, @file_get_contents('php://input'));
$email = isset($result['verifiedEmail']) ? strtolower($result['verifiedEmail']) : '';
$name = isset($result['displayName']) ? $result['displayName'] : '';
$firstName = isset($result['firstName']) ? $result['firstName'] : '';
$lastName = isset($result['lastName']) ? $result['lastName'] : '';
if (strlen($email)) {
    sess('u:id', "mailto:{$email}");
    sess('u:link', "mailto:{$email}");
    sess('u:name', strlen($name) ? $name : $email);
}
$next = sess('next', null);
if (!is_string($next) || !strlen($next)) {
    $next = '/login';
}
?>
<script type="text/javascript">
var next = <?php 
echo json_encode($next);
?>
;
if (opener) {
    opener.location = next;
    window.close();
} else {
    window.location = next;
}
開發者ID:sgml,項目名稱:rww.io,代碼行數:31,代碼來源:rp_callback.php

示例7: his_captcha_data

 function his_captcha_data()
 {
     $d = sess('him.captcha_data');
     if ($d) {
         return sess('him.captcha_data');
     }
     return 0;
 }
開發者ID:hellopsm,項目名稱:robot,代碼行數:8,代碼來源:univ.php

示例8: count

$time = $TAGS[count($TAGS) - 1]['time'] - $TAGS[0]['time'];
$caller = $TAGS[count($TAGS) - 2];
$sparql_n = 0;
$sparql_t = 0;
if (isset($timings)) {
    $sparql_n = count($timings);
    foreach ($timings as $t) {
        $sparql_t += $t['time'];
    }
}
?>
<hr class="center" />
<div class="center align-right width-1024">
<?php 
$user_link = sess('u:link');
$user_name = sess('u:name');
if (is_null($user_name) || !strlen($user_name)) {
    $user_name = $_user;
}
if ($_options->coderev) {
    $src = explode('/', __FILE__);
    $src = array_slice($src, array_search('www', $src));
    $src = implode('/', $src);
    $src = "https://github.com/linkeddata/data.fm/tree/master/{$src}";
    $queryFoot = $sparql_n < 1 ? '' : sprintf('with %d quer%s in %ss', $sparql_n, $sparql_n > 1 ? 'ies' : 'y', substr($sparql_t, 0, 6));
    $versionFoot = implode(' / ', array('librdf: ' . array_shift(explode(' ', librdf_version_string_get())), 'raptor: ' . array_shift(explode(' ', raptor_version_string_get())), 'rasqal: ' . array_shift(explode(' ', rasqal_version_string_get()))));
    ?>
    <div class="footer">
        <span id="codeTime" ng-mouseenter="runtime=1" ng-mouseleave="runtime=0">
        <em ng-if="runtime"><?php 
    echo $versionFoot;
開發者ID:Sunnepah,項目名稱:ldphp,代碼行數:31,代碼來源:footer.php

示例9: front

 public function front()
 {
     $d = ['debug' => debugging(), 'is_logged_in' => sess('is_logged_in'), 'his_chara' => sess('his_chara'), 'username' => sess('username'), 'uid' => sess('uid')];
     return ss($d);
 }
開發者ID:hellopsm,項目名稱:robot,代碼行數:5,代碼來源:IInit.php

示例10: processReporter

 private function processReporter($realName = '')
 {
     $formattedRet = array();
     if ($realName) {
         $var = $this->news_model->getDetailReporter($realName);
         if (count($var) > 0) {
             #$formattedRet[] = array('email' => $var[0]['user_email'],'user_fullname'=>$var[0]['user_realname']);
             $formattedRet[] = array('id' => $var[0]['user_id'], 'name' => $var[0]['user_realname']);
         }
     } else {
         $formattedRet[] = array('id' => sess('usr_id'), 'name' => sess('usr_fullname'));
     }
     return json_encode($formattedRet);
 }
開發者ID:cyberorca,項目名稱:dfp-api,代碼行數:14,代碼來源:video.php

示例11: modiPassProcess

 public function modiPassProcess()
 {
     $newpass = $_POST['confirm'];
     $username = sess();
     $u = M('User');
     $where['username'] = $username;
     $data['password'] = md5($newpass);
     $save = $u->where($where)->save($data);
     if (!$save) {
         $this->error('修改失敗');
     }
     if ($username == 'admin') {
         $this->success('修改成功', "__APP__/User/modiUser", 2);
     } else {
         $this->success('修改成功', "__APP__/ListByUser/revBox", 2);
     }
 }
開發者ID:xiaoshuishuihuohuo,項目名稱:crud_mail_php,代碼行數:17,代碼來源:UserAction.class.php

示例12: processReporter

 private function processReporter($realName = '')
 {
     $formattedRet = array();
     if ($realName != '') {
         if (strpos($realName, ',')) {
             $arr_nama = explode(',', $realName);
             foreach ($arr_nama as $key => $value) {
                 $var = $this->news_model->getDetailReporter($value);
                 if (count($var) > 0) {
                     $formattedRet[] = array('id' => $var[0]['user_id'], 'name' => $var[0]['user_realname']);
                 }
             }
         } else {
             $var = $this->news_model->getDetailReporter($realName);
             if (count($var) > 0) {
                 #$formattedRet[] = array('email' => $var[0]['user_email'],'user_fullname'=>$var[0]['user_realname']);
                 $formattedRet[] = array('id' => $var[0]['user_id'], 'name' => $var[0]['user_realname']);
             }
         }
     } else {
         $formattedRet[] = array('id' => sess('usr_id'), 'name' => sess('usr_fullname'));
     }
     return json_encode($formattedRet);
 }
開發者ID:cyberorca,項目名稱:dfp-api,代碼行數:24,代碼來源:news.php

示例13: modiPass

 public function modiPass()
 {
     sess();
     $this->display();
 }
開發者ID:xiaoshuishuihuohuo,項目名稱:crud_mail_php,代碼行數:5,代碼來源:IndexAction.class.php

示例14: profile

 public function profile()
 {
     $this->load->helper('core/user_helper');
     $data = $this->syter->spawn('profile');
     $user = sess('user');
     // echo var_dump($user);
     $args = array();
     $join = array();
     $select = "users.*,user_roles.role";
     $args['users.id'] = $user['id'];
     $join['user_roles'] = array('content' => 'users.role=user_roles.id', 'mode' => 'left');
     $result = $this->site_model->get_tbl('users', $args, array(), $join, true, $select);
     $res = $result[0];
     $img = array();
     $resultIMG = $this->site_model->get_image(null, $user['id'], 'users');
     if (count($resultIMG) > 0) {
         $img = $resultIMG[0];
     }
     $data['code'] = userProfilePage($res, $img);
     $data['page_title'] = fa('fa-user') . " User Profile";
     $data['load_js'] = 'site/user';
     $data['use_js'] = 'profileJs';
     $this->load->view('page', $data);
 }
開發者ID:reytej,項目名稱:Acct,代碼行數:24,代碼來源:user.php

示例15: sess

function sess($id, $val = NULL)
{
    if (func_num_args() == 1) {
        return isSess($id) ? $_SESSION[$id] : NULL;
    } elseif (is_null($val)) {
        $r = isset($_SESSION[$id]) ? $_SESSION[$id] : null;
        unset($_SESSION[$id]);
        return $r;
    } else {
        $prev = sess($id);
        $_SESSION[$id] = $val;
        return $prev;
    }
}
開發者ID:Sunnepah,項目名稱:ldphp,代碼行數:14,代碼來源:util.lib.php


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