From: Michael M Slusarz Date: Wed, 14 Oct 2009 10:54:21 +0000 (-0600) Subject: Track Horde_Auth:: username changes X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8472cb4e8a8c57b9f9a4a3c71f9933ede673726e;p=horde.git Track Horde_Auth:: username changes --- diff --git a/fima/lib/Fima.php b/fima/lib/Fima.php index 7862a83ba..a7e3404cb 100644 --- a/fima/lib/Fima.php +++ b/fima/lib/Fima.php @@ -722,7 +722,7 @@ class Fima { $identity = &Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $share = &$GLOBALS['fima_shares']->newShare(Horde_Auth::getAuth()); $share->set('name', sprintf(_("%s's Ledger"), $name)); diff --git a/fima/lib/Forms/DeleteLedger.php b/fima/lib/Forms/DeleteLedger.php index 477dbd674..77e05c276 100644 --- a/fima/lib/Forms/DeleteLedger.php +++ b/fima/lib/Forms/DeleteLedger.php @@ -73,7 +73,7 @@ class Fima_DeleteLedgerForm extends Horde_Form { $identity = &Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $ledger = &$GLOBALS['fima_shares']->newShare(Horde_Auth::getAuth()); if (is_a($ledger, 'PEAR_Error')) { diff --git a/folks/account/resetpassword.php b/folks/account/resetpassword.php index 29574937c..685c6855d 100644 --- a/folks/account/resetpassword.php +++ b/folks/account/resetpassword.php @@ -50,7 +50,7 @@ $form->setButtons(_("Continue")); // Get user security pass $user = Horde_Util::getFormData('username'); if ($user) { - $u_prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', Horde_Auth::addHook($user), '', null, false); + $u_prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', Horde_Auth::convertUsername($user, true), '', null, false); $u_prefs->retrieve(); $answer = $u_prefs->getValue('security_answer'); $question = $u_prefs->getValue('security_question'); diff --git a/folks/lib/Folks.php b/folks/lib/Folks.php index 294dab5fe..44e8fea38 100644 --- a/folks/lib/Folks.php +++ b/folks/lib/Folks.php @@ -262,7 +262,7 @@ class Folks { static public function getUserEmail($user) { // We should always realy on registration data - // $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'horde', Horde_Auth::addHook($user), '', null, false); + // $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'horde', Horde_Auth::convertUsername($user, true), '', null, false); // $prefs->retrieve(); // $email = $prefs->getValue('alternate_email') ? $prefs->getValue('alternate_email') : $prefs->getValue('from_addr'); diff --git a/folks/lib/Friends.php b/folks/lib/Friends.php index b33e69296..0d6d5a883 100644 --- a/folks/lib/Friends.php +++ b/folks/lib/Friends.php @@ -144,7 +144,7 @@ class Folks_Friends { return (boolean)$GLOBALS['prefs']->getValue('friends_approval'); } - $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'folks', Horde_Auth::addHook($user), '', null, false); + $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'folks', Horde_Auth::convertUsername($user, true), '', null, false); $prefs->retrieve(); return (boolean)$prefs->getValue('friends_approval'); diff --git a/folks/perms.php b/folks/perms.php index 5cb942153..212fcbe16 100644 --- a/folks/perms.php +++ b/folks/perms.php @@ -48,7 +48,7 @@ case 'editform': // Process owner and owner permissions. $old_owner = $share->get('owner'); - $new_owner = Horde_Auth::addHook(Horde_Util::getFormData('owner', $old_owner)); + $new_owner = Horde_Auth::convertUsername(Horde_Util::getFormData('owner', $old_owner), true); if ($old_owner !== $new_owner && !empty($new_owner)) { if ($old_owner != Horde_Auth::getAuth() && !Horde_Auth::isAdmin()) { $notification->push(_("Only the owner or system administrator may change ownership or owner permissions for a share"), 'horde.error'); @@ -133,7 +133,7 @@ case 'editform': foreach ($u_names as $key => $user) { // Apply backend hooks - $user = Horde_Auth::addHook($user); + $user = Horde_Auth::convertUsername($user, true); // If the user is empty, or we've already set permissions // via the owner_ options, don't do anything here. if (empty($user) || $user == $new_owner) { diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index dd9d7344f..8046f62d6 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -200,7 +200,7 @@ class IMP_Auth /* Determine the unique user name. */ if (Horde_Auth::getAuth()) { - $_SESSION['imp']['uniquser'] = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $_SESSION['imp']['uniquser'] = Horde_Auth::getOriginalAuth(); } else { $_SESSION['imp']['uniquser'] = $credentials['userId']; if (!empty($ptr['realm'])) { diff --git a/ingo/lib/base.php b/ingo/lib/base.php index 60667d057..e21cb4b06 100644 --- a/ingo/lib/base.php +++ b/ingo/lib/base.php @@ -71,7 +71,7 @@ if ($driver->supportShares()) { $identity = &Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $share = &$GLOBALS['ingo_shares']->newShare($signature); $share->set('name', $name); diff --git a/kronolith/lib/Forms/DeleteCalendar.php b/kronolith/lib/Forms/DeleteCalendar.php index 179ecaecc..66d8f2596 100644 --- a/kronolith/lib/Forms/DeleteCalendar.php +++ b/kronolith/lib/Forms/DeleteCalendar.php @@ -70,7 +70,7 @@ class Kronolith_DeleteCalendarForm extends Horde_Form { $identity = &Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $calendar = &$GLOBALS['kronolith_shares']->newShare(Horde_Auth::getAuth()); if (is_a($calendar, 'PEAR_Error')) { diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index ee4b37b68..718dc0c1a 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -151,7 +151,7 @@ class Kronolith foreach ($GLOBALS['all_calendars'] as $id => $calendar) { $owner = $calendar->get('owner') == Horde_Auth::getAuth(); $code['conf']['calendars']['internal'][$id] = array( - 'name' => ($owner ? '' : '[' . Horde_Auth::removeHook($calendar->get('owner')) . '] ') + 'name' => ($owner ? '' : '[' . Horde_Auth::convertUsername($calendar->get('owner'), false) . '] ') . $calendar->get('name'), 'owner' => $owner, 'fg' => self::foregroundColor($calendar), @@ -868,7 +868,7 @@ class Kronolith $identity = &Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $share = &$GLOBALS['kronolith_shares']->newShare(Horde_Auth::getAuth()); $share->set('name', sprintf(_("%s's Calendar"), $name)); diff --git a/kronolith/perms.php b/kronolith/perms.php index 2bc78612e..519a717f9 100644 --- a/kronolith/perms.php +++ b/kronolith/perms.php @@ -48,12 +48,12 @@ case 'editform': // Process owner and owner permissions. $old_owner = $share->get('owner'); - $new_owner = Horde_Auth::addHook(Horde_Util::getFormData('owner_select', Horde_Util::getFormData('owner_input', $old_owner))); + $new_owner = Horde_Auth::convertUsername(Horde_Util::getFormData('owner_select', Horde_Util::getFormData('owner_input', $old_owner)), true); if ($old_owner !== $new_owner && !empty($new_owner)) { if ($old_owner != Horde_Auth::getAuth() && !Horde_Auth::isAdmin()) { $notification->push(_("Only the owner or system administrator may change ownership or owner permissions for a share"), 'horde.error'); } elseif ($auth->hasCapability('list') && !$auth->exists($new_owner)) { - $notification->push(sprintf(_("The user \"%s\" does not exist."), Auth::removeHook($new_owner)), 'horde.error'); + $notification->push(sprintf(_("The user \"%s\" does not exist."), Auth::convertUsername($new_owner, false)), 'horde.error'); } else { $share->set('owner', $new_owner); $share->save(); @@ -151,14 +151,14 @@ case 'editform': foreach ($u_names as $key => $user) { // Apply backend hooks - $user = Horde_Auth::addHook($user); + $user = Horde_Auth::convertUsername($user, true); // If the user is empty, or we've already set permissions // via the owner_ options, don't do anything here. if (empty($user) || $user == $new_owner) { continue; } if ($auth->hasCapability('list') && !$auth->exists($user)) { - $notification->push(sprintf(_("The user \"%s\" does not exist."), Auth::removeHook($user)), 'horde.error'); + $notification->push(sprintf(_("The user \"%s\" does not exist."), Auth::convertUsername($user, false)), 'horde.error'); continue; } diff --git a/kronolith/templates/panel.inc b/kronolith/templates/panel.inc index 8f5b4f72c..9f6119021 100644 --- a/kronolith/templates/panel.inc +++ b/kronolith/templates/panel.inc @@ -109,7 +109,7 @@ $ta->attach();

diff --git a/kronolith/templates/perms/perms.inc b/kronolith/templates/perms/perms.inc index 48f6db786..ac6e9ade9 100644 --- a/kronolith/templates/perms/perms.inc +++ b/kronolith/templates/perms/perms.inc @@ -28,14 +28,14 @@ - + @@ -181,7 +181,7 @@ $uperm) { if ($user != $owner) { - $user = Horde_Auth::removeHook($user); + $user = Horde_Auth::convertUsername($user, false); ?> @@ -218,8 +218,8 @@ foreach ($userperms as $user => $uperm) { diff --git a/nag/lib/Forms/DeleteTaskList.php b/nag/lib/Forms/DeleteTaskList.php index aa077b814..b071975cf 100644 --- a/nag/lib/Forms/DeleteTaskList.php +++ b/nag/lib/Forms/DeleteTaskList.php @@ -74,7 +74,7 @@ class Nag_DeleteTaskListForm extends Horde_Form { $identity = &Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $tasklist = &$GLOBALS['nag_shares']->newShare(Horde_Auth::getAuth()); if (is_a($tasklist, 'PEAR_Error')) { diff --git a/nag/lib/Nag.php b/nag/lib/Nag.php index b4e237621..9697869ee 100644 --- a/nag/lib/Nag.php +++ b/nag/lib/Nag.php @@ -666,7 +666,7 @@ class Nag $identity = Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $share = $GLOBALS['nag_shares']->newShare(Horde_Auth::getAuth()); $share->set('name', sprintf(_("%s's Task List"), $name)); diff --git a/nag/tasklists/info.php b/nag/tasklists/info.php index 6f3369b60..777629576 100644 --- a/nag/tasklists/info.php +++ b/nag/tasklists/info.php @@ -25,7 +25,7 @@ $subscribe_url = Horde::url($registry->get('webroot', 'horde') . '/rpc.php/nag/' $identity = Identity::singleton('none', $tasklist->get('owner')); $owner_name = $identity->getValue('fullname'); if (trim($owner_name) == '') { - $owner_name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $owner_name = Horde_Auth::getOriginalAuth(); } diff --git a/nag/templates/panel.inc b/nag/templates/panel.inc index 812596e60..f4e20b50e 100644 --- a/nag/templates/panel.inc +++ b/nag/templates/panel.inc @@ -81,7 +81,7 @@ document.observe('dom:loaded', function() {

diff --git a/skoli/templates/panel.inc b/skoli/templates/panel.inc index 3bfda7d7d..c00adf785 100644 --- a/skoli/templates/panel.inc +++ b/skoli/templates/panel.inc @@ -62,7 +62,7 @@ function sbarToggle()

diff --git a/turba/lib/Turba.php b/turba/lib/Turba.php index 182b4936f..ad8d3d0f8 100644 --- a/turba/lib/Turba.php +++ b/turba/lib/Turba.php @@ -530,7 +530,7 @@ class Turba { $identity = Identity::singleton(); $name = $identity->getValue('fullname'); if (trim($name) == '') { - $name = Horde_Auth::removeHook(Horde_Auth::getAuth()); + $name = Horde_Auth::getOriginalAuth(); } $name = sprintf(_("%s's Address Book"), $name); } else {