- don't delete everything if the path is the domains document-root (protect basedir, awstats|webalizer-dir and place default index), fixes #273

refs #273
This commit is contained in:
Michael Kaufmann (d00p)
2010-06-24 08:11:43 +00:00
parent 67c55c5a25
commit 57124d040d
3 changed files with 25 additions and 5 deletions

View File

@@ -264,7 +264,18 @@ class ApsInstaller extends ApsParser
$this->db->query('DELETE FROM `' . TABLE_APS_SETTINGS . '` WHERE `InstanceID` = ' . $this->db->escape($Row['InstanceID']));
//remove data, #273
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/');
if($this->DomainPath != '' && $this->DomainPath != '/') {
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/');
} else {
// save awstats/webalizer folder if it's the docroot
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/', true);
// place standard-index file
$loginname = getLoginNameByUid($Row['CustomerID']);
if($loginname !== false)
{
storeDefaultIndex($loginname, $this->RealPath . $this->DomainPath . '/');
}
}
}
}