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


PHP Session::is_set方法代码示例

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


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

示例1: check_admin

 public function check_admin()
 {
     if (!Session::is_set('lfy_name') or !Session::is_set('lfy') or $_SESSION['lfy'] != md5('lfy000')) {
         $this->redirect('index/index');
         exit;
     }
 }
开发者ID:yunsite,项目名称:baokao,代码行数:7,代码来源:LoginModel.class.php

示例2: listInformationColumn

 /**
 +----------------------------------------------------------
 * 返回后台资讯列表
 +----------------------------------------------------------
 */
 public function listInformationColumn()
 {
     if (!Session::is_set("systemId")) {
         header("Content-type: text/html; charset=utf-8");
         echo '<script>alert("您还没有登录!");location.href="Admin/loginInit";</script>';
     } else {
         $informationColumn = M("information_column");
         $title = $_REQUEST["title"];
         if (!empty($title)) {
             $condition["title"] = array("like", "%" . $title . "%");
         }
         $source = $_REQUEST["source"];
         if (!empty($source)) {
             $condition["source"] = $source;
         }
         $column = $_REQUEST["column"];
         if (!empty($column)) {
             $condition["column"] = $column;
         }
         $status = $_REQUEST["status"];
         if (!empty($status)) {
             $condition["status"] = $status;
         }
         $count = $informationColumn->where($condition)->count();
         import("ORG.Util.Page");
         $Page = new Page($count, 10);
         $foot = $Page->show();
         $list = $informationColumn->where($condition)->order('seq  desc,update_time desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
         // 查询数据
         $this->assign('list', $list);
         $this->assign('foot', $foot);
         $this->display();
     }
 }
开发者ID:nehnre,项目名称:kuaipei,代码行数:39,代码来源:InformationColumnAction.class.php

示例3: SignIn

 function SignIn($row)
 {
     Module::Module($row);
     if (User::is_login()) {
         if ($data = Session::get('user_data') and $data['home_page']) {
             Url::redirect_url($data['home_page']);
         } else {
             Url::redirect('home');
         }
     } else {
         // xoa toan bo du lieu dang co truoc khi dang nhap
         if (Session::is_set('user_id')) {
             $id = Session::get('user_id');
             DB::update('account', array('last_online_time' => time()), 'id=\'' . $id . '\'');
             setcookie('user_id', "", time() - 3600);
             Session::destroy('user_id');
         }
         //if(URL::get("m")== "mobile"){
         //	require_once 'forms/mlogin.php';
         //	$this->add_form(new SignInmForm);
         //}else{
         require_once 'forms/sign_in.php';
         $this->add_form(new SignInForm());
         //}
     }
 }
开发者ID:nguyenxuantung,项目名称:Website_Quan_Ly_Nha_Hang,代码行数:26,代码来源:class.php

示例4: getCurrent

 static function getCurrent()
 {
     if (!Session::is_set(self::SESSION_LANGUAGE_PATH)) {
         self::initDefault();
     }
     return Session::get(self::SESSION_LANGUAGE_PATH);
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:7,代码来源:Language.class.php

示例5: listActivityComment

 /**
 +----------------------------------------------------------
 * 返回用户列表
 +----------------------------------------------------------
 */
 public function listActivityComment()
 {
     if (!Session::is_set("systemId")) {
         header("Content-type: text/html; charset=utf-8");
         echo '<script>alert("您还没有登录!");location.href="/Admin/loginInit";try{window.event.returnValue=false; }catch(e){}</script>';
     } else {
         $vactivity_comment = M("vactivity_comment");
         $user_name = $_REQUEST["user_name"];
         if (!empty($user_name)) {
             $condition["user_name"] = array("like", "%" . $user_name . "%");
         }
         $activity_title = $_REQUEST["activity_title"];
         if (!empty($activity_title)) {
             $condition["activity_title"] = array("like", "%" . $activity_title . "%");
         }
         $content = $_REQUEST["content"];
         if (!empty($content)) {
             $condition["content"] = array("like", "%" . $content . "%");
         }
         $count = $vactivity_comment->where($condition)->count();
         import("ORG.Util.Page");
         $Page = new Page($count, 10);
         $foot = $Page->show();
         $list = $vactivity_comment->where($condition)->order('insert_time desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
         // 查询数据
         $this->assign('list', $list);
         $this->assign('foot', $foot);
         $this->display();
     }
 }
开发者ID:nehnre,项目名称:kuaipei,代码行数:35,代码来源:AdminActivityCommentAction.class.php

示例6: testClear

 function testClear()
 {
     Session::clear();
     $this->assertFalse(Session::is_set("/prova"), "La variabile prova e' gia' impostata!!");
     Session::set("/prova", "ok");
     $this->assertTrue(Session::is_set("/prova"), "la chiave prova non e' stata trovata.");
     $this->assertTrue(Session::get("/prova"), "ok", "Il valore della chiave non corrisponde!!");
     Session::clear();
     $this->assertFalse(Session::is_set("/prova"), "la chiave prova e' stata trovata.");
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:10,代码来源:session_test.php

示例7: getNodeName

function getNodeName($id)
{
    if (Session::is_set('nodeNameList')) {
        $name = Session::get('nodeNameList');
        return $name[$id];
    }
    $Group = D("Node");
    $list = $Group->getField('id,name');
    $name = $list[$id];
    Session::set('nodeNameList', $list);
    return $name;
}
开发者ID:wanggeopens,项目名称:own-libs,代码行数:12,代码来源:common.php

示例8: getInfoByCodeFromCodeDict

 /**
  * 通过条码字典获取条码信息
  *
  * @param  $code
  */
 private function getInfoByCodeFromCodeDict($code)
 {
     if (!Session::is_set('codeparm') || !Session::is_set('codedict')) {
         return false;
     }
     $codeparm = Session::get('codeparm');
     $codedict = Session::get('codedict');
     $codeinfo = array();
     foreach ($codeparm as $key => $value) {
         $s = (int) $value["start"] - 1;
         $l = $value["length"];
         $data = $codedict[$key][substr($code, $s, $l)];
         if ($data == '' || $data == null) {
             continue;
         }
         switch ($key) {
             case '品名':
                 $codeinfo['goodsName'] = $data;
                 break;
             case '型号':
                 $codeinfo['spec'] = $data;
                 break;
             case '电流':
                 $codeinfo['current1'] = $data;
                 break;
             case '电压':
                 $codeinfo['voltage1'] = $data;
                 break;
             case '方向':
                 $codeinfo['direct'] = $data;
                 break;
             case '常数':
                 $codeinfo['constant'] = $data;
                 break;
             case '等级':
                 $codeinfo['grade'] = $data;
                 break;
             case '生产厂商':
                 $codeinfo['madeIn'] = $data;
                 break;
             case '生产日期':
                 $codeinfo['madeDate'] = $data;
                 break;
         }
     }
     system_out(print_r($codeinfo, true));
     if (sizeof($codeinfo)) {
         $codeinfo['code'] = $code;
         return $codeinfo;
     } else {
         return false;
     }
 }
开发者ID:kenlong,项目名称:example,代码行数:58,代码来源:CodeInfo.class.php

示例9: logout

 public function logout()
 {
     if (Session::is_set(C('USER_AUTH_KEY'))) {
         Session::clear();
         $this->assign('jumpUrl', __URL__ . '/login');
         $this->success("注销成功!");
     } else {
         $this->assign('jumpUrl', __URL__ . '/login');
         $this->error('已经注销!');
     }
     $this->forward();
 }
开发者ID:rohcirtep,项目名称:easygameengine,代码行数:12,代码来源:PublicAction.class.php

示例10: add

 public function add()
 {
     $dao = D("Node");
     if (Session::is_set('currentNodeId')) {
         $vo = $dao->getById(Session::get('currentNodeId'));
         $this->assign('parentNode', $vo['name']);
         $this->assign('level', $vo['level'] + 1);
         $this->assign('pid', $vo['id']);
     } else {
         $this->assign('level', 1);
     }
     $this->display();
 }
开发者ID:lee99,项目名称:tpmaker,代码行数:13,代码来源:NodeAction.class.php

示例11: checkAdminUser

 public function checkAdminUser()
 {
     if (!Session::is_set("systemId")) {
         $json["success"] = false;
         $json["msg"] = "请您先登录";
     } else {
         $condition["id"] = Session::get("systemId");
         $admin_user = M("admin_user");
         $result = $admin_user->where($condition)->find();
         $json["success"] = true;
         $json["user_name"] = $result["user_name"];
     }
     $this->ajaxReturn($json);
 }
开发者ID:nehnre,项目名称:kuaipei,代码行数:14,代码来源:AdminAction.class.php

示例12: getGroupName

function getGroupName($id)
{
    if ($id == 0) {
        return '无上级组';
    }
    if (Session::is_set('groupName')) {
        $name = Session::get('groupName');
        return $name[$id];
    }
    $Group = D("Group");
    $list = $Group->getFields('id,name');
    $name = $list[$id];
    Session::set('groupName', $list);
    return $name;
}
开发者ID:8yong8,项目名称:vshop,代码行数:15,代码来源:function.php

示例13: listUser

 /**
 +----------------------------------------------------------
 * 返回用户列表
 +----------------------------------------------------------
 */
 public function listUser()
 {
     if (!Session::is_set("systemId")) {
         header("Content-type: text/html; charset=utf-8");
         echo '<script>alert("您还没有登录!");location.href="Admin/loginInit";try{window.event.returnValue=false; }catch(e){}</script>';
     } else {
         $User = M("User");
         $user_name = $_REQUEST["user_name"];
         if (!empty($user_name)) {
             $condition["user_name"] = array("like", "%" . $user_name . "%");
         }
         $user_type1 = $_REQUEST["user_type1"];
         if (!empty($user_type1)) {
             $condition["user_type1"] = $user_type1;
         }
         $user_type2 = $_REQUEST["user_type2"];
         if (!empty($user_type2)) {
             $condition["user_type2"] = $user_type2;
         }
         $status = $_REQUEST["status"];
         if (!empty($status)) {
             $condition["status"] = $status;
         }
         $activite_flag = $_REQUEST["activite_flag"];
         if (!empty($activite_flag)) {
             $condition["activite_flag"] = $activite_flag;
         }
         $freeze_flag = $_REQUEST["freeze_flag"];
         if (!empty($freeze_flag)) {
             if ($freeze_flag == "已冻结") {
                 $condition["freeze_flag"] = $freeze_flag;
             } else {
                 $condition["freeze_flag"] = array('neq', "已冻结");
             }
         }
         $count = $User->where($condition)->count();
         import("ORG.Util.Page");
         $Page = new Page($count, 10);
         $foot = $Page->show();
         $list = $User->where($condition)->order('update_time desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
         // 查询数据
         $this->assign('list', $list);
         $this->assign('foot', $foot);
         $this->display();
     }
 }
开发者ID:nehnre,项目名称:kuaipei,代码行数:51,代码来源:AdminUserAction.class.php

示例14: update

 public function update()
 {
     if (!isset($_POST['author']) or !isset($_POST['content'])) {
         alert('非法操作!', 3);
     }
     //读取数据库和缓存
     $pl = M('guestbook');
     $config = F('basic', '', './Web/Conf/');
     //相关判断
     if (Session::is_set('posttime')) {
         $temp = Session::get('posttime') + $config['postovertime'];
         if (time() < $temp) {
             //				echo "请不要连续发布!";
             alert('请不要连续发布!', U('Guestbook/index'));
             exit;
         }
     }
     //准备工作
     if ($config['bookoff'] == 0) {
         $data['status'] = 0;
     }
     $data['author'] = htmlspecialchars($_POST['author']);
     $data['content'] = htmlspecialchars(trim($_POST['content']));
     $data['email'] = htmlspecialchars(trim($_POST['email']));
     $data['tel'] = htmlspecialchars(trim($_POST['tel']));
     $data['addtime'] = date('Y-m-d H:i:s');
     //处理数据
     //		dump($data)
     if ($pl->add($data)) {
         Session::set('posttime', time());
         if ($config['bookoff'] == 0) {
             //				echo '发布成功,留言需要管理员审核!';
             alert('操作成功!', U('Guestbook/index'));
             exit;
         } else {
             //				echo '发布成功!';
             alert('发布成功!', U('Guestbook/index'));
             exit;
         }
     } else {
         //			echo '发布失败!';
         alert('发布失败!', U('Guestbook/index'));
         exit;
     }
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:45,代码来源:GuestbookAction.class.php

示例15: update

 public function update()
 {
     //输出gb2312码,ajax默认转的是utf-8
     header("Content-type: text/html; charset=utf-8");
     if (!isset($_POST['author']) or !isset($_POST['content'])) {
         alert('非法操作!', 3);
     }
     //读取数据库和缓存
     $pl = M('guestbook');
     $config = F('basic', '', './Web/Conf/');
     //相关判断
     if (Session::is_set('posttime')) {
         $temp = Session::get('posttime') + $config['postovertime'];
         if (time() < $temp) {
             echo "请不要连续发布!";
             exit;
         }
     }
     //准备工作
     if ($config['bookoff'] == 0) {
         $data['status'] = 0;
     }
     //先解密js的escape
     $data['author'] = htmlspecialchars(unescape($_POST['author']));
     $data['content'] = htmlspecialchars(trim(unescape($_POST['content'])));
     $data['title'] = htmlspecialchars(trim(unescape($_POST['title'])));
     $data['tel'] = htmlspecialchars(trim(unescape($_POST['tel'])));
     $data['ip'] = remove_xss(htmlentities(get_client_ip()));
     $data['addtime'] = date('Y-m-d H:i:s');
     //处理数据
     if ($pl->add($data)) {
         Session::set('posttime', time());
         if ($config['bookoff'] == 0) {
             echo '发布成功,留言需要管理员审核!';
             exit;
         } else {
             echo '发布成功!';
             exit;
         }
     } else {
         echo '发布失败!';
         exit;
     }
 }
开发者ID:babyhuangshiming,项目名称:webserver,代码行数:44,代码来源:GuestbookAction.class.php


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