diff --git a/lib/authentication/Authenticator.inc b/lib/authentication/Authenticator.inc index 9cd5f5f..7b56946 100644 --- a/lib/authentication/Authenticator.inc +++ b/lib/authentication/Authenticator.inc @@ -35,7 +35,7 @@ class Authenticator { * @return array containing userID and authentication status code */ function login($sUserName, $sPassword) { - global $default, $lang_err_database; + global $default; // initialise return array $aUserDetails = array(); diff --git a/lib/authentication/DBAuthenticator.inc b/lib/authentication/DBAuthenticator.inc index c3c952e..3915366 100644 --- a/lib/authentication/DBAuthenticator.inc +++ b/lib/authentication/DBAuthenticator.inc @@ -45,7 +45,6 @@ class DBAuthenticator extends Authenticator { return false; } } else { - $_SESSION["errorMessage"] = $lang_err_database; return false; } } @@ -58,7 +57,7 @@ class DBAuthenticator extends Authenticator { * @return array containing the users found */ function getUser($sUserName, $aAttributes) { - global $default, $lang_err_database; + global $default; $sql = $default->db; $sQuery = "SELECT "; @@ -77,7 +76,6 @@ class DBAuthenticator extends Authenticator { } return $aUserResults; } else { - $_SESSION["errorMessage"] = $lang_err_database; return false; } } @@ -90,7 +88,7 @@ class DBAuthenticator extends Authenticator { * @return array containing the users found */ function searchUsers($sUserNameSearch, $aAttributes) { - global $default, $lang_err_database; + global $default; $sql = $default->db; $sQuery = "SELECT "; @@ -110,7 +108,6 @@ class DBAuthenticator extends Authenticator { } return $aUserResults; } else { - $_SESSION["errorMessage"] = $lang_err_database; return false; } } diff --git a/lib/discussions/DiscussionComment.inc b/lib/discussions/DiscussionComment.inc index 30e97a9..e3df497 100644 --- a/lib/discussions/DiscussionComment.inc +++ b/lib/discussions/DiscussionComment.inc @@ -163,10 +163,8 @@ class DiscussionComment { $oDiscussionComment->dDate = $sql->f("date"); return $oDiscussionComment; } - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iNewCommentID . " table = $default->discussion_comments_table"; return false; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } @@ -204,16 +202,14 @@ class DiscussionComment { $this->iId = $sql->insert_id(); return true; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->units_table"; return false; } function update(){ - global $default, $lang_err_database, $lang_err_object_key; + global $default; //only update if the object has been stored if ($this->iId > 0) { $sql = $default->db; @@ -230,15 +226,13 @@ class DiscussionComment { if ($result) { return true; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } - $_SESSION["errorMessage"] = $lang_err_object_key; return false; } function delete(){ - global $default, $lang_err_database, $lang_err_object_key; + global $default; // only delete the object if it exists in the database if ($this->iId > 0) { @@ -250,7 +244,6 @@ class DiscussionComment { if ($rows > 1) { // duplicate Thread exists - $_SESSION["errorMessage"] = "Thread::The Thread id " . $this->iId . " has duplicates!"; return false; } else { $sql = $default->db; @@ -258,11 +251,9 @@ class DiscussionComment { if ($result) { return true; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } } - $_SESSION["errorMessage"] = $lang_err_object_key; return false; } } diff --git a/lib/discussions/DiscussionThread.inc b/lib/discussions/DiscussionThread.inc index ed5c795..1591361 100644 --- a/lib/discussions/DiscussionThread.inc +++ b/lib/discussions/DiscussionThread.inc @@ -159,7 +159,6 @@ class DiscussionThread { } return $sAllCommentID ; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } else { // No Thread for document @@ -201,10 +200,8 @@ class DiscussionThread { return "false"; } } - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "Document_id = " . $iDocumentID . " table = $default->discussion_threads_table"; return false; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } @@ -234,10 +231,8 @@ class DiscussionThread { $oDiscussionThread->iNumberOfReplies = $sql->f("replies"); return $oDiscussionThread; } - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iNewThreadID . " table = $default->discussion_threads_table"; return false; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } @@ -247,7 +242,6 @@ class DiscussionThread { function create(){ global $default, $lang_err_database, $lang_err_object_exists; //if the object hasn't been created - $sQuery = "what the hell"; if ($this->iId < 0) { //check to see if entry exists $sql = $default->db; $sQuery = "INSERT INTO " . $default->discussion_threads_table . @@ -259,10 +253,9 @@ class DiscussionThread { $this->iId = $sql->insert_id(); return true; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->discussion_threads_table"; + return false; } @@ -288,10 +281,8 @@ class DiscussionThread { if ($result) { return true; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } - $_SESSION["errorMessage"] = $lang_err_object_key; return false; } @@ -300,7 +291,7 @@ class DiscussionThread { * Delete a thread in the table */ function delete(){ - global $default, $lang_err_database, $lang_err_object_key; + global $default; //only delete the object if it exists in the database if ($this->iId > 0) { @@ -321,11 +312,9 @@ class DiscussionThread { if ($result) { return true; } - $_SESSION["errorMessage"] = $lang_err_database; return false; } } - $_SESSION["errorMessage"] = $lang_err_object_key; return false; } }