Exemplo n.º 1
0
 function ClearAccountCompletely()
 {
     $this->_fs->DeleteAccountDirs();
     if ($this->_db->Connect()) {
         return $this->_db->TempFilesClearAccountCompletely();
     }
     return false;
 }
Exemplo n.º 2
0
             $fs = new FileSystem(INI_DIR . '/mail', $account->Email, $account->Id);
             $fs->DeleteAccountDirs();
             $fs2 = new FileSystem(INI_DIR . '/temp', $account->Email, $account->Id);
             $fs2->DeleteAccountDirs();
             unset($fs, $fs2);
             GetAccountList($account, -1, $_SESSION[ACCOUNT_ID]);
         } else {
             printErrorAndExit(PROC_CANT_DEL_ACCT_BY_ID, $xmlRes);
         }
     } else {
         $idAcct = $xmlObj->GetParamValueByName('id_acct');
         if ($dbStorage->Connect() && $dbStorage->IsAccountInRing($_SESSION[ACCOUNT_ID], $idAcct) && Account::DeleteFromDb($idAcct)) {
             $fs = new FileSystem(INI_DIR . '/mail', $account->Email, $account->Id);
             $fs->DeleteAccountDirs();
             $fs2 = new FileSystem(INI_DIR . '/temp', $account->Email, $account->Id);
             $fs2->DeleteAccountDirs();
             unset($fs, $fs2);
             GetAccountList($account, -1);
         } else {
             printErrorAndExit(PROC_CANT_DEL_ACCT_BY_ID, $xmlRes);
         }
     }
     break;
 case 'filter':
     $dbStorage =& DbStorageCreator::CreateDatabaseStorage($null);
     if ($dbStorage->Connect()) {
         $acctId = $xmlObj->GetParamValueByName('id_acct');
         $editAccount =& Account::LoadFromDb($acctId);
         if ($editAccount->IsDemo || $dbStorage->DeleteFilter($xmlObj->GetParamValueByName('id_filter'), $acctId)) {
             GetFiltersList($acctId);
         } else {
Exemplo n.º 3
0
 /**
  * @param int $id[optional] = null
  * @return bool
  */
 function DeleteAccount($id = null)
 {
     $result = true;
     $account = null;
     if ($id > 0) {
         $account =& $this->DbStorage->SelectAccountData($id);
     } else {
         $account =& $this->_account;
     }
     if ($account) {
         $result &= $this->DbStorage->DeleteAccountData($account->Id, $account->Email);
         $fs = new FileSystem(INI_DIR . '/mail', strtolower($account->Email), $account->Id);
         $fs->DeleteAccountDirs();
         $fs2 = new FileSystem(INI_DIR . '/temp', strtolower($account->Email), $account->Id);
         $fs2->DeleteAccountDirs();
         unset($fs, $fs2);
     } else {
         $result = false;
     }
     return $result;
 }