Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Bypassing $trusted_dir for PHP Include

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
patrickrice
Smarty n00b


Joined: 16 Nov 2003
Posts: 2
Location: Auburn, AL

PostPosted: Sun Nov 16, 2003 8:46 pm    Post subject: Bypassing $trusted_dir for PHP Include Reply with quote

Hi All,
I'm looking for a way to call a weather php script from a Smarty template without having the script in the $trusted_dir. I've tried include_php, simply adding the script within the template using the {php} tags, and fetch, but they all rely on the script being in the $trusted_dir.

I've also tried calling the php from a javascript include using...
Code:
<script language="JavaScript" src="http://www.theplainsman.com/pages/weather/index.php"></script>

and even
Code:

{literal}
<script language="JavaScript">
document.write('<script type="text/javascript" src="http://www.theplainsman.com/pages/weather/index.php"></script>');
</script>
{/literal}

Any ideas on how I could go about calling this script? Thanks in advance.
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Sun Nov 16, 2003 9:05 pm    Post subject: Reply with quote

write a plugin and put it in the plugins-dir.

something along:
[php:1:c49c011297]
function smarty_function_weather($params, &$smarty) {
return implode('', file('http://www.theplainsman.com/pages/weather/index.php'));
}
[/php:1:c49c011297]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
patrickrice
Smarty n00b


Joined: 16 Nov 2003
Posts: 2
Location: Auburn, AL

PostPosted: Sun Nov 16, 2003 9:09 pm    Post subject: No permission to access plugins Reply with quote

Sorry, I forgot to mention I don't have access to that directory either, any other ideas off the top of your head?
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Sun Nov 16, 2003 10:05 pm    Post subject: Re: No permission to access plugins Reply with quote

patrickrice wrote:
Sorry, I forgot to mention I don't have access to that directory either, any other ideas off the top of your head?


nope. if i knew how to circumvent it, it was a security-problem and i would fix it Smile . ask you administrator to give you the permissions you need.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP