summaryrefslogtreecommitdiff
path: root/demos/time-tracker
diff options
context:
space:
mode:
Diffstat (limited to 'demos/time-tracker')
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/BaseDao.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/ProjectDao.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/ProjectRecord.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/Dao/UserDao.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/DaoManager.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Code/TimeTrackerException.php4
-rwxr-xr-xdemos/time-tracker/protected/App_Code/TimeTrackerUser.php6
-rwxr-xr-xdemos/time-tracker/protected/App_Code/TrackerAuthManager.php19
-rwxr-xr-xdemos/time-tracker/protected/App_Code/UserManager.php2
-rwxr-xr-xdemos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php2
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/Login.php10
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/Logout.php4
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/SiteMap.php6
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/UserCreate.php20
-rwxr-xr-xdemos/time-tracker/protected/pages/TimeTracker/UserList.php4
15 files changed, 29 insertions, 58 deletions
diff --git a/demos/time-tracker/protected/App_Code/Dao/BaseDao.php b/demos/time-tracker/protected/App_Code/Dao/BaseDao.php
index b37fb5df..571a9d1a 100755
--- a/demos/time-tracker/protected/App_Code/Dao/BaseDao.php
+++ b/demos/time-tracker/protected/App_Code/Dao/BaseDao.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: BaseDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Base DAO class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: BaseDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php b/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php
index dbaf0e80..0110ae5e 100755
--- a/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php
+++ b/demos/time-tracker/protected/App_Code/Dao/ProjectDao.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ProjectDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Project DAO class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: ProjectDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php b/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php
index 631b1f8c..c02a78a5 100755
--- a/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php
+++ b/demos/time-tracker/protected/App_Code/Dao/ProjectRecord.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: ProjectRecord.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Time Tracker Project class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: ProjectRecord.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/Dao/UserDao.php b/demos/time-tracker/protected/App_Code/Dao/UserDao.php
index 495da072..51d04c58 100755
--- a/demos/time-tracker/protected/App_Code/Dao/UserDao.php
+++ b/demos/time-tracker/protected/App_Code/Dao/UserDao.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -17,7 +16,6 @@
* this token can be used to perform persistent cookie login.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserDao.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/DaoManager.php b/demos/time-tracker/protected/App_Code/DaoManager.php
index 9602ced0..90655ac8 100755
--- a/demos/time-tracker/protected/App_Code/DaoManager.php
+++ b/demos/time-tracker/protected/App_Code/DaoManager.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: DaoManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -18,7 +17,6 @@ Prado::using('System.Data.SqlMap.TSqlMapConfig');
* A Registry for Dao and an implementation of that type.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: DaoManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Code/TimeTrackerException.php b/demos/time-tracker/protected/App_Code/TimeTrackerException.php
index 424c7d30..87398952 100755
--- a/demos/time-tracker/protected/App_Code/TimeTrackerException.php
+++ b/demos/time-tracker/protected/App_Code/TimeTrackerException.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TimeTrackerException.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -15,7 +14,6 @@
* "exceptions.txt"
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TimeTrackerException.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -27,6 +25,6 @@ class TimeTrackerException extends TException
protected function getErrorMessageFile()
{
return dirname(__FILE__).'/exceptions.txt';
- }
+ }
}
diff --git a/demos/time-tracker/protected/App_Code/TimeTrackerUser.php b/demos/time-tracker/protected/App_Code/TimeTrackerUser.php
index da98e786..5215b31c 100755
--- a/demos/time-tracker/protected/App_Code/TimeTrackerUser.php
+++ b/demos/time-tracker/protected/App_Code/TimeTrackerUser.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TimeTrackerUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -20,14 +19,13 @@ Prado::using('System.Security.TUserManager');
* User class for Time Tracker application.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TimeTrackerUser.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
class TimeTrackerUser extends TUser
{
private $_emailAddress;
-
+
/**
* @param string user email address
*/
@@ -35,7 +33,7 @@ class TimeTrackerUser extends TUser
{
$this->_emailAddress = $value;
}
-
+
/**
* @return string user email address
*/
diff --git a/demos/time-tracker/protected/App_Code/TrackerAuthManager.php b/demos/time-tracker/protected/App_Code/TrackerAuthManager.php
index 48962167..08daae3f 100755
--- a/demos/time-tracker/protected/App_Code/TrackerAuthManager.php
+++ b/demos/time-tracker/protected/App_Code/TrackerAuthManager.php
@@ -4,7 +4,6 @@
* a string token saved in the cookie.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TrackerAuthManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -14,24 +13,24 @@ class TrackerAuthManager extends TAuthManager
* @const string signon token cookie name.
*/
const SignonCookieName = 'time-tracker-signon';
-
+
/**
* Performs the real authentication work. Overrides and calls parent
- * implementation. Trys to authenticate using token saved in cookie.
+ * implementation. Trys to authenticate using token saved in cookie.
* @param mixed parameter to be passed to OnAuthenticate event
*/
public function onAuthenticate($param)
{
parent::onAuthenticate($param);
- $currentUser = $this->Application->User;
+ $currentUser = $this->Application->User;
if(!$currentUser || $currentUser->IsGuest)
$this->authenticateFromCookie($param);
}
-
+
/**
* If the user is not set or is still a guest, try to authenticate the user
* using a string token saved in the cookie if any.
- * @param mixed parameter to be passed to OnAuthenticate event
+ * @param mixed parameter to be passed to OnAuthenticate event
*/
protected function authenticateFromCookie($param)
{
@@ -45,7 +44,7 @@ class TrackerAuthManager extends TAuthManager
$this->updateCredential($user);
}
}
-
+
/**
* Changes the user credentials.
* @param TUser new user details.
@@ -54,9 +53,9 @@ class TrackerAuthManager extends TAuthManager
{
$user->IsGuest = false;
$this->updateSessionUser($user);
- $this->Application->User = $user;
+ $this->Application->User = $user;
}
-
+
/**
* Generate a token to be saved in the cookie for later authentication.
* @param TimeTrackerUser user details.
@@ -70,7 +69,7 @@ class TrackerAuthManager extends TAuthManager
$cookie->Expire = strtotime('+1 month');
$this->Response->Cookies[] = $cookie;
}
-
+
/**
* Logs out the user and delete the token from cookie.
*/
diff --git a/demos/time-tracker/protected/App_Code/UserManager.php b/demos/time-tracker/protected/App_Code/UserManager.php
index 20b34d47..eabbe315 100755
--- a/demos/time-tracker/protected/App_Code/UserManager.php
+++ b/demos/time-tracker/protected/App_Code/UserManager.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* User manager module class for time tracker application.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserManager.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php b/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php
index 3a67afb0..12a8a23e 100755
--- a/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php
+++ b/demos/time-tracker/protected/App_Data/TimeTrackerUserTypeHandler.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TimeTrackerUserTypeHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -15,7 +14,6 @@
* The TimeTrackerUser requires an instance of IUserManager in constructor.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TimeTrackerUserTypeHandler.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
diff --git a/demos/time-tracker/protected/pages/TimeTracker/Login.php b/demos/time-tracker/protected/pages/TimeTracker/Login.php
index 941cb4b7..8de63ad8 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/Login.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/Login.php
@@ -6,18 +6,16 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Login.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
/**
* Login page class.
- *
- * Validate the user credentials and redirect to requested page
+ *
+ * Validate the user credentials and redirect to requested page
* if successful.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: Login.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -26,7 +24,7 @@ class Login extends TPage
/**
* Validates the username and password.
* @param TControl custom validator that created the event.
- * @param TServerValidateEventParameter validation parameters.
+ * @param TServerValidateEventParameter validation parameters.
*/
public function validateUser($sender, $param)
{
@@ -34,7 +32,7 @@ class Login extends TPage
if(!$authManager->login($this->username->Text,$this->password->Text))
$param->IsValid=false;;
}
-
+
/**
* Redirect to the requested page if login is successful.
* @param TControl button control that created the event.
diff --git a/demos/time-tracker/protected/pages/TimeTracker/Logout.php b/demos/time-tracker/protected/pages/TimeTracker/Logout.php
index 9f4de556..bab924f2 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/Logout.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/Logout.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: Logout.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* Logout page class.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: Logout.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -27,7 +25,7 @@ class Logout extends TPage
{
$this->Application->getModule('auth')->logout();
$url = $this->Service->constructUrl($this->Service->DefaultPage);
- $this->Response->redirect($url);
+ $this->Response->redirect($url);
}
}
diff --git a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php
index 51df0583..ab612baf 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/SiteMap.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: SiteMap.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* SiteMap menu is rendered depending on user roles.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: SiteMap.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -26,7 +24,7 @@ class SiteMap extends TTemplateControl
public function onPreRender($param)
{
parent::onPreRender($param);
-
+
$page = explode('.',$this->Request->ServiceParameter);
$active = null;
switch($page[count($page)-1])
@@ -47,7 +45,7 @@ class SiteMap extends TTemplateControl
$active = $this->LogMenu;
break;
}
-
+
//add 'active' string to place holder body.
if(!is_null($active))
$active->Controls[] = 'active';
diff --git a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php
index 2c73752a..34e69713 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/UserCreate.php
@@ -6,18 +6,16 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
/**
* Create new user wizard page class. Validate that the usernames are unique and
* set the new user credentials as the current application credentials.
- *
+ *
* If logged in as admin, the user role can be change during creation.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserCreate.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -30,11 +28,11 @@ class UserCreate extends TPage
{
if(!$this->IsPostBack)
{
- $this->role->SelectedValue =
+ $this->role->SelectedValue =
$this->Application->Parameters['NewUserRoles'];
}
}
-
+
/**
* Verify that the username is not taken.
* @param TControl custom validator that created the event.
@@ -46,11 +44,11 @@ class UserCreate extends TPage
if($userDao->usernameExists($this->username->Text))
{
$param->IsValid = false;
- $sender->ErrorMessage =
+ $sender->ErrorMessage =
"The user name is already taken, try '{$this->username->Text}01'";
}
}
-
+
/**
* Skip the role assignment step if not admin.
*/
@@ -66,7 +64,7 @@ class UserCreate extends TPage
}
}
}
-
+
/**
* Create a new user if all data entered are valid.
* The default user roles are obtained from "config.xml". The new user
@@ -84,11 +82,11 @@ class UserCreate extends TPage
$newUser->Name = $this->username->Text;
$newUser->IsGuest = false;
$newUser->Roles = $this->role->SelectedValue;
-
+
//save the user
$userDao = $this->Application->Modules['daos']->getDao('UserDao');
$userDao->addNewUser($newUser, $this->password->Text);
-
+
//update the user credentials if not admin
if(!$this->User->isInRole('admin'))
{
@@ -97,7 +95,7 @@ class UserCreate extends TPage
}
}
}
-
+
/**
* Continue with requested page.
*/
diff --git a/demos/time-tracker/protected/pages/TimeTracker/UserList.php b/demos/time-tracker/protected/pages/TimeTracker/UserList.php
index 9dc3ab5f..71b41add 100755
--- a/demos/time-tracker/protected/pages/TimeTracker/UserList.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/UserList.php
@@ -6,7 +6,6 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2006 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: UserList.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
*/
@@ -14,7 +13,6 @@
* List all users in a repeater.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: UserList.php 3189 2012-07-12 12:16:21Z ctrlaltca $
* @package Demos
* @since 3.1
*/
@@ -27,7 +25,7 @@ class UserList extends TPage
{
$userDao = $this->Application->Modules['daos']->getDao('UserDao');
$this->list->DataSource = $userDao->getAllUsers();
- $this->list->dataBind();
+ $this->list->dataBind();
}
}