Some hackish way to respect $conf['reminder']['server_name']. In the long term
authorJan Schneider <jan@horde.org>
Thu, 23 Dec 2010 17:53:43 +0000 (18:53 +0100)
committerJan Schneider <jan@horde.org>
Thu, 23 Dec 2010 17:53:43 +0000 (18:53 +0100)
this need to move to horde and set in horde/bin/alarms.

kronolith/lib/Event.php

index 142a9d6..467e08e 100644 (file)
@@ -1536,6 +1536,12 @@ abstract class Kronolith_Event
             }
         }
 
+        $serverName = $_SERVER['SERVER_NAME'];
+        $serverConf = $GLOBALS['conf']['server']['name'];
+        if (!empty($GLOBALS['conf']['reminder']['server_name'])) {
+            $_SERVER['SERVER_NAME'] = $GLOBALS['conf']['server']['name'] = $GLOBALS['conf']['reminder']['server_name'];
+        }
+
         if (empty($user)) {
             $user = $GLOBALS['registry']->getAuth();
         }
@@ -1596,7 +1602,7 @@ abstract class Kronolith_Event
             $methods['mail']['mimepart'] = Kronolith::buildMimeMessage($view, 'mail', $image);
         }
 
-        return array(
+        $alarm = array(
             'id' => $this->uid,
             'user' => $user,
             'start' => $start,
@@ -1605,6 +1611,11 @@ abstract class Kronolith_Event
             'params' => $methods,
             'title' => $this->getTitle($user),
             'text' => $this->description);
+
+        $_SERVER['SERVER_NAME'] = $serverName;
+        $GLOBALS['conf']['server']['name'] = $serverConf;
+
+        return $alarm;
     }
 
     /**