New remote api function mail_spamfilter_user_delete_by_email [PATCH INCLUDED]
Another enhancement that allows an action based on logical data and not internal data. There are no functions to retrieve "spamfilter_users.id" values, and honestly I believe it would be silly to provide it. Here is a compromise, use the email address to cleanup spamfilter users. Ultimately a "purge mail account" function should exist that removes all trace of an account and all associated services. Baby-steps.
BEGIN PATCH
--- /usr/local/ispconfig/interface/lib/classes/remoting.inc.php 2011-04-20 12:31:46.906037774 -0500 +++ ispconfig3_install/interface/lib/classes/remoting.inc.php 2011-04-20 12:52:37.786813579 -0500 @@ -652,7 +652,29 @@ $affected_rows = $this->deleteQuery('../mail/form/spamfilter_users.tform.php', $primary_id); return $affected_rows; }
-
/**
-
* Remove a spamfilter user using the user's email address.
-
* @param int session_id
-
* @param string email address or (@tld is ok too, but this is not a wildcard or anything)
-
* @return int the number of removed policies
-
* @author Unknown
-
*/
-
public function mail_spamfilter_user_delete_by_email($session_id, $email)
-
{
-
global $app;
-
if (!$this->checkPerm($session_id, 'mail_spamfilter_user_delete')) {
-
$this->server->fault('permission_denied','You do not have the permissions to access this function.');
-
return false;
-
}
-
$email = $app->db->quote($email);
-
$sql = "DELETE FROM spamfilter_users WHERE email = '".$email."'";
-
$app->db->query($sql);
-
return $app->db->affectedRows();
-
}
-
//* Get policy details public function mail_policy_get($session_id, $primary_id)
END PATCH
Edited by Thom