From: Ben Klang Date: Fri, 21 Oct 2005 05:38:19 +0000 (+0000) Subject: Updated project to match new webserver layout X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a00cb9e210c339bd026827864e4dee424e6cd33a;p=horde.git Updated project to match new webserver layout Removed some unnecessary tests Began work on some of the FIXMEs Immediate goal: Get ready for Tuesday demo. User subsystem MUST be 100%! git-svn-id: https://svn.alkaloid.net/gpl/shout/trunk@75 06cd67b6-e706-0410-b29e-9de616bca6e9 --- diff --git a/andrew.webprj b/andrew.webprj index 33443e0d1..b55c2db93 100644 --- a/andrew.webprj +++ b/andrew.webprj @@ -9,11 +9,11 @@ - + - + @@ -47,19 +47,66 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + templates/ + toolbars/ Ben Klang ben@alkaloid.net No Debugger *~; - templates/ - toolbars/ diff --git a/lib/Driver/ldap.php b/lib/Driver/ldap.php index 94472671a..9f5830df4 100644 --- a/lib/Driver/ldap.php +++ b/lib/Driver/ldap.php @@ -628,9 +628,22 @@ for $context")); function saveUser($context, $extension, $userdetails) { # FIXME: Add test to make sure we aren't duplicating the extension + $res = ldap_search($this->_LDAP, SHOUT_USERS_BRANCH.','.$this->_params['basedn'], + "(&(objectClass=asteriskUser)(voiceMailbox=". + $userdetails['newextension']."))"); + $res = ldap_get_entries($this->_LDAP, $res); + if ($res['count'] > 0) { + # The extension already exists. Do some sanity checking to make + # sure we know we're modifying an existing user + # FIXME + } # FIXME Access Control/Authorization - + if (!Shout::checkRights("shout:contexts:$context:users", + PERMS_DELETE, 1)) { + return PEAR::raiseError("No permission to modify users in this " . + "context."); + } $ldapKey = &$this->_ldapKey; $appKey = &$this->_appKey; diff --git a/lib/Shout.php b/lib/Shout.php index 4955fa80c..b8cbd6688 100644 --- a/lib/Shout.php +++ b/lib/Shout.php @@ -28,7 +28,7 @@ class Shout $menu = &new Menu(HORDE_MENU_MASK_ALL); - if (isset($context) && isset($section) && $section == "users" && + if (isset($context) && $section == "users" && Shout::checkRights("shout:contexts:$context:users", PERMS_EDIT, 1)) { $url = Horde::applicationUrl("users.php"); @@ -89,6 +89,7 @@ class Shout function &getTabs($context, &$vars) { global $shout; + # FIXME Is this right? if (!Auth::isAdmin("shout", PERMS_SHOW|PERMS_READ)) { return false; } @@ -99,7 +100,7 @@ class Shout if (Shout::checkRights("$permprefix:users", null, 1) && $shout->checkContextType($context, "users")) { - $tabs->addTab(_("Users"), + $tabs->addTab(_("Users"), Horde::applicationUrl("index.php?context=$context"), 'users'); } @@ -152,7 +153,7 @@ class Shout */ function checkRights($permname, $permmask = null, $numparents = 0) { - if ($permmask == null) { + if ($permmask === null) { $permmask = PERMS_SHOW|PERMS_READ; }