username = $username; $zym_1 = $this->db( )->find( $zym_1, array( "limit" => 1 ) ); if ( $zym_1 && $zym_1->validatePassword( $password ) ) { $zym_2 = ( "admin", "test" ); $zym_2->user = array( "id" => $zym_1->id, "username" => $zym_1->username ); return "/index.php".( "[admin]MainController", "index" ); } $data['errorMsg'] = "账号或者密码错误!"; } else { $data['errorMsg'] = "请输入账号和密码!"; } } $this->renderc( "auth/login", $data ); } public function logout( ) { $zym_2 = ( "admin" ); $zym_2->user = NULL; header( "location:".( )->APP_URL."index.php/admin" ); } } ?>