Hi Charles,

On Thu, Apr 03, 2003 at 10:02:25AM -0500, Charles R. Rusty Thompson wrote:
> I'm trying to create a web link in the AgentNavigationBar.dtl to our bug
> logging system. Our developers sometimes work from home so I thought I could
> make the link intelligent based on their IP. Basically I'm trying to do
> something like this, but it's not working. How Do I get access to the $ENV
> table in DTL or am I going about this all wrong?
> 
> <dtl if($ENV{'REMOTE_HOST'} =~ /^192\.168/){ $Data{"Server"} =
> "internalname" } else { $Data{"Server"} = "machine.domain.com" }>
> 
> and later...
> 
> <td><a href="http://$Data{"Server"}/bugtrack/";
> target="_blank">$Text{"BugTracker"}</a></td>

Regexp and dtl works only with upcoming OTRS 1.1 or OTRS CVS version.

-=> Use the following for your case:

[...]
<dtl set $Data{"Server"} = "somehost-ext">
<dtl if ($Env{"REMOTE_ADDR"} =~ "^192\.168") { $Data{"Server"} = "somehost-int"; }>

<a href="http://$Data{"Server"}/bugtrack/"; target="_blank">$Text{"BugTracker"}</a>
[...]

> CT

  Martin

--
Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/
--
Noch 164 Tage bis zum G�ubodenvolksfest! ;-)
_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Reply via email to