示例#1
0
文件: webUser.php 项目: rigidus/ea
 function get($name)
 {
     if (!self::$user) {
         db::table('users');
         db::where('user_id', $_SESSION['WEB_USER_ID']);
         db::where('user_pub', 1);
         db::limit(1);
         self::$user = db::assoc();
     }
     if (!isset(self::$user[$name])) {
         return false;
     }
     return self::$user[$name];
 }
示例#2
0
文件: web.php 项目: rigidus/ea
 function observerMemory()
 {
     $cookie = cookie::get(md5(SERVER));
     if ($cookie) {
         $err = false;
         list($username, $userid, $hash) = explode(',', $cookie);
         $userid = intval($userid);
         db::table('users');
         db::where('user_id', $userid);
         $row = db::assoc();
         $word = 'legenda';
         if (md5($row['user_login'] . $word) != $hash) {
             $err = true;
         }
         if (db::rows() == 0) {
             $err = true;
         }
         if ($err) {
             unset($_SESSION['WEB_AUTH']);
             $_SESSION['WEB_NO_AUTH'] = 1;
             headers::self();
         } else {
             webUser::setAuth($userid);
             headers::self();
         }
     } else {
         $_SESSION['WEB_NO_AUTH'] = 1;
     }
 }