• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_login函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_login函数的典型用法代码示例。如果您正苦于以下问题:PHP is_login函数的具体用法?PHP is_login怎么用?PHP is_login使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _initialize

 public function _initialize()
 {
     /* 获取用户ID */
     define('UID', is_login());
     /* 判断是否登录 */
     if (!UID) {
         $this->redirect('Public/login');
     }
     /* 判断是否为超级管理员 */
     define('IS_ROOT', is_administrator());
     /* 检测访问权限 */
     $access = $this->accessControl();
     if ($access === false) {
         R('Empty/index');
     } elseif ($access === NULL) {
         /* 检测分类栏目有关的各项动态权限 */
         $dynamic = $this->checkDynamic();
         if ($dynamic === NULL) {
             /* 检测非动态权限 */
             $rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME);
             if (!$this->checkRule($rule)) {
                 R('Empty/index');
             }
         } elseif ($dynamic === false) {
             R('Empty/index');
         }
     }
 }
开发者ID:liqihua,项目名称:yanzhihui,代码行数:28,代码来源:BaseController.class.php


示例2: index

 /**
  * 首页
  */
 public function index()
 {
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/img20150320-8746-y01jkz.jpg?1426860004";
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/163623_photo.jpg?1427077663";
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/641675_photo.jpg?1399943906";
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/163602_photo.jpg?1426959397";
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/355294_photo.jpg?1352336813";
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/922025_photo.jpg?1420255388";
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/img20150221-26754-1f34xst.jpg?1424564067";
     $pic_name[] = "http://coollive.labake.cn/public/data/images/coollive/648047_photo.jpg?1416532039";
     if (is_login()) {
         $this->home();
     } else {
         $this->load->model('live_programs_model', 'live_m');
         /*+++++++++++++++++++++++++++++++列表数据++++++++++++++++++++++++++*/
         //酷Live精选
         $new_programes = $this->live_m->get_best_programs(1, 10);
         foreach ($new_programes as $k => $v) {
             if ($v['is_live'] == 1) {
                 $new_programes[$k]['pic_name'] = $pic_name[$k];
             } else {
                 $new_programes[$k]['pic_name'] = "/public/data/images/video/cut/187x140_" . $v['pic_name'];
             }
         }
         $this->data['new_programes'] = $this->new_programes($new_programes);
         /*+++++++++++++++++++++++++++++++列表数据结束++++++++++++++++++++++++++*/
         $this->load->view('spree/index.tpl', $this->data);
     }
 }
开发者ID:Bingle-labake,项目名称:coollive.com.cn,代码行数:32,代码来源:lauch.php


示例3: _initialize

 /**
  * 后台控制器初始化
  */
 protected function _initialize()
 {
     // 获取当前用户ID
     define('UID', is_login());
     if (!UID) {
         // 还没登录 跳转到登录页面
         $this->redirect('Public/login');
     }
     // 是否是超级管理员
     define('IS_ROOT', is_administrator());
     if (!IS_ROOT && C('ADMIN_ALLOW_IP')) {
         // 检查IP地址访问
         if (!in_array(get_client_ip(), explode(',', C('ADMIN_ALLOW_IP')))) {
             $this->error('403:禁止访问');
         }
     }
     // 检测访问权限
     $access = $this->accessControl();
     if ($access === false) {
         $this->error('403:禁止访问');
     } elseif ($access === null) {
         $dynamic = $this->checkDynamic();
         //检测分类栏目有关的各项动态权限
         if ($dynamic === null) {
             //检测非动态权限
             $rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME);
             if (!$this->checkRule($rule, array('in', '1,2'))) {
                 $this->error('未授权访问!');
             }
         } elseif ($dynamic === false) {
             $this->error('未授权访问!');
         }
     }
     $this->assign('__MENU__', $this->getMenus());
 }
开发者ID:Backflag,项目名称:weiphp2.0.1202,代码行数:38,代码来源:AdminController.class.php


示例4: getfaceid

 /**
  * 数据表前缀
  * @var string
  */
 public function getfaceid($uid)
 {
     if (!$uid) {
         $uid = is_login();
     }
     return $this->where("id='{$uid}'")->getField("face");
 }
开发者ID:gitchenze,项目名称:soloshop,代码行数:11,代码来源:UcenterMemberModel.class.php


示例5: attach

 public function attach($id)
 {
     $uid = is_login();
     $where = array('project_id' => $id, 'investor_id' => $uid);
     $data = $this->field('status')->where($where)->find();
     $status = 1;
     if ($data) {
         $status = $data['status'] ? 0 : 1;
         if ($status) {
             M('Project')->where(array('id' => $id))->setInc('like_record');
         } else {
             M('Project')->where(array('id' => $id))->setDec('like_record');
         }
         $save = array('status' => $status, 'attach_time' => NOW_TIME, 'update_time' => NOW_TIME, 'update_id' => $id);
         $this->where($where)->save($save);
     } else {
         $save = array('project_id' => $id, 'attach_time' => NOW_TIME, 'investor_id' => $uid, 'status' => 1, 'create_time' => NOW_TIME, 'create_id' => $id, 'update_time' => NOW_TIME, 'update_id' => $id);
         $this->add($save);
     }
     $proj = M('Project')->where('id=' . $id)->field('uid,project_name')->find();
     $link = '<a href="' . U('Project/detail?id=' . $id) . '">《' . $proj['project_name'] . '》</a>';
     $ulink = '<a href="' . U('MCenter/profile?id=' . $uid) . '">' . get_membername($uid) . '</a>';
     if ($status) {
         D('ProjectDynamic')->addDynamic($id, '收藏了' . $link . '项目。', 1);
         //用户(关注)动态
         // 项目方(收藏提示)消息
         D('Message')->send(0, $proj['uid'], '', $ulink . '收藏了您的' . $link . '项目。', 3);
     } else {
         M('ProjectDynamic')->where(array('project_id' => $id, 'create_id' => $uid, 'type' => 1))->delete();
         // 项目方(收藏提示)消息
         D('Message')->send(0, $proj['uid'], '', $ulink . '取消收藏了您的' . $link . '项目。', 3);
     }
     return $status;
 }
开发者ID:rainly123,项目名称:zyzm,代码行数:34,代码来源:ProjectAttachModel.class.php


示例6: sendMessage

 /**
  * 注:appname及之后的参数,一般情况下无需填写
  * @param        $to_uid 接受消息的用户ID
  * @param string $content 内容
  * @param string $title 标题,默认为  您有新的消息
  * @param        $url 链接地址,不提供则默认进入消息中心
  * @param int    $from_uid 发起消息的用户,根据用户自动确定左侧图标,如果为用户,则左侧显示头像
  * @param int    $type 消息类型,0系统,1用户,2应用
  * @param string $appname 应用名,默认不需填写,如果填写了就必须实现对应的消息处理模型,例如贴吧里面可以基于某个回复开启聊天
  * @param string $apptype 同上,应用里面的一个标识符
  * @param int    $source_id 来源ID,通过来源ID获取基于XX聊天的来源信息
  * @param int    $find_id 查找ID,通过查找ID获得标识ID
  * @return int
  * @auth 陈一枭
  */
 public function sendMessage($to_uid, $content = '', $title = '您有新的消息', $url, $from_uid = 0, $type = 0, $appname = '', $apptype = '', $source_id = 0, $find_id = 0)
 {
     if ($to_uid == is_login()) {
         return 0;
     }
     $this->sendMessageWithoutCheckSelf($to_uid, $content, $title, $url, $from_uid, $type, $appname, $apptype, $source_id, $find_id);
 }
开发者ID:fishling,项目名称:chatPro,代码行数:22,代码来源:MessageModel.class.php


示例7: _initialize

 /**
  * 后台控制器初始化
  */
 protected function _initialize()
 {
     // 获取当前用户ID
     if (defined('UID')) {
         return;
     }
     define('UID', is_login());
     if (!UID) {
         // 还没登录 跳转到登录页面
         $this->redirect('Public/login');
     }
     /* 读取数据库中的配置 */
     $config = S('DB_CONFIG_DATA');
     if (!$config) {
         $config = D('Config')->lists();
         S('DB_CONFIG_DATA', $config);
     }
     C($config);
     //添加配置
     // 是否是超级管理员
     define('IS_ROOT', is_administrator());
     if (!IS_ROOT && C('ADMIN_ALLOW_IP')) {
         // 检查IP地址访问
         if (!in_array(get_client_ip(), explode(',', C('ADMIN_ALLOW_IP')))) {
             $this->error('403:禁止访问');
         }
     }
 }
开发者ID:xingluxin,项目名称:jianshen,代码行数:31,代码来源:AdminController.class.php


示例8: flow2

 public function flow2()
 {
     if (!is_login()) {
         cookie('__forward__', __SELF__);
         $this->error('请先登录', U('Member/login'));
         return;
     }
     if (IS_POST) {
         $order_model = D('OrderInfo');
         if ($order_model->addOrder()) {
             $this->redirect('flow3');
         } else {
             $this->error('下单失败,请稍后再试');
         }
     } else {
         //用户地址列表
         $this->assign('address_list', D('Address')->getAddList());
         //获取支付方式
         $this->assign('pay_list', D('Setting')->getPayList());
         //获取配送方式
         $this->assign('transport_list', D('Setting')->getTransportList());
         //取出购物车里面的内容
         $this->assign('car_list', D('ShoppingCar')->getCar());
         $this->display();
     }
 }
开发者ID:kunx-edu,项目名称:tp1030,代码行数:26,代码来源:ShoppingCarController.class.php


示例9: check_read_auth

/**
 * 根据book表的role_ids字段判断用户有无阅读权限
 * @param $role_ids
 * @return int
 * @author 郑钟良<[email protected]>
 */
function check_read_auth($role_ids)
{
    if ($role_ids == '') {
        return 2;
        //无需权限
    }
    if (!is_array($role_ids)) {
        $role_ids = str_replace('[', '', $role_ids);
        $role_ids = str_replace(']', '', $role_ids);
        $role_ids = explode(',', $role_ids);
    }
    if (!count($role_ids)) {
        return 2;
        //无需权限
    }
    $map['role_id'] = array('in', $role_ids);
    $map['uid'] = is_login();
    $map['status'] = 1;
    if (D('UserRole')->where($map)->count()) {
        return 1;
        //有权限阅读
    } else {
        return 0;
        //无权限阅读
    }
}
开发者ID:sunjie20081001,项目名称:sns,代码行数:32,代码来源:function.php


示例10: render

 public function render($uid = 0, $page = 1, $tab = null, $count = 10)
 {
     !$uid && ($uid = is_login());
     //查询条件
     $map['uid'] = $uid;
     $NewsModel = new NewsModel();
     /* 获取当前分类下资讯列表 */
     if ($uid != is_login()) {
         $map['status'] = 1;
         $map['dead_line'] = array('gt', time());
     }
     list($list, $totalCount) = $NewsModel->getListByPage($map, $page, 'update_time desc', '*', $count);
     foreach ($list as &$val) {
         if ($val['status'] == 1) {
             $val['audit_status'] = '<span style="color: green;">审核通过</span>';
         } elseif ($val['status'] == 2) {
             $val['audit_status'] = '<span style="color:#4D9EFF;">待审核</span>';
         } elseif ($val['status'] == -1) {
             $val['audit_status'] = '<span style="color: #b5b5b5;">审核失败</span>';
         }
     }
     unset($val);
     /* 模板赋值并渲染模板 */
     $this->assign('news_list', $list);
     $this->assign('totalCount', $totalCount);
     $this->display(T('News@Widget/ucenterblock'));
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:27,代码来源:UcenterBlockWidget.class.php


示例11: login

 /**
  * 管理员登录
  */
 public function login()
 {
     if (IS_POST) {
         $adm_id = I('adm_id');
         $adm_pw = I('adm_pw');
         # 图片验证码校验
         if (!$this->check_verify(I('post.verify'))) {
             $this->error('验证码输入错误!');
         }
         if (!$adm_id) {
             $this->error('请输入管理员!');
         }
         if (!$adm_pw) {
             $this->error('请输入密码!');
         }
         $ADM = D('Admin');
         $uid = $ADM->login($adm_id, $adm_pw);
         if (0 < $uid) {
             $this->redirect('Index/index');
         } else {
             $this->error($ADM->getError());
         }
     } else {
         if (is_login('Admin')) {
             $this->error("您已登陆系统", Cookie('__forward__') ?: C('HOME_PAGE'));
         }
         $this->meta_title = '管理员登录';
         $this->display();
     }
 }
开发者ID:rainbow88,项目名称:zsy,代码行数:33,代码来源:LoginController.class.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->helper('admin');
     is_login();
     //?登陆
     //暂时只有后台使用,验证是否允许上传权限
     $this->_config = get_config();
     $this->base_path = str_replace('\\', '/', FCPATH) . 'public/';
     $this->root_url = $this->_config['base_url'] . 'public/';
     //设置上传路径
     if (isset($_REQUEST['up'])) {
         //可接受的dir参数值为 <dir>/<dir1>/***
         $dir = isset($_GET['dir']) ? trim($_GET['dir']) : 'default';
         $this->save_path = 'image/' . $dir;
     } else {
         if (isset($_GET['dir']) && isset($this->allow_ext[$_GET['dir']])) {
             $this->utype = $_GET['dir'];
         } else {
             $this->utype = 'image';
         }
         $this->save_path = $this->utype . '/' . date('Y/m/d');
     }
     $this->save_url = $this->_config['base_url'] . 'public/' . $this->save_path;
 }
开发者ID:shitfSign,项目名称:conf_system,代码行数:25,代码来源:file.php


示例13: getAllMenu

 /**
  * 获取所有模块菜单
  * @param string $addon_dir
  * @author jry <[email protected]>
  */
 public function getAllMenu()
 {
     $uid = is_login();
     $user_group = D('Admin/Access')->getFieldByUid($uid, 'group');
     // 获得当前登录用户信息
     $group_info = D('Admin/Group')->find($user_group);
     $group_auth = json_decode($group_info['menu_auth'], true);
     // 获得当前登录用户所属部门的权限列表
     // 获取所有菜单
     $menu_list = S('MENU_LIST_' . $uid);
     if (!$menu_list || APP_DEBUG === true) {
         $con['status'] = 1;
         $system_module_list = $this->where($con)->order('sort asc, id asc')->select();
         $tree = new tree();
         $menu_list = array();
         foreach ($system_module_list as $key => &$module) {
             $menu = json_decode($module['admin_menu'], true);
             $temp = $tree->list_to_tree($menu);
             $menu_list[$module['name']] = $temp[0];
             $menu_list[$module['name']]['id'] = $module['id'];
             $menu_list[$module['name']]['name'] = $module['name'];
         }
         S('MENU_LIST_' . $uid, $menu_list, 3600);
         // 缓存配置
     }
     return $menu_list;
 }
开发者ID:applemin,项目名称:tangguo,代码行数:32,代码来源:ModuleModel.class.php


示例14: addLZLReply

 public function addLZLReply($post_id, $to_f_reply_id, $to_reply_id, $to_uid, $content, $p, $send_message = true)
 {
     //新增一条回复
     $data = array('uid' => is_login(), 'post_id' => $post_id, 'to_f_reply_id' => $to_f_reply_id, 'to_reply_id' => $to_reply_id, 'to_uid' => $to_uid, 'content' => $content);
     $data = $this->create($data);
     if (!$data) {
         return false;
     }
     $result = $this->add($data);
     action_log('add_post_reply', 'ForumLzlReply', $result, is_login());
     S('post_replylist_' . $post_id, null);
     S('post_replylzllist_' . $to_f_reply_id, null);
     $postModel = D('ForumPost');
     //增加帖子的回复数
     $postModel->where(array('id' => $post_id))->setInc('reply_count');
     //更新最后回复时间
     $postModel->where(array('id' => $post_id))->setField('last_reply_time', time());
     $post = $postModel->find($post_id);
     D('Forum')->where(array('id' => $post['forum_id']))->setField('last_reply_time', time());
     if ($send_message) {
         $this->sendReplyMessage(is_login(), $post_id, $content, $to_uid, $to_f_reply_id, $result, $p);
     }
     $this->handleAt($post_id, $to_f_reply_id, $content, $p, $map);
     //返回结果
     return $result;
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:26,代码来源:ForumLzlReplyModel.class.php


示例15: drawcash

 public function drawcash($bankinfo, $notifyurl)
 {
     $uid = is_login();
     $this->config = C('DRAW_CASH');
     $time = NOW_TIME;
     $tradFlowNo = time_format($time, 'Ymd') . $this->config['MERCHANTID'] . substr(floor(microtime($time) * 1000), -8);
     //head文件
     $head = array('version' => '01', 'type' => '0001', 'channelNo' => 'HM', 'tradDate' => time_format($time, 'Ymd'), 'tradTime' => time_format($time, 'His'), 'tradFlowNo' => $tradFlowNo, 'tradNo' => 'ES0007');
     //交易代码
     //body文件
     $body = array('tranSeqId' => $tradFlowNo, 'merchantNo' => $this->config['MERCHANTID'], 'alias' => $this->config['ALIAS'], 'submitDate' => time_format($time, 'Ymd'), 'isNeedNotify' => '0', 'notifyUrl' => $notifyurl, 'batchUse' => '01', 'bankId' => $bankinfo['bankId'], 'acctNo' => $bankinfo['acctNo'], 'acctName' => $bankinfo['acctName'], 'acctAttribute' => '02', 'bankName' => $bankinfo['bankName'], 'bankProvince' => $bankinfo['bankProvince'], 'bankCity' => $bankinfo['bankCity'], 'cityCode' => '', 'amount' => $bankinfo['amount'], 'currencyType' => 'CNY', 'mobilePhone' => '', 'remark' => '');
     $message = array('head' => $head, 'body' => $body);
     include_once APP_PATH . '/BaoyiPay/BaoyiPay.php';
     $xml = to_xmlstring1($message);
     $mac = md5($xml . $this->config['MERKEY']);
     $para = array('tradNo' => 'ES0007', 'type' => '0001', 'merchantNo' => $this->config['MERCHANTID'], 'data' => $xml, 'mac' => $mac);
     // D('AccountLog')->record($head, $xml, $mac, 7);
     $text = $this->getHttpResponseGet($this->config['DRAW_URL'], $para);
     $para = md5Response($text, $this->config['MERKEY']);
     if (!$para) {
         $this->error('返回信息不正确');
     }
     if ($para['status'] == '000000000') {
         //提现记录
         $drawcashlist = array('pid' => 0, 'bussflowno' => $tradFlowNo, 'amount' => $bankinfo['amount'], 'create_time' => NOW_TIME, 'update_time' => NOW_TIME);
         M('DrawcashList')->add($drawcashlist);
         return $tradFlowNo;
     } else {
         $this->error($para['statusMsg']);
     }
 }
开发者ID:rainly123,项目名称:zyzm,代码行数:31,代码来源:DrawcashController.class.php


示例16: todo

 public function todo()
 {
     if (!is_login()) {
         return redirect(site_url('login?url=' . site_url('cart')));
     }
     // 如果购物车为空则返回出错提示
     $cart_items = $this->cart->contents();
     if (empty($cart_items)) {
         return redirect(site_url('cart'));
     }
     // 添加订单
     $order = array('user_id' => current_user()->id, 'subject' => '', 'status' => 0, 'total' => $this->cart->total());
     // 添加订单详情
     $order_subject = array();
     $order_details = array();
     foreach ($this->cart->contents() as $items) {
         $order_subject[] = $items['name'];
         $detail = array('user_id' => current_user()->id, 'price' => $items['price'], 'quantity' => $items['qty'], 'name' => $items['name'], 'goods_type' => $items['goods_type'], 'goods_id' => $items['goods_id'], 'url' => $items['url']);
         $order_details[] = $detail;
     }
     $order['subject'] = join(' / ', $order_subject);
     $this->load->model('Order_model', 'order');
     $order_obj = $this->order->create($order, $order_details);
     // 清除购物车
     $this->cart->destroy();
     // 到支付宝支付,应该还有一个确认订单的过程
     $this->load->model('alipay_model', 'alipay');
     header("content-Type: text/html; charset=Utf-8");
     $alipay_form = array('order_id' => $order_obj->id, 'subject' => $order_obj->subject, 'body' => '', 'show_url' => site_url('orders/' . $order_obj->id), 'price' => $order_obj->total);
     echo $this->alipay->build_form($alipay_form);
     // 还应该配置收货地址等,这样用户不用在支付宝去做这个事情了(用户支付宝就用地址?)
 }
开发者ID:robotzhang,项目名称:bangwoke,代码行数:32,代码来源:cart.php


示例17: addAddress

 /**
  * 新增和修改地址
  * @return boolean
  */
 public function addAddress()
 {
     $userinfo = is_login();
     if ($this->data['is_default']) {
         $this->where(array('member_id' => $userinfo['id']))->setField('is_default', 0);
     }
     $this->data['member_id'] = $userinfo['id'];
     $id = $this->data['id'];
     //如果表单中的id值不为空,表示是修改
     if ($this->data['id']) {
         if ($this->save() !== false) {
             return $id;
         } else {
             return false;
         }
     } else {
         //如果表单中id值为空,表示是新增,并且把id删除
         unset($this->data['id']);
         if (($id = $this->add()) !== false) {
             return $id;
         } else {
             return false;
         }
     }
 }
开发者ID:kunx-edu,项目名称:tp1030,代码行数:29,代码来源:AddressModel.class.php


示例18: _initialize

 function _initialize()
 {
     //模板初始化
     C('DEFAULT_THEME', session('DEFAULT_THEME'));
     $token = get_token();
     $param = array('lists', 'config', 'nulldeal');
     if (in_array(_ACTION, $param) && (empty($token) || $token == '-1')) {
         $url = U('Public/lists?from=2');
         redirect($url);
     }
     // 管理员需要对插件的管理权限进行判断
     if (is_login()) {
         $token_status = D('Common/AddonStatus')->getList(false);
         if ($token_status[_ADDONS] == -1) {
             $this->error('你没有权限管理和配置该插件');
         }
         return true;
     }
     C('EDITOR_UPLOAD.rootPath', './Uploads/Editor/' . $token . '/');
     if ($GLOBALS['is_wap']) {
         // 默认错误跳转对应的模板文件
         C('TMPL_ACTION_ERROR', 'Addons:dispatch_jump_mobile');
         // 默认成功跳转对应的模板文件
         C('TMPL_ACTION_SUCCESS', 'Addons:dispatch_jump_mobile');
     } else {
         $this->_nav();
     }
 }
开发者ID:LukeChow1018,项目名称:weixin,代码行数:28,代码来源:AddonsController.class.php


示例19: groundup_new_user_cookie

 function groundup_new_user_cookie()
 {
     // start a new session to track new visits expires after 30 minutes
     session_start();
     if (isset($_SESSION['last_activity']) && time() - $_SESSION['last_activity'] > 1800) {
         // last request was more than 30 minutes ago
         session_unset();
         // unset $_SESSION variable for the run-time
         session_destroy();
         // destroy session data in storage
     }
     $_SESSION['last_activity'] = time();
     // update last activity time stamp
     if (!isset($_SESSION['new_user_check'])) {
         $_SESSION['new_user_check'] = '1';
         if (!is_admin() && !is_login() && !is_register()) {
             if (!isset($_COOKIE['new_user'])) {
                 $visit = 0;
             } else {
                 $visit = $_COOKIE['new_user'] + 1;
             }
             setcookie('new_user', $visit, time() + 3600 * 24 * 100, '/', COOKIE_DOMAIN, false);
         }
     }
 }
开发者ID:abacusadvertising,项目名称:groundup,代码行数:25,代码来源:helpers.php


示例20: beAdmin

 public function beAdmin()
 {
     if (!is_login()) {
         $this->error(L('_ERROR_PLEASE_LOGIN_BEFORE_APPLY_') . L('_PERIOD_'));
     }
     $this->checkAuth(null, -1, L('_INFO_AUTHORITY_LACK_FOR_PRESENTER_'));
     $tid = I('tid', 0, 'intval');
     $topicModel = D('Topic');
     $topic = $topicModel->find($tid);
     if ($topic) {
         if ($topic['uadmin']) {
             //已经存在管理员
             $this->error(L('_FAIL_APPLY_') . L('_PERIOD_'));
         } else {
             if (is_administrator() || check_auth('Weibo/Topic/beAdmin')) {
                 $topic['uadmin'] = is_login();
                 $result = $topicModel->save($topic);
                 if ($result) {
                     $this->success(L('_SUCCESS_BECOME_PRESENTER_') . L('_PERIOD_'), 'refresh');
                 } else {
                     $this->error(L('_FAIL_OPERATION_') . L('_PERIOD_'));
                 }
             } else {
                 $this->error(L('_ERROR_AUTHORITY_LACK_FOR_APPLY_PRESENTER_') . L('_PERIOD_'));
             }
         }
     } else {
         $this->error(L('_ERROR_TOPIC_INEXISTENT_') . L('_PERIOD_'));
     }
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:30,代码来源:TopicController.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_long函数代码示例发布时间:2022-05-15
下一篇:
PHP is_loggedin函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap