Moin,
Jo da stimmten sicherlich die Pfade nicht
:kaffee: jo, sicher sicher
1 Script auf 4 Servern und 1mal sind die Pfade falsch?
Warning:
filetype(): open_basedir restriction in effect. File(cms800/../..) is not within the allowed path(s):
if ( $_GET['Backup']=='txt' )
{
$dirpath ='cms800/';
$dhandle=opendir($dirpath);
while( (($file = readdir($dhandle)) !== false) )
{ if ( strcmp($file,'.')
&& strcmp($file,'..')
&& filetype($dirpath.$file) == 'file'
&& !strpos($file,'.phpBACKUP') )
{
$content.="\n/******************************************************************************/";
$content.="\n/***DL***START***".$dirpath.$file;
$content.="\n/******************************************************************************/";
$content.="\n";
$content.=$src=file_get_contents($dirpath.$file);
$content.="\n";
$content.="\n/******************************************************************************/";
$content.="\n/***DL***END***".$dirpath.$file;
$content.="\n/******************************************************************************/";
}
} closedir($dhandle);
$dirpath ='cms800/module/';
$dhandle=opendir($dirpath);
while( (($file = readdir($dhandle)) !== false) )
{ if ( strcmp($file,'.')
&& strcmp($file,'..')
&& filetype($dirpath.$file) == 'file'
&& !strpos($file,'.phpBACKUP') )
{
$content.="\n/******************************************************************************/";
$content.="\n/***DL***START***".$dirpath.$file;
$content.="\n/******************************************************************************/";
$content.="\n";
$content.=$src=file_get_contents($dirpath.$file);
$content.="\n";
$content.="\n/******************************************************************************/";
$content.="\n/***DL***END***".$dirpath.$file;
$content.="\n/******************************************************************************/";
}
} closedir($dhandle);
$dirpath ='cms800/../';
$dhandle=opendir($dirpath);
while( (($file = readdir($dhandle)) !== false) )
{ if ( strcmp($file,'.')
&& strcmp($file,'..')
&& !strpos($file,'.phpBACKUP')
&& filetype($dirpath.$file) == 'file' )
{
$content.="\n/******************************************************************************/";
$content.="\n/***DL***START***".$dirpath.$file;
$content.="\n/******************************************************************************/";
$content.="\n";
$content.=$src=file_get_contents($dirpath.$file);
$content.="\n";
$content.="\n/******************************************************************************/";
$content.="\n/***DL***END***".$dirpath.$file;
$content.="\n/******************************************************************************/";
}
} closedir($dhandle);
$lines=substr_count($content,"\n");
header('Content-Length: '.strlen($content));
header('Content-Disposition: attachment; filename=Backup'.date('Ymd_His_', time()).'-'.strtok($_CMS800['adminurl'],'/').'-'.$lines.'.txt;');
echo($content);
exit();
}
Alles anzeigen
Kurzform
$dirpath ='cms800/../';
$dhandle=opendir($dirpath);
while( (($file = readdir($dhandle)) !== false) )
{ if ( strcmp($file,'.')
&& strcmp($file,'..')
&& filetype($dirpath.$file) == 'file'
&& !strpos($file,'.phpBACKUP') )
{
Wenn "readDiR" das ".." zurückgibt, dann geh ich einen Ordner hoch
bei einem Hoster darf ich das nicht; vor den "www" gehen
if ( strcmp($file,'..')
&& filetype($dirpath.$file) == 'file' )
Lösung
vor dem fileTYPE abfragen ob es "ordnerHOCH" ist bzw NiCHTist
jetzt hab ich immernoch ein Problem
meine Leitung ist gerade wieder langsam ....
.... und einer schaft es dann nicht zu senden; kommt wohl der PHPmaxecekutionTimeout
könnte auch an die Domain gekoppelt sein; schärfere Restriktionen
konnte auf die DOmain auch keine "Updates" draufsenden;
Domain geändert und das senden (also empfangen) ging
wenn ich jetzt das CMS auf eine Andere Domain switchen würde, würde eventuell auch der BackupDownload gehen (das wäre kein Problem, nur ein kleiner edit in der "ini" und neues einloggen .... hab aber kein Book drauf ...)