Commit a30dcf95da168ef88682767cba038542b31e2e29

Authored by michael
1 parent df57d3ec

added copyright and gpl notice

removed owl prefix from table aliases


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2566 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/roles/Role.inc
1 <?php 1 <?php
2 /** 2 /**
3 -*  
4 -* Class Role  
5 -* Represents a role as per the roles database table  
6 -*  
7 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
8 -* @date 20 January 2003  
9 -* package lib.roles  
10 -*/  
11 - 3 + * $Id$
  4 + *
  5 + * Represents a role as per the roles database table.
  6 + *
  7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22 + *
  23 + * @version $Revision$
  24 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  25 + * @package lib.roles
  26 + */
12 class Role { 27 class Role {
13 28
14 /** role object primary key */ 29 /** role object primary key */
@@ -87,7 +102,7 @@ class Role { @@ -87,7 +102,7 @@ class Role {
87 if ($this->iId < 0) { 102 if ($this->iId < 0) {
88 //check to see if name exsits 103 //check to see if name exsits
89 $sql = $default->db; 104 $sql = $default->db;
90 - $query = "SELECT name FROM ". $default->owl_roles_table ." WHERE name = '" . $this->sName . "'"; 105 + $query = "SELECT name FROM ". $default->roles_table ." WHERE name = '" . $this->sName . "'";
91 $sql->query($query); 106 $sql->query($query);
92 $rows = $sql->num_rows($sql); 107 $rows = $sql->num_rows($sql);
93 108
@@ -98,7 +113,7 @@ class Role { @@ -98,7 +113,7 @@ class Role {
98 }else 113 }else
99 { 114 {
100 $sql = $default->db; 115 $sql = $default->db;
101 - $result = $sql->query("INSERT INTO " . $default->owl_roles_table . " (name, active, can_read, can_write) VALUES ('" . addslashes($this->sName) . "', " . ($this->bActive ? 1 : 0) . ", " . ($this->bCanRead ? 1 : 0) . ", " . ($this->bCanWrite ? 1 : 0) . ")"); 116 + $result = $sql->query("INSERT INTO " . $default->roles_table . " (name, active, can_read, can_write) VALUES ('" . addslashes($this->sName) . "', " . ($this->bActive ? 1 : 0) . ", " . ($this->bCanRead ? 1 : 0) . ", " . ($this->bCanWrite ? 1 : 0) . ")");
102 if ($result) { 117 if ($result) {
103 $this->iId = $sql->insert_id(); 118 $this->iId = $sql->insert_id();
104 return true; 119 return true;
@@ -122,7 +137,7 @@ class Role { @@ -122,7 +137,7 @@ class Role {
122 //only update if the object has been stored 137 //only update if the object has been stored
123 if ($this->iId > 0) { 138 if ($this->iId > 0) {
124 $sql = $default->db; 139 $sql = $default->db;
125 - $result = $sql->query("UPDATE " . $default->owl_roles_table . " SET name = '" . addslashes($this->sName) . "', active = " . ($this->bActive ? 1 : 0) . ", can_read = " . ($this->bCanRead ? 1 : 0) . ", can_write = " . ($this->bCanWrite ? 1 : 0) . " WHERE id = $this->iId"); 140 + $result = $sql->query("UPDATE " . $default->roles_table . " SET name = '" . addslashes($this->sName) . "', active = " . ($this->bActive ? 1 : 0) . ", can_read = " . ($this->bCanRead ? 1 : 0) . ", can_write = " . ($this->bCanWrite ? 1 : 0) . " WHERE id = $this->iId");
126 if ($result) { 141 if ($result) {
127 return true; 142 return true;
128 } 143 }
@@ -145,7 +160,7 @@ class Role { @@ -145,7 +160,7 @@ class Role {
145 if ($this->iId >= 0) { 160 if ($this->iId >= 0) {
146 //check to see if role is linked to a folder 161 //check to see if role is linked to a folder
147 $sql = $default->db; 162 $sql = $default->db;
148 - $query = "SELECT role_id FROM ". $default->owl_groups_folders_approval_table ." WHERE role_id = '" . $this->iId . "'"; 163 + $query = "SELECT role_id FROM ". $default->groups_folders_approval_table ." WHERE role_id = '" . $this->iId . "'";
149 $sql->query($query); 164 $sql->query($query);
150 $rows = $sql->num_rows($sql); 165 $rows = $sql->num_rows($sql);
151 166
@@ -156,7 +171,7 @@ class Role { @@ -156,7 +171,7 @@ class Role {
156 171
157 }else{ 172 }else{
158 $sql = $default->db; 173 $sql = $default->db;
159 - $result = $sql->query("DELETE FROM $default->owl_roles_table WHERE id = $this->iId"); 174 + $result = $sql->query("DELETE FROM $default->roles_table WHERE id = $this->iId");
160 if ($result) { 175 if ($result) {
161 return true; 176 return true;
162 } 177 }
@@ -179,7 +194,7 @@ class Role { @@ -179,7 +194,7 @@ class Role {
179 function & get($iRoleID) { 194 function & get($iRoleID) {
180 global $default; 195 global $default;
181 $sql = $default->db; 196 $sql = $default->db;
182 - $result = $sql->query("SELECT * FROM $default->owl_roles_table WHERE id = $iRoleID"); 197 + $result = $sql->query("SELECT * FROM $default->roles_table WHERE id = $iRoleID");
183 if ($result) { 198 if ($result) {
184 if ($sql->next_record()) { 199 if ($sql->next_record()) {
185 $oRole = & new Role(stripslashes($sql->f("name")), $sql->f("can_read"), $sql->f("can_write")); 200 $oRole = & new Role(stripslashes($sql->f("name")), $sql->f("can_read"), $sql->f("can_write"));
@@ -187,7 +202,7 @@ class Role { @@ -187,7 +202,7 @@ class Role {
187 $oRole->bActive = $sql->f("active"); 202 $oRole->bActive = $sql->f("active");
188 return $oRole; 203 return $oRole;
189 } 204 }
190 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iRoleID . " table = $default->owl_roles_table"; 205 + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iRoleID . " table = $default->roles_table";
191 return false; 206 return false;
192 } 207 }
193 $_SESSION["errorMessage"] = $lang_err_database; 208 $_SESSION["errorMessage"] = $lang_err_database;
@@ -207,7 +222,7 @@ class Role { @@ -207,7 +222,7 @@ class Role {
207 $aRoleArray; 222 $aRoleArray;
208 settype($aRoleArray, "array"); 223 settype($aRoleArray, "array");
209 $sql = $default->db; 224 $sql = $default->db;
210 - $result = $sql->query("SELECT * FROM " . $default->owl_roles_table . (isset($sWhereClause) ? " " . $sWhereClause : "")); 225 + $result = $sql->query("SELECT * FROM " . $default->roles_table . (isset($sWhereClause) ? " " . $sWhereClause : ""));
211 if ($result) { 226 if ($result) {
212 $iCount = 0; 227 $iCount = 0;
213 while ($sql->next_record()) { 228 while ($sql->next_record()) {
lib/roles/RoleFolderLink.inc
1 <?php 1 <?php
2 /** 2 /**
3 -*  
4 -* Class RoleFolderLink  
5 -* Represents a role, folder links as per the folders_users_role_link table  
6 -*  
7 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
8 -* @date 20 January 2003  
9 -* @package lib.roles  
10 -*/  
11 - 3 + * $Id$
  4 + *
  5 + * Represents a role, folder links as per the folders_users_role_link table.
  6 + *
  7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22 + *
  23 + * @version $Revision$
  24 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  25 + * @package lib.roles
  26 + */
12 class RoleFolderLink { 27 class RoleFolderLink {
13 28
14 var $iId; 29 var $iId;
@@ -162,7 +177,7 @@ class RoleFolderLink { @@ -162,7 +177,7 @@ class RoleFolderLink {
162 //if the object hasn't been created 177 //if the object hasn't been created
163 if ($this->iId < 0) { 178 if ($this->iId < 0) {
164 $sql = $default->db; 179 $sql = $default->db;
165 - $result = $sql->query("INSERT INTO " . $default->owl_folders_user_roles_table . " (user_id, folder_id, role_type_id, datetime, done, active) VALUES ($this->iUserID, $this->iFolderID, $this->iRoleTypeID, '$this->dDateTime', " . ($this->bDone ? 1 : 0) . "), " . ($this->bActive ? 1 : 0) . ")"); 180 + $result = $sql->query("INSERT INTO " . $default->folders_user_roles_table . " (user_id, folder_id, role_type_id, datetime, done, active) VALUES ($this->iUserID, $this->iFolderID, $this->iRoleTypeID, '$this->dDateTime', " . ($this->bDone ? 1 : 0) . "), " . ($this->bActive ? 1 : 0) . ")");
166 if ($result) { 181 if ($result) {
167 $this->iId = $sql->insert_id(); 182 $this->iId = $sql->insert_id();
168 return true; 183 return true;
@@ -170,7 +185,6 @@ class RoleFolderLink { @@ -170,7 +185,6 @@ class RoleFolderLink {
170 $_SESSION["errorMessage"] = $lang_err_database; 185 $_SESSION["errorMessage"] = $lang_err_database;
171 return false; 186 return false;
172 } 187 }
173 - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_folder_user_roles_table";  
174 return false; 188 return false;
175 } 189 }
176 190
@@ -185,7 +199,7 @@ class RoleFolderLink { @@ -185,7 +199,7 @@ class RoleFolderLink {
185 //only update if the object has been stored 199 //only update if the object has been stored
186 if ($this->iId > 0) { 200 if ($this->iId > 0) {
187 $sql = $default->db; 201 $sql = $default->db;
188 - $result = $sql->query("UPDATE " . $default->owl_folders_user_roles_table . " SET user_id = $this->iUserID, folder_id = $this->iFolderID, role_type_id = $this->iRoleTypeID, datetime = '$this->dDateTime', done = " . ($this->bDone ? 1 : 0) . ", active = " . ($this->bActive ? 1 : 0) . " WHERE id = $this->iId"); 202 + $result = $sql->query("UPDATE " . $default->folders_user_roles_table . " SET user_id = $this->iUserID, folder_id = $this->iFolderID, role_type_id = $this->iRoleTypeID, datetime = '$this->dDateTime', done = " . ($this->bDone ? 1 : 0) . ", active = " . ($this->bActive ? 1 : 0) . " WHERE id = $this->iId");
189 if ($result) { 203 if ($result) {
190 return true; 204 return true;
191 } 205 }
@@ -207,7 +221,7 @@ class RoleFolderLink { @@ -207,7 +221,7 @@ class RoleFolderLink {
207 //only delete the object if it exists in the database 221 //only delete the object if it exists in the database
208 if ($this->iId >= 0) { 222 if ($this->iId >= 0) {
209 $sql = $default->db; 223 $sql = $default->db;
210 - $result = $sql->query("DELETE FROM $default->owl_folders_user_roles_table WHERE id = $this->iId"); 224 + $result = $sql->query("DELETE FROM $default->folders_user_roles_table WHERE id = $this->iId");
211 if ($result) { 225 if ($result) {
212 return true; 226 return true;
213 } 227 }
@@ -229,7 +243,7 @@ class RoleFolderLink { @@ -229,7 +243,7 @@ class RoleFolderLink {
229 function & get($iRolesFoldersID) { 243 function & get($iRolesFoldersID) {
230 global $default; 244 global $default;
231 $sql = $default->db; 245 $sql = $default->db;
232 - $result = $sql->query("SELECT * FROM $default->owl_folders_user_roles_table WHERE id = $iRolesFoldersID"); 246 + $result = $sql->query("SELECT * FROM $default->folders_user_roles_table WHERE id = $iRolesFoldersID");
233 if ($result) { 247 if ($result) {
234 if ($sql->next_record()) { 248 if ($sql->next_record()) {
235 $oRolesFoldersLink = & new RoleFolderLink($sql->f("user_id"), $sql->f("folder_id"), $sql->f("role_type_id"), $sql->f("datetime")); 249 $oRolesFoldersLink = & new RoleFolderLink($sql->f("user_id"), $sql->f("folder_id"), $sql->f("role_type_id"), $sql->f("datetime"));
@@ -238,7 +252,7 @@ class RoleFolderLink { @@ -238,7 +252,7 @@ class RoleFolderLink {
238 $oRolesFoldersLink->iId = $iRolesFoldersID; 252 $oRolesFoldersLink->iId = $iRolesFoldersID;
239 return $oRolesFoldersLink; 253 return $oRolesFoldersLink;
240 } 254 }
241 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iRolesFoldersID . " table = $default->owl_folders_user_roles_table"; 255 + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iRolesFoldersID . " table = $default->folders_user_roles_table";
242 return false; 256 return false;
243 } 257 }
244 $_SESSION["errorMessage"] = $lang_err_database; 258 $_SESSION["errorMessage"] = $lang_err_database;
@@ -258,7 +272,7 @@ class RoleFolderLink { @@ -258,7 +272,7 @@ class RoleFolderLink {
258 $aRolesFoldersLinkArray; 272 $aRolesFoldersLinkArray;
259 settype($aRolesFoldersLinkArray, "array"); 273 settype($aRolesFoldersLinkArray, "array");
260 $sql = $default->db; 274 $sql = $default->db;
261 - $result = $sql->query("SELECT * FROM " . $default->owl_folders_user_roles_table . (isset($sWhereClause) ? " " . $sWhereClause : "")); 275 + $result = $sql->query("SELECT * FROM " . $default->folders_user_roles_table . (isset($sWhereClause) ? " " . $sWhereClause : ""));
262 if ($result) { 276 if ($result) {
263 $iCount = 0; 277 $iCount = 0;
264 while ($sql->next_record()) { 278 while ($sql->next_record()) {
lib/session/Session.inc
@@ -2,14 +2,28 @@ @@ -2,14 +2,28 @@
2 /** 2 /**
3 * $Id$ 3 * $Id$
4 * 4 *
5 - * This class is used for session management. 5 + * Session management class.
6 * 6 *
7 - * Licensed under the GNU GPL. For full terms see the file COPYING. 7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8 * 22 *
9 - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa  
10 * @version $Revision$ 23 * @version $Revision$
  24 + * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
11 * @package lib.session 25 * @package lib.session
12 - */ 26 + */
13 class Session { 27 class Session {
14 28
15 /** 29 /**
@@ -36,7 +50,7 @@ class Session { @@ -36,7 +50,7 @@ class Session {
36 50
37 // insert session information into db 51 // insert session information into db
38 $sql = $default->db; 52 $sql = $default->db;
39 - $query = "INSERT INTO $default->owl_sessions_table (session_id, user_id, lastused, ip) VALUES ('$sessionID', $iUserID, '" . date("Y-m-d H:i:s", time()) . "', '$ip')"; 53 + $query = "INSERT INTO $default->sessions_table (session_id, user_id, lastused, ip) VALUES ('$sessionID', $iUserID, '" . date("Y-m-d H:i:s", time()) . "', '$ip')";
40 54
41 $result = $sql->query($query); 55 $result = $sql->query($query);
42 if(!$result) { 56 if(!$result) {
@@ -58,7 +72,7 @@ class Session { @@ -58,7 +72,7 @@ class Session {
58 72
59 // remove the session information from the database 73 // remove the session information from the database
60 $sql = $default->db; 74 $sql = $default->db;
61 - $query = "DELETE FROM $default->owl_sessions_table WHERE session_id = '$sSessionID' AND user_id=$iUserID"; 75 + $query = "DELETE FROM $default->sessions_table WHERE session_id = '$sSessionID' AND user_id=$iUserID";
62 $default->log->info("Session::destroy $query"); 76 $default->log->info("Session::destroy $query");
63 $sql->query($query); 77 $sql->query($query);
64 78
@@ -77,7 +91,7 @@ class Session { @@ -77,7 +91,7 @@ class Session {
77 // deletes any sessions for this userID where the default timeout has elapsed. 91 // deletes any sessions for this userID where the default timeout has elapsed.
78 $time = time() - $default->sessionTimeout; 92 $time = time() - $default->sessionTimeout;
79 $sql = $default->db; 93 $sql = $default->db;
80 - $sQuery = "DELETE FROM $default->owl_sessions_table WHERE " . (($userID != -1) ? "user_id=$userID AND " : "") . "lastused <= '" . formatDateTime($time) . "'"; 94 + $sQuery = "DELETE FROM $default->sessions_table WHERE " . (($userID != -1) ? "user_id=$userID AND " : "") . "lastused <= '" . formatDateTime($time) . "'";
81 $sql->query($sQuery); 95 $sql->query($sQuery);
82 } 96 }
83 97
@@ -97,7 +111,7 @@ class Session { @@ -97,7 +111,7 @@ class Session {
97 111
98 // this should be an existing session, so check the db 112 // this should be an existing session, so check the db
99 $sql = $default->db; 113 $sql = $default->db;
100 - $sql->query("SELECT * FROM $default->owl_sessions_table WHERE session_id = '$sessionID'"); 114 + $sql->query("SELECT * FROM $default->sessions_table WHERE session_id = '$sessionID'");
101 $numrows = $sql->num_rows($sql); 115 $numrows = $sql->num_rows($sql);
102 116
103 // FIXME: if there aren't more rows that the max sessions for this user 117 // FIXME: if there aren't more rows that the max sessions for this user
@@ -123,7 +137,7 @@ class Session { @@ -123,7 +137,7 @@ class Session {
123 } 137 }
124 138
125 // update last used timestamp 139 // update last used timestamp
126 - $sql->query("UPDATE $default->owl_sessions_table SET lastused = '" . getCurrentDateTime() ."' " . 140 + $sql->query("UPDATE $default->sessions_table SET lastused = '" . getCurrentDateTime() ."' " .
127 "WHERE user_id = $iUserID AND session_id = '$sessionID'"); 141 "WHERE user_id = $iUserID AND session_id = '$sessionID'");
128 // add the array to the session 142 // add the array to the session
129 $_SESSION["sessionStatus"] = $sessionStatus; 143 $_SESSION["sessionStatus"] = $sessionStatus;
lib/session/SiteMap.inc
1 <?php 1 <?php
2 -  
3 -require_once("$default->fileSystemRoot/lib/security/permission.inc");  
4 - 2 +require_once("$default->fileSystemRoot/lib/security/Permission.inc");
5 // define access constants 3 // define access constants
6 define("None", 1); 4 define("None", 1);
7 define("Guest", 2); 5 define("Guest", 2);
8 define("User", 3); 6 define("User", 3);
9 define("UnitAdmin", 4); 7 define("UnitAdmin", 4);
10 define("SysAdmin", 5); 8 define("SysAdmin", 5);
11 -  
12 /** 9 /**
13 * $Id$ 10 * $Id$
14 - * 11 + *
15 * Maintains (page, access) access map, as well as (section, page) map. 12 * Maintains (page, access) access map, as well as (section, page) map.
16 - *  
17 - * @version $Revision$ 13 + *
  14 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  15 + *
  16 + * This program is free software; you can redistribute it and/or modify
  17 + * it under the terms of the GNU General Public License as published by
  18 + * the Free Software Foundation; either version 2 of the License, or
  19 + * (at your option) any later version.
  20 + *
  21 + * This program is distributed in the hope that it will be useful,
  22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24 + * GNU General Public License for more details.
  25 + *
  26 + * You should have received a copy of the GNU General Public License
  27 + * along with this program; if not, write to the Free Software
  28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  29 + *
  30 + * @version $Revision$
18 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 31 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
19 * @package lib.session 32 * @package lib.session
20 */ 33 */
@@ -169,12 +182,12 @@ class SiteMap { @@ -169,12 +182,12 @@ class SiteMap {
169 global $default, $lang_err_database, $fFolderID; 182 global $default, $lang_err_database, $fFolderID;
170 $sql = $default->db; 183 $sql = $default->db;
171 // lookup sectionID 184 // lookup sectionID
172 - $sectionID = lookupID($default->owl_site_sections_table, "name", $sSectionName); 185 + $sectionID = lookupID($default->site_sections_table, "name", $sSectionName);
173 if ($sectionID) { 186 if ($sectionID) {
174 // initialise result array 187 // initialise result array
175 $results = array("descriptions" => array(), "links" => array()); 188 $results = array("descriptions" => array(), "links" => array());
176 189
177 - if ($sql->query("SELECT link_text, action, access_id FROM $default->owl_sitemap_table WHERE section_id=$sectionID " . 190 + if ($sql->query("SELECT link_text, action, access_id FROM $default->sitemap_table WHERE section_id=$sectionID " .
178 "AND is_enabled=1 AND is_default=0" . ( $bSortLinks ? " ORDER BY link_text ASC" : "" ) ) ) { 191 "AND is_enabled=1 AND is_default=0" . ( $bSortLinks ? " ORDER BY link_text ASC" : "" ) ) ) {
179 while ($sql->next_record()) { 192 while ($sql->next_record()) {
180 // check permissions 193 // check permissions
@@ -310,7 +323,7 @@ class SiteMap { @@ -310,7 +323,7 @@ class SiteMap {
310 global $default, $lang_err_database; 323 global $default, $lang_err_database;
311 $sql = $default->db; 324 $sql = $default->db;
312 // lookup the page and access_id from the sitemap 325 // lookup the page and access_id from the sitemap
313 - if ($sql->query("SELECT page, access_id FROM $default->owl_sitemap_table WHERE action='$action'")) { 326 + if ($sql->query("SELECT page, access_id FROM $default->sitemap_table WHERE action='$action'")) {
314 if ($sql->next_record()) { 327 if ($sql->next_record()) {
315 // check permissions 328 // check permissions
316 if ($this->hasPermission($sql->f("access_id"))) { 329 if ($this->hasPermission($sql->f("access_id"))) {
@@ -384,8 +397,8 @@ class SiteMap { @@ -384,8 +397,8 @@ class SiteMap {
384 global $default, $lang_err_database; 397 global $default, $lang_err_database;
385 $sql = $default->db; 398 $sql = $default->db;
386 // lookup the page and access_id from the sitemap 399 // lookup the page and access_id from the sitemap
387 - if ($sql->query("SELECT SSL.name FROM $default->owl_sitemap_table AS S  
388 - INNER JOIN $default->owl_site_sections_table AS SSL ON S.section_id=SSL.id 400 + if ($sql->query("SELECT SSL.name FROM $default->sitemap_table AS S
  401 + INNER JOIN $default->site_sections_table AS SSL ON S.section_id=SSL.id
389 WHERE S.page='$sRequiredPage'")) { 402 WHERE S.page='$sRequiredPage'")) {
390 if ($sql->next_record()) { 403 if ($sql->next_record()) {
391 // return the section name 404 // return the section name
@@ -446,10 +459,10 @@ class SiteMap { @@ -446,10 +459,10 @@ class SiteMap {
446 global $default, $lang_err_database; 459 global $default, $lang_err_database;
447 $sql = $default->db; 460 $sql = $default->db;
448 // lookup sectionID 461 // lookup sectionID
449 - $sectionID = lookupID($default->owl_site_sections_table, "name", $sSectionName); 462 + $sectionID = lookupID($default->site_sections_table, "name", $sSectionName);
450 if ($sectionID) { 463 if ($sectionID) {
451 // lookup the default action for the specified section 464 // lookup the default action for the specified section
452 - if ($sql->query("SELECT action FROM $default->owl_sitemap_table 465 + if ($sql->query("SELECT action FROM $default->sitemap_table
453 WHERE section_id=$sectionID 466 WHERE section_id=$sectionID
454 AND is_default=1 AND is_enabled=1")) { 467 AND is_default=1 AND is_enabled=1")) {
455 if ($sql->next_record()) { 468 if ($sql->next_record()) {
@@ -527,7 +540,7 @@ class SiteMap { @@ -527,7 +540,7 @@ class SiteMap {
527 $sql = $default->db; 540 $sql = $default->db;
528 541
529 // lookup the action for the specified page 542 // lookup the action for the specified page
530 - if ($sql->query("SELECT action FROM $default->owl_sitemap_table WHERE page='$sPage'")) { 543 + if ($sql->query("SELECT action FROM $default->sitemap_table WHERE page='$sPage'")) {
531 if ($sql->next_record()) { 544 if ($sql->next_record()) {
532 // return the section name 545 // return the section name
533 return $sql->f("action"); 546 return $sql->f("action");
@@ -588,13 +601,13 @@ class SiteMap { @@ -588,13 +601,13 @@ class SiteMap {
588 // only if we're using the array 601 // only if we're using the array
589 if (!$this->bUseDB) { 602 if (!$this->bUseDB) {
590 // clear section table 603 // clear section table
591 - if ($sql->query("DELETE from $default->owl_site_sections_table")) { 604 + if ($sql->query("DELETE from $default->site_sections_table")) {
592 $default->log->debug("Sitemap::syncWithDB removed sections"); 605 $default->log->debug("Sitemap::syncWithDB removed sections");
593 } else { 606 } else {
594 $default->log->error("Sitemap::syncWithDB remove sections failed"); 607 $default->log->error("Sitemap::syncWithDB remove sections failed");
595 } 608 }
596 // clear sitemap table 609 // clear sitemap table
597 - if ($sql->query("DELETE from $default->owl_sitemap_table")) { 610 + if ($sql->query("DELETE from $default->sitemap_table")) {
598 $default->log->debug("Sitemap::syncWithDB removed sitemap"); 611 $default->log->debug("Sitemap::syncWithDB removed sitemap");
599 } else { 612 } else {
600 $default->log->error("Sitemap::syncWithDB remove sitemap failed"); 613 $default->log->error("Sitemap::syncWithDB remove sitemap failed");
@@ -602,7 +615,7 @@ class SiteMap { @@ -602,7 +615,7 @@ class SiteMap {
602 // for each section 615 // for each section
603 foreach ($this->aSiteMap as $section => $valArr) { 616 foreach ($this->aSiteMap as $section => $valArr) {
604 // insert into the section 617 // insert into the section
605 - $sSectionSql = "INSERT INTO $default->owl_site_sections_table (name) VALUES ('$section')"; 618 + $sSectionSql = "INSERT INTO $default->site_sections_table (name) VALUES ('$section')";
606 $default->log->debug("Sitemap::syncWithDB insert=$sSectionSql"); 619 $default->log->debug("Sitemap::syncWithDB insert=$sSectionSql");
607 620
608 if ($sql->query($sSectionSql)) { 621 if ($sql->query($sSectionSql)) {
@@ -616,7 +629,7 @@ class SiteMap { @@ -616,7 +629,7 @@ class SiteMap {
616 foreach ($valArr as $requiredAccess => $pageArr) { 629 foreach ($valArr as $requiredAccess => $pageArr) {
617 // now loop through all the pages 630 // now loop through all the pages
618 foreach ($pageArr as $action => $page) { 631 foreach ($pageArr as $action => $page) {
619 - $sSiteMapSql = "INSERT INTO $default->owl_sitemap_table (action, page, section_id, access_id, link_text, is_default, is_enabled) " . 632 + $sSiteMapSql = "INSERT INTO $default->sitemap_table (action, page, section_id, access_id, link_text, is_default, is_enabled) " .
620 "VALUES ('$action', '" . $page["page"] . "', $sectionID, $requiredAccess, '" . $page["description"] . "', " . $page["default"] . ", " . $page["enabled"] . ")"; 633 "VALUES ('$action', '" . $page["page"] . "', $sectionID, $requiredAccess, '" . $page["description"] . "', " . $page["default"] . ", " . $page["enabled"] . ")";
621 if ($sql->query($sSiteMapSql)) { 634 if ($sql->query($sSiteMapSql)) {
622 $default->log->debug("Sitemap::syncWithDb sitemap insert worked for ($action, " . $page["page"] . ")"); 635 $default->log->debug("Sitemap::syncWithDb sitemap insert worked for ($action, " . $page["page"] . ")");
lib/session/control.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 * $Id$ 3 * $Id$
5 * 4 *
6 - * Contains the controller helper functions 5 + * Contains the controller helper functions.
  6 + *
  7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
7 * 18 *
8 - * Licensed under the GNU GPL. For full terms see the file COPYING. 19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9 * 22 *
10 * @version $Revision$ 23 * @version $Revision$
11 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 24 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
lib/subscriptions/Subscription.inc
@@ -2,20 +2,31 @@ @@ -2,20 +2,31 @@
2 require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionConstants.inc"); 2 require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionConstants.inc");
3 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); 3 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
4 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); 4 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
5 -  
6 /** 5 /**
7 - *  
8 * $Id$ 6 * $Id$
9 - * 7 + *
10 * Represents a subscription. 8 * Represents a subscription.
11 * 9 *
12 - * Licensed under the GNU GPL. For full terms see the file COPYING. 10 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
13 * 11 *
14 - * @version $Revision$  
15 - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 12 + * This program is free software; you can redistribute it and/or modify
  13 + * it under the terms of the GNU General Public License as published by
  14 + * the Free Software Foundation; either version 2 of the License, or
  15 + * (at your option) any later version.
16 * 16 *
  17 + * This program is distributed in the hope that it will be useful,
  18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20 + * GNU General Public License for more details.
  21 + *
  22 + * You should have received a copy of the GNU General Public License
  23 + * along with this program; if not, write to the Free Software
  24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25 + *
  26 + * @version $Revision$
  27 + * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
17 * @package lib.subscriptions 28 * @package lib.subscriptions
18 - */ 29 + */
19 class Subscription { 30 class Subscription {
20 31
21 /** 32 /**
@@ -354,9 +365,9 @@ class Subscription { @@ -354,9 +365,9 @@ class Subscription {
354 global $default; 365 global $default;
355 366
356 if ($iSubscriptionType == SubscriptionConstants::subscriptionType("DocumentSubscription")) { 367 if ($iSubscriptionType == SubscriptionConstants::subscriptionType("DocumentSubscription")) {
357 - return $default->owl_document_subscriptions_table; 368 + return $default->document_subscriptions_table;
358 } else if($iSubscriptionType == SubscriptionConstants::subscriptionType("FolderSubscription")) { 369 } else if($iSubscriptionType == SubscriptionConstants::subscriptionType("FolderSubscription")) {
359 - return $default->owl_folder_subscriptions_table; 370 + return $default->folder_subscriptions_table;
360 } 371 }
361 372
362 } 373 }
lib/subscriptions/SubscriptionConstants.inc
1 <?php 1 <?php
2 /** 2 /**
3 - *  
4 * $Id$ 3 * $Id$
5 - * 4 + *
6 * Holds all the subscription constants. 5 * Holds all the subscription constants.
7 * 6 *
8 - * Licensed under the GNU GPL. For full terms see the file COPYING. 7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
9 * 8 *
10 - * @version $Revision$  
11 - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
12 * 18 *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22 + *
  23 + * @version $Revision$
  24 + * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
13 * @package lib.subscriptions 25 * @package lib.subscriptions
14 - */ 26 + */
15 class SubscriptionConstants { 27 class SubscriptionConstants {
16 /** 28 /**
17 * Statically returns subscription types 29 * Statically returns subscription types
lib/subscriptions/SubscriptionEngine.inc
@@ -6,20 +6,31 @@ require_once(&quot;$default-&gt;fileSystemRoot/lib/subscriptions/Subscription.inc&quot;); @@ -6,20 +6,31 @@ require_once(&quot;$default-&gt;fileSystemRoot/lib/subscriptions/Subscription.inc&quot;);
6 require_once("$default->fileSystemRoot/lib/alert/AlertContent.inc"); 6 require_once("$default->fileSystemRoot/lib/alert/AlertContent.inc");
7 require_once("$default->fileSystemRoot/lib/alert/delivery/EmailAlert.inc"); 7 require_once("$default->fileSystemRoot/lib/alert/delivery/EmailAlert.inc");
8 require_once("$default->fileSystemRoot/lib/alert/delivery/SMSAlert.inc"); 8 require_once("$default->fileSystemRoot/lib/alert/delivery/SMSAlert.inc");
9 -  
10 /** 9 /**
11 - *  
12 * $Id$ 10 * $Id$
13 - * 11 + *
14 * Facilitates firing subscription alerts. 12 * Facilitates firing subscription alerts.
15 * 13 *
16 - * Licensed under the GNU GPL. For full terms see the file COPYING. 14 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
17 * 15 *
18 - * @version $Revision$  
19 - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 16 + * This program is free software; you can redistribute it and/or modify
  17 + * it under the terms of the GNU General Public License as published by
  18 + * the Free Software Foundation; either version 2 of the License, or
  19 + * (at your option) any later version.
20 * 20 *
  21 + * This program is distributed in the hope that it will be useful,
  22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24 + * GNU General Public License for more details.
  25 + *
  26 + * You should have received a copy of the GNU General Public License
  27 + * along with this program; if not, write to the Free Software
  28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  29 + *
  30 + * @version $Revision$
  31 + * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
21 * @package lib.subscriptions 32 * @package lib.subscriptions
22 - */ 33 + */
23 class SubscriptionEngine { 34 class SubscriptionEngine {
24 35
25 /** 36 /**
lib/subscriptions/SubscriptionManager.inc
1 <?php 1 <?php
2 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc"); 2 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc");
3 -  
4 /** 3 /**
5 - *  
6 * $Id$ 4 * $Id$
7 - * 5 + *
8 * Facilitates adding and removing file and folder subscriptions. 6 * Facilitates adding and removing file and folder subscriptions.
9 * 7 *
10 - * Licensed under the GNU GPL. For full terms see the file COPYING. 8 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
11 * 9 *
12 - * @version $Revision$  
13 - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 10 + * This program is free software; you can redistribute it and/or modify
  11 + * it under the terms of the GNU General Public License as published by
  12 + * the Free Software Foundation; either version 2 of the License, or
  13 + * (at your option) any later version.
14 * 14 *
  15 + * This program is distributed in the hope that it will be useful,
  16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18 + * GNU General Public License for more details.
  19 + *
  20 + * You should have received a copy of the GNU General Public License
  21 + * along with this program; if not, write to the Free Software
  22 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23 + *
  24 + * @version $Revision$
  25 + * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
15 * @package lib.subscriptions 26 * @package lib.subscriptions
16 - */ 27 + */
17 class SubscriptionManager { 28 class SubscriptionManager {
18 29
19 /** 30 /**
lib/unitmanagement/Unit.inc
1 <?php 1 <?php
2 /** 2 /**
3 -* Class Unit  
4 -* Represents a unit as per the database table units  
5 -*  
6 -* @author Mukhtar Dharsey  
7 -* @date 28 January 2003  
8 -* @package lib.unitmanagement  
9 -*/  
10 - 3 + * $Id$
  4 + *
  5 + * Represents a unit as per the database table units.
  6 + *
  7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22 + *
  23 + * @version $Revision$
  24 + * @author Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa
  25 + * @package lib.unitmanagement
  26 + */
11 class Unit { 27 class Unit {
12 28
13 /** object's primary key */ 29 /** object's primary key */
@@ -64,7 +80,7 @@ class Unit { @@ -64,7 +80,7 @@ class Unit {
64 //if the object hasn't been created 80 //if the object hasn't been created
65 if ($this->iId < 0) { //check to see if name exsits 81 if ($this->iId < 0) { //check to see if name exsits
66 $sql = $default->db; 82 $sql = $default->db;
67 - $query = "SELECT name FROM ". $default->owl_units_table ." WHERE name = '" . $this->sName . "'"; 83 + $query = "SELECT name FROM ". $default->units_table ." WHERE name = '" . $this->sName . "'";
68 $sql->query($query); 84 $sql->query($query);
69 $rows = $sql->num_rows($sql); 85 $rows = $sql->num_rows($sql);
70 86
@@ -73,7 +89,7 @@ class Unit { @@ -73,7 +89,7 @@ class Unit {
73 $_SESSION["errorMessage"] = "Unit::The name " . $this->sName . " is already in use!"; 89 $_SESSION["errorMessage"] = "Unit::The name " . $this->sName . " is already in use!";
74 return false; 90 return false;
75 } else { 91 } else {
76 - $result = $sql->query("INSERT INTO " . $default->owl_units_table . " (name) VALUES ('" . addslashes($this->sName) . "')"); 92 + $result = $sql->query("INSERT INTO " . $default->units_table . " (name) VALUES ('" . addslashes($this->sName) . "')");
77 if ($result) { 93 if ($result) {
78 $this->iId = $sql->insert_id(); 94 $this->iId = $sql->insert_id();
79 // create a new unit root folder 95 // create a new unit root folder
@@ -98,7 +114,7 @@ class Unit { @@ -98,7 +114,7 @@ class Unit {
98 return false; 114 return false;
99 } 115 }
100 } 116 }
101 - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_units_table"; 117 + $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->units_table";
102 return false; 118 return false;
103 } 119 }
104 120
@@ -114,8 +130,8 @@ class Unit { @@ -114,8 +130,8 @@ class Unit {
114 if ($this->iId > 0) { 130 if ($this->iId > 0) {
115 $sql = $default->db; 131 $sql = $default->db;
116 // lookup current name before updating 132 // lookup current name before updating
117 - $sOldName = lookupField($default->owl_units_table, "name", "id", $this->iId);  
118 - $result = $sql->query("UPDATE " . $default->owl_units_table . " SET name = '" . addslashes($this->sName) . "' WHERE id = $this->iId"); 133 + $sOldName = lookupField($default->units_table, "name", "id", $this->iId);
  134 + $result = $sql->query("UPDATE " . $default->units_table . " SET name = '" . addslashes($this->sName) . "' WHERE id = $this->iId");
119 if ($result) { 135 if ($result) {
120 // need to update the units root folder also 136 // need to update the units root folder also
121 $iFolderID = Folder::getFolderID($sOldName); 137 $iFolderID = Folder::getFolderID($sOldName);
@@ -162,7 +178,7 @@ class Unit { @@ -162,7 +178,7 @@ class Unit {
162 //only delete the object if it exists in the database 178 //only delete the object if it exists in the database
163 if ($this->iId >= 0) { 179 if ($this->iId >= 0) {
164 $sql = $default->db; 180 $sql = $default->db;
165 - if ($sql->query("DELETE FROM $default->owl_units_table WHERE id = $this->iId")) { 181 + if ($sql->query("DELETE FROM $default->units_table WHERE id = $this->iId")) {
166 return true; 182 return true;
167 } 183 }
168 $_SESSION["errorMessage"] = $lang_err_database; 184 $_SESSION["errorMessage"] = $lang_err_database;
@@ -183,14 +199,14 @@ class Unit { @@ -183,14 +199,14 @@ class Unit {
183 function & get($iUnitID) { 199 function & get($iUnitID) {
184 global $default; 200 global $default;
185 $sql = $default->db; 201 $sql = $default->db;
186 - $result = $sql->query("SELECT * FROM $default->owl_units_table WHERE id = $iUnitID"); 202 + $result = $sql->query("SELECT * FROM $default->units_table WHERE id = $iUnitID");
187 if ($result) { 203 if ($result) {
188 if ($sql->next_record()) { 204 if ($sql->next_record()) {
189 $oUnit = & new Unit(stripslashes($sql->f("name"))); 205 $oUnit = & new Unit(stripslashes($sql->f("name")));
190 $oUnit->iId = $iUnitID; 206 $oUnit->iId = $iUnitID;
191 return $oUnit; 207 return $oUnit;
192 } 208 }
193 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iUnitID . " table = $default->owl_units_table"; 209 + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iUnitID . " table = $default->units_table";
194 return false; 210 return false;
195 } 211 }
196 $_SESSION["errorMessage"] = $lang_err_database; 212 $_SESSION["errorMessage"] = $lang_err_database;
@@ -204,7 +220,7 @@ class Unit { @@ -204,7 +220,7 @@ class Unit {
204 global $default; 220 global $default;
205 // check to see if group is linked to a unit 221 // check to see if group is linked to a unit
206 $sql = $default->db; 222 $sql = $default->db;
207 - $query = "SELECT unit_id FROM ". $default->owl_groups_units_table ." WHERE unit_id = " . $this->iId; 223 + $query = "SELECT unit_id FROM ". $default->groups_units_table ." WHERE unit_id = " . $this->iId;
208 $sql->query($query); 224 $sql->query($query);
209 if ($sql->num_rows($sql) > 0) { 225 if ($sql->num_rows($sql) > 0) {
210 return true; 226 return true;
@@ -222,7 +238,7 @@ class Unit { @@ -222,7 +238,7 @@ class Unit {
222 */ 238 */
223 function getUnitID($name) { 239 function getUnitID($name) {
224 global $default; 240 global $default;
225 - $id = lookupID($default->owl_units_table, "name", $name); 241 + $id = lookupID($default->units_table, "name", $name);
226 $this->iId= $id; 242 $this->iId= $id;
227 } 243 }
228 244
@@ -236,7 +252,7 @@ class Unit { @@ -236,7 +252,7 @@ class Unit {
236 */ 252 */
237 function getUnitName($id) { 253 function getUnitName($id) {
238 global $default; 254 global $default;
239 - $name = lookupField("$default->owl_units_table", "name", "id", $id ); 255 + $name = lookupField("$default->units_table", "name", "id", $id );
240 $this->sName= $name; 256 $this->sName= $name;
241 } 257 }
242 258
@@ -253,7 +269,7 @@ class Unit { @@ -253,7 +269,7 @@ class Unit {
253 $aUnitArray; 269 $aUnitArray;
254 settype($aUnitArray, "array"); 270 settype($aUnitArray, "array");
255 $sql = $default->db; 271 $sql = $default->db;
256 - $result = $sql->query("SELECT * FROM " . $default->owl_units_table . (isset($sWhereClause) ? " " . $sWhereClause : "")); 272 + $result = $sql->query("SELECT * FROM " . $default->units_table . (isset($sWhereClause) ? " " . $sWhereClause : ""));
257 if ($result) { 273 if ($result) {
258 $iCount = 0; 274 $iCount = 0;
259 while ($sql->next_record()) { 275 while ($sql->next_record()) {
lib/unitmanagement/UnitOrganisationLink.inc
1 <?php 1 <?php
2 /** 2 /**
3 -*  
4 -* Class UnitOrganisationLink  
5 -* Represents a unit, organisation link as per the database table units_organisations_link  
6 -*  
7 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
8 -* @date 20 January 2003  
9 -* @package lib.groups  
10 -*/  
11 -  
12 - 3 + * $Id$
  4 + *
  5 + * Represents a unit, organisation link as per the database table units_organisations_link.
  6 + *
  7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22 + *
  23 + * @version $Revision$
  24 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  25 + * @package lib.unitmanagement
  26 + */
13 class UnitOrganisationLink { 27 class UnitOrganisationLink {
14 28
15 /** primary key of object */ 29 /** primary key of object */
@@ -91,7 +105,7 @@ class UnitOrganisationLink { @@ -91,7 +105,7 @@ class UnitOrganisationLink {
91 if ($this->iId < 0) { 105 if ($this->iId < 0) {
92 106
93 $sql = $default->db; 107 $sql = $default->db;
94 - $query = "SELECT unit_id FROM $default->owl_units_organisations_table WHERE unit_id = $this->iUnitID AND organisation_id = $this->iOrgID"; 108 + $query = "SELECT unit_id FROM $default->units_organisations_table WHERE unit_id = $this->iUnitID AND organisation_id = $this->iOrgID";
95 $sql->query($query); 109 $sql->query($query);
96 $rows = $sql->num_rows($sql); 110 $rows = $sql->num_rows($sql);
97 111
@@ -100,7 +114,7 @@ class UnitOrganisationLink { @@ -100,7 +114,7 @@ class UnitOrganisationLink {
100 $_SESSION["errorMessage"] = "UnitOrganisationlink::The id " . $this->iUnitID . " is already exist!"; 114 $_SESSION["errorMessage"] = "UnitOrganisationlink::The id " . $this->iUnitID . " is already exist!";
101 return false; 115 return false;
102 } else{ 116 } else{
103 - $result = $sql->query("INSERT INTO " . $default->owl_units_organisations_table . " (unit_id,organisation_id) VALUES ($this->iUnitID,$this->iOrgID)"); 117 + $result = $sql->query("INSERT INTO " . $default->units_organisations_table . " (unit_id,organisation_id) VALUES ($this->iUnitID,$this->iOrgID)");
104 if ($result) { 118 if ($result) {
105 $this->iId = $sql->insert_id(); 119 $this->iId = $sql->insert_id();
106 return true; 120 return true;
@@ -109,7 +123,6 @@ class UnitOrganisationLink { @@ -109,7 +123,6 @@ class UnitOrganisationLink {
109 return false; 123 return false;
110 } 124 }
111 } 125 }
112 - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_units_organisations_link_table";  
113 return false; 126 return false;
114 } 127 }
115 128
@@ -124,7 +137,7 @@ class UnitOrganisationLink { @@ -124,7 +137,7 @@ class UnitOrganisationLink {
124 //only update if the object has been stored 137 //only update if the object has been stored
125 if ($this->iId > 0) { 138 if ($this->iId > 0) {
126 $sql = $default->db; 139 $sql = $default->db;
127 - $result = $sql->query("UPDATE " . $default->owl_units_organisations_table . " SET organisation_id = $this->iOrgID, unit_id = $this->iUnitID WHERE id = $this->iId"); 140 + $result = $sql->query("UPDATE " . $default->units_organisations_table . " SET organisation_id = $this->iOrgID, unit_id = $this->iUnitID WHERE id = $this->iId");
128 if ($result) { 141 if ($result) {
129 return true; 142 return true;
130 } 143 }
@@ -146,7 +159,7 @@ class UnitOrganisationLink { @@ -146,7 +159,7 @@ class UnitOrganisationLink {
146 //only delete the object if it exists in the database 159 //only delete the object if it exists in the database
147 if ($this->iId >= 0) { 160 if ($this->iId >= 0) {
148 $sql = $default->db; 161 $sql = $default->db;
149 - $result = $sql->query("DELETE FROM $default->owl_units_organisations_table WHERE id = $this->iId"); 162 + $result = $sql->query("DELETE FROM $default->units_organisations_table WHERE id = $this->iId");
150 if ($result) { 163 if ($result) {
151 return true; 164 return true;
152 } 165 }
@@ -168,14 +181,13 @@ class UnitOrganisationLink { @@ -168,14 +181,13 @@ class UnitOrganisationLink {
168 function & get($iUnitOrganisationLinkID) { 181 function & get($iUnitOrganisationLinkID) {
169 global $default; 182 global $default;
170 $sql = $default->db; 183 $sql = $default->db;
171 - $result = $sql->query("SELECT * FROM $default->owl_units_organisations_table WHERE id = $iUnitOrganisationLinkID"); 184 + $result = $sql->query("SELECT * FROM $default->units_organisations_table WHERE id = $iUnitOrganisationLinkID");
172 if ($result) { 185 if ($result) {
173 if ($sql->next_record()) { 186 if ($sql->next_record()) {
174 $oUnitOrganisationLink = & new UnitOrganisationLink($sql->f("unit_id"),$sql->f("organisation_id") ); 187 $oUnitOrganisationLink = & new UnitOrganisationLink($sql->f("unit_id"),$sql->f("organisation_id") );
175 $oUnitOrganisationLink->iId = $iUnitOrganisationLinkID; 188 $oUnitOrganisationLink->iId = $iUnitOrganisationLinkID;
176 return $oUnitOrganisationLink; 189 return $oUnitOrganisationLink;
177 } 190 }
178 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iUnitOrganisationLinkID . " table = $default->owl_units_organisations_link_table";  
179 return false; 191 return false;
180 } 192 }
181 $_SESSION["errorMessage"] = $lang_err_database; 193 $_SESSION["errorMessage"] = $lang_err_database;
@@ -195,7 +207,7 @@ class UnitOrganisationLink { @@ -195,7 +207,7 @@ class UnitOrganisationLink {
195 $aUnitOrganisationLink; 207 $aUnitOrganisationLink;
196 settype($aUnitOrganisationLink, "array"); 208 settype($aUnitOrganisationLink, "array");
197 $sql = $default->db; 209 $sql = $default->db;
198 - $result = $sql->query("SELECT * FROM " . $default->owl_units_organisations_table . (isset($sWhereClause) ? " " . $sWhereClause : "")); 210 + $result = $sql->query("SELECT * FROM " . $default->units_organisations_table . (isset($sWhereClause) ? " " . $sWhereClause : ""));
199 if ($result) { 211 if ($result) {
200 $iCount = 0; 212 $iCount = 0;
201 while ($sql->next_record()) { 213 while ($sql->next_record()) {
@@ -218,7 +230,7 @@ class UnitOrganisationLink { @@ -218,7 +230,7 @@ class UnitOrganisationLink {
218 */ 230 */
219 function unitBelongsToOrg($unitId) { 231 function unitBelongsToOrg($unitId) {
220 global $default; 232 global $default;
221 - return lookupField("$default->owl_units_organisations_table", "organisation_id", "unit_id", $unitId ); 233 + return lookupField("$default->units_organisations_table", "organisation_id", "unit_id", $unitId );
222 } 234 }
223 235
224 /* 236 /*
@@ -232,14 +244,14 @@ class UnitOrganisationLink { @@ -232,14 +244,14 @@ class UnitOrganisationLink {
232 */ 244 */
233 function setUnitOrgID($unitId) { 245 function setUnitOrgID($unitId) {
234 global $default; 246 global $default;
235 - $id = lookupID($default->owl_units_organisations_table, "unit_id", $unitId); 247 + $id = lookupID($default->units_organisations_table, "unit_id", $unitId);
236 $this->iId= $id; 248 $this->iId= $id;
237 } 249 }
238 250
239 function getByUnitID($unitId) { 251 function getByUnitID($unitId) {
240 global $default; 252 global $default;
241 $sql = $default->db; 253 $sql = $default->db;
242 - $result = $sql->query("SELECT * FROM $default->owl_units_organisations_table WHERE unit_id = $unitId"); 254 + $result = $sql->query("SELECT * FROM $default->units_organisations_table WHERE unit_id = $unitId");
243 if ($result) { 255 if ($result) {
244 if ($sql->next_record()) { 256 if ($sql->next_record()) {
245 $oUnitOrganisationLink = & UnitOrganisationLink::get($sql->f("id")); 257 $oUnitOrganisationLink = & UnitOrganisationLink::get($sql->f("id"));
lib/users/User.inc
1 <?php 1 <?php
2 /** 2 /**
3 -* Class User  
4 -* Represents a user as per the users table in the database  
5 -*  
6 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
7 -* @date 20 January 2003  
8 -* @package lib.user  
9 -*/  
10 - 3 + * $Id$
  4 + *
  5 + * Represents a user as per the users table in the database.
  6 + *
  7 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22 + *
  23 + * @version $Revision$
  24 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  25 + * @package lib.unitmanagement
  26 + */
11 class User { 27 class User {
12 28
13 /** object primary key */ 29 /** object primary key */
@@ -297,7 +313,7 @@ class User { @@ -297,7 +313,7 @@ class User {
297 if ($this->iId < 0) { 313 if ($this->iId < 0) {
298 //check to see if name exsits 314 //check to see if name exsits
299 $sql = $default->db; 315 $sql = $default->db;
300 - $query = "SELECT username FROM ". $default->owl_users_table ." WHERE username = '" . $this->sUserName . "'"; 316 + $query = "SELECT username FROM ". $default->users_table ." WHERE username = '" . $this->sUserName . "'";
301 $sql->query($query); 317 $sql->query($query);
302 $rows = $sql->num_rows($sql); 318 $rows = $sql->num_rows($sql);
303 319
@@ -307,7 +323,7 @@ class User { @@ -307,7 +323,7 @@ class User {
307 return false; 323 return false;
308 } 324 }
309 else { 325 else {
310 - $result = $sql->query("INSERT INTO " . $default->owl_users_table . " (username, name, password, quota_max, quota_current, email, mobile, email_notification, sms_notification, ldap_dn, max_sessions, language_id) " . 326 + $result = $sql->query("INSERT INTO " . $default->users_table . " (username, name, password, quota_max, quota_current, email, mobile, email_notification, sms_notification, ldap_dn, max_sessions, language_id) " .
311 "VALUES ('" . addslashes($this->sUserName) . "', '" . addslashes($this->sName) . "', '" . addslashes(md5($this->sPassword)) . "', $this->iQuotaMax, 0, '" . addslashes($this->sEmail) . "', '" . addslashes($this->sMobile) . "', " . ($this->bEmailNotification ? 1 : 0) . ", " . ($this->bSmsNotification ? 1 : 0) . ", '" . addslashes($this->sLdapDn) . "', $this->iMaxSessions, $this->iLanguageID)"); 327 "VALUES ('" . addslashes($this->sUserName) . "', '" . addslashes($this->sName) . "', '" . addslashes(md5($this->sPassword)) . "', $this->iQuotaMax, 0, '" . addslashes($this->sEmail) . "', '" . addslashes($this->sMobile) . "', " . ($this->bEmailNotification ? 1 : 0) . ", " . ($this->bSmsNotification ? 1 : 0) . ", '" . addslashes($this->sLdapDn) . "', $this->iMaxSessions, $this->iLanguageID)");
312 if ($result) { 328 if ($result) {
313 $this->iId = $sql->insert_id(); 329 $this->iId = $sql->insert_id();
@@ -317,7 +333,7 @@ class User { @@ -317,7 +333,7 @@ class User {
317 return false; 333 return false;
318 } 334 }
319 } 335 }
320 - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_users_table"; 336 + $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->users_table";
321 return false; 337 return false;
322 } 338 }
323 339
@@ -333,7 +349,7 @@ class User { @@ -333,7 +349,7 @@ class User {
333 if ($this->iId < 0) { 349 if ($this->iId < 0) {
334 //check to see if name exsits 350 //check to see if name exsits
335 $sql = $default->db; 351 $sql = $default->db;
336 - $query = "SELECT username FROM ". $default->owl_users_table ." WHERE username = '" . $this->sUserName . "'"; 352 + $query = "SELECT username FROM ". $default->users_table ." WHERE username = '" . $this->sUserName . "'";
337 $sql->query($query); 353 $sql->query($query);
338 $rows = $sql->num_rows($sql); 354 $rows = $sql->num_rows($sql);
339 355
@@ -344,7 +360,7 @@ class User { @@ -344,7 +360,7 @@ class User {
344 } 360 }
345 else { 361 else {
346 $sql = $default->db; 362 $sql = $default->db;
347 - $result = $sql->query("UPDATE " . $default->owl_users_table . " SET username = '" . addslashes($this->sUserName) . "', name = '" . addslashes($this->sName) . "', " . ($this->bPasswordChanged ? "password = '" . addslashes(md5($this->sPassword)) . "', " : " ") . " quota_max = $this->iQuotaMax, email = '" . addslashes($this->sEmail) . "', mobile = '" . addslashes($this->sMobile) . "', email_notification = " . ($this->bEmailNotification ? 1 : 0) . ", sms_notification = " . ($this->bSmsNotification ? 1 : 0) . ", ldap_dn = '" . addslashes($this->sLdapDn) . "', max_sessions = $this->iMaxSessions, language_id = $this->iLanguageID WHERE id = $this->iId"); 363 + $result = $sql->query("UPDATE " . $default->users_table . " SET username = '" . addslashes($this->sUserName) . "', name = '" . addslashes($this->sName) . "', " . ($this->bPasswordChanged ? "password = '" . addslashes(md5($this->sPassword)) . "', " : " ") . " quota_max = $this->iQuotaMax, email = '" . addslashes($this->sEmail) . "', mobile = '" . addslashes($this->sMobile) . "', email_notification = " . ($this->bEmailNotification ? 1 : 0) . ", sms_notification = " . ($this->bSmsNotification ? 1 : 0) . ", ldap_dn = '" . addslashes($this->sLdapDn) . "', max_sessions = $this->iMaxSessions, language_id = $this->iLanguageID WHERE id = $this->iId");
348 if ($result) { 364 if ($result) {
349 return true; 365 return true;
350 } 366 }
@@ -367,7 +383,7 @@ class User { @@ -367,7 +383,7 @@ class User {
367 //only delete the object if it exists in the database 383 //only delete the object if it exists in the database
368 if ($this->iId >= 0) { 384 if ($this->iId >= 0) {
369 $sql = $default->db; 385 $sql = $default->db;
370 - $result = $sql->query("DELETE FROM $default->owl_users_table WHERE id = $this->iId"); 386 + $result = $sql->query("DELETE FROM $default->users_table WHERE id = $this->iId");
371 if ($result) { 387 if ($result) {
372 return true; 388 return true;
373 } 389 }
@@ -390,7 +406,7 @@ class User { @@ -390,7 +406,7 @@ class User {
390 //only delete the object if it exists in the database 406 //only delete the object if it exists in the database
391 if ($this->iId >= 0) { 407 if ($this->iId >= 0) {
392 $sql = $default->db; 408 $sql = $default->db;
393 - $result = $sql->query("DELETE FROM $default->owl_users_groups_table WHERE user_id = $this->iId"); 409 + $result = $sql->query("DELETE FROM $default->users_groups_table WHERE user_id = $this->iId");
394 if ($result) { 410 if ($result) {
395 return true; 411 return true;
396 } 412 }
@@ -411,14 +427,14 @@ class User { @@ -411,14 +427,14 @@ class User {
411 function & get($iUserID) { 427 function & get($iUserID) {
412 global $default; 428 global $default;
413 $sql = $default->db; 429 $sql = $default->db;
414 - $result = $sql->query("SELECT * FROM $default->owl_users_table WHERE id = $iUserID"); 430 + $result = $sql->query("SELECT * FROM $default->users_table WHERE id = $iUserID");
415 if ($result) { 431 if ($result) {
416 if ($sql->next_record()) { 432 if ($sql->next_record()) {
417 $oUser = & new User(stripslashes($sql->f("username")), stripslashes($sql->f("name")), stripslashes($sql->f("password")), $sql->f("quota_max"), stripslashes($sql->f("email")), stripslashes($sql->f("mobile")), $sql->f("email_notification"), $sql->f("sms_notification"), $sql->f("ldap_dn"), $sql->f("max_sessions"), $sql->f("language_id")); 433 $oUser = & new User(stripslashes($sql->f("username")), stripslashes($sql->f("name")), stripslashes($sql->f("password")), $sql->f("quota_max"), stripslashes($sql->f("email")), stripslashes($sql->f("mobile")), $sql->f("email_notification"), $sql->f("sms_notification"), $sql->f("ldap_dn"), $sql->f("max_sessions"), $sql->f("language_id"));
418 $oUser->iId = $iUserID; 434 $oUser->iId = $iUserID;
419 return $oUser; 435 return $oUser;
420 } 436 }
421 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iUserID . " table = $default->owl_users_table"; 437 + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iUserID . " table = $default->users_table";
422 return false; 438 return false;
423 } 439 }
424 $_SESSION["errorMessage"] = $lang_err_database; 440 $_SESSION["errorMessage"] = $lang_err_database;
@@ -438,7 +454,7 @@ class User { @@ -438,7 +454,7 @@ class User {
438 $aUserArray; 454 $aUserArray;
439 settype($aUserArray, "array"); 455 settype($aUserArray, "array");
440 $sql = $default->db; 456 $sql = $default->db;
441 - $result = $sql->query("SELECT * FROM " . $default->owl_users_table . (isset($sWhereClause) ? " " . $sWhereClause : "")); 457 + $result = $sql->query("SELECT * FROM " . $default->users_table . (isset($sWhereClause) ? " " . $sWhereClause : ""));
442 if ($result) { 458 if ($result) {
443 $iCount = 0; 459 $iCount = 0;
444 while ($sql->next_record()) { 460 while ($sql->next_record()) {
@@ -465,8 +481,8 @@ class User { @@ -465,8 +481,8 @@ class User {
465 global $default, $lang_err_database; 481 global $default, $lang_err_database;
466 482
467 $sql = $default->db; 483 $sql = $default->db;
468 - $result = $sql->query("SELECT DISTINCT gul.unit_id FROM $default->owl_users_groups_table ugl " .  
469 - "INNER JOIN $default->owl_groups_units_table gul ON ugl.group_id = gul.group_id ". 484 + $result = $sql->query("SELECT DISTINCT gul.unit_id FROM $default->users_groups_table ugl " .
  485 + "INNER JOIN $default->groups_units_table gul ON ugl.group_id = gul.group_id ".
470 "WHERE ugl.user_id=$userID"); 486 "WHERE ugl.user_id=$userID");
471 if ($result) { 487 if ($result) {
472 if ($sql->next_record()) { 488 if ($sql->next_record()) {
@@ -487,7 +503,7 @@ class User { @@ -487,7 +503,7 @@ class User {
487 function getUserID($sUsername) { 503 function getUserID($sUsername) {
488 global $default; 504 global $default;
489 505
490 - $id = lookupID($default->owl_users_table, "username", $sUsername); 506 + $id = lookupID($default->users_table, "username", $sUsername);
491 507
492 $this->iId = $id; 508 $this->iId = $id;
493 } 509 }
@@ -505,7 +521,7 @@ class User { @@ -505,7 +521,7 @@ class User {
505 // if the user is in a unit, start at the unit's root folder 521 // if the user is in a unit, start at the unit's root folder
506 522
507 // lookup the unit name 523 // lookup the unit name
508 - $unitName = lookupField($default->owl_units_table, "name", "id", $unitID); 524 + $unitName = lookupField($default->units_table, "name", "id", $unitID);
509 525
510 // the unit root folder has the same name as the unit 526 // the unit root folder has the same name as the unit
511 // FIXME: dodgy i know, but its easy 527 // FIXME: dodgy i know, but its easy
@@ -516,12 +532,12 @@ class User { @@ -516,12 +532,12 @@ class User {
516 532
517 if (!$aFolders) { 533 if (!$aFolders) {
518 // no folder exists with this name, so start at the root 534 // no folder exists with this name, so start at the root
519 - $iFolderID = lookupID($default->owl_folders_table, "parent_id", 0); 535 + $iFolderID = lookupID($default->folders_table, "parent_id", 0);
520 } else { 536 } else {
521 $iFolderID = $aFolders[0]->getID(); 537 $iFolderID = $aFolders[0]->getID();
522 } 538 }
523 } else { 539 } else {
524 - $iFolderID = lookupID($default->owl_folders_table, "parent_id", 0); 540 + $iFolderID = lookupID($default->folders_table, "parent_id", 0);
525 } 541 }
526 return $iFolderID; 542 return $iFolderID;
527 } 543 }
@@ -538,16 +554,16 @@ class User { @@ -538,16 +554,16 @@ class User {
538 // then find the group that is unit_admin 554 // then find the group that is unit_admin
539 $sql = $default->db; 555 $sql = $default->db;
540 $sEmail = ""; 556 $sEmail = "";
541 - if ($sql->query("SELECT group_id FROM $default->owl_groups_units_table GUL " .  
542 - "INNER JOIN $default->owl_groups_table GL on GUL.group_id=GL.id " . 557 + if ($sql->query("SELECT group_id FROM $default->groups_units_table GUL " .
  558 + "INNER JOIN $default->groups_table GL on GUL.group_id=GL.id " .
543 "WHERE GL.is_unit_admin=1 " . 559 "WHERE GL.is_unit_admin=1 " .
544 "AND unit_id=$iUnitID")) { 560 "AND unit_id=$iUnitID")) {
545 // get the first record 561 // get the first record
546 if ($sql->next_record()) { 562 if ($sql->next_record()) {
547 $iGroupID = $sql->f("group_id"); 563 $iGroupID = $sql->f("group_id");
548 // then find the first user in this group that has an email address 564 // then find the first user in this group that has an email address
549 - if ($sql->query("SELECT U.id, U.email FROM $default->owl_users_table U " .  
550 - "INNER JOIN $default->owl_users_groups_table UGL on UGL.user_id=U.id " . 565 + if ($sql->query("SELECT U.id, U.email FROM $default->users_table U " .
  566 + "INNER JOIN $default->users_groups_table UGL on UGL.user_id=U.id " .
551 "WHERE group_id=$iGroupID")) { 567 "WHERE group_id=$iGroupID")) {
552 while ($sql->next_record()) { 568 while ($sql->next_record()) {
553 if (strlen($sql->f("email")) > 0) { 569 if (strlen($sql->f("email")) > 0) {