diff --git a/lib/Log.inc b/lib/Log.inc index 76fac7f..3560a2b 100644 --- a/lib/Log.inc +++ b/lib/Log.inc @@ -1,4 +1,9 @@ Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa - * @package dmslib + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package lib */ -define("DEBUG", 0); -define("INFO", 1); -define("ERROR", 2); - class Log { /** * The minimum logging level- log everything with @@ -33,7 +34,8 @@ class Log { /** * Default constructor * - * @param $logLevel the desired level to log at + * @param string the path to the logfile to write to + * @param int the desired level to log at */ function Log($logFile, $logLevel = INFO) { $this->logFile = $logFile; @@ -45,7 +47,7 @@ class Log { /** * Log a debug entry * - * @param $logEntry the message to write to the log file + * @param string the message to write to the log file */ function debug($logEntry) { $this->writeLog($this->prefixEntry($logEntry, "DEBUG"), DEBUG); @@ -54,7 +56,7 @@ class Log { /** * Log an info entry * - * @param $logEntry the message to write to the log file + * @param string the message to write to the log file */ function info($logEntry) { $this->writeLog($this->prefixEntry($logEntry, " INFO"), INFO); @@ -63,7 +65,7 @@ class Log { /** * Log an error entry * - * @param $logEntry the message to write to the log file + * @param string the message to write to the log file */ function error($logEntry) { $this->writeLog($this->prefixEntry($logEntry, "ERROR"), ERROR); @@ -73,8 +75,8 @@ class Log { * Writes to the log file, checking that the log level is within * the minimum logging level * - * @param $logEntry the message to write to the log file - * @param $logLevel the error level to log at + * @param string the message to write to the log file + * @param int the error level to log at */ function writeLog($logEntry, $logLevel) { if ($logLevel >= $this->minimumLoggingLevel) { @@ -88,6 +90,9 @@ class Log { /** * Prefixes the log entry with the current date time, the logging level * and the page that called it + * + * @param string the message to write to the log file + * @param int the error level to log at */ function prefixEntry($logEntry, $logLevel) { return getCurrentDateTime() . ":$logLevel: $logEntry\n"; diff --git a/lib/Session.inc b/lib/Session.inc index 5924ef7..bb6a0b0 100644 --- a/lib/Session.inc +++ b/lib/Session.inc @@ -4,16 +4,18 @@ * * This class is used for session management. * - * @author Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa + * Licensed under the GNU GPL. For full terms see the file COPYING. + * + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa * @version $Revision$ - * @package dmslib + * @package lib.session */ class Session { /** * Creates a session. * - * @param $userID the id of the user to create a session for + * @param int the id of the user to create a session for * @return string the generated sessionID */ function create($userID) { @@ -64,8 +66,7 @@ class Session { /** * Removes any stale sessions for the specified userID * - * @param userID - * the userID to remove stale sessions for + * @param int the userID to remove stale sessions for */ function removeStaleSessions($userID) { global $default; @@ -78,8 +79,7 @@ class Session { /** * Used to verify the current user's session. * - * @return - * array containing the userID, groupID and session verification status + * @return int session verification status */ function verify() { global $default, $lang_sesstimeout, $lang_sessinuse, $lang_err_sess_notvalid; diff --git a/lib/authentication/LDAPAuthenticator.inc b/lib/authentication/LDAPAuthenticator.inc index a076b8f..fbb972f 100644 --- a/lib/authentication/LDAPAuthenticator.inc +++ b/lib/authentication/LDAPAuthenticator.inc @@ -8,9 +8,11 @@ require_once("$default->owl_fs_root/lib/authentication/Authenticator.inc"); * * Perform authentication tasks against LDAP compliant directory server. * + * Licensed under the GNU GPL. For full terms see the file COPYING. + * * @version $Revision$ - * @author Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa - * @package dmslib + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package lib.authentication */ class LDAPAuthenticator extends Authenticator { @@ -26,10 +28,8 @@ class LDAPAuthenticator extends Authenticator { /** * Creates a new instance of the LDAPAuthenticator * - * @param $ldapServer - * the LDAP server to connect to for validation - * @param $ldapDN - * the dn branch to perform the authentication against + * @param string the LDAP server to connect to for validation + * @param string the dn branch to perform the authentication against */ function LDAPAuthentication($ldapServer, $ldapDN) { $this->ldapServer = $ldapServer; @@ -39,10 +39,8 @@ class LDAPAuthenticator extends Authenticator { /** * Checks the user's password against the LDAP directory * - * @param $userName - * the name of the user to check - * @param $password - * the password to check + * @param string the name of the user to check + * @param string the password to check * @return boolean true if the password is correct, else false */ function checkPassword($userName, $password) { diff --git a/lib/database/lookup.inc b/lib/database/lookup.inc index 6c78afd..b83e52d 100644 --- a/lib/database/lookup.inc +++ b/lib/database/lookup.inc @@ -6,18 +6,19 @@ * Contains database helper functions * * Licensed under the GNU GPL. For full terms see the file COPYING. + * * @version $Revision$ - * @author Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa - * @package dmslib + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package lib.database */ /** * Performs an id field lookup on the specified table. * - * @param $tableName the name of table to perform the id lookup. - * @param $fieldName the db field to return. - * @param $fieldValue the value to perform the lookup for - * @return the id of the row in the db with $fieldName=$fieldValue + * @param string the name of table to perform the id lookup. + * @param string the db field to return. + * @param mixed the value to perform the lookup for + * @return int the id of the row in the db with $fieldName=$fieldValue */ function lookupID($tableName, $fieldName, $fieldValue){ return lookupField($tableName, "id", $fieldName, $fieldValue); @@ -26,8 +27,8 @@ function lookupID($tableName, $fieldName, $fieldValue){ /** * Retrieves the groups that the user is a member of * - * @param $userID the user to lookup groups for - * @return an array containing the groupsIDs the user is a member of + * @param int the user to lookup groups for + * @return array the groupsIDs the user is a member of */ function lookupGroupIDs($userID) { global $default; @@ -44,11 +45,10 @@ function lookupGroupIDs($userID) { /** * Performs a generic one field lookup on a table * - * @param $tableName the name of the table to perform the lookup on - * @param $selectFieldName the field to return - * @param $whereFieldName the field to discriminate against(?!) - * @param $whereFieldValue the field value to return rows for - * (NOTE: the caller is responsible for quoting this value) + * @param string the name of the table to perform the lookup on + * @param string the field to return + * @param string the field to discriminate against(?!) + * @param string the field value to return rows for */ function lookupField($tableName, $selectFieldName, $whereFieldName, $whereFieldValue) { global $default; @@ -71,6 +71,9 @@ function lookupField($tableName, $selectFieldName, $whereFieldName, $whereFieldV /** * Converts an array to a string + * + * @param array the array to convert + * @return string stringified array */ function arrayToString($array) { ob_start(); @@ -83,8 +86,8 @@ function arrayToString($array) { /** * Converts an array to a comma separated string * - * @param $array the array to convert - * @return a comma separated string of the array values + * @param array the array to convert + * @return string a comma separated string of the array values */ function arrayToCss($array) { $css = ""; @@ -108,7 +111,7 @@ function getCurrentDateTime() { /** * Returns the specified date time, formatted as Y-m-d H:i:s * - * @param $dateTime the date time to format + * @param int the date time to format * @return string the formatted date time */ function formatDateTime($dateTime) { diff --git a/lib/documentmanagement/DocumentBrowser.inc b/lib/documentmanagement/DocumentBrowser.inc index 52da887..97863ac 100644 --- a/lib/documentmanagement/DocumentBrowser.inc +++ b/lib/documentmanagement/DocumentBrowser.inc @@ -7,17 +7,19 @@ require_once("$default->owl_fs_root/lib/security/permission.inc"); * * Contains document browsing business logic. * + * Licensed under the GNU GPL. For full terms see the file COPYING. + * * @version $Revision$ - * @author Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa - * @package dmslib + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package lib.documentmanagement */ class DocumentBrowser { /** * Browse the documents by folder * - * @param $folderID the folder to browse from - * @return an multidimensional array of folders and documents + * @param int the folder to browse from + * @return array folders and documents */ function browseByFolder($folderID = -1) { global $default; @@ -137,7 +139,7 @@ class DocumentBrowser { /** * Browse the documents by category * - * @param $category the category to browse + * @param string the category to browse */ function browseByCategory($category = "") { global $default; @@ -196,7 +198,7 @@ class DocumentBrowser { /** * Browse the documents by document type * - * @param $documentTypeID the document type ID to browse + * @param int the document type ID to browse */ function browseByDocumentType($documentTypeID = -1) { global $default; @@ -241,8 +243,8 @@ class DocumentBrowser { * Checks whether the required group is one of the * groups in the $groupIDs array * - * @param $requiredGroupName the group name to check for - * @param $groupIDS an array of groupIDs to check + * @param string the group name to check for + * @param array an array of groupIDs to check * @return boolean true if $requiredGroupName is in the $groupIDs array, else false */ function checkGroup($requiredGroupName, $groupIDs) { @@ -270,8 +272,8 @@ class DocumentBrowser { /** * Returns an array of folder details for the specified folder * - * @param $folderQuery the sql query to retrieve the correct folder - * @return an array containing the folder details + * @param string the sql query to retrieve the correct folder + * @return array the folder details */ function retrieveFolderDetails($folderQuery) { global $default; @@ -308,8 +310,8 @@ class DocumentBrowser { /** * Lookup document details for all the document_ids in the input array * - * @param $documentIDs an array containing the documentIDs to retrieve details for - * @return an array containing the details of all the documents + * @param array the documentIDs to retrieve details for + * @return array the details of all the documents */ function lookupDocumentDetails($documentIDs) { global $default; diff --git a/login.php b/login.php index fbac097..e097af5 100644 --- a/login.php +++ b/login.php @@ -1,5 +1,8 @@ Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa - * @package dms + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package presentation */ - -// main library routines and defaults -require_once("./config/dmsDefaults.php"); // ------------------------------- // page start diff --git a/logout.php b/logout.php index e6c02bc..a2ad985 100644 --- a/logout.php +++ b/logout.php @@ -1,5 +1,8 @@ Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa - * @package dms + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package presentation */ - -// main library routines and defaults -require_once("./config/dmsDefaults.php"); // destroy the session Session::destroy(); diff --git a/tests/administration/UnitManager.php b/tests/administration/UnitManager.php index 1201668..df0cbfe 100644 --- a/tests/administration/UnitManager.php +++ b/tests/administration/UnitManager.php @@ -5,17 +5,30 @@ require_once("../../config/dmsDefaults.php"); require_once("$default->owl_fs_root/lib/owl.lib.php"); require_once("$default->owl_fs_root/lib/administration/UnitManager.inc"); +/** + * $Id$ + * + * Unit Tests for lib/administration/UnitManager.inc + * + * Licensed under the GNU GPL. For full terms see the file COPYING. + * + * @version $Revision$ + * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa + * @package tests.administration + */ + echo "
";
 // unit tests for UnitManager methods
 
 $um = new UnitManager();
+/*
 $userArray = $um->listLdapUsers($userNameSearch);
-if (!'userArray') {
+if (!userArray) {
     echo "ldap user lookup failed!
"; } else { print_r($userArray); } -/* +*/ // do some transformation of the first entry in the array? // think maybe just set username = uid @@ -34,10 +47,10 @@ global $default; $result = $um->addUser($unitID, $userDetails); if (!$result) { echo "add user failed!
"; - echo "error message=$default->errorMessage"; + echo "error message=" . $_SESSION["errorMessage"]; } else { echo "added user successfully
"; } -*/ + echo "
"; ?>