summaryrefslogtreecommitdiff
path: root/demos/chat/protected/App_Code
diff options
context:
space:
mode:
authorxue <>2007-10-01 01:10:04 +0000
committerxue <>2007-10-01 01:10:04 +0000
commit3a7602effa90c05e8f9e4fbfd6db7d774e16beb1 (patch)
tree27c6619baa39278c9f634a44e8e7b34e061eb0bc /demos/chat/protected/App_Code
parent769c6663a77893cfbc2270db8ba0d506ea5e493f (diff)
final fixes.3.1.1
Diffstat (limited to 'demos/chat/protected/App_Code')
-rw-r--r--demos/chat/protected/App_Code/ChatUserManager.php28
1 files changed, 25 insertions, 3 deletions
diff --git a/demos/chat/protected/App_Code/ChatUserManager.php b/demos/chat/protected/App_Code/ChatUserManager.php
index f8fe09cc..f28ee362 100644
--- a/demos/chat/protected/App_Code/ChatUserManager.php
+++ b/demos/chat/protected/App_Code/ChatUserManager.php
@@ -9,7 +9,7 @@ class ChatUserManager extends TModule implements IUserManager
{
return 'Guest';
}
-
+
/**
* Returns a user instance given the user name.
* @param string user name, null if it is a guest.
@@ -18,7 +18,7 @@ class ChatUserManager extends TModule implements IUserManager
public function getUser($username=null)
{
$user=new TUser($this);
- $user->setIsGuest(true);
+ $user->setIsGuest(true);
if($username !== null)
{
$user->setIsGuest(false);
@@ -27,7 +27,7 @@ class ChatUserManager extends TModule implements IUserManager
}
return $user;
}
-
+
/**
* Add a new user to the database.
* @param string username.
@@ -57,6 +57,28 @@ class ChatUserManager extends TModule implements IUserManager
{
return $this->usernameExists($username);
}
+
+ /**
+ * Saves user auth data into a cookie.
+ * @param THttpCookie the cookie to receive the user auth data.
+ * @since 3.1.1
+ */
+ public function saveUserToCookie($cookie)
+ {
+ // do nothing since we don't support cookie-based auth in this example
+ }
+
+ /**
+ * Returns a user instance according to auth data stored in a cookie.
+ * @param THttpCookie the cookie storing user authentication information
+ * @return TUser the user instance generated based on the cookie auth data, null if the cookie does not have valid auth data.
+ * @since 3.1.1
+ */
+ public function getUserFromCookie($cookie)
+ {
+ // do nothing since we don't support cookie-based auth in this example
+ return null;
+ }
}