Ejemplo n.º 1
0
 public function log_out_action()
 {
     account::log_out();
     //is the character still logged in? if yes, log it out
     if (character::selected()) {
         character::unselect();
     }
     page::redirect();
 }
Ejemplo n.º 2
0
 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 F**K 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());
 }