Use Horde_Core_Factory_Identity directly, change name of factory method
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 16:48:56 +0000 (12:48 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 7 Oct 2010 16:54:55 +0000 (12:54 -0400)
50 files changed:
agora/messages/abuse.php
agora/messages/index.php
ansel/image.php
ansel/lib/Ansel.php
ansel/lib/Form/Ecard.php
ansel/lib/Gallery.php
ansel/lib/Image.php
ansel/lib/Report.php
ansel/lib/View/List.php
ansel/rss.php
folks/lib/Notification.php
framework/Alarm/lib/Horde/Alarm/Handler/Mail.php
framework/Core/lib/Horde/Core/Binder/Identity.php [deleted file]
framework/Core/lib/Horde/Core/Factory/Alarm.php
framework/Core/lib/Horde/Core/Factory/Identity.php
framework/Core/lib/Horde/Core/Prefs/Ui.php
framework/Core/package.xml
hermes/lib/Hermes.php
horde/admin/user.php
horde/scripts/import_squirrelmail_prefs.php
horde/services/confirm.php
horde/services/portal/index.php
horde/services/portal/mobile.php
horde/services/problem.php
imp/attachment.php
imp/lib/Ui/Message.php
ingo/lib/Api.php
ingo/lib/Application.php
ingo/vacation.php
jonah/stories/share.php
kronolith/attendees.php
kronolith/feed/index.php
kronolith/lib/FreeBusy.php
kronolith/lib/Kronolith.php
kronolith/lib/View/EditEvent.php
kronolith/scripts/agenda.php
mnemo/lib/Forms/DeleteNotepad.php
mnemo/lib/Mnemo.php
nag/lib/Forms/task.php
nag/lib/Nag.php
nag/tasklists/info.php
trean/lib/Trean.php
turba/lib/Driver/Group.php
turba/lib/Turba.php
whups/lib/Mail.php
whups/lib/Ticket.php
whups/lib/Whups.php
wicked/lib/Page.php
wicked/lib/Page/StandardPage.php
wicked/lib/Wicked.php

index 24740b4..4f6b9ab 100644 (file)
@@ -54,7 +54,7 @@ if ($form->validate()) {
     /* Collect moderators emails, and send them the notify */
     $emails = array();
     foreach ($forum['moderators'] as $moderator) {
-        $identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($moderator);
+        $identity = $injector->getInstance('Horde_Core_Factory_Identity')->create($moderator);
         $address = $identity->getValue('from_addr');
         if (!empty($address)) {
             $emails[] = $address;
index 991c608..0fe04b4 100644 (file)
@@ -74,7 +74,7 @@ $view = new Agora_View();
 if (!$view_bodies) {
     /* Get the author's avatar. */
     if ($conf['avatar']['allow_avatars']) {
-        $identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($message['message_author']);
+        $identity = $injector->getInstance('Horde_Core_Factory_Identity')->create($message['message_author']);
         $avatar_path = $identity->getValue('avatar_path');
         $message_author_avatar = Agora::validateAvatar($avatar_path) ? Agora::getAvatarUrl($avatar_path) : false;
         $view->message_author_avatar = $message_author_avatar;
index d9d5778..51993ef 100644 (file)
@@ -28,7 +28,7 @@ $date = Ansel::getDateParameter();
 
 /* Are we watermarking the image? */
 if ($watermark) {
-    $identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
+    $identity = $injector->getInstance('Horde_Core_Factory_Identity')->create();
     $name = $identity->getValue('fullname');
     if (empty($name)) {
         $name = $registry->getAuth();
index dae0b17..7f84bd9 100644 (file)
@@ -586,7 +586,7 @@ class Ansel
                 ));
                 $fullname = $uprefs->getValue('grouptitle');
                 if (!$fullname) {
-                    $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($owner);
+                    $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($owner);
                     $fullname = $identity->getValue('fullname');
                     if (!$fullname) {
                         $fullname = $owner;
index aeb80c1..e498c0e 100644 (file)
@@ -23,7 +23,7 @@ class Ansel_Form_Ecard extends Horde_Form {
         if (empty($user)) {
             $this->addVariable(_("Use the following return address:"), 'ecard_retaddr', 'text', true);
         } else {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
             $from_addr = $identity->getDefaultFromAddress();
             $vars->set('ecard_retaddr', $from_addr);
             $this->addHidden('', 'ecard_retaddr', 'text', true);
index e927431..5a664b7 100644 (file)
@@ -465,7 +465,7 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical
      */
     public function getIdentity()
     {
-        return $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($this->data['share_owner']);
+        return $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($this->data['share_owner']);
     }
 
     /**
index 2e780df..e85ac12 100644 (file)
@@ -982,7 +982,7 @@ class Ansel_Image Implements Iterator
             $font = $GLOBALS['prefs']->getValue('watermark_font');
         }
         if (empty($watermark)) {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
             $name = $identity->getValue('fullname');
             if (empty($name)) {
                 $name = $GLOBALS['registry']->getAuth();
index d599250..55994bb 100644 (file)
@@ -55,7 +55,7 @@ class Ansel_Report {
      */
     function _getUserEmail($user = null)
     {
-        return $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user)->getValue('from_addr');
+        return $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user)->getValue('from_addr');
     }
 
     /**
index ae41a84..b7f3bde 100644 (file)
@@ -155,7 +155,7 @@ class Ansel_View_List extends Ansel_View_Base
                 ));
                 $fullname = $uprefs->getValue('grouptitle');
                 if (!$fullname) {
-                    $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($this->_owner);
+                    $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($this->_owner);
                     $fullname = $identity->getValue('fullname');
                     if (!$fullname) {
                         $fullname = $this->_owner;
index 573976a..4008a51 100644 (file)
@@ -147,7 +147,7 @@ if (empty($rss)) {
                  Horde::logMessage($e->getMessage(), 'ERR');
             }
             if (count($images)) {
-                $owner = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($id);
+                $owner = $injector->getInstance('Horde_Core_Factory_Identity')->create($id);
                 $name = $owner->getValue('fullname');
                 $author = $owner->getValue('from_addr');
                 if (!$name) {
index 710de67..2f6c4d4 100644 (file)
@@ -221,7 +221,7 @@ class Folks_Notification {
      */
     protected function _getUserFromAddr($user)
     {
-        return $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user)->getValue('from_addr');
+        return $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user)->getValue('from_addr');
     }
 
     /**
index 4668214..dc5da33 100644 (file)
@@ -47,7 +47,7 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler
                 throw new Horde_Alarm_Exception('Parameter \'' . $param . '\' missing.');
             }
         }
-        if (!method_exists($params['identity'], 'getIdentity')) {
+        if (!method_exists($params['identity'], 'create')) {
             throw new Horde_Alarm_Exception('Parameter \'identity\' does not implement getIdentity().');
         }
         if (!($params['mail'] instanceof Horde_Mail_Transport)) {
diff --git a/framework/Core/lib/Horde/Core/Binder/Identity.php b/framework/Core/lib/Horde/Core/Binder/Identity.php
deleted file mode 100644 (file)
index 5516717..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/**
- * @category Horde
- * @package  Core
- */
-class Horde_Core_Binder_Identity implements Horde_Injector_Binder
-{
-    public function create(Horde_Injector $injector)
-    {
-        return new Horde_Core_Factory_Identity($injector);
-    }
-
-    public function equals(Horde_Injector_Binder $binder)
-    {
-        return false;
-    }
-}
index a4e6a90..ee6e22c 100644 (file)
@@ -68,7 +68,7 @@ class Horde_Core_Factory_Alarm
         */
 
         $handler_params = array(
-            'identity' => $injector->getInstance('Horde_Prefs_Identity'),
+            'identity' => $injector->getInstance('Horde_Core_Factory_Identity'),
             'mail' => $injector->getInstance('Horde_Mail'),
         );
         $alarm->addHandler('mail', new Horde_Alarm_Handler_Mail($handler_params));
index b838fdb..038a984 100644 (file)
@@ -61,7 +61,7 @@ class Horde_Core_Factory_Identity
      * @return Horde_Identity  The singleton identity instance.
      * @throws Horde_Exception
      */
-    public function getIdentity($user = null, $driver = null)
+    public function create($user = null, $driver = null)
     {
         global $injector, $prefs, $registry;
 
index 8577ba6..b6ee271 100644 (file)
@@ -735,7 +735,7 @@ class Horde_Core_Prefs_Ui
      */
     protected function _identityHeader($members)
     {
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity(null, $this->app);
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create(null, $this->app);
         $default_identity = $identity->getDefault();
 
         $t = $GLOBALS['injector']->createInstance('Horde_Template');
@@ -807,7 +807,7 @@ class Horde_Core_Prefs_Ui
     {
         global $conf, $notification, $prefs;
 
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity(null, $this->app);
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create(null, $this->app);
 
         if ($this->vars->delete_identity) {
             $id = intval($this->vars->id);
index e14a346..1bc8f49 100644 (file)
@@ -113,7 +113,6 @@ Application Framework.</description>
        <file name="Auth.php" role="php" />
        <file name="AuthFactory.php" role="php" />
        <file name="AuthSignup.php" role="php" />
-       <file name="Identity.php" role="php" />
        <file name="Logger.php" role="php" />
        <file name="Mail.php" role="php" />
        <file name="Mapper.php" role="php" />
@@ -426,7 +425,6 @@ Application Framework.</description>
    <install as="Horde/Core/Binder/Auth.php" name="lib/Horde/Core/Binder/Auth.php" />
    <install as="Horde/Core/Binder/AuthFactory.php" name="lib/Horde/Core/Binder/AuthFactory.php" />
    <install as="Horde/Core/Binder/AuthSignup.php" name="lib/Horde/Core/Binder/AuthSignup.php" />
-   <install as="Horde/Core/Binder/Identity.php" name="lib/Horde/Core/Binder/Identity.php" />
    <install as="Horde/Core/Binder/Logger.php" name="lib/Horde/Core/Binder/Logger.php" />
    <install as="Horde/Core/Binder/Mail.php" name="lib/Horde/Core/Binder/Mail.php" />
    <install as="Horde/Core/Binder/Mapper.php" name="lib/Horde/Core/Binder/Mapper.php" />
index d2f0f5d..a39bea0 100644 (file)
@@ -137,7 +137,7 @@ class Hermes {
             if (isset($namecache[$emp])) {
                 $emp = $namecache[$emp];
             } else {
-                $ident = $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($emp);
+                $ident = $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($emp);
                 $fullname = $ident->getValue('fullname');
                 if ($fullname) {
                     $namecache[$emp] = $emp = $fullname;
@@ -176,7 +176,7 @@ class Hermes {
 
         $employees = array();
         foreach ($users as $user) {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
             $label = $identity->getValue('fullname');
             if (empty($label)) {
                 $label = $user;
index 2f857ee..b340f17 100644 (file)
@@ -176,7 +176,7 @@ case 'update':
         }
     }
 
-    $identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($user_name_1);
+    $identity = $injector->getInstance('Horde_Core_Factory_Identity')->create($user_name_1);
     $identity->setValue('fullname', $fullname);
     $identity->setValue('from_addr', $email);
     $identity->save();
@@ -226,7 +226,7 @@ require HORDE_TEMPLATES . '/common-header.inc';
 require HORDE_TEMPLATES . '/admin/menu.inc';
 
 if (isset($update_form) && $auth->hasCapability('list')) {
-    $identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($f_user_name);
+    $identity = $injector->getInstance('Horde_Core_Factory_Identity')->create($f_user_name);
     require HORDE_TEMPLATES . '/admin/user/update.inc';
 } elseif (isset($remove_form) &&
           $auth->hasCapability('list') &&
index 54ad658..34e8ac7 100644 (file)
@@ -26,7 +26,7 @@ function savePrefs($user, $basename, $prefs_cache)
 
     // Import identities
     if (isset($prefs_cache['identities']) && $prefs_cache['identities'] > 1) {
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user, 'imp');
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user, 'imp');
         // Intentionally off-by-one
         for ($i = 1; $i < $prefs_cache['identities']; $i++) {
             $new_identity = array('id' => 'Identity #' . ($i + 1),
index 827b1ca..ee4aeea 100644 (file)
@@ -14,6 +14,6 @@
 require_once dirname(__FILE__) . '/../lib/Application.php';
 Horde_Registry::appInit('horde', array('nologintasks' => true));
 
-$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity()->confirmIdentity(Horde_Util::getFormData('h'));
+$identity = $injector->getInstance('Horde_Core_Factory_Identity')->create()->confirmIdentity(Horde_Util::getFormData('h'));
 
 Horde::getServiceLink('prefs')->add('group', 'identities')->redirect();
index 6531b96..b63dd00 100644 (file)
@@ -63,7 +63,7 @@ $title = _("My Portal");
 require HORDE_TEMPLATES . '/common-header.inc';
 echo Horde::menu();
 echo '<div id="menuBottom">';
-echo htmlspecialchars($injector->getInstance('Horde_Prefs_Identity')->getIdentity()->getName());
+echo htmlspecialchars($injector->getInstance('Horde_Core_Factory_Identity')->create()->getName());
 if (!$prefs->isLocked('portal_layout')) {
     echo ' | <a href="' . Horde::url('services/portal/edit.php') . '">' . _("Add Content") . '</a>';
 }
index ea1cf31..0b85f67 100644 (file)
@@ -13,7 +13,7 @@
 require_once dirname(__FILE__) . '/../../lib/Application.php';
 Horde_Registry::appInit('horde');
 
-$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
+$identity = $injector->getInstance('Horde_Core_Factory_Identity')->create();
 $fullname = $identity->getValue('fullname');
 if (empty($fullname)) {
     $fullname = $registry->getAuth();
index a822938..62d2c1d 100644 (file)
@@ -22,7 +22,7 @@ if (!Horde_Menu::showService('problem')) {
     _returnToPage();
 }
 
-$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
+$identity = $injector->getInstance('Horde_Core_Factory_Identity')->create();
 $email = $identity->getValue('from_addr');
 if (!$email) {
     $email = Horde_Util::getFormData('email', $registry->getAuth());
index 72ba93b..791f7c5 100644 (file)
@@ -75,7 +75,7 @@ if ($conf['compose']['link_attachments_notify']) {
                 'user' => $mail_user
             ));
 
-            $mail_identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($mail_user);
+            $mail_identity = $injector->getInstance('Horde_Core_Factory_Identity')->create($mail_user);
             $mail_address = $mail_identity->getDefaultFromAddress();
 
             /* Ignore missing addresses, which are returned as <>. */
index 2da9534..afbdc7d 100644 (file)
@@ -133,7 +133,7 @@ class IMP_Ui_Message
                 $GLOBALS['injector']->getInstance('IMP_Mail'),
                 array(
                     'charset' => 'UTF-8',
-                    'from_addr' => $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity()->getDefaultFromAddress()
+                    'from_addr' => $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create()->getDefaultFromAddress()
                 )
             );
             IMP_Maillog::log('mdn', $msg_id, 'displayed');
index 4756b82..c47bf0b 100644 (file)
@@ -127,7 +127,7 @@ class Ingo_Api extends Horde_Registry_Api
 
         /* Make sure we have at least one address. */
         if (empty($info['addresses'])) {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
             /* Remove empty lines. */
             $info['addresses'] = preg_replace('/\n{2,}/', "\n", implode("\n", $identity->getAll('from_addr')));
             if (empty($addresses)) {
index e273576..47e859c 100644 (file)
@@ -70,7 +70,7 @@ class Ingo_Application extends Horde_Registry_Application
             /* If personal share doesn't exist then create it. */
             $signature = $_SESSION['ingo']['backend']['id'] . ':' . $GLOBALS['registry']->getAuth();
             if (!$GLOBALS['ingo_shares']->exists($signature)) {
-                $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+                $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
                 $name = $identity->getValue('fullname');
                 if (trim($name) == '') {
                     $name = $GLOBALS['registry']->getAuth('original');
index 71a8f74..e3321d3 100644 (file)
@@ -103,7 +103,7 @@ $form->appendButtons(_("Return to Rules List"));
 
 /* Make sure we have at least one address. */
 if (!$vacation->getVacationAddresses()) {
-    $identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
+    $identity = $injector->getInstance('Horde_Core_Factory_Identity')->create();
     $addresses = implode("\n", $identity->getAll('from_addr'));
     /* Remove empty lines. */
     $addresses = preg_replace('/\n+/', "\n", $addresses);
index 16de655..e52ac19 100644 (file)
@@ -83,7 +83,7 @@ $form->addHidden('', 'channel_id', 'int', false);
 $form->addHidden('', 'id', 'int', false);
 $v = &$form->addVariable(_("From"), 'from', 'email', true, false);
 if ($GLOBALS['registry']->getAuth()) {
-    $v->setDefault($injector->getInstance('Horde_Prefs_Identity')->getIdentity()->getValue('from_addr'));
+    $v->setDefault($injector->getInstance('Horde_Core_Factory_Identity')->create()->getValue('from_addr'));
 }
 $form->addVariable(_("To"), 'recipients', 'email', true, false, _("Separate multiple email addresses with commas."), true);
 $form->addVariable(_("Subject"), 'subject', 'text', true);
index 63404fb..6ee693b 100644 (file)
@@ -182,7 +182,7 @@ $view = Horde_Util::getFormData('view', 'Day');
 // Pre-format our delete image/link.
 $delimg = Horde::img('delete.png', _("Remove Attendee"));
 
-$ident = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
+$ident = $injector->getInstance('Horde_Core_Factory_Identity')->create();
 $identities = $ident->getAll('id');
 $vars = Horde_Variables::getDefaultVariables();
 $tabs = new Horde_Core_Ui_Tabs(null, $vars);
index 259827c..ae9f25c 100644 (file)
@@ -86,7 +86,7 @@ if (isset($conf['urls']['pretty']) && $conf['urls']['pretty'] == 'rewrite') {
 }
 
 $owner = $share->get('owner');
-$identity = $injectory->getInstance('Horde_Prefs_Identity')->getIdentity($owner);
+$identity = $injectory->getInstance('Horde_Core_Factory_Identity')->create($owner);
 $history = $injector->getInstance('Horde_History');
 $now = new Horde_Date(time());
 
index 31ee396..62a8024 100644 (file)
@@ -68,7 +68,7 @@ class Kronolith_FreeBusy
         }
 
         /* Get the Identity for the owner of the share. */
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
         $email = $identity->getValue('from_addr');
         $cn = $identity->getValue('fullname');
         if (empty($mail) && empty($cn)) {
index dbadc00..a47b873 100644 (file)
@@ -1150,7 +1150,7 @@ class Kronolith
         if ($GLOBALS['registry']->getAuth() &&
             !count($GLOBALS['display_calendars']) &&
             !$GLOBALS['kronolith_shares']->exists($GLOBALS['registry']->getAuth())) {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
             $name = $identity->getValue('fullname');
             if (trim($name) == '') {
                 $name = $GLOBALS['registry']->getAuth('original');
@@ -1271,7 +1271,7 @@ class Kronolith
         static $names = array();
 
         if (!isset($names[$uid])) {
-            $ident = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($uid);
+            $ident = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($uid);
             $ident->setDefault($ident->getDefault());
             $names[$uid] = $ident->getValue('fullname');
             if (empty($names[$uid])) {
@@ -1290,7 +1290,7 @@ class Kronolith
         static $emails = array();
 
         if (!isset($emails[$uid])) {
-            $ident = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($uid);
+            $ident = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($uid);
             $emails[$uid] = $ident->getValue('from_addr');
             if (empty($emails[$uid])) {
                 $emails[$uid] = $uid;
@@ -1308,7 +1308,7 @@ class Kronolith
         static $emails = array();
 
         if (!isset($emails[$uid])) {
-            $ident = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($uid);
+            $ident = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($uid);
 
             $addrs = $ident->getAll('from_addr');
             $addrs[] = $uid;
@@ -1731,8 +1731,8 @@ class Kronolith
 
         if ($GLOBALS['conf']['share']['notify']) {
             $identity = $GLOBALS['injector']
-                ->getInstance('Horde_Prefs_Identity')
-                ->getIdentity();
+                ->getInstance('Horde_Core_Factory_Identity')
+                ->create();
             $userName = $identity->getName();
             $mail = new Horde_Mime_Mail(
                 array('from' => $identity->getDefaultFromAddress(true),
@@ -1755,8 +1755,8 @@ class Kronolith
                 $share->save();
                 if ($GLOBALS['conf']['share']['notify']) {
                     $to = $GLOBALS['injector']
-                        ->getInstance('Horde_Prefs_Identity')
-                        ->getIdentity($new_owner)
+                        ->getInstance('Horde_Core_Factory_Identity')
+                        ->create($new_owner)
                         ->getDefaultFromAddress(true);
                     try {
                         $message = Horde::callHook('shareOwnerNotification', array($new_owner, $share));
@@ -1910,8 +1910,8 @@ class Kronolith
             if ($GLOBALS['conf']['share']['notify'] &&
                 !isset($current[$user]) && $has_perms) {
                 $to = $GLOBALS['injector']
-                    ->getInstance('Horde_Prefs_Identity')
-                    ->getIdentity($user)
+                    ->getInstance('Horde_Core_Factory_Identity')
+                    ->create($user)
                     ->getDefaultFromAddress(true);
                 try {
                     $message = Horde::callHook('shareUserNotification', array($user, $share));
@@ -2247,7 +2247,7 @@ class Kronolith
             return;
         }
 
-        $ident = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($event->creator);
+        $ident = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($event->creator);
         if (!$ident->getValue('from_addr')) {
             $notification->push(sprintf(_("You do not have an email address configured in your Personal Information Preferences. You must set one %shere%s before event notifications can be sent."), Horde::getServiceLink('prefs', 'kronolith')->add(array('app' => 'horde', 'group' => 'identities'))->link(), '</a>'), 'horde.error', array('content.raw'));
             return;
@@ -2403,7 +2403,7 @@ class Kronolith
             throw new Kronolith_Exception($e);
         }
 
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
 
         $owner = $share->get('owner');
         if ($owner) {
@@ -2437,7 +2437,7 @@ class Kronolith
             if (!$vals) {
                 continue;
             }
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
             $email = $identity->getValue('from_addr');
             if (strpos($email, '@') === false) {
                 continue;
index 3f41b1d..ad2985d 100644 (file)
@@ -45,7 +45,7 @@ class Kronolith_View_EditEvent {
             exit;
         }
 
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
 
         if ($this->event->hasPermission(Horde_Perms::EDIT)) {
             $calendar_id = $this->event->calendarType . '_' . $this->event->calendar;
index ad9a623..fe926c7 100755 (executable)
@@ -69,7 +69,7 @@ function send_agendas()
         }
 
         // Try to find an email address for the user.
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
         $email = $identity->getDefaultFromAddress(true);
 
         // Check if user has a timezone pref, and set it. Otherwise, make
index 167a951..5fe7d4f 100644 (file)
@@ -74,7 +74,7 @@ class Mnemo_DeleteNotepadForm extends Horde_Form {
             // If the default share doesn't exist then create it.
             if (!$GLOBALS['mnemo_shares']->exists($GLOBALS['registry']->getAuth())) {
 
-                $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+                $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
                 $name = $identity->getValue('fullname');
                 if (trim($name) == '') {
                     $name = $GLOBALS['registry']->getAuth();
index 7675f1a..1538f2b 100644 (file)
@@ -213,7 +213,7 @@ class Mnemo {
         static $names = array();
 
         if (!isset($names[$uid])) {
-            $ident = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($uid);
+            $ident = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($uid);
             $ident->setDefault($ident->getDefault());
             $names[$uid] = $ident->getValue('fullname');
             if (empty($names[$uid])) {
@@ -443,7 +443,7 @@ class Mnemo {
 
                 /* If the user's personal notepad doesn't exist, then create it. */
                 if (!$GLOBALS['mnemo_shares']->exists($GLOBALS['registry']->getAuth())) {
-                    $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+                    $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
                     $name = $identity->getValue('fullname');
                     if (trim($name) == '') {
                         $name = $GLOBALS['registry']->getAuth();
index f190e54..fa10a7c 100644 (file)
@@ -63,7 +63,7 @@ class Nag_TaskForm extends Horde_Form {
 
         if (count($users)) {
             foreach (array_keys($users) as $user) {
-                $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+                $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
                 $fullname = $identity->getValue('fullname');
                 $users[$user] = strlen($fullname) ? $fullname : $user;
             }
index d9bd320..15b700c 100644 (file)
@@ -661,7 +661,7 @@ class Nag
             return '';
         }
 
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($assignee);
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($assignee);
         $fullname = $identity->getValue('fullname');
         if (!strlen($fullname)) {
             $fullname = $assignee;
@@ -733,7 +733,7 @@ class Nag
 
                 /* If the user's personal tasklist doesn't exist, then create it. */
                 if (!$GLOBALS['nag_shares']->exists($GLOBALS['registry']->getAuth())) {
-                    $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+                    $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
                     $name = $identity->getValue('fullname');
                     if (trim($name) == '') {
                         $name = $GLOBALS['registry']->getAuth('original');
@@ -824,7 +824,7 @@ class Nag
 
         $groups = $GLOBALS['injector']->getInstance('Horde_Group');
         $recipients = array();
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
         $from = $identity->getDefaultFromAddress(true);
 
         $owner = $share->get('owner');
@@ -858,7 +858,7 @@ class Nag
             if (!$vals) {
                 continue;
             }
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
             $email = $identity->getValue('from_addr');
             if (strpos($email, '@') === false) {
                 continue;
@@ -937,12 +937,12 @@ class Nag
                                   $old_task->category, $task->category);
                 }
                 if ($old_task->assignee != $task->assignee) {
-                    $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($old_task->assignee);
+                    $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($old_task->assignee);
                     $old_name = $identity->getValue('fullname');
                     if (!strlen($old_name)) {
                         $old_name = $old_task->assignee;
                     }
-                    $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($task->assignee);
+                    $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($task->assignee);
                     $new_name = $identity->getValue('fullname');
                     if (!strlen($new_name)) {
                         $new_name = $new_task->assignee;
@@ -1034,7 +1034,7 @@ class Nag
         static $names = array();
 
         if (!isset($names[$uid])) {
-            $ident = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($uid);
+            $ident = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($uid);
             $ident->setDefault($ident->getDefault());
             $names[$uid] = $ident->getValue('fullname');
             if (empty($names[$uid])) {
index 474dfea..ed5d82e 100644 (file)
@@ -24,7 +24,7 @@ $subscribe_url = Horde::url($registry->get('webroot', 'horde') . '/rpc.php/nag/'
     . ($tasklist->get('owner') ? $tasklist->get('owner') : '')
     . '/' . $tasklist->getName() . '.ics';
 
-$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($tasklist->get('owner'));
+$identity = $injector->getInstance('Horde_Core_Factory_Identity')->create($tasklist->get('owner'));
 $owner_name = $identity->getValue('fullname');
 if (trim($owner_name) == '') {
     $owner_name = $registry->getAuth('original');
index ae7f725..03bffb4 100644 (file)
@@ -18,7 +18,7 @@ class Trean
     {
         // Make sure "My Bookmarks" folder exists
         if ($GLOBALS['registry']->getAuth() && !$GLOBALS['trean_shares']->exists($GLOBALS['registry']->getAuth())) {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
             $name = $identity->getValue('fullname');
             if (trim($name) == '') {
                 $name = $GLOBALS['registry']->getAuth();
index 16d1b6c..ff6d091 100644 (file)
@@ -138,7 +138,7 @@ class Turba_Driver_Group extends Turba_Driver
         $members = $groups->listAllUsers($this->_gid);
         $addressbook = array();
         foreach ($members as $member) {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($member);
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($member);
             $name = $identity->getValue('fullname');
             $email = $identity->getValue('from_addr');
             // We use the email as the key since we could have multiple users
index c57cdb1..ce6db80 100644 (file)
@@ -285,7 +285,7 @@ class Turba {
         static $names = array();
 
         if (!isset($names[$uid])) {
-            $ident = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($uid);
+            $ident = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($uid);
             $ident->setDefault($ident->getDefault());
             $names[$uid] = $ident->getValue('fullname');
             if (empty($names[$uid])) {
@@ -560,7 +560,7 @@ class Turba {
     {
         if (!isset($params['name'])) {
             /* Sensible default for empty display names */
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
             $name = $identity->getValue('fullname');
             if (trim($name) == '') {
                 $name = $GLOBALS['registry']->getAuth('original');
index 9d7ce23..8a40f5f 100644 (file)
@@ -212,7 +212,7 @@ class Whups_Mail {
 
         if ($auth->hasCapability('list')) {
             foreach ($auth->listUsers() as $user) {
-                $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+                $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
                 $addrs = $identity->getAll('from_addr');
                 foreach ($addrs as $addr) {
                     if (strcasecmp($from, $addr) == 0) {
index 867af66..f0f5e4c 100644 (file)
@@ -725,7 +725,7 @@ class Whups_Ticket {
         }
 
         /* Build message template. */
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
         $name = $identity->getValue('fullname');
         if (empty($name)) {
             $name = $GLOBALS['registry']->getAuth('bare');
index ce0180b..9bf2451 100644 (file)
@@ -569,7 +569,7 @@ class Whups {
                         }
                     } catch (Horde_Mime_Exception $e) {}
                 } else {
-                    $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($user);
+                    $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);
 
                     $results[$user]['name'] = $identity->getValue('fullname');
                     $results[$user]['email'] = $identity->getValue('from_addr');
index b1dbd4c..be925d0 100644 (file)
@@ -257,7 +257,7 @@ class Wicked_Page {
             return _("Guest");
         }
 
-        $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($modify);
+        $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($modify);
         $name = $identity->getValue('fullname');
         if (!empty($name)) {
             $modify = $name;
index abb6978..182769d 100644 (file)
@@ -265,8 +265,8 @@ class StandardPage extends Wicked_Page {
         $requestor = $this->_lock['lock_owner'];
         if ($requestor) {
             $name = $GLOBALS['injector']
-                ->getInstance('Horde_Prefs_Identity')
-                ->getIdentity($requestor)
+                ->getInstance('Horde_Core_Factory_Identity')
+                ->create($requestor)
                 ->getValue('fullname');
             if (!strlen($name)) {
                 $name = $requestor;
index f4e5efb..4122db8 100644 (file)
@@ -160,7 +160,7 @@ class Wicked
             $conf['wicked']['guest_address'] :
             $conf['wicked']['notify_address'];
         if ($GLOBALS['registry']->getAuth()) {
-            $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
+            $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create();
             $from = $identity->getValue('fullname');
             if (empty($from)) {
                 $from = $registry->get('name');