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


PHP account::logged_in方法代码示例

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


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

示例1: not_logged_in_action

 public function not_logged_in_action()
 {
     if (account::logged_in()) {
         //y u lie tho?
         page::redirect('/world');
     }
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:7,代码来源:account.php

示例2: __construct

 public function __construct()
 {
     //the whole world needs both, valid account and character
     if (!account::logged_in()) {
         page::redirect('/account/not-logged-in');
     }
     if (!character::selected()) {
         page::redirect('/character/select');
     }
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:10,代码来源:world.php

示例3: select_action

 public function select_action($id)
 {
     character::unselect();
     if (!account::logged_in()) {
         page::redirect('/account/not-logged-in');
     }
     if ($id) {
         $id = (int) $id;
         $q = db::query('select count(*) from ' . character::table_name() . ' where id=? and account_id=?', $id, account::current()->id);
         $count = $q->fetchColumn(0);
         if (!$count) {
             //character doesn't exist or this isn't your character, reload
             //the character selection (AND DONT TRY TO FUCK WITH ME!)
             page::redirect('/character/select');
         }
         character::select($id);
         page::redirect('/world');
     }
     $characters = character::load(account::current()->id, 'account_id');
     $this->set('characters', $characters->fetchAll());
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:21,代码来源:character.php

示例4: info_action

 public function info_action($id)
 {
     $char = null;
     if (!$id) {
         if (!account::logged_in()) {
             return api::result(false, array('message' => 'Not_logged_in'));
         }
         if (!character::selected()) {
             return api::result(false, array('message' => 'No_character_selected'));
         }
         $char = character::current();
     } else {
         if (is_numeric($id)) {
             $char = character::load_one((int) $id);
         } else {
             $char = character::load_one($id, 'name');
         }
         if (!$char) {
             //character doesn't exist
             return api::result(false, array('message' => 'Character_not_found'));
         }
     }
     return api::result(true, $char->info());
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:24,代码来源:character.php

示例5: index_action

 public function index_action()
 {
     if (account::logged_in()) {
         page::redirect('/world');
     }
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:6,代码来源:index.php

示例6: create

 public static function create($name, $gender = character::GENDER_MALE, $account = null)
 {
     $acc = null;
     if ($acc instanceof account) {
         $acc = $account;
     } else {
         if (is_numeric($account)) {
             $acc = account::load_one($account);
         } else {
             if (is_string($account)) {
                 $acc = account::load_one($account, 'email');
             } else {
                 if (!account::logged_in()) {
                     return false;
                 } else {
                     $acc = account::current();
                 }
             }
         }
     }
     $char = new static();
     $char->name = $name;
     $char->account_id = $acc->id;
     $char->save();
     //actually just for getting the ID and attach the real shit
     $char->gender = $gender;
     $char->save();
     return $char;
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:29,代码来源:character.php


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