Exemple #1
0
 public static function check($a, $p)
 {
     if (empty($a) && empty($p)) {
         self::LoginPage();
     }
     self::$data = iDB::row("SELECT * FROM `#iCMS@__members` WHERE `username`='{$a}' AND `password`='{$p}' AND `status`='1' LIMIT 1;");
     self::$data or self::LoginPage();
     unset(self::$data->password);
     self::$data->info && (self::$data->info = unserialize(self::$data->info));
     self::$userid = self::$data->uid;
     self::$nickname = self::$data->nickname ? self::$data->nickname : self::$data->username;
     self::$group = iDB::row("SELECT * FROM `#iCMS@__group` WHERE `gid`='" . self::$data->gid . "' LIMIT 1;");
     self::$mpower = (array) self::use_power(self::$group->power, self::$data->power);
     self::$cpower = (array) self::use_power(self::$group->cpower, self::$data->cpower);
     return self::$data;
 }
Exemple #2
0
 public static function CP($p, $act = '', $ret = '')
 {
     if (self::is_superadmin()) {
         return true;
     }
     if ($p === '__CID__') {
         foreach ((array) iMember::$cpower as $key => $_cid) {
             if (!strstr($value, ':')) {
                 self::CP($_cid, $act) && ($cids[] = $_cid);
             }
         }
         return $cids;
     }
     $act && ($p = $p . ':' . $act);
     $rt = iMember::check_power((string) $p, iMember::$cpower);
     $rt or self::permission_msg($p, $ret);
     return $rt;
 }
Exemple #3
0
 function do_logout()
 {
     iMember::logout();
     iACP::destroy_seccode();
     iPHP::success('注销成功!', 'url:' . __SELF__);
 }