Example #1
0
    {
        return $this->uid;
    }
    function getUsername()
    {
        return $this->username;
    }
    function getPrivilege()
    {
        return $this->privilege;
    }
    function getTheme()
    {
        return $this->theme;
    }
    function setTheme($theme)
    {
        if (in_array($theme, array_keys(Config::getCfg('styles')))) {
            if ($this->uid != 0) {
                OldModel::updateUserTheme($this->uid, $theme);
            }
            $this->theme = $theme;
        }
    }
    function canSearch()
    {
        return $this->privilege >= Site::LEVEL_SEARCH;
    }
}
User::$guest = new User(0, "guest", 0, "yotsuba");
Example #2
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }