Beispiel #1
0
function baddslashes($string)
{
    if (is_array($string)) {
        $keys = array_keys($string);
        foreach ($keys as $key) {
            $val = $string[$key];
            unset($string[$key]);
            $string[addslashes($key)] = baddslashes($val);
        }
    } else {
        $string = addslashes($string);
    }
    return $string;
}
Beispiel #2
0
 private function _init_user()
 {
     $authuser = $this->b['cookie']['authuser'];
     if ($authuser) {
         $authuser = baddslashes(explode("\t", authcode($authuser, 'DECODE')));
     }
     list($pwd, $uid) = empty($authuser) || count($authuser) < 2 ? array('', '') : $authuser;
     $uinfo = array();
     if ($uid) {
         $uinfo = getUser($uid);
     }
     if ($uinfo && $pwd == $uinfo['password']) {
         $this->b['uid'] = $uinfo['uid'];
         $this->b['username'] = $uinfo['username'];
         $this->b['groupid'] = $uinfo['groupid'];
         if ($uinfo['groupid'] == 1) {
             $this->b['admin'] = 1;
         }
         $this->b['user'] = $uinfo;
     }
 }