static function ExecuteDeleteForwarder($fw_id_pk) { global $zdbh; global $controller; runtime_hook::Execute('OnBeforeDeleteForwarer'); //$rowforwarder = $zdbh->query("SELECT * FROM x_forwarders WHERE fw_id_pk=" . $fw_id_pk . "")->fetch(); $numrows = $zdbh->prepare("SELECT * FROM x_forwarders WHERE fw_id_pk=:fw_id_pk"); $numrows->bindParam(':fw_id_pk', $fw_id_pk); $numrows->execute(); $rowforwarder = $numrows->fetch(); self::$delete = true; // Include mail server specific file here. $MailServerFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('mailserver_php'); if (file_exists($MailServerFile)) { include $MailServerFile; } $sql = "UPDATE x_forwarders SET fw_deleted_ts=:time WHERE fw_id_pk=:fw_id_pk"; $sql = $zdbh->prepare($sql); $sql->bindParam(':fw_id_pk', $fw_id_pk); $sql->bindParam(':time', time()); $sql->execute(); runtime_hook::Execute('OnAfterDeleteForwarder'); self::$ok = true; }
static function ExecuteDeleteFTP($ft_id_pk, $uid) { global $zdbh; global $controller; // Verify if Current user can Edit FTP Account. $currentuser = ctrl_users::GetUserDetail($uid); $sql = "SELECT * FROM x_ftpaccounts WHERE ft_acc_fk=:userid AND ft_id_pk=:editedUsrID AND ft_deleted_ts IS NULL"; $numrows = $zdbh->prepare($sql); $numrows->bindParam(':userid', $currentuser['userid']); $numrows->bindParam(':editedUsrID', $ft_id_pk); $numrows->execute(); if ($numrows->rowCount() == 0) { return; } // Delete User runtime_hook::Execute('OnBeforeDeleteFTPAccount'); $rowftpsql = "SELECT * FROM x_ftpaccounts WHERE ft_id_pk=:ftIdPk"; $rowftpfind = $zdbh->prepare($rowftpsql); $rowftpfind->bindParam(':ftIdPk', $ft_id_pk); $rowftpfind->execute(); $rowftp = $rowftpfind->fetch(); $sql = $zdbh->prepare("UPDATE x_ftpaccounts SET ft_deleted_ts=:time WHERE ft_id_pk=:ftpid"); $sql->bindParam(':ftpid', $ft_id_pk); $sql->bindParam(':time', $ft_id_pk); $sql->execute(); self::$delete = true; // Include FTP server specific file here. $FtpModuleFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('ftp_php'); if (file_exists($FtpModuleFile)) { include $FtpModuleFile; } $retval = TRUE; runtime_hook::Execute('OnAfterDeleteFTPAccount'); return $retval; }
static function ExecuteDeleteFTP($ft_id_pk) { global $zdbh; global $controller; runtime_hook::Execute('OnBeforeDeleteFTPAccount'); $rowftpsql = "SELECT * FROM x_ftpaccounts WHERE ft_id_pk=:ftIdPk"; $rowftpfind = $zdbh->prepare($rowftpsql); $rowftpfind->bindParam(':ftIdPk', $ft_id_pk); $rowftpfind->execute(); $rowftp = $rowftpfind->fetch(); $sql = $zdbh->prepare("UPDATE x_ftpaccounts SET ft_deleted_ts=:time WHERE ft_id_pk=:ftpid"); $sql->bindParam(':ftpid', $ft_id_pk); $sql->bindParam(':time', $ft_id_pk); $sql->execute(); self::$delete = true; // Include FTP server specific file here. $FtpModuleFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('ftp_php'); if (file_exists($FtpModuleFile)) { include $FtpModuleFile; } $retval = TRUE; runtime_hook::Execute('OnAfterDeleteFTPAccount'); return $retval; }
static function ExecuteDeleteAlias($al_id_pk) { global $zdbh; global $controller; self::$delete = true; runtime_hook::Execute('OnBeforeDeleteAlias'); //$rowalias = $zdbh->query("SELECT * FROM x_aliases WHERE al_id_pk=" . $al_id_pk . "")->Fetch(); $bindArray = array(':id' => $al_id_pk); $sqlStatment = $zdbh->bindQuery("SELECT * FROM x_aliases WHERE al_id_pk=:id", $bindArray); $rowalias = $zdbh->returnRow(); // Include mail server specific file here. if (file_exists("modules/" . $controller->GetControllerRequest('URL', 'module') . "/code/" . ctrl_options::GetSystemOption('mailserver_php') . "")) { include "modules/" . $controller->GetControllerRequest('URL', 'module') . "/code/" . ctrl_options::GetSystemOption('mailserver_php') . ""; } $sqlStatmentUpdate = "UPDATE x_aliases SET al_deleted_ts=:time WHERE al_id_pk=:id"; $sql = $zdbh->prepare($sqlStatmentUpdate); $sql->bindParam(':id', $al_id_pk); $sql->bindParam(':time', time()); $sql->execute(); runtime_hook::Execute('OnAfterDeleteAlias'); self::$ok = true; }
static function ExecuteDeleteDistList($dl_id_pk) { global $zdbh; global $controller; runtime_hook::Execute('OnBeforeDeleteDistList'); self::$delete = true; $numrows = $zdbh->prepare("SELECT * FROM x_distlists WHERE dl_id_pk=:dl_id_pk AND dl_deleted_ts IS NULL"); $numrows->bindParam(':dl_id_pk', $dl_id_pk); $numrows->execute(); $rowdl = $numrows->fetch(); // Include mail server specific file here. $MailServerFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('mailserver_php'); if (file_exists($MailServerFile)) { include $MailServerFile; } $sql = "UPDATE x_distlistusers SET du_deleted_ts=:time WHERE du_distlist_fk=:dl_id_pk"; $sql = $zdbh->prepare($sql); $sql->bindParam(':dl_id_pk', $dl_id_pk); $sql->bindParam(':time', time()); $sql->execute(); $sql = "UPDATE x_distlists SET dl_deleted_ts=:time WHERE dl_id_pk=:dl_id_pk"; $sql = $zdbh->prepare($sql); $sql->bindParam(':dl_id_pk', $dl_id_pk); $sql->bindParam(':time', time()); $sql->execute(); runtime_hook::Execute('OnAfterDeleteDistList'); self::$ok = true; }
static function ExecuteDeleteMailbox($mid) { global $zdbh; global $controller; runtime_hook::Execute('OnBeforeDeleteMailbox'); self::$delete = true; //$rowmailbox = $zdbh->query("SELECT * FROM x_mailboxes WHERE mb_id_pk=" . $mid . "")->Fetch(); $numrows = $zdbh->prepare("SELECT * FROM x_mailboxes WHERE mb_id_pk=:mid"); $numrows->bindParam(':mid', $mid); $numrows->execute(); $rowmailbox = $numrows->fetch(); // Include mail server specific file here. $MailServerFile = 'modules/' . $controller->GetControllerRequest('URL', 'module') . '/code/' . ctrl_options::GetSystemOption('mailserver_php'); if (file_exists($MailServerFile)) { include $MailServerFile; } $time = time(); $sql = "UPDATE x_mailboxes SET mb_deleted_ts=:time WHERE mb_id_pk=:mid"; $sql = $zdbh->prepare($sql); $sql->bindParam(':time', $time); $sql->bindParam(':mid', $mid); $sql->execute(); runtime_hook::Execute('OnAfterDeleteMailbox'); self::$ok = true; }
static function ExecuteDeleteFaq($fq_id_pk) { global $zdbh; $sql = "UPDATE x_faqs SET fq_deleted_ts=:time WHERE fq_id_pk=:fq_id_pk"; $sql = $zdbh->prepare($sql); $time = time(); $sql->bindParam(':time', $time); $sql->bindParam(':fq_id_pk', $fq_id_pk); $sql->execute(); self::$delete = true; return true; }