/** * 构造方法 * @access public * @param mixed $name * @param mixed $password * @return mixed */ public function __construct($name, $password) { if (Session::get('user') === null) { $model = new Model(''); $user = $model->getObjs('*', 'name="' . $name . '" and password="******"'); if (isset($user[0])) { $this->properties = $user[0]; $this->status = 'online'; Session::set('user', $this->properties); } else { $this->status = 'offline'; $this->properties = null; } } else { $this->status = 'online'; $this->properties = Session::get('user'); } }