public function testDeletePersonnel() { $user = new db_user(); $user->insert('dupond'); $user->delete('dupond'); $users = $user->getAllData(); $this->assertNotContains('dupond', $users); }
public function get_user_info() { if (!isset($_COOKIE['login_username']) || !isset($_COOKIE['login_password'])) { $this->userid = null; $this->groupid = null; return; } else { $user = db_user::getInstance(); $userinfo = $user->getDataLimit('password,userid,groupid', "username='******'login_username']}'"); if (empty($userinfo) || md5($userinfo[0]['password'] . $GLOBALS['config']['cookie_password']) != $_COOKIE['login_password']) { action_public::turnPage($GLOBALS['config']['site_url'] . 'index.php?case=user&act=login', '用户不存在!'); } } $this->userid = $userinfo[0]['userid']; $this->groupid = $userinfo[0]['groupid']; }