Re: [SMARTY] changing template_c ownership
| From: | Jason Sweat | Date: | Tue, 13 Aug 2002 13:13:37 +0000 |
| Subject: | Re: [SMARTY] changing template_c ownership | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5668@lists.php.net to get a copy of this message | ||
It should not hurt you to have the files and
directories owned by the web server, the compiled
templates and cache are meant to only be used by the
web server.
I occasionally have a need to do something as the web
server. Use the following (very dangerous) script at
your own risk to execute commands on the system as the
web server. You should probably remove this script
from the system when not in use.
P.S. My appologies for not using Smarty in this script
;)
<pre>
<?php
$self = $_SERVER['PHPSELF'];
$result = '';
$cmd = (array_key_exists('cmd', $_POST)) ?
$_POST['cmd'] : '';
if ($cmd) {
print <<<EOS
<h1>command:</h1>
$cmd
<hr>
EOS;
$ph = popen($cmd, 'r');
while ($chunk = fgets($ph, 4096)) {
$result .= $chunk;
}
pclose($ph);
}
if ($result) {
print <<<EOS
<h1>result:</h1>
$result
<hr>
EOS;
}
print <<<EOS
<form action="$self" method="post">
<b>Enter Command: </b>
<input type="text" size="80" name="cmd">
<input type="submit" value="go">
</form>
EOS;
?>
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com