[Vtigercrm-commits] [vtiger-commits] r7956 - in /vtigercrm/trunk/modules/Users: AuditTrail.php LoginHistory.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Jul 11 11:59:56 EDT 2006


Author: saraj
Date: Tue Jul 11 09:59:52 2006
New Revision: 7956

Log:
api doc written for audit trail & login history functions  - ahmed

Modified:
    vtigercrm/trunk/modules/Users/AuditTrail.php
    vtigercrm/trunk/modules/Users/LoginHistory.php

Modified: vtigercrm/trunk/modules/Users/AuditTrail.php
==============================================================================
--- vtigercrm/trunk/modules/Users/AuditTrail.php (original)
+++ vtigercrm/trunk/modules/Users/AuditTrail.php Tue Jul 11 09:59:52 2006
@@ -59,19 +59,36 @@
 		
 	var $default_order_by = "actiondate";
 	var $default_sort_order = 'DESC';
+/**
+ * Function to get the Headers of Audit Trail Information like Module, Action, RecordID, ActionDate.
+ * Returns Header Values like Module, Action etc in an array format.
+**/
 
 	function getAuditTrailHeader()
 	{
+		global $log;
+		$log->debug("Entering getAuditTrailHeader() method ...");
 		global $app_strings;
 		
 		$header_array = array($app_strings['LBL_MODULE'], $app_strings['LBL_ACTION'], $app_strings['LBL_RECORD_ID'], $app_strings['LBL_ACTION_DATE']);
 
+		$log->debug("Exiting getAuditTrailHeader() method ...");
 		return $header_array;
 		
 	}
 
+/**
+  * Function to get the Audit Trail Information values of the actions performed by a particular User.
+  * @param integer $userid - User's ID
+  * @param $navigation_array - Array values to navigate through the number of entries.
+  * @param $sortorder - DESC
+  * @param $orderby - actiondate
+  * Returns the audit trail entries in an array format.
+**/
 	function getAuditTrailEntries($userid, $navigation_array, $sorder='', $orderby='')
 	{
+		global $log;
+		$log->debug("Entering getAuditTrailEntries(".$userid.") method ...");
 		global $adb, $current_user;
 		
 		if($sorder != '' && $order_by != '')
@@ -96,6 +113,7 @@
 			
 			$entries_list[] = $entries;
 		}
+		$log->debug("Exiting getAuditTrailEntries() method ...");
 		return $entries_list;	
 	}
 	}

Modified: vtigercrm/trunk/modules/Users/LoginHistory.php
==============================================================================
--- vtigercrm/trunk/modules/Users/LoginHistory.php (original)
+++ vtigercrm/trunk/modules/Users/LoginHistory.php Tue Jul 11 09:59:52 2006
@@ -45,7 +45,7 @@
 		,"logout_time"
 		,"status"
 		);
-
+	
 	function LoginHistory() {
 		$this->log = LoggerManager::getLogger('loginhistory');
 		$this->db = new PearDatabase();
@@ -72,19 +72,34 @@
 	var $default_order_by = "login_time";
 	var $default_sort_order = 'DESC';
 
-
+/**
+ * Function to get the Header values of Login History.
+ * Returns Header Values like UserName, IP, LoginTime etc in an array format.
+**/
 	function getHistoryListViewHeader()
 	{
+		global $log;
+		$log->debug("Entering getHistoryListViewHeader method ...");
 		global $app_strings;
 		
 		$header_array = array($app_strings['LBL_LIST_USER_NAME'], $app_strings['LBL_LIST_USERIP'], $app_strings['LBL_LIST_SIGNIN'], $app_strings['LBL_LIST_SIGNOUT'], $app_strings['LBL_LIST_STATUS']);
 
+		$log->debug("Exiting getHistoryListViewHeader method ...");
 		return $header_array;
 		
 	}
 
+/**
+  * Function to get the Login History values of the User.
+  * @param $navigation_array - Array values to navigate through the number of entries.
+  * @param $sortorder - DESC
+  * @param $orderby - login_time
+  * Returns the login history entries in an array format.
+**/
 	function getHistoryListViewEntries($navigation_array, $sorder='', $orderby='')
 	{
+		global $log;
+		$log->debug("Entering getHistoryListViewEntries() method ...");
 		global $adb, $current_user;	
 
 		if($sorder != '' && $order_by != '')
@@ -118,7 +133,8 @@
 			$entries[] = $adb->query_result($result, $i-1, 'status');
 
 			$entries_list[] = $entries;
-		}		
+		}	
+		log->debug("Exiting getHistoryListViewEntries() method ...");
 		return $entries_list;
 		
 	}
@@ -126,7 +142,7 @@
 	/** Records the Login info */
 	function user_login(&$usname,&$usip,&$intime)
 	{
-		$query = "Insert into vtiger_loginhistory (user_name, user_ip, logout_time, login_time, status) values ('$usname','$usip',null,".$this->db->formatDate($intime).",'Signedin')";
+		$query = "Insert into vtiger_loginhistory (user_name, user_ip, logout_time, login_time, status) values ('$usname','$usip',null,".$this->db->formatDate($intime).",'Signed in')";
 		$result = $this->db->query($query)
                         or die("MySQL error: ".mysql_error());
 		
@@ -143,7 +159,7 @@
                         return;
                 }
 		// update the user login info.
-		$query = "Update vtiger_loginhistory set logout_time =".$this->db->formatDate($outtime).", status='Signedoff' where login_id = $loginid";
+		$query = "Update vtiger_loginhistory set logout_time =".$this->db->formatDate($outtime).", status='Signed off' where login_id = $loginid";
 		$result = $this->db->query($query)
                         or die("MySQL error: ".mysql_error());
 	}





More information about the vtigercrm-commits mailing list