From 341ef7175af7c8f21d27262b58da8f5bc2c06ef0 Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Tue, 08 Jul 2014 08:44:59 -0400 Subject: [PATCH] Merge branch 'master_fixes' into 'master' --- interface/lib/classes/remote.d/mail.inc.php | 68 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/interface/lib/classes/remote.d/mail.inc.php b/interface/lib/classes/remote.d/mail.inc.php index 7adaf1f..e579fb6 100644 --- a/interface/lib/classes/remote.d/mail.inc.php +++ b/interface/lib/classes/remote.d/mail.inc.php @@ -214,6 +214,10 @@ return false; } + //* Set a few params to non empty values that will be overwritten by mail_plugin + if (!isset($params['uid'])) $params['uid'] = -1; + if (!isset($params['gid'])) $params['gid'] = -1; + $affected_rows = $this->insertQuery('../mail/form/mail_user.tform.php', $client_id, $params); return $affected_rows; } @@ -523,6 +527,57 @@ return $affected_rows; } + //* Get mail relay_recipient details + public function mail_relay_recipient_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_relay_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_relay_recipient.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + + //* relay recipient email + public function mail_relay_recipient_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_relay_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_relay_recipient.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_relay_recipient_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_relay_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_relay_recipient.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_relay_recipient_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_relay_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_relay_recipient.tform.php', $primary_id); + return $affected_rows; + } + //* Get spamfilter whitelist details public function mail_spamfilter_whitelist_get($session_id, $primary_id) { @@ -969,6 +1024,19 @@ } } + //** quota functions ----------------------------------------------------------------------------------- + public function mailquota_get_by_user($session_id, $client_id) + { + global $app; + $app->uses('quota_lib'); + + if(!$this->checkPerm($session_id, 'mailquota_get_by_user')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + + return $app->quota_lib->get_mailquota_data($client_id, false); + } } -- Gitblit v1.9.1