mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
added check if webserver has write-permission for dumping $app/setup/etemplates.inc.php and renaming file to old first.
This commit is contained in:
parent
bc406008c4
commit
3d0eaa4b7e
@ -387,7 +387,18 @@
|
||||
|
||||
$this->db->query("SELECT * FROM $this->db_name WHERE et_name LIKE '$app%'");
|
||||
|
||||
if (!($f = fopen($path = PHPGW_SERVER_ROOT.'/'.$app.'/setup/etemplates.inc.php','w')))
|
||||
$dir = PHPGW_SERVER_ROOT . "/$app/setup";
|
||||
if (!is_writeable($dir))
|
||||
{
|
||||
return "Error: webserver is not allowed to write into '$dir' !!!";
|
||||
}
|
||||
$file = "$dir/etemplates.inc.php";
|
||||
if (file_exists($file))
|
||||
{
|
||||
rename($file,"$dir/etemplates.old.inc.php");
|
||||
}
|
||||
|
||||
if (!($f = fopen($file,'w')))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -404,7 +415,7 @@
|
||||
}
|
||||
fclose($f);
|
||||
|
||||
return "$n eTemplates for Application '$app' dumped to '$path'";
|
||||
return "$n eTemplates for Application '$app' dumped to '$file'";
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user