From: Michael M Slusarz Date: Wed, 12 Jan 2011 19:56:02 +0000 (-0700) Subject: Don't directly alter $conf array; use $chora_conf instead X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=886ad8b8ebeb74b317e09c228d38e5995d902c5f;p=horde.git Don't directly alter $conf array; use $chora_conf instead $conf can be overwritten at any time by an application push, so there is no guarantee the data will remain in there. --- diff --git a/chora/browsedir.php b/chora/browsedir.php index dae1f9228..d6483e78c 100644 --- a/chora/browsedir.php +++ b/chora/browsedir.php @@ -35,7 +35,7 @@ try { /* Decide what title to display. */ $title = ($where == '') - ? $conf['options']['introTitle'] + ? $chora_conf['introTitle'] : "/$where"; $extraLink = $VC->hasFeature('deleted') diff --git a/chora/lib/Application.php b/chora/lib/Application.php index e3d7d28bd..2a3574fb5 100644 --- a/chora/lib/Application.php +++ b/chora/lib/Application.php @@ -44,12 +44,12 @@ class Chora_Application extends Horde_Registry_Application * Initialization function. * * Global variables defined: + * $chora_conf * $sourceroots */ protected function _init() { - global $conf; - global $acts, $defaultActs, $where, $atdir, $fullname, $sourceroot; + global $acts, $conf, $defaultActs, $where, $atdir, $fullname, $sourceroot; try { $GLOBALS['sourceroots'] = Horde::loadConfiguration('backends.php', 'sourceroots'); @@ -119,20 +119,21 @@ class Chora_Application extends Horde_Registry_Application ? null : $GLOBALS['injector']->getInstance('Horde_Cache'); - $conf['paths']['temp'] = Horde::getTempDir(); - - $GLOBALS['VC'] = Horde_Vcs::factory(Horde_String::ucfirst($sourcerootopts['type']), - array('cache' => $cache, - 'sourceroot' => $sourcerootopts['location'], - 'paths' => $conf['paths'], - 'username' => isset($sourcerootopts['username']) ? $sourcerootopts['username'] : '', - 'password' => isset($sourcerootopts['password']) ? $sourcerootopts['password'] : '')); - - $conf['paths']['sourceroot'] = $sourcerootopts['location']; - $conf['paths']['cvsusers'] = $sourcerootopts['location'] . '/' . (isset($sourcerootopts['cvsusers']) ? $sourcerootopts['cvsusers'] : ''); - $conf['paths']['introText'] = CHORA_BASE . '/config/' . (isset($sourcerootopts['intro']) ? $sourcerootopts['intro'] : ''); - $conf['options']['introTitle'] = isset($sourcerootopts['title']) ? $sourcerootopts['title'] : ''; - $conf['options']['sourceRootName'] = $sourcerootopts['name']; + $GLOBALS['chora_conf'] = array( + 'cvsusers' => $sourcerootopts['location'] . '/' . (isset($sourcerootopts['cvsusers']) ? $sourcerootopts['cvsusers'] : ''), + 'introText' => CHORA_BASE . '/config/' . (isset($sourcerootopts['intro']) ? $sourcerootopts['intro'] : ''), + 'introTitle' => (isset($sourcerootopts['title']) ? $sourcerootopts['title'] : ''), + 'sourceRootName' => $sourcerootopts['name'] + ); + $chora_conf = &$GLOBALS['chora_conf']; + + $GLOBALS['VC'] = Horde_Vcs::factory(Horde_String::ucfirst($sourcerootopts['type']), array( + 'cache' => $cache, + 'sourceroot' => $sourcerootopts['location'], + 'paths' => array_merge($conf['paths'], array('temp' => Horde::getTempDir())), + 'username' => isset($sourcerootopts['username']) ? $sourcerootopts['username'] : '', + 'password' => isset($sourcerootopts['password']) ? $sourcerootopts['password'] : '' + )); $where = Horde_Util::getFormData('f', '/'); diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index 3ebcb6d49..99aa01d62 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -433,7 +433,7 @@ class Chora static public function showAuthorName($name, $fullname = false) { try { - $users = $GLOBALS['VC']->getUsers($GLOBALS['conf']['paths']['cvsusers']); + $users = $GLOBALS['VC']->getUsers($GLOBALS['chora_conf']['cvsusers']); if (isset($users[$name])) { return '' . htmlspecialchars($fullname ? $users[$name]['name'] : $name) . @@ -447,7 +447,7 @@ class Chora static public function getAuthorEmail($name) { try { - $users = $GLOBALS['VC']->getUsers($GLOBALS['conf']['paths']['cvsusers']); + $users = $GLOBALS['VC']->getUsers($GLOBALS['chora_conf']['cvsusers']); if (isset($users[$name])) { return $users[$name]['mail']; } diff --git a/chora/templates/headerbar.inc b/chora/templates/headerbar.inc index 08d7bb1b3..d57f1c497 100644 --- a/chora/templates/headerbar.inc +++ b/chora/templates/headerbar.inc @@ -3,7 +3,7 @@ - [ ] + [ ] : @@ -14,9 +14,9 @@ - + - +