[horde] "best practices" for adding an external app to horde menus?
Robert P. J. Day
rpjday at crashcourse.ca
Thu Aug 27 15:00:28 UTC 2009
finally, i have a question just asking for advice -- how best to add
an *external* app into the horde menus.
consider the following directory structure (inherited from previous
3.0.9 setup but i'm free to make changes if they make sense):
/var/www/<EXTURL>/
tts/ (non-horde ticketing system)
horde/ (webroot)
config/ (you get the idea)
local_apps/ (some other non-horde apps)
webstats/ (for website stats)
tts/ (same ticketing system as above)
how the first (webstats) app was added -- add a new menu heading in
registry.php, and an entry for webstats:
$this->applications['website'] = array(
'name' => _("Web Site"),
'status' => 'heading',
);
$this->applications['webstats'] = array(
'fileroot' => dirname(__FILE__) . '/../local_apps/webstats',
'webroot' => $this->applications['horde']['webroot'] . '/local_apps/webstats',
'name' => _("Website Stats"),
'allow_guests' => false,
'status' => 'active',
'menu_parent' => 'website'
);
then add local_apps/webstats/index.php, which takes one to an
external site:
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh"
CONTENT="0;URL=http://extremetracking.com/open?login=XXXXXX">
<SCRIPT LANGUAGE="JavaScript"><!--
function redirect () { setTimeout("go_now()",1000); }
function go_now () { window.location.href =
"http://extremetracking.com/open?login=XXXXXX"; }
//--></SCRIPT>
</HEAD>
<BODY onLoad="redirect()">
</BODY>
</HTML>
pretty straightforward, registry points to appropriate local_apps
directory, under which the index.php file then redirects *explicitly*
to an external site. that's how it was set up before, and it works
just fine. now, here's the issue.
i want to add another external app under that same heading -- the
"tts" ticketing system. so i add another equivalent entry to
registry.php:
$this->applications['tts'] = array(
'fileroot' => dirname(__FILE__) . '/../local_apps/tts',
'webroot' => $this->applications['horde']['webroot'] . '/local_apps/tts',
'name' => _("Ticket System"),
'allow_guests' => false,
'status' => 'active',
'menu_parent' => 'website'
);
but the difference is that *that* index.php file reads thusly:
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://../../../tts/">
<SCRIPT LANGUAGE="JavaScript"><!--
function redirect () { setTimeout("go_now()",1000); }
function go_now () { window.location.href = "../../../tts/"; }
//--></SCRIPT>
</HEAD>
<BODY onLoad="redirect()">
</BODY>
</HTML>
as in, head up three directory levels, *above* the webroot.
however, while that entry shows up in the menus, if i try to run that
app, i get the diagnostic:
".." could not be found
this *used* to work in 3.0.9, but not now in 3.3.4.
one obvious solution is to just hardcode the http url in that
index.php file to go straight to "http://<EXTURL>/tts, which is in
fact externally visible, and which seems to work just fine. but i'm
not i should count on that.
so the question is, what's the best practice for adding to the horde
menus apps that live *above* the webroot, the way that "tts" app does?
clearly, using the "../../.." notation used to work once, but not
anymore for reasons i don't understand. is there a way to fix that?
or am i better off just putting in the actual URL?
personally, i'd prefer to install non-horde apps above the webroot
to keep them philosophically separate from horde-related content and
not clutter up the webroot directory, but i'll defer to the expertise
of those who know better.
rday
More information about the horde
mailing list