Fixed CleanupData to prevent recursive delete of all data
This commit is contained in:
@@ -269,18 +269,23 @@ class ApsInstaller extends ApsParser
|
|||||||
$this->db->query('DELETE FROM `' . TABLE_APS_INSTANCES . '` WHERE `ID` = ' . $this->db->escape($Row['InstanceID']));
|
$this->db->query('DELETE FROM `' . TABLE_APS_INSTANCES . '` WHERE `ID` = ' . $this->db->escape($Row['InstanceID']));
|
||||||
$this->db->query('DELETE FROM `' . TABLE_APS_SETTINGS . '` WHERE `InstanceID` = ' . $this->db->escape($Row['InstanceID']));
|
$this->db->query('DELETE FROM `' . TABLE_APS_SETTINGS . '` WHERE `InstanceID` = ' . $this->db->escape($Row['InstanceID']));
|
||||||
|
|
||||||
//remove data, #273
|
if($this->DomainPath != '' && checkDisallowedPaths($this->DomainPath))
|
||||||
if($this->DomainPath != '' && $this->DomainPath != '/') {
|
{
|
||||||
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/');
|
$documentroot = getCustomerDetail($Row['CustomerID'],'documentroot');
|
||||||
} else {
|
|
||||||
// save awstats/webalizer folder if it's the docroot
|
//remove data, #273
|
||||||
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/', true);
|
if($this->DomainPath != $documentroot) {
|
||||||
// place standard-index file
|
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/');
|
||||||
$loginname = getLoginNameByUid($Row['CustomerID']);
|
} else {
|
||||||
if($loginname !== false)
|
// save awstats/webalizer folder if it's the docroot
|
||||||
{
|
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/', true);
|
||||||
storeDefaultIndex($loginname, $this->RealPath . $this->DomainPath . '/');
|
// place standard-index file
|
||||||
}
|
$loginname = getLoginNameByUid($Row['CustomerID']);
|
||||||
|
if($loginname !== false)
|
||||||
|
{
|
||||||
|
storeDefaultIndex($loginname, $this->RealPath . $this->DomainPath . '/');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user