コード例 #1
0
ファイル: Login.php プロジェクト: rakeshraushan/dase
 public function postToLogin($r)
 {
     //this is the default, uber-simple login
     //which should be overidden by a module
     //all valid users need to be superusers
     $username = strtolower($r->get('username'));
     $pass = $r->get('password');
     $superusers = $r->getSuperusers();
     //todo: this is why params are not saved -- super ONLY
     if (isset($superusers[$username]) && $superusers[$username] == $pass) {
         $user = new Dase_DBO_DaseUser($this->db);
         $user->retrieveByEid($username);
         $user->initCart();
         $r->setCookie('collections', Dase_Json::get(Dase_DBO_Collection::getLookupArray($this->db)));
         $r->setCookie('eid', $username);
         $r->setCookie('max', $user->max_items);
         $r->setCookie('display', $user->display);
         $r->renderRedirect(urldecode($r->get('target')));
     } else {
         //I could probably just display here instead of redirect
         $params['msg'] = 'incorrect username/password';
         $r->renderRedirect("login/form", $params);
     }
 }
コード例 #2
0
ファイル: Tag.php プロジェクト: rakeshraushan/dase
 public static function get($db, $ascii_id, $eid)
 {
     if (!$ascii_id || !$eid) {
         return false;
     }
     $user = new Dase_DBO_DaseUser($db);
     $user->retrieveByEid($eid);
     $tag = new Dase_DBO_Tag($db);
     $tag->ascii_id = $ascii_id;
     $tag->dase_user_id = $user->id;
     $tag->findOne();
     if ($tag->id) {
         return $tag;
     } else {
         return false;
     }
 }
コード例 #3
0
ファイル: DaseUser.php プロジェクト: rakeshraushan/dase
 public static function get($db, $eid)
 {
     $u = new Dase_DBO_DaseUser($db);
     return $u->retrieveByEid($eid);
 }