Commit 3777dd77e5d9fab4f8c8419ef192648ae215a428
1 parent
b8283401
Obsoleted by userManagement.php
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4224 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
12 changed files
with
0 additions
and
1550 deletions
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/addUserBL.php deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Add a user. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -require_once("../../../../../config/dmsDefaults.php"); | |
| 29 | - | |
| 30 | -KTUtil::extractGPC('fAddToDb', 'fEmail', 'fEmailNotification', 'fFromDb'); | |
| 31 | -KTUtil::extractGPC('fGroupID', 'fLdap', 'fMobile', 'fName', 'fPassword'); | |
| 32 | -KTUtil::extractGPC('fSearch', 'fSelectedUser', 'fUsername'); | |
| 33 | - | |
| 34 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 35 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | |
| 36 | -require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 37 | -require_once("$default->fileSystemRoot/lib/groups/Group.inc"); | |
| 38 | -require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | |
| 39 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 40 | -require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 41 | -require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 42 | -require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 43 | -require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/administration/adminUI.inc"); | |
| 44 | -require_once("addUserUI.inc"); | |
| 45 | - | |
| 46 | -if (checkSession()) { | |
| 47 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 48 | - $oPatternCustom = & new PatternCustom(); | |
| 49 | - //create db object | |
| 50 | - $oAuth = new $default->authenticationClass; | |
| 51 | - // user attributes to search for | |
| 52 | - if ($default->authenticationClass == "DBAuthenticator") { | |
| 53 | - $aAttributes = array ("username", "name", "email", "mobile", "email_notification"); | |
| 54 | - $bLdap = false; | |
| 55 | - } else { | |
| 56 | - //if its using LDAP get these attributes | |
| 57 | - // FIXME: move these to $default(ldapSettings.inc) and map them to DN, username, display name, email, mobile | |
| 58 | - if ($default->ldapServerType == "ActiveDirectory") { | |
| 59 | - $aAttributes = array ("dn", "samaccountname", "givenname", "sn", "userPrincipalName", "telephonenumber"); | |
| 60 | - } else { | |
| 61 | - $aAttributes = array ("dn", "uid", "givenname", "sn", "mail", "mobile"); | |
| 62 | - } | |
| 63 | - $bLdap = true; | |
| 64 | - } | |
| 65 | - | |
| 66 | - if (isset($fSearch)) { | |
| 67 | - //get user name | |
| 68 | - $sSearch = $fName; | |
| 69 | - | |
| 70 | - // search for users | |
| 71 | - $aResults = $oAuth->searchUsers($sSearch, $aAttributes); | |
| 72 | - | |
| 73 | - //post array to page | |
| 74 | - if (isset($aResults)) { | |
| 75 | - if(count($aResults) == 0) { | |
| 76 | - $oPatternCustom->setHtml(getPageUsernameNotFound()); | |
| 77 | - } else { | |
| 78 | - if (count($aResults) > 1) { | |
| 79 | - // display results in a listbox | |
| 80 | - $oPatternCustom->setHtml(getSelectUserPage($aResults)); | |
| 81 | - $main->setFormAction($_SERVER["PHP_SELF"]. "?fSelectedUser=1"); | |
| 82 | - } else { | |
| 83 | - if($bLdap) { | |
| 84 | - $oPatternCustom->setHtml(getDetailsLDAPPage($sSearch,$aResults, $oAuth->oLdap->getUserIdentifier())); | |
| 85 | - if ($default->bNN4) { | |
| 86 | - $main->setOnLoadJavaScript("disable(document.MainForm.fLdap);disable(document.MainForm.fUsername)"); | |
| 87 | - } | |
| 88 | - $main->setFormAction($_SERVER["PHP_SELF"]. "?fAddToDb=1"); | |
| 89 | - } else { | |
| 90 | - $oPatternCustom->setHtml(getDetailsDBPage($sSearch,$aResults)); | |
| 91 | - $main->setFormAction($_SERVER["PHP_SELF"]. "?fAddToDb=1&fFromDb=1"); | |
| 92 | - } | |
| 93 | - } | |
| 94 | - } | |
| 95 | - } else { | |
| 96 | - $oPatternCustom->setHtml(getAddPageFail()); | |
| 97 | - $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 98 | - } | |
| 99 | - } else if (isset($fSelectedUser)) { | |
| 100 | - // user has been selected | |
| 101 | - | |
| 102 | - // retrieve user details | |
| 103 | - $aResult = $oAuth->getUser($fName, $aAttributes); | |
| 104 | - // display details page | |
| 105 | - if ($bLdap) { | |
| 106 | - $oPatternCustom->setHtml(getDetailsLDAPPage($fName,$aResult, $oAuth->oLdap->getUserIdentifier())); | |
| 107 | - if ($default->bNN4) { | |
| 108 | - $main->setOnLoadJavaScript("disable(document.MainForm.fLdap);disable(document.MainForm.fUsername)"); | |
| 109 | - } | |
| 110 | - $main->setFormAction($_SERVER["PHP_SELF"]. "?fAddToDb=1"); | |
| 111 | - } else { | |
| 112 | - $oPatternCustom->setHtml(getDetailsDBPage($fName,$aResult)); | |
| 113 | - $main->setFormAction($_SERVER["PHP_SELF"]. "?fAddToDb=1&fFromDb=1"); | |
| 114 | - } | |
| 115 | - | |
| 116 | - } else if(isset($fAddToDb)) { | |
| 117 | - // if db authentication | |
| 118 | - if(isset($fFromDb)) { | |
| 119 | - $oUser = new User($fUsername,$fName,$fPassword,0,$fEmail,$fMobile,$fEmailNotification,false,0,1,0); | |
| 120 | - } else { | |
| 121 | - $oUser = new User($fUsername,$fName,0,0,$fEmail,$fMobile,$fEmailNotification,false,$fLdap,1,0); | |
| 122 | - } | |
| 123 | - | |
| 124 | - if($oUser->create()) { | |
| 125 | - // now add the user to the initial group | |
| 126 | - $default->log->info("adding user id " . $oUser->getID() . " to group id $fGroupID"); | |
| 127 | - $oGroup = Group::get($fGroupID); | |
| 128 | - if (!PEAR::isError($oGroup)) { | |
| 129 | - if ($oGroup->addMember($oUser)) { | |
| 130 | - // FIXME: update search permissions for the group | |
| 131 | - // redirect to list page | |
| 132 | - exit(controllerRedirect("listUsers")); | |
| 133 | - } else { | |
| 134 | - $oPatternCustom->setHtml(getPageGroupFail()); | |
| 135 | - } | |
| 136 | - } else { | |
| 137 | - $oPatternCustom->setHtml(getPageGroupFail()); | |
| 138 | - } | |
| 139 | - } else { | |
| 140 | - $oPatternCustom->setHtml(getPageFail()); | |
| 141 | - } | |
| 142 | - } else { | |
| 143 | - if ($default->authenticationClass == "DBAuthenticator") { | |
| 144 | - $aAttributes = array("" => array ("username", "name", "email", "mobile", "email_notification")); | |
| 145 | - $oPatternCustom->setHtml(getDetailsDBPage(null,$aAttributes)); | |
| 146 | - $main->setFormAction($_SERVER["PHP_SELF"]. "?fAddToDb=1&fFromDb=1"); | |
| 147 | - } else { | |
| 148 | - // if nothing happens...just reload edit page | |
| 149 | - $oPatternCustom->setHtml(getSearchPage(null)); | |
| 150 | - $main->setFormAction($_SERVER["PHP_SELF"]. "?fSearch=1"); | |
| 151 | - } | |
| 152 | - } | |
| 153 | - | |
| 154 | - $main->setCentralPayload($oPatternCustom); | |
| 155 | - $main->setHasRequiredFields(true); | |
| 156 | - $main->render(); | |
| 157 | -} | |
| 158 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/addUserUI.inc deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Add user UI 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. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | -// display multiple users | |
| 28 | -function getSelectUserPage($aResults) { | |
| 29 | - global $default; | |
| 30 | - $sToRender .= renderHeading(_("Add User To System")); | |
| 31 | - $sToRender .= "<table>\n"; | |
| 32 | - $sToRender .= "<tr><td>" . _("Select the User to add to the System:") . "</td></tr>\n"; | |
| 33 | - $sToRender .= "<tr><td><select name=\"fName\">\n"; | |
| 34 | - foreach ($aResults as $sName => $aAttributes) { | |
| 35 | - $sToRender .= "<option value=\"$sName\">$sName</option>"; | |
| 36 | - } | |
| 37 | - $sToRender .= "</select></td></tr>\n"; | |
| 38 | - $sToRender .= "<tr><td></td><td align=\"right\"><input type=\"image\" src=\"" . KTHtml::getSelectButton() . "\" value=\"submit\" border=\"0\"/></td></tr>\n"; | |
| 39 | - $sToRender .= "</table>\n"; | |
| 40 | - return $sToRender; | |
| 41 | -} | |
| 42 | - | |
| 43 | -// get add pages | |
| 44 | -function getSearchPage($unitID) { | |
| 45 | - global $default; | |
| 46 | - $sToRender .= renderHeading(_("Search For A User To Add")); | |
| 47 | - $sToRender .= "<table>\n"; | |
| 48 | - $sToRender .= "<tr><td colspan=\"2\">" . _("Please enter a VALID Username to search for in the text box below") . "</td></tr>\n"; | |
| 49 | - $sToRender .= "<tr>\n"; | |
| 50 | - $sToRender .= "<td>" . _("Username") . ": </td><td><input size = \"40\" type=\"text\" name=\"fName\"> </td>\n"; | |
| 51 | - $sToRender .= "</tr>\n"; | |
| 52 | - $sToRender .= "<tr>\n"; | |
| 53 | - $sToRender .= "</tr>\n"; | |
| 54 | - $sToRender .= "<tr>\n"; | |
| 55 | - $sToRender .= "</tr>\n"; | |
| 56 | - $sToRender .= "<td></td><td align = right><input type=\"image\" src =\"" . KTHtml::getSelectButton() . "\" value=\"Submit\" border=\"0\"/></td>\n"; | |
| 57 | - $sToRender .= "</table>\n"; | |
| 58 | - return $sToRender; | |
| 59 | -} | |
| 60 | - | |
| 61 | -function getDetailsDBPage($sUserName, $aAttributes) { | |
| 62 | - global $default; | |
| 63 | - $sToRender .= renderHeading(_("Add User To System")); | |
| 64 | - foreach ($aAttributes as $sUserName => $aUserAttributes) { | |
| 65 | - $sToRender .= "<table>\n"; | |
| 66 | - $sToRender .= "<tr><td><b>" . _("User Details") . ": </b></td></tr>\n"; | |
| 67 | - $sToRender .= "<tr>\n"; | |
| 68 | - $sToRender .= "<td>" . _("Username") . ": </td><td><input size = \"40\" type=\"text\" name=\"fUsername\" value = \"". $aUserAttributes["username"]. "\"> </td>\n"; | |
| 69 | - $sToRender .= "</tr>\n"; | |
| 70 | - $sToRender .= "<tr>\n"; | |
| 71 | - $sToRender .= "<td>" . _("Password") . ": </td><td><input size = \"40\" type=\"password\" name=\"fPassword\"></td>\n"; | |
| 72 | - $sToRender .= "</tr>\n"; | |
| 73 | - $sToRender .= "<tr>\n"; | |
| 74 | - $sToRender .= "<td>" . _("Name") . ": </td><td><input size = \"40\" type=\"text\" name=\"fName\" value = \"" . $aUserAttributes["name"] ."\"> </td>\n"; | |
| 75 | - $sToRender .= "</tr>\n"; | |
| 76 | - $sToRender .= "<tr>\n"; | |
| 77 | - $sToRender .= "<td>" . _("Email Address") . ": </td><td><input size = \"40\" type=\"text\" name=\"fEmail\" value = \"" . $aUserAttributes["email"] ."\"> </td>\n"; | |
| 78 | - $sToRender .= "</tr>\n"; | |
| 79 | - $sToRender .= "<tr>\n"; | |
| 80 | - $sToRender .= "<td>" . _("Mobile Number") . ": </td><td><input size = \"40\" type=\"text\" name=\"fMobile\" value = \"" . $aUserAttributes["mobile"] ."\"> </td>\n"; | |
| 81 | - $sToRender .= "</tr>\n"; | |
| 82 | - $sToRender .= "<tr>\n"; | |
| 83 | - $sToRender .= "<td>" . _("Email Notification") . ": </td><td><input type=\"checkbox\" name=\"fEmailNotification\" " . (isset($aUserAttributes["email_notification"]) ? "value=\"" . $aUserAttributes["email_notification"] . "\" " : "") . ($aUserAttributes["email_notification"] == "1" ? "checked" : "") . "> </td>\n"; | |
| 84 | - $sToRender .= "</tr>\n"; | |
| 85 | - $sToRender .= "<tr><td><b>" . _("Initial Group") . "</b></td><td>" . getGroupListBox() . "</td></tr>\n"; | |
| 86 | - $sToRender .= "<tr>\n"; | |
| 87 | - $sToRender .= "<td colspan=\"2\" align=\"right\">" . getAddButton() . getCancelButton("listUsers") . "</td>"; | |
| 88 | - $sToRender .= "</tr>\n"; | |
| 89 | - $sToRender .= "</table>\n"; | |
| 90 | - $sToRender .= getJavascriptValidation(); | |
| 91 | - } | |
| 92 | - return $sToRender; | |
| 93 | -} | |
| 94 | - | |
| 95 | -function getDetailsLDAPPage($sUserName, $aAttributes, $sUserIdentifier) { | |
| 96 | - global $default; | |
| 97 | - $sToRender .= renderHeading(_("Add User To System")); | |
| 98 | - foreach ($aAttributes as $sUserName => $aUserAttributes) { | |
| 99 | - $sToRender .= "<table>\n"; | |
| 100 | - $sToRender .= "<tr><td><b>" . _("User Details") . ": </b></td></tr>\n"; | |
| 101 | - $sToRender .= "<tr>\n"; | |
| 102 | - $sToRender .= "<td>" . _("LDAP DN") . ": </td><td><input " . ($default->bNN4 ? "onblur=\"disable(document.MainForm.fLdap)" : "DISABLED") . " size = \"40\" type=\"text\" name=\"fLdap\" value = \"". $aUserAttributes["dn"]. "\"> </td>\n"; | |
| 103 | - $sToRender .= "<input type=\"hidden\" name=\"fLdap\" value = \"". $aUserAttributes["dn"]. "\">\n"; | |
| 104 | - $sToRender .= "</tr>\n"; | |
| 105 | - $sToRender .= "<tr>\n"; | |
| 106 | - $sToRender .= "<td>" . _("Username") . ": </td><td><input " . ($default->bNN4 ? "onblur=\"disable(document.MainForm.fUsername)" : "DISABLED") . " size = \"40\" type=\"text\" name=\"fUsername\" value = \"" . $aUserAttributes[$sUserIdentifier] ."\"> </td>\n"; | |
| 107 | - $sToRender .= "<input type=\"hidden\" name=\"fUsername\" value = \"" . $aUserAttributes[$sUserIdentifier] ."\">\n"; | |
| 108 | - $sToRender .= "</tr>\n"; | |
| 109 | - $sToRender .= "<tr>\n"; | |
| 110 | - $sToRender .= "<td>" . _("Name") . ": </td><td><input size = \"40\" type=\"text\" name=\"fName\" value = \"" . $aUserAttributes["givenname"] ." " . $aUserAttributes["sn"] ."\"> </td>\n"; | |
| 111 | - $sToRender .= "</tr>\n"; | |
| 112 | - $sToRender .= "<tr>\n"; | |
| 113 | - $sDefaultEmail = KTUtil::arrayGet($aUserAttributes, "mail", KTUtil::arrayGet($aUserAttributes, "userPrincipalName", "")); | |
| 114 | - $sToRender .= "<td>" . _("Email Address") . ": </td><td><input size = \"40\" type=\"text\" name=\"fEmail\" value = \"" . $sDefaultEmail ."\"> </td>\n"; | |
| 115 | - $sToRender .= "</tr>\n"; | |
| 116 | - $sToRender .= "<tr>\n"; | |
| 117 | - $sToRender .= "<td>" . _("Mobile Number") . ": </td><td><input size = \"40\" type=\"text\" name=\"fMobile\" value = \"" . $aUserAttributes["mobile"] ."\"> </td>\n"; | |
| 118 | - $sToRender .= "</tr>\n"; | |
| 119 | - $sToRender .= "<tr>\n"; | |
| 120 | - $sToRender .= "<td>" . _("Email Notification") . ": </td><td><input type=\"checkbox\" name=\"fEmailNotification\" CHECKED/> </td>\n"; | |
| 121 | - $sToRender .= "</tr>\n"; | |
| 122 | - $sToRender .= "<tr>\n"; | |
| 123 | - $sToRender .= "<td>" . _("Sms Notification") . ": </td><td><input type=\"checkbox\" name=\"fSmsNotification\"/> </td>\n"; | |
| 124 | - $sToRender .= "</tr>\n"; | |
| 125 | - $sToRender .= "<tr><td><b>" . _("Initial Group") . "</b></td><td>" . getGroupListBox() . "</td></tr>\n"; | |
| 126 | - $sToRender .= "<tr>\n"; | |
| 127 | - $sToRender .= "<td colspan=\"2\" align=\"right\">" . getAddButton() . getCancelButton("listUsers") . "</td>"; | |
| 128 | - $sToRender .= "</tr>\n"; | |
| 129 | - $sToRender .= "</table>\n"; | |
| 130 | - $sToRender .= getJavascriptValidation(true); | |
| 131 | - } | |
| 132 | - return $sToRender; | |
| 133 | -} | |
| 134 | - | |
| 135 | -function getJavascriptValidation($bLdap = false) { | |
| 136 | - // validation starts | |
| 137 | - $sToRender .= "\n\n<script language=\"javascript\">\n<!--\n"; | |
| 138 | - $sToRender .= "function validateForm(theForm) {\n"; | |
| 139 | - // the username is disabled for adding users from a directory | |
| 140 | - if (!$bLdap) { | |
| 141 | - $sToRender .= "\tif (!(validRequired(theForm.fUsername, 'Username'))) {\n"; | |
| 142 | - $sToRender .= "\t\treturn false;\n\t}\n"; | |
| 143 | - } | |
| 144 | - $sToRender .= "\tif (!(validRequired(theForm.fName, 'User display name'))) {\n"; | |
| 145 | - $sToRender .= "\t\treturn false;\n\t}\n"; | |
| 146 | - $sToRender .= "\tif (!(validRequired(theForm.fPassword, 'Password'))) {\n"; | |
| 147 | - $sToRender .= "\t\treturn false;\n\t}\n"; | |
| 148 | - $sToRender .= "\tif (!(validRequired(theForm.fEmail, 'Email address'))) {\n"; | |
| 149 | - $sToRender .= "\t\treturn false;\n\t}\n"; | |
| 150 | - $sToRender .= "\tif (!(validRequired(theForm.fGroupID, 'Initial group'))) {\n"; | |
| 151 | - $sToRender .= "\t\treturn false;\n\t}\n"; | |
| 152 | - $sToRender .= "return true;\n}\n"; | |
| 153 | - $sToRender .= "//-->\n</script>\n\n"; | |
| 154 | - return $sToRender; | |
| 155 | -} | |
| 156 | - | |
| 157 | -function getPageSuccess() { | |
| 158 | - return statusPage(_("Add User To System"), _("Addition Successful!"), _("The User was successfully added to the System."), "addUser"); | |
| 159 | -} | |
| 160 | - | |
| 161 | -function getPageGroupFail() { | |
| 162 | - return statusPage(_("Add User To System"), _("Group Addition Unsuccessful!"), _("The user was succesfully added, but could not be assigned to the selected group."), "addUser"); | |
| 163 | -} | |
| 164 | - | |
| 165 | -function getPageFail() { | |
| 166 | - return statusPage(_("Add User To System"), _("Addition Unsuccessful") . "!", _("The user was not added because the selected User Name already exists."), "addUser"); | |
| 167 | -} | |
| 168 | - | |
| 169 | -function getPageUsernameNotFound() { | |
| 170 | - return statusPage(_("Add User To System"), _("Username not found!"), _("Your user search string did not match any users in the user directory."), "addUser"); | |
| 171 | -} | |
| 172 | - | |
| 173 | -function getAddButton() { | |
| 174 | - global $default; | |
| 175 | - return "<input type=\"image\" src =\"" . KTHtml::getAddButton() . "\" value=\"submit\" border=\"0\"/>\n"; | |
| 176 | -} | |
| 177 | - | |
| 178 | -function getGroupListBox() { | |
| 179 | - global $default; | |
| 180 | - if (Permission::userIsSystemAdministrator()) { | |
| 181 | - // if this is the system administrator, prepend group names with unit name | |
| 182 | - $oPatternListBox = & new PatternListBox($default->groups_table, "name", "id", "fGroupID"); | |
| 183 | - $oPatternListBox->setFromClause("LEFT OUTER JOIN groups_units_link GUL on ST.id=GUL.group_id " . | |
| 184 | - "LEFT OUTER JOIN units_lookup UL on GUL.unit_id=UL.id"); | |
| 185 | - $oPatternListBox->setCompositeDisplayName("DISTINCT COALESCE(CONCAT(CONCAT(UL.name, '-'),ST.name),ST.name)"); | |
| 186 | - } else if (Permission::userIsUnitAdministrator()) { | |
| 187 | - // else if this is a unit administrator, only display the groups in your unit | |
| 188 | - $oPatternListBox = & new PatternListBox($default->groups_table, "name", "id", "fGroupID"); | |
| 189 | - $oPatternListBox->setFromClause("INNER JOIN $default->groups_units_table GUL on ST.id=GUL.group_id"); | |
| 190 | - $oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"])); | |
| 191 | - } | |
| 192 | - return $oPatternListBox->render(); | |
| 193 | -} | |
| 194 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/editUserBL.php deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Edit user details. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -require_once("../../../../../config/dmsDefaults.php"); | |
| 29 | - | |
| 30 | -KTUtil::extractGPC('fSuccess', 'fUserID'); | |
| 31 | - | |
| 32 | -if (checkSession()) { | |
| 33 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 34 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | |
| 35 | - require_once("editUserUI.inc"); | |
| 36 | - require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | |
| 37 | - require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 38 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 39 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 40 | - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 41 | - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 42 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 43 | - | |
| 44 | - $oPatternCustom = & new PatternCustom(); | |
| 45 | - | |
| 46 | - if (isset($fUserID)){ | |
| 47 | - // post back on User select from manual edit page | |
| 48 | - $oPatternCustom->setHtml(getUserDetailsPage($fUserID)); | |
| 49 | - $_SESSION["pageAccess"][$default->rootUrl . '/presentation/lookAndFeel/knowledgeTree/store.php'] = true; | |
| 50 | - $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/store.php?fReturnURL=" . urlencode("$default->rootUrl/control.php?action=editUser&fSuccess=1")); | |
| 51 | - } else if ($fSuccess) { | |
| 52 | - $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 53 | - } else { | |
| 54 | - // if nothing happens...just reload edit page | |
| 55 | - $oPatternCustom->setHtml(getEditPage(null)); | |
| 56 | - $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 57 | - | |
| 58 | - } | |
| 59 | - //render the page | |
| 60 | - $main->setCentralPayload($oPatternCustom); | |
| 61 | - $main->render(); | |
| 62 | -} | |
| 63 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/editUserGroupsBL.php deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Edit user-group mappings. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -require_once("../../../../../config/dmsDefaults.php"); | |
| 29 | - | |
| 30 | -KTUtil::extractGPC('fAssign', 'fUserID', 'fUserSet', 'groupAddedLeft', 'groupAddedRight'); | |
| 31 | - | |
| 32 | -/* | |
| 33 | - * Update all User/Groups association | |
| 34 | - * Return 1 if success | |
| 35 | - * 0 if fail | |
| 36 | - */ | |
| 37 | -function updateGroups($iUserID, $aToAddIDs, $aToRemoveIDs) { | |
| 38 | - | |
| 39 | - $oUser = User::get($iUserID); | |
| 40 | - | |
| 41 | - foreach ($aToAddIDs as $iGroupID ) { | |
| 42 | - if ($iGroupID > 0) { | |
| 43 | - $oGroup = Group::get($iGroupID); | |
| 44 | - $oGroup->addMember($oUser); | |
| 45 | - } | |
| 46 | - } | |
| 47 | - | |
| 48 | - // Remove groups | |
| 49 | - foreach ($aToRemoveIDs as $iGroupID ) { | |
| 50 | - if ($iGroupID > 0) { | |
| 51 | - $oGroup = Group::get($iGroupID); | |
| 52 | - $oGroup->removeMember($oUser); | |
| 53 | - } | |
| 54 | - } | |
| 55 | - | |
| 56 | - return true; | |
| 57 | -} | |
| 58 | - | |
| 59 | -if (checkSession()) { | |
| 60 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 61 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | |
| 62 | - require_once("editUserGroupsUI.inc"); | |
| 63 | - require_once("$default->fileSystemRoot/lib/groups/Group.inc"); | |
| 64 | - require_once("$default->fileSystemRoot/lib/groups/GroupUtil.php"); | |
| 65 | - require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 66 | - require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | |
| 67 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 68 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 69 | - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 70 | - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 71 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 72 | - | |
| 73 | - $oPatternCustom = & new PatternCustom(); | |
| 74 | - | |
| 75 | - if(isset($fUserID)) { // isset($fUserSet)) | |
| 76 | - // do a check to see both drop downs selected | |
| 77 | - if($fUserID == -1) { | |
| 78 | - $oPatternCustom->setHtml(getPageNotSelected()); | |
| 79 | - } else { | |
| 80 | - $oPatternCustom->setHtml(renderGroupPicker($fUserID)); | |
| 81 | - $main->setOnLoadJavaScript("optGroup.init(document.forms[0]);"); | |
| 82 | - $main->setHasRequiredFields(false); | |
| 83 | - $main->setAdditionalJavaScript(initialiseOptionTransferJavaScript()); | |
| 84 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fUserID=$fUserID&fAssign=1"); | |
| 85 | - $main->setDHTMLScrolling(false); | |
| 86 | - | |
| 87 | - if (isset($fAssign)) { | |
| 88 | - | |
| 89 | - $aGroupToAddIDs = explode(",", $groupAddedLeft); | |
| 90 | - $aGroupToRemoveIDs = explode(",", $groupAddedRight); | |
| 91 | - | |
| 92 | - // Add/Remove new groups to user | |
| 93 | - if ( updateGroups($fUserID, $aGroupToAddIDs, $aGroupToRemoveIDs) ) { | |
| 94 | - // Redirect edit groups page | |
| 95 | - redirect($_SERVER["PHP_SELF"] . "?fUserID=$fUserID"); | |
| 96 | - } else { | |
| 97 | - $main->setErrorMessage(_("Some problems in updating groups") . ". " . _("Please contact your administrator") . "."); | |
| 98 | - } | |
| 99 | - } | |
| 100 | - } | |
| 101 | - } else { | |
| 102 | - // build first page | |
| 103 | - $oPatternCustom->setHtml(getPage(null)); | |
| 104 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fUserSet=1"); | |
| 105 | - } | |
| 106 | - | |
| 107 | - // render page | |
| 108 | - $main->setCentralPayload($oPatternCustom); | |
| 109 | - $main->render(); | |
| 110 | -} | |
| 111 | - | |
| 112 | - | |
| 113 | - | |
| 114 | -function initialiseOptionTransferJavascript() { | |
| 115 | - return "<script LANGUAGE=\"JavaScript\">\n" . | |
| 116 | - "var optGroup = new OptionTransfer(\"groupSelect\",\"chosenGroups\");\n" . | |
| 117 | - "optGroup.setAutoSort(true);\n" . | |
| 118 | - "optGroup.setDelimiter(\",\");\n" . | |
| 119 | - "optGroup.saveNewLeftOptions(\"groupNewLeft\");\n" . | |
| 120 | - "optGroup.saveNewRightOptions(\"groupNewRight\");\n" . | |
| 121 | - "optGroup.saveRemovedLeftOptions(\"groupRemovedLeft\");\n" . | |
| 122 | - "optGroup.saveRemovedRightOptions(\"groupRemovedRight\");\n" . | |
| 123 | - "optGroup.saveAddedLeftOptions(\"groupAddedLeft\");\n" . | |
| 124 | - "optGroup.saveAddedRightOptions(\"groupAddedRight\");\n" . | |
| 125 | - "</SCRIPT>"; | |
| 126 | -} | |
| 127 | - | |
| 128 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/editUserGroupsUI.inc deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Edit a users groups UI 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. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -// Create two listbox | |
| 29 | -function renderGroupPicker($iUserID){ | |
| 30 | - global $default; | |
| 31 | - | |
| 32 | - // change headings if User selected | |
| 33 | - if (isset($iUserID)) { | |
| 34 | - $oUser = User::get($iUserID); | |
| 35 | - } | |
| 36 | - | |
| 37 | - $sToRender .= renderHeading(_("Edit User Groups")); | |
| 38 | - | |
| 39 | - $sToRender .= "<table width=\"600\" border=0>"; | |
| 40 | - $sToRender .= "<tr><td width=100%><b>" . _("User Name") . ": </b>" . getUserDisplay($oUser) . "</td><td>"; | |
| 41 | - $sToRender .= "<a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a>"; | |
| 42 | - $sToRender .= "</td></tr>\n"; | |
| 43 | - $sToRender .= "</table>\n"; | |
| 44 | - | |
| 45 | - $sToRender .= "<table width=\"600\" border=0>"; | |
| 46 | - | |
| 47 | - // Headings | |
| 48 | - $sToRender .= "<tr>"; | |
| 49 | - $sToRender .= "<td ><strong>" . _("Assigned Groups") . "</strong></td>"; | |
| 50 | - $sToRender .= "<td></td>"; | |
| 51 | - $sToRender .= "<td ><strong>" . _("Available Groups") . "</strong></td>"; | |
| 52 | - $sToRender .= "</tr>"; | |
| 53 | - | |
| 54 | - // Initialise structure | |
| 55 | - $aInfoGroups = InitGroups($iUserID); | |
| 56 | - | |
| 57 | - // Select Boxes | |
| 58 | - $sToRender .= "<tr>"; | |
| 59 | - $sToRender .= "<td valign=\"top\" width=1%>\n"; | |
| 60 | - $sToRender .= "<select name=\"groupSelect\" size=\"10\" multiple>\n"; | |
| 61 | - // retrieve users' groups | |
| 62 | - $sToRender .= getUserGroups($aInfoGroups); | |
| 63 | - $sToRender .= "</select></td>"; | |
| 64 | - | |
| 65 | - // Move buttons | |
| 66 | - $sToRender .= "<td align=\"center\">"; | |
| 67 | - $sToRender .= "<input TYPE=\"button\" NAME=\"right\" style=\"width:60px\" VALUE=\"- >>\" ONCLICK=\"optGroup.transferRight()\">"; | |
| 68 | - $sToRender .= "<BR>"; | |
| 69 | - $sToRender .= "<input TYPE=\"button\" NAME=\"left\" style=\"width:60px\" VALUE=\"<< +\" ONCLICK=\"optGroup.transferLeft()\">"; | |
| 70 | - $sToRender .= "</td>"; | |
| 71 | - | |
| 72 | - $sToRender .= "<td valign=\"top\" width=1%>\n"; | |
| 73 | - $sToRender .= "<select name=\"chosenGroups\" size=\"10\" multiple>\n"; | |
| 74 | - // retrieve other groups | |
| 75 | - $sToRender .= getOtherGroups($aInfoGroups); | |
| 76 | - $sToRender .= "</select></td>"; | |
| 77 | - $sToRender .= "</tr>"; | |
| 78 | - | |
| 79 | - // Filter Button | |
| 80 | - $sToRender .= "<tr>"; | |
| 81 | - $sToRender .= "<td>" . _("Filter") . " <BR><input type=\"text\" name=\"filterUG\" onkeyup=\"optGroup.sortSelectMatch(groupSelect, this.value)\" onchange=\"optGroup.sortSelectMatch(groupSelect, this.value)\"></td>"; | |
| 82 | - $sToRender .= "<td></td>"; | |
| 83 | - $sToRender .= "<td>" . _("Filter") . " <BR><input type=\"text\" name=\"filterOG\" onkeyup=\"optGroup.sortSelectMatch(chosenGroups, this.value)\" onchange=\"optGroup.sortSelectMatch(chosenGroups, this.value)\"></td>"; | |
| 84 | - $sToRender .= "</tr>"; | |
| 85 | - | |
| 86 | - // Assign/Cancel button | |
| 87 | - $sToRender .= "<tr><td align=\"right\" colspan=\"3\">"; | |
| 88 | - $sToRender .= "<input type=\"image\" src=\"" . KTHtml::getAssignButton() . "\" border=\"0\" />"; | |
| 89 | - $sToRender .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?fUserID=" . $iUserID . "\"><img src=\"" . KTHtml::getCancelButton() ."\" border=\"0\"/></a>\n"; | |
| 90 | - $sToRender .= "</td></tr>"; | |
| 91 | - | |
| 92 | - | |
| 93 | - // Insert all user's groups | |
| 94 | - $sBgColor = "#F5F6EE"; | |
| 95 | - $sToRender .= "<tr>"; | |
| 96 | - $sToRender .= "<td colspan=\"3\"><strong>" . _("Current Groups") . "</strong><BR>"; | |
| 97 | - $sToRender .= "<table cellspacing=1 border=0>"; | |
| 98 | - for ($i=0; $i < count($aInfoGroups[0]); $i++) { | |
| 99 | - $oGroup = Group::get($aInfoGroups[0][$i]); | |
| 100 | - $sToRender .= "<tr><td>" . ($i+1) . "</td><td bgcolor=$sBgColor>". $oGroup->getName() ."</td></tr>\n"; | |
| 101 | - } | |
| 102 | - $sToRender .= "</table></td></tr>"; | |
| 103 | - | |
| 104 | - $sToRender .= "</table>"; | |
| 105 | - | |
| 106 | - $sToRender .= "<input type=\"hidden\" name=\"groupNewLeft\"/><br>"; | |
| 107 | - $sToRender .= "<input type=\"hidden\" name=\"groupNewRight\"/><br>"; | |
| 108 | - $sToRender .= "<input type=\"hidden\" name=\"groupRemovedLeft\"/><br>"; | |
| 109 | - $sToRender .= "<input type=\"hidden\" name=\"groupRemovedRight\"/><br>"; | |
| 110 | - $sToRender .= "<input type=\"hidden\" name=\"groupAddedLeft\"/><br>"; | |
| 111 | - $sToRender .= "<input type=\"hidden\" name=\"groupAddedRight\"/><br>"; | |
| 112 | - | |
| 113 | - return $sToRender; | |
| 114 | -} | |
| 115 | - | |
| 116 | - | |
| 117 | - | |
| 118 | - | |
| 119 | -/* Initialise some structures to build ui | |
| 120 | - * Return an array of: | |
| 121 | - * Current Users Group Ids | |
| 122 | - * UnitAdmin Manageable Group Ids | |
| 123 | -*/ | |
| 124 | -function InitGroups($iUserID) { | |
| 125 | - global $default; | |
| 126 | - | |
| 127 | - $aUserGroupIDs = array(); | |
| 128 | - $aManageableGroupIDs = array(); | |
| 129 | - | |
| 130 | - $oUser = User::get($iUserID); | |
| 131 | - $aGroups = GroupUtil::listGroupsForUser($oUser); | |
| 132 | - $aGroupIDs = array(); | |
| 133 | - foreach ($aGroups as $oGroup) { | |
| 134 | - $aGroupIDs[] = $oGroup->getID(); | |
| 135 | - } | |
| 136 | - | |
| 137 | - if (Permission::userIsUnitAdministrator()) { | |
| 138 | - /*ok*/ $sQuery = array("SELECT ST.id FROM " . $default->groups_table . " ST " . | |
| 139 | - "INNER JOIN " . $default->groups_units_table . " GUL on ST.id=GUL.group_id " . | |
| 140 | - "WHERE GUL.unit_id = ?", User::getUnitID($_SESSION["userID"])); | |
| 141 | - $sql = $default->db; | |
| 142 | - $sql->query($sQuery); | |
| 143 | - | |
| 144 | - while ($sql->next_record()) { | |
| 145 | - array_push($aManageableGroupIDs, $sql->f("id")); | |
| 146 | - } | |
| 147 | - } | |
| 148 | - | |
| 149 | - return array($aGroupIDs, $aManageableGroupIDs); | |
| 150 | -} | |
| 151 | - | |
| 152 | - | |
| 153 | -/* Get all groups of a user */ | |
| 154 | -function getUserGroups($aInfoGroups) { | |
| 155 | - | |
| 156 | - $aManageableGroupIDs = array(); | |
| 157 | - | |
| 158 | - if (Permission::userIsSystemAdministrator()) { | |
| 159 | - $aManageableGroupIDs = $aInfoGroups[0]; | |
| 160 | - } else if (Permission::userIsUnitAdministrator()) { | |
| 161 | - $aManageableGroupIDs = array_intersect($aInfoGroups[0], $aInfoGroups[1]); | |
| 162 | - } | |
| 163 | - | |
| 164 | - foreach ($aManageableGroupIDs as $iGroupID) { | |
| 165 | - $oGroup = Group::get($iGroupID); | |
| 166 | - $sToRender .= "<OPTION value=\"" . $oGroup->getID() . "\" onDblClick=\"optGroup.transferRight()\" >\n"; | |
| 167 | - $sToRender .= $oGroup->getName(); | |
| 168 | - $sToRender .= "</OPTION>\n"; | |
| 169 | - } | |
| 170 | - | |
| 171 | - return $sToRender; | |
| 172 | -} | |
| 173 | - | |
| 174 | - | |
| 175 | - | |
| 176 | - | |
| 177 | -// Get other group | |
| 178 | -function getOtherGroups($aInfoGroups) { | |
| 179 | - | |
| 180 | - $aOtherGroupIDs = array(); | |
| 181 | - $allGroupIDs = array(); | |
| 182 | - | |
| 183 | - if (Permission::userIsSystemAdministrator()) { | |
| 184 | - $allGroups = Group::getList("ORDER BY name");/*ok*/ | |
| 185 | - foreach ($allGroups as $oGroup) { | |
| 186 | - array_push($allGroupIDs, $oGroup->getID()); | |
| 187 | - } | |
| 188 | - $aOtherGroupIDs = array_diff($allGroupIDs, $aInfoGroups[0]); | |
| 189 | - | |
| 190 | - } else if (Permission::userIsUnitAdministrator()) { | |
| 191 | - $aOtherGroupIDs = array_diff($aInfoGroups[1], $aInfoGroups[0]); | |
| 192 | - } | |
| 193 | - | |
| 194 | - foreach ($aOtherGroupIDs as $iGroupID) { | |
| 195 | - $oGroup = Group::get($iGroupID); | |
| 196 | - $sToRender .= "<OPTION value=\"" . $oGroup->getID() . "\" onDblClick=\"optGroup.transferRight()\" >\n"; | |
| 197 | - $sToRender .= $oGroup->getName(); | |
| 198 | - $sToRender .= "</OPTION>\n"; | |
| 199 | - } | |
| 200 | - | |
| 201 | - return $sToRender; | |
| 202 | -} | |
| 203 | - | |
| 204 | - | |
| 205 | -// get page for removal | |
| 206 | -function getPage($iUserID) { | |
| 207 | - global $default; | |
| 208 | - $oUser = null; | |
| 209 | - $oGroup = null; | |
| 210 | - | |
| 211 | - // change headings if User selected | |
| 212 | - if (isset($iUserID)) { | |
| 213 | - $oUser = User::get($iUserID); | |
| 214 | - } else { | |
| 215 | - $heading = "<tr><td>" . _("Please select a User") . ":</td></tr>\n"; | |
| 216 | - } | |
| 217 | - | |
| 218 | - $sToRender .= renderHeading(_("Edit User Groups")); | |
| 219 | - $sToRender .= "<table>\n"; | |
| 220 | - $sToRender .= $heading; | |
| 221 | - $sToRender .= "<tr>\n"; | |
| 222 | - $sToRender .= "</tr>\n"; | |
| 223 | - $sToRender .= "<td>" . _("User Name") . ": " . getUserDisplay($oUser) . "</td>\n"; | |
| 224 | - $sToRender .= "<tr>\n"; | |
| 225 | - $sToRender .= "</tr>\n"; | |
| 226 | - $sToRender .= "<tr>\n"; | |
| 227 | - $sToRender .= "</tr>\n"; | |
| 228 | - $sToRender .= "<tr>\n"; | |
| 229 | - $sToRender .= "</tr>\n"; | |
| 230 | - $sToRender .= "</td></table>\n"; | |
| 231 | - | |
| 232 | - return $sToRender; | |
| 233 | -} | |
| 234 | - | |
| 235 | - | |
| 236 | -// show listbox of Users belonging to Users_Groups_link table | |
| 237 | -function getUserDisplay($oUser) { | |
| 238 | - global $default; | |
| 239 | - if (!isset($oUser)) { | |
| 240 | - $oPatternListBox = & new PatternListBox($default->users_table, "username", "id", "fUserID"); | |
| 241 | - if (Permission::userIsUnitAdministrator()) { | |
| 242 | - $oPatternListBox->setFromClause("INNER JOIN $default->users_groups_table UGL on ST.id=UGL.user_id " . | |
| 243 | - "INNER JOIN $default->groups_units_table GUL on UGL.group_id=GUL.group_id"); | |
| 244 | - $oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"])); | |
| 245 | - } | |
| 246 | - $oPatternListBox->setPostBackOnChange(true); | |
| 247 | - return $oPatternListBox->render(); | |
| 248 | - } else { | |
| 249 | - return "<input type=\"hidden\" name=\"fUserID\" value=\"" . $oUser->iId . "\">\n" . | |
| 250 | - $oUser->getUserName(); | |
| 251 | - } | |
| 252 | -} | |
| 253 | - | |
| 254 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/editUserUI.inc deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Edit user UI 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. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | -// if its the manual edit page..then display normally | |
| 28 | -function getEditPage($iUserID) { | |
| 29 | - global $default; | |
| 30 | - $oUser = null; | |
| 31 | - if (isset($iUserID)) { | |
| 32 | - $oUser = User::get($iUserID); | |
| 33 | - } | |
| 34 | - $sToRender .= renderHeading(_("Edit User Properties")); | |
| 35 | - $sToRender .= "<table>\n"; | |
| 36 | - $sToRender .= "<tr><td>" . _("Please select a User") . ": </td></tr>\n"; | |
| 37 | - $sToRender .= "<tr>\n"; | |
| 38 | - $sToRender .= "<td>" . _("Username") . ": </td><td>" . getUserDisplay($oUser) . "</td>\n"; | |
| 39 | - $sToRender .= "</tr>\n"; | |
| 40 | - $sToRender .= "<tr>\n"; | |
| 41 | - $sToRender .= "</tr>\n"; | |
| 42 | - $sToRender .= "<tr>\n"; | |
| 43 | - $sToRender .= "<tr>\n"; | |
| 44 | - $sToRender .= "</tr>\n"; | |
| 45 | - $sToRender .= "<tr><td colspan=\"2\" align=\"right\">" . getCancelButton($oUser) . "</td></tr>"; | |
| 46 | - $sToRender .= "</table>\n"; | |
| 47 | - | |
| 48 | - return $sToRender; | |
| 49 | -} | |
| 50 | - | |
| 51 | -function getUserDetailsPage($iUserID) { | |
| 52 | - | |
| 53 | - global $default; | |
| 54 | - $oUser = null; | |
| 55 | - | |
| 56 | - /*ok*/ $sQuery = array("SELECT * FROM $default->users_table WHERE id = ?", $iUserID); | |
| 57 | - $aDisplayColumns = array( "username","name","email", "mobile", "email_notification", "max_sessions"); | |
| 58 | - $aStoreColumns = array( "username","name","email", "mobile", "email_notification", "max_sessions") ; | |
| 59 | - $aColumnNames = array(_("Username") . ": ", _("Name") . ": ", _("Email Address") . ": ", _("Mobile Number") . ": ", _("Email Notification") . ": ", _("Max Sessions") . ": "); | |
| 60 | - $aDisplayColumnTypes = array(1,1,1,1,2,1,1,1,1); | |
| 61 | - $aDatabaseColumnTypes = array(1,1,1,1,2,1,1,1,1); | |
| 62 | - | |
| 63 | - // get list of User properties...name...text field...is_Sys_admin and is_unit_admin..checkboxes | |
| 64 | - $oPattern = & new PatternEditableListFromQuery($sQuery, $default->users_table, $aDisplayColumns, $aStoreColumns, $aColumnNames, $aDisplayColumnTypes, $aDatabaseColumnTypes) ; | |
| 65 | - $oPattern->setUniqueName("userEdit"); | |
| 66 | - $oPattern->setColumnsRequired(array(1,1,0,0,0,0)); | |
| 67 | - | |
| 68 | - $sToRender .= renderHeading(_("Edit User Properties")); | |
| 69 | - $sToRender .= "<table>\n"; | |
| 70 | - $sToRender .= "<tr></tr>\n"; | |
| 71 | - $sToRender .= "<tr>\n"; | |
| 72 | - $sToRender .= "<td>" . $oPattern->render() . "</td>\n"; | |
| 73 | - $sToRender .= "</tr>\n"; | |
| 74 | - $sToRender .= "<tr>\n"; | |
| 75 | - $sToRender .= "</tr>\n"; | |
| 76 | - $sToRender .= "<tr><td align = right><input type=\"image\" src =\"" . KTHtml::getUpdateButton() . "\" value=\"Update\" border=\"0\"/>\n"; | |
| 77 | - //$sToRender .= getCancelButton(User::get($iUserID)) . "</td></tr>"; | |
| 78 | - $sToRender .= getCancelButton(User::get($iUserID)); | |
| 79 | - if (strcmp($default->authenticationClass,"DBAuthenticator") == 0) { | |
| 80 | - //only update password if we are using the db | |
| 81 | - $sToRender .= "<a href=\"$default->rootUrl/control.php?action=userPasswordManagement&fUserID=$iUserID\"><img src =\"" . KTHtml::getUpdatePasswordButton() . "\" border=\"0\" /></td></tr>\n"; | |
| 82 | - } | |
| 83 | - $sToRender .= "</table>\n"; | |
| 84 | - | |
| 85 | - return $sToRender; | |
| 86 | -} | |
| 87 | - | |
| 88 | -// if edition is successful print otu success page | |
| 89 | -function getEditPageSuccess() { | |
| 90 | - global $default; | |
| 91 | - | |
| 92 | - $sToRender .= renderHeading(_("Edit User Properties")); | |
| 93 | - $sToRender .= "<table>\n"; | |
| 94 | - $sToRender .= "<tr><td><b>" . _("Success") . "!</b></td></tr>\n"; | |
| 95 | - $sToRender .= "<tr></tr>\n"; | |
| 96 | - $sToRender .= "<tr><td>" . _("The User was successfully modified") . "</td></tr>\n"; | |
| 97 | - $sToRender .= "<tr></tr>\n"; | |
| 98 | - $sToRender .= "<tr></tr>\n"; | |
| 99 | - $sToRender .= "<tr>\n"; | |
| 100 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listUsers&\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td>\n"; | |
| 101 | - $sToRender .= "</tr>\n"; | |
| 102 | - $sToRender .= "</table>\n"; | |
| 103 | - | |
| 104 | - | |
| 105 | - return $sToRender; | |
| 106 | -} | |
| 107 | - | |
| 108 | - | |
| 109 | -// gets the page if edition fails | |
| 110 | -function getEditPageFail() { | |
| 111 | - global $default; | |
| 112 | - | |
| 113 | - $sToRender .= renderHeading(_("Edit User Properties")); | |
| 114 | - $sToRender .= "<table>\n"; | |
| 115 | - $sToRender .= "<tr><td><b>" . strtoupper(_("Failure")) . "!</b></td></tr>\n"; | |
| 116 | - $sToRender .= "<tr></tr>\n"; | |
| 117 | - $sToRender .= "<tr><td>" . _("User modification Failed!") . "</td></tr>\n"; | |
| 118 | - $sToRender .= "<tr></tr>\n"; | |
| 119 | - $sToRender .= "<tr></tr>\n"; | |
| 120 | - $sToRender .= "<tr>\n"; | |
| 121 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=editUser\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td>\n"; | |
| 122 | - $sToRender .= "</tr>\n"; | |
| 123 | - $sToRender .= "</table>\n"; | |
| 124 | - | |
| 125 | - | |
| 126 | - return $sToRender; | |
| 127 | -} | |
| 128 | - | |
| 129 | -// show the list box when no User selected | |
| 130 | -// then shows a text box with the User's name | |
| 131 | -function getUserDisplay($oUser) { | |
| 132 | - global $default; | |
| 133 | - if (!isset($oUser)) { | |
| 134 | - $oPatternListBox = & new PatternListBox($default->users_table, "username", "id", "fUserID"); | |
| 135 | - $oPatternListBox->setPostBackOnChange(true); | |
| 136 | - return $oPatternListBox->render(); | |
| 137 | - } else { | |
| 138 | - return "<input type=\"hidden\" name=\"fUserID\" value=\"" . $oUser->iId . "\">\n" . | |
| 139 | - "<input size = \"40\" type=\"text\" name=\"fUserName\" value=\"" . $oUser->getUserName() . "\">"; | |
| 140 | - } | |
| 141 | - | |
| 142 | -} | |
| 143 | - | |
| 144 | - | |
| 145 | -// gets the updatebutton when a User is selected | |
| 146 | -function getUpdateButton($oUser) { | |
| 147 | - global $default; | |
| 148 | - if (!isset($oUser)) { | |
| 149 | - return "<td align = right><input type=\"image\" src =\"" . KTHtml::getUpdateButton() . "\" value=\"submit\" border=\"0\"/></td>\n"; | |
| 150 | - } | |
| 151 | -} | |
| 152 | - | |
| 153 | -// gets the cancel button when a User is selected | |
| 154 | -function getCancelButton($oUser) { | |
| 155 | - global $default; | |
| 156 | - if (!isset($oUser)) { | |
| 157 | - return "<a href=\"$default->rootUrl/control.php?action=userManagement\"><img src =\"" . KTHtml::getCancelButton() . "\" value=\"cancel\" border=\"0\"/></a>\n"; | |
| 158 | - } else { | |
| 159 | - return "<a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"" . KTHtml::getCancelButton() . "\" border=\"0\" /></a>\n"; | |
| 160 | - } | |
| 161 | -} | |
| 162 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/listUsersBL.php deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * List users. | |
| 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 Omar Rahbeeni, Jam Warehouse (Pty) Ltd, South Africa | |
| 25 | - * @package administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -require_once("../../../../../config/dmsDefaults.php"); | |
| 29 | - | |
| 30 | -KTUtil::extractGPC('fGroupID', 'fName'); | |
| 31 | - | |
| 32 | -require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 33 | -require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | |
| 34 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 35 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | |
| 36 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 37 | -require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 38 | -require_once("listUsersUI.inc"); | |
| 39 | -require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/administration/adminUI.inc"); | |
| 40 | - | |
| 41 | -if (checkSession()) { | |
| 42 | - $oPatternCustom = & new PatternCustom(); | |
| 43 | - if (Permission::userIsUnitAdministrator() && !$fGroupID) { | |
| 44 | - // #3519 select a group in your unit if you're a unit administrator and none has been selected | |
| 45 | - $sql = $default->db; | |
| 46 | - /*ok*/ $sQuery = array("SELECT group_id FROM $default->groups_units_table WHERE unit_id = ? ORDER BY group_id", User::getUnitID($_SESSION["userID"])); | |
| 47 | - $sql->query($sQuery); | |
| 48 | - if ($sql->next_record()) { | |
| 49 | - $fGroupID = $sql->f("group_id"); | |
| 50 | - } | |
| 51 | - } else { | |
| 52 | - $default->log->info("fGroupID=$fGroupID"); | |
| 53 | - } | |
| 54 | - $oPatternCustom->setHtml(getPage($fGroupID, $fName)); | |
| 55 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 56 | - $main->setCentralPayload($oPatternCustom); | |
| 57 | - $main->setFormAction($_SERVER['PHP_SELF']); | |
| 58 | - $main->render(); | |
| 59 | -} | |
| 60 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/listUsersUI.inc deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * List users UI 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. | |
| 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 Omar Rahbeeni, Jam Warehouse (Pty) Ltd, South Africa | |
| 25 | - * @package administration.usermanagement | |
| 26 | - */ | |
| 27 | -function getGroupDisplay($iGroupID) { | |
| 28 | - global $default; | |
| 29 | - if (Permission::userIsSystemAdministrator()) { | |
| 30 | - // if this is the system administrator, prepend group names with unit name | |
| 31 | - $oPatternListBox = & new PatternListBox($default->groups_table, "name", "id", "fGroupID"); | |
| 32 | - $oPatternListBox->setFromClause("LEFT OUTER JOIN groups_units_link GUL on ST.id=GUL.group_id " . | |
| 33 | - "LEFT OUTER JOIN units_lookup UL on GUL.unit_id=UL.id"); | |
| 34 | - $oPatternListBox->setCompositeDisplayName("COALESCE(CONCAT(CONCAT(UL.name, '-'),ST.name),ST.name)"); | |
| 35 | - } else if (Permission::userIsUnitAdministrator()) { | |
| 36 | - // else if this is a unit administrator, only display the groups in your unit | |
| 37 | - $oPatternListBox = & new PatternListBox($default->groups_table, "name", "id", "fGroupID"); | |
| 38 | - $oPatternListBox->setFromClause("INNER JOIN $default->groups_units_table GUL on ST.id=GUL.group_id"); | |
| 39 | - $oPatternListBox->setWhereClause("GUL.unit_id IN (" . implode(",", User::getUnitIDs($_SESSION["userID"])) . ")"); | |
| 40 | - $oPatternListBox->setIncludeDefaultValue(false); | |
| 41 | - } | |
| 42 | - $oPatternListBox->setPostBackOnChange(true); | |
| 43 | - if ($iGroupID != 0) { | |
| 44 | - $oPatternListBox->setSelectedValue($iGroupID); | |
| 45 | - } | |
| 46 | - | |
| 47 | - return "<table><tr><td><b>" . _("Filter By Group") . " </b></td><td>" . $oPatternListBox->render() . "</td></tr></table>"; | |
| 48 | -} | |
| 49 | - | |
| 50 | -function getNameDisplay($sName) { | |
| 51 | - return "<table><tr><td><b>" . _("Filter By Name") . " </b></td><td><input type=\"text\" size=\"20\" name=\"fName\" value=\"$sName\" /> <input type=\"button\" value=\"Go\" onCLick=\"document.MainForm.submit()\"></td></tr></table>"; | |
| 52 | -} | |
| 53 | - | |
| 54 | -function getUsers($iGroupID, $sName) { | |
| 55 | - global $default; | |
| 56 | - // changed from inner to outer joins to include users that aren't in any groups (Stefano Ciancio [s.ciancio@pisa.iol.it]) | |
| 57 | - $aParam = array(); | |
| 58 | - /*ok*/ $sQuery = "SELECT DISTINCT U.id as userid, U.name as name, U.username, " . | |
| 59 | - "'Edit' AS \"Edit\", 'Delete' AS \"Delete\", 'Edit Groups' AS \"Edit Groups\" " . | |
| 60 | - "FROM $default->users_table U " . | |
| 61 | - "LEFT OUTER JOIN $default->users_groups_table UGL ON U.id = UGL.user_id " . | |
| 62 | - "LEFT OUTER JOIN $default->groups_table GL ON UGL.group_id = GL.id "; | |
| 63 | - // filter by group | |
| 64 | - if ($iGroupID) { | |
| 65 | - $sWhereClause = "WHERE UGL.group_id = ? "; | |
| 66 | - $aParams[] = $iGroupID; | |
| 67 | - } | |
| 68 | - // filter by name | |
| 69 | - if ($sName) { | |
| 70 | - $sWhereClause = "WHERE U.name like '%" . DBUtil::escapeSimple($sName) . "%' "; | |
| 71 | - } | |
| 72 | - // #2978 don't display sys admin accounts if you're not a sysadmin | |
| 73 | - if (!Permission::userIsSystemAdministrator()) { | |
| 74 | - $sRestrictUsers = " GL.is_sys_admin = 0 "; | |
| 75 | - if (strlen($sWhereClause) > 0) { | |
| 76 | - $sWhereClause .= " AND $sRestrictUsers"; | |
| 77 | - } else { | |
| 78 | - $sWhereClause = "WHERE $sRestrictUsers"; | |
| 79 | - } | |
| 80 | - } | |
| 81 | - $sQuery .= $sWhereClause . "ORDER BY U.username"; | |
| 82 | - | |
| 83 | - $aColumns = array("name", "username", "Edit", "Delete", "Edit Groups"); | |
| 84 | - $aColumnNames = array(_("Name"), _("Username"), _("Edit"), _("Delete"), _("Edit Groups")); | |
| 85 | - $aColumnTypes = array(1,1,3,3,3); | |
| 86 | - $aDBColumnArray = array("userid"); | |
| 87 | - $aQueryStringVariableNames = array("fUserID"); | |
| 88 | - | |
| 89 | - $aHyperLinkURL = array( 2=> "$default->rootUrl/control.php?action=editUser", | |
| 90 | - 3=> "$default->rootUrl/control.php?action=removeUser", | |
| 91 | - 4=> "$default->rootUrl/control.php?action=editUserGroups"); | |
| 92 | - | |
| 93 | - $oSearchResults = & new PatternTableSqlQuery(array($sQuery, $aParams), $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | |
| 94 | - $oSearchResults->setDisplayColumnHeadings(true); | |
| 95 | - return $oSearchResults->render() ; | |
| 96 | -} | |
| 97 | - | |
| 98 | -function getPage($iGroupID, $sName) { | |
| 99 | - global $default; | |
| 100 | - $sToRender .= renderHeading(_("User Management")); | |
| 101 | - | |
| 102 | - // add user link if you're a sysadmin | |
| 103 | - if (Permission::userIsSystemAdministrator()) { | |
| 104 | - $sToRender .= getAddLink("addUser", _("Add A User")); | |
| 105 | - } | |
| 106 | - $sToRender .= getGroupDisplay($iGroupID); | |
| 107 | - $sToRender .= getNameDisplay($sName); | |
| 108 | - $sToRender .= getUsers($iGroupID, $sName); | |
| 109 | - return $sToRender; | |
| 110 | -} | |
| 111 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/passwordManagementBL.php deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Change a user's password | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -require_once("../../../../../config/dmsDefaults.php"); | |
| 29 | - | |
| 30 | -KTUtil::extractGPC('fForUpdate', 'fNewPassword', 'fNewPasswordConfirm', 'fUserID'); | |
| 31 | - | |
| 32 | -if (checkSession()) { | |
| 33 | - require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | |
| 34 | - require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 35 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 36 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 37 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 38 | - require_once("passwordManagementUI.inc"); | |
| 39 | - | |
| 40 | - $oPatternCustom = & new PatternCustom(); | |
| 41 | - | |
| 42 | - if (strcmp($default->authenticationClass,"DBAuthenticator") == 0) { | |
| 43 | - //only update passwords if we are in db authentication mode | |
| 44 | - if (isset($fUserID)){ | |
| 45 | - if (Permission::userIsSystemAdministrator()) { | |
| 46 | - $oUser = User::get($fUserID); | |
| 47 | - //only the administrator is allowed to change passwords here | |
| 48 | - if (isset($fForUpdate)) { | |
| 49 | - //execute the update and return to the edit page?? | |
| 50 | - if (strlen($fNewPassword) > 0 && strlen($fNewPasswordConfirm) > 0) { | |
| 51 | - //if passwords have been entered | |
| 52 | - if (strcmp($fNewPassword, $fNewPasswordConfirm) == 0) { | |
| 53 | - //if the password and its confirmation are the same | |
| 54 | - $oUser->setPassword($fNewPassword); | |
| 55 | - if ($oUser->update()) { | |
| 56 | - //successful update | |
| 57 | - $oPatternCustom->setHtml(getPasswordUpdateSuccessPage()); | |
| 58 | - } else { | |
| 59 | - //update failed | |
| 60 | - $oPatternCustom->setHtml(getPage($oUser->getName())); | |
| 61 | - $main->setErrorMessage(_("An error occured while attempting to update the user's password")); | |
| 62 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForUpdate=1&fUserID=$fUserID"); | |
| 63 | - } | |
| 64 | - } else { | |
| 65 | - $oPatternCustom->setHtml(getPage($oUser->getName())); | |
| 66 | - $main->setErrorMessage(_("The password and its confirmation do not match. Please try again.")); | |
| 67 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForUpdate=1&fUserID=$fUserID"); | |
| 68 | - } | |
| 69 | - } else { | |
| 70 | - $oPatternCustom->setHtml(getPage($oUser->getName())); | |
| 71 | - $main->setErrorMessage(_("Blank passwords are not valid. Please try again.")); | |
| 72 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForUpdate=1&fUserID=$fUserID"); | |
| 73 | - } | |
| 74 | - } else { | |
| 75 | - //show the page | |
| 76 | - $oPatternCustom->setHtml(getPage($oUser->getName())); | |
| 77 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForUpdate=1&fUserID=$fUserID"); | |
| 78 | - } | |
| 79 | - } else { | |
| 80 | - $main->setErrorMessage(_("Only an administrator can update a user password from here")); | |
| 81 | - } | |
| 82 | - } | |
| 83 | - } else { | |
| 84 | - $oPatternCustom->setHtml(getPage($oUser->getName())); | |
| 85 | - $main->setErrorMessage(_("Passwords can only be update in Knowledgew Tree when authentication is against the MySQL database, not against an LDAP server")); | |
| 86 | - $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 87 | - } | |
| 88 | - //render the page | |
| 89 | - $main->setCentralPayload($oPatternCustom); | |
| 90 | - $main->render(); | |
| 91 | -} | |
| 92 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/passwordManagementUI.inc deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Updaate user password | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -function getPage($sUserName) { | |
| 29 | - global $default; | |
| 30 | - $sToRender = renderHeading(_("Update user password")); | |
| 31 | - $sToRender .= "<br>\n"; | |
| 32 | - $sToRender .= "<table cellpadding=\"5\">\n"; | |
| 33 | - $sToRender .= "<tr>\n"; | |
| 34 | - $sToRender .= "<td bgcolor=\"6699FF\">" . _("User name") . ": </td>\n"; | |
| 35 | - $sToRender .= "<td bgcolor=\"F5F6EE\">$sUserName</td>\n"; | |
| 36 | - $sToRender .= "</tr>\n"; | |
| 37 | - $sToRender .= "<tr>\n"; | |
| 38 | - $sToRender .= "<td bgcolor=\"6699FF\">" . _("New password") . ": </td>\n"; | |
| 39 | - $sToRender .= "<td><input type=\"password\" name=\"fNewPassword\"></td>\n"; | |
| 40 | - $sToRender .= "</tr>\n"; | |
| 41 | - $sToRender .= "<tr>\n"; | |
| 42 | - $sToRender .= "<td bgcolor=\"6699FF\">" . _("Confirm password") . ": </td>\n"; | |
| 43 | - $sToRender .= "<td bgcolor=\"F5F6EE\"><input type=\"password\" name=\"fNewPasswordConfirm\"></td>\n"; | |
| 44 | - $sToRender .= "</tr>\n"; | |
| 45 | - $sToRender .= "<tr>\n"; | |
| 46 | - $sToRender .= "</tr>\n"; | |
| 47 | - $sToRender .= "<tr>\n"; | |
| 48 | - $sToRender .= "<td colspan=\"2\" align=\"right\">"; | |
| 49 | - $sToRender .= "<td align = right><input type=\"image\" src =\"" . KTHtml::getUpdateButton() . "\" value=\"Update\" border=\"0\"/>"; | |
| 50 | - $sToRender .= "<a href=\"$default->rootUrl/control.php?action=userManagement\"><img src =\"" . KTHtml::getCancelButton() . "\" value=\"cancel\" border=\"0\"/></a>\n"; | |
| 51 | - $sToRender .= "</tr>\n"; | |
| 52 | - $sToRender .= "</table>\n"; | |
| 53 | - | |
| 54 | - return $sToRender; | |
| 55 | - | |
| 56 | -} | |
| 57 | - | |
| 58 | -function getPasswordUpdateSuccessPage() { | |
| 59 | - global $default; | |
| 60 | - | |
| 61 | - $sToRender .= renderHeading(_("Update user password")); | |
| 62 | - $sToRender .= "<br>\n"; | |
| 63 | - $sToRender .= "<table>\n"; | |
| 64 | - $sToRender .= "<tr><td>" . _("The user's password was successfully updated") . ".</td></tr>\n"; | |
| 65 | - $sToRender .= "<tr></tr>\n"; | |
| 66 | - $sToRender .= "<tr></tr>\n"; | |
| 67 | - $sToRender .= "<tr>\n"; | |
| 68 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=userManagement\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td>\n"; | |
| 69 | - $sToRender .= "</tr>\n"; | |
| 70 | - $sToRender .= "</table>\n"; | |
| 71 | - | |
| 72 | - | |
| 73 | - return $sToRender; | |
| 74 | -} | |
| 75 | - | |
| 76 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/removeUserBL.php deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Remove a user. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | - | |
| 28 | -require_once("../../../../../config/dmsDefaults.php"); | |
| 29 | - | |
| 30 | -KTUtil::extractGPC('fForDeleteConfirmed', 'fUserID', 'fUserName'); | |
| 31 | - | |
| 32 | -if (checkSession()) { | |
| 33 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 34 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | |
| 35 | - require_once("removeUserUI.inc"); | |
| 36 | - require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 37 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 38 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 39 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 40 | - | |
| 41 | - $oPatternCustom = & new PatternCustom(); | |
| 42 | - | |
| 43 | - // get main page | |
| 44 | - if (isset($fUserID)) { | |
| 45 | - $oPatternCustom->setHtml(getDeleteConfirmedPage($fUserID)); | |
| 46 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDeleteConfirmed=1"); | |
| 47 | - } else { | |
| 48 | - $oPatternCustom->setHtml(getDeletePage(null)); | |
| 49 | - $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 50 | - } | |
| 51 | - | |
| 52 | - if (isset($fForDeleteConfirmed)) { | |
| 53 | - //get User object | |
| 54 | - $oUser = User::get($fUserID); | |
| 55 | - $oUser->setUserName($fUserName); | |
| 56 | - | |
| 57 | - //delete from all groups | |
| 58 | - $oUser->deleteFromSystem(); | |
| 59 | - | |
| 60 | - //delete the User object | |
| 61 | - if ($oUser->delete()) { | |
| 62 | - $oPatternCustom->setHtml(getDeleteSuccessPage()); | |
| 63 | - } else { | |
| 64 | - $oPatternCustom->setHtml(getDeleteFailPage()); | |
| 65 | - } | |
| 66 | - } | |
| 67 | - | |
| 68 | - $main->setCentralPayload($oPatternCustom); | |
| 69 | - $main->render(); | |
| 70 | -} | |
| 71 | -?> |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/removeUserUI.inc deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Remove user UI 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. | |
| 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 administration.usermanagement | |
| 26 | - */ | |
| 27 | -// gets the delete stuff | |
| 28 | -function getDeletePage($iUserID) { | |
| 29 | - global $default; | |
| 30 | - $oUser = null; | |
| 31 | - if (isset($iUserID)) { | |
| 32 | - $oUser = User::get($iUserID); | |
| 33 | - $sHeading .= "<tr><td><b>" . _("Are you sure you wish to remove this user?") . ":</b></td></tr>\n"; | |
| 34 | - } else { | |
| 35 | - $sHeading .= "<tr><td><b>" . _("Please select a user") . ":</b></td></tr>\n"; | |
| 36 | - } | |
| 37 | - | |
| 38 | - $sToRender .= renderHeading(_("Remove User")); | |
| 39 | - $sToRender .= "<table>\n"; | |
| 40 | - $sToRender .= $sHeading; | |
| 41 | - $sToRender .= "<tr></tr>\n"; | |
| 42 | - $sToRender .= "<tr>\n"; | |
| 43 | - $sToRender .= "<td>User Name: " . getUserDisplay($oUser) . "</td>\n"; | |
| 44 | - $sToRender .= "</tr>\n"; | |
| 45 | - $sToRender .= "<tr>\n"; | |
| 46 | - $sToRender .= "</tr>\n"; | |
| 47 | - $sToRender .= "<tr>\n"; | |
| 48 | - $sToRender .= "</tr>\n"; | |
| 49 | - $sToRender .= "<tr>\n"; | |
| 50 | - $sToRender .= "</tr>\n"; | |
| 51 | - $sToRender .= "</table>\n"; | |
| 52 | - | |
| 53 | - return $sToRender; | |
| 54 | -} | |
| 55 | - | |
| 56 | -// get successfully deletion page | |
| 57 | -function getDeleteSuccessPage() { | |
| 58 | - | |
| 59 | - global $default; | |
| 60 | - | |
| 61 | - $sToRender .= renderHeading(_("Remove User")); | |
| 62 | - $sToRender .= "<table>\n"; | |
| 63 | - $sToRender .= "<tr>\n"; | |
| 64 | - $sToRender .= "<td><b>" . _("User SuccessFully Removed!") . "</b></td>\n"; | |
| 65 | - $sToRender .= "</tr>\n"; | |
| 66 | - $sToRender .= "<tr></tr>\n"; | |
| 67 | - $sToRender .= "<tr></tr>\n"; | |
| 68 | - $sToRender .= "<tr></tr>\n"; | |
| 69 | - $sToRender .= "<tr></tr>\n"; | |
| 70 | - $sToRender .= "<tr>\n"; | |
| 71 | - $sToRender .= "<td align = right><a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td>\n"; | |
| 72 | - $sToRender .= "</tr>\n"; | |
| 73 | - $sToRender .= "</table>\n"; | |
| 74 | - | |
| 75 | - return $sToRender; | |
| 76 | -} | |
| 77 | - | |
| 78 | -// get deletion failed page | |
| 79 | -function getDeleteFailPage() { | |
| 80 | - | |
| 81 | - global $default; | |
| 82 | - | |
| 83 | - $sToRender .= renderHeading(_("Remove User")); | |
| 84 | - $sToRender .= "<table>\n"; | |
| 85 | - $sToRender .= "<tr>\n"; | |
| 86 | - $sToRender .= "<td><b>" . _("Deletion Failed!") . "</b></td>\n"; | |
| 87 | - $sToRender .= "</tr>\n"; | |
| 88 | - $sToRender .= "<tr></tr>\n"; | |
| 89 | - $sToRender .= "</tr>\n"; | |
| 90 | - $sToRender .= "<tr><td align = right><a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"" . KTHtml::getBackButton() . "\" border = \"0\" /></a></td></tr>\n"; | |
| 91 | - $sToRender .= "</table>\n"; | |
| 92 | - | |
| 93 | - return $sToRender; | |
| 94 | -} | |
| 95 | - | |
| 96 | - | |
| 97 | -function getDeleteConfirmedPage($iUserID) { | |
| 98 | - global $default; | |
| 99 | - $oUser = null; | |
| 100 | - if (isset($iUserID)) { | |
| 101 | - $oUser = User::get($iUserID); | |
| 102 | - } | |
| 103 | - | |
| 104 | - $sToRender .= renderHeading(_("Remove User")); | |
| 105 | - $sToRender .= "<table>\n"; | |
| 106 | - $sToRender .= "<tr><td><b>" . _("Are you sure you wish to remove this user?") . ":</b></td></tr>"; | |
| 107 | - $sToRender .= "<tr><td>" . _("Note: This User will be Removed from ALL Groups as well") . "\n</td></tr>\n"; | |
| 108 | - $sToRender .= "<tr>\n"; | |
| 109 | - $sToRender .= "<td>" . _("User Name") . ": " . getUserDisplay($oUser) . "</td>\n"; | |
| 110 | - $sToRender .= "</tr>\n"; | |
| 111 | - $sToRender .= "<tr>\n"; | |
| 112 | - $sToRender .= getUserDetails($oUser). "</td>\n"; | |
| 113 | - $sToRender .= "</tr>\n"; | |
| 114 | - $sToRender .= "<tr>\n"; | |
| 115 | - $sToRender .= "</tr>\n"; | |
| 116 | - $sToRender .= "<tr>\n"; | |
| 117 | - $sToRender .= "</tr>\n"; | |
| 118 | - $sToRender .= "<tr>\n"; | |
| 119 | - $sToRender .= "<td></td>" . getDeleteButton($oUser); | |
| 120 | - $sToRender .= "</tr>\n"; | |
| 121 | - $sToRender .= "</table>\n"; | |
| 122 | - | |
| 123 | - | |
| 124 | - return $sToRender; | |
| 125 | -} | |
| 126 | - | |
| 127 | - | |
| 128 | -// show listbox...or the text name | |
| 129 | -function getUserDisplay($oUser) { | |
| 130 | - global $default; | |
| 131 | - if (!isset($oUser)) { | |
| 132 | - $oPatternListBox = & new PatternListBox($default->users_table, "username", "id", "fUserID"); | |
| 133 | - $oPatternListBox->setIncludeDefaultValue(true); | |
| 134 | - $oPatternListBox->setPostBackOnChange(true); | |
| 135 | - return $oPatternListBox->render(); | |
| 136 | - } else { | |
| 137 | - return "<input type=\"hidden\" name=\"fUserID\" value=\"" . $oUser->iId . "\">\n" . | |
| 138 | - "<td><b>" . $oUser->getUserName() . "</b>"; | |
| 139 | - } | |
| 140 | -} | |
| 141 | - | |
| 142 | -// show listbox...or the text name | |
| 143 | -function getUserDetails($oUser) { | |
| 144 | - global $default; | |
| 145 | - if (!isset($oUser)) { | |
| 146 | - return ""; | |
| 147 | - } else { | |
| 148 | - return | |
| 149 | - "<tr>\n". | |
| 150 | - "<td>" . _("Name") . ": </td><td>". $oUser->getName() . "</td>\n" . | |
| 151 | - "</tr>\n". | |
| 152 | - "<tr>\n". | |
| 153 | - "<td>" . _("Email Address") . ": </td><td>". $oUser->getEmail() . "</td>\n" . | |
| 154 | - "</tr>\n". | |
| 155 | - "<tr>\n". | |
| 156 | - "<td>" . _("Mobile Number") . ": </td><td>". $oUser->getMobile() . "</td>\n" . | |
| 157 | - "</tr>\n"; | |
| 158 | - } | |
| 159 | -} | |
| 160 | - | |
| 161 | - | |
| 162 | -// show delete button | |
| 163 | -function getDeleteButton($oUser) { | |
| 164 | - global $default; | |
| 165 | - return "<td align = right><input type=\"image\" src =\"" . KTHtml::getDeleteButton() . "\" value=\"submit\" border=\"0\"/></td>\n". | |
| 166 | - "<td><a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"" . KTHtml::getCancelButton() . "\" border=\"0\" /></a></td>\n"; | |
| 167 | -} | |
| 168 | - | |
| 169 | - | |
| 170 | -// show cancel button | |
| 171 | -function getCancelButton($oUser) { | |
| 172 | - global $default; | |
| 173 | - if (!isset($oUser)) { | |
| 174 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=userAdministration\"><img src =\"" . KTHtml::getCancelButton() . "\" value=\"cancel\" /></a></td>\n"; | |
| 175 | - } | |
| 176 | - else { | |
| 177 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=removeUser\"><img src =\"" . KTHtml::getCancelButton() . "\" border = \"0\" /></a></td>\n"; | |
| 178 | - } | |
| 179 | -} | |
| 180 | - | |
| 181 | -?> |