From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../samples/day3/blog/protected/BlogUser.php | 116 ++++++++++----------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'demos/blog-tutorial/samples/day3/blog/protected/BlogUser.php') diff --git a/demos/blog-tutorial/samples/day3/blog/protected/BlogUser.php b/demos/blog-tutorial/samples/day3/blog/protected/BlogUser.php index 6b9e0a23..4f094a0c 100644 --- a/demos/blog-tutorial/samples/day3/blog/protected/BlogUser.php +++ b/demos/blog-tutorial/samples/day3/blog/protected/BlogUser.php @@ -1,59 +1,59 @@ -findByPk($username); - if($userRecord instanceof UserRecord) // if found - { - $user=new BlogUser($this->Manager); - $user->Name=$username; // set username - $user->Roles=($userRecord->role==1?'admin':'user'); // set role - $user->IsGuest=false; // the user is not a guest - return $user; - } - else - return null; - } - - /** - * Checks if the specified (username, password) is valid. - * This method is required by TDbUser. - * @param string username - * @param string password - * @return boolean whether the username and password are valid. - */ - public function validateUser($username,$password) - { - // use UserRecord Active Record to look for the (username, password) pair. - return UserRecord::finder()->findBy_username_AND_password($username,$password)!==null; - } - - /** - * @return boolean whether this user is an administrator. - */ - public function getIsAdmin() - { - return $this->isInRole('admin'); - } -} - +findByPk($username); + if($userRecord instanceof UserRecord) // if found + { + $user=new BlogUser($this->Manager); + $user->Name=$username; // set username + $user->Roles=($userRecord->role==1?'admin':'user'); // set role + $user->IsGuest=false; // the user is not a guest + return $user; + } + else + return null; + } + + /** + * Checks if the specified (username, password) is valid. + * This method is required by TDbUser. + * @param string username + * @param string password + * @return boolean whether the username and password are valid. + */ + public function validateUser($username,$password) + { + // use UserRecord Active Record to look for the (username, password) pair. + return UserRecord::finder()->findBy_username_AND_password($username,$password)!==null; + } + + /** + * @return boolean whether this user is an administrator. + */ + public function getIsAdmin() + { + return $this->isInRole('admin'); + } +} + ?> \ No newline at end of file -- cgit v1.2.3