Newer
Older
if(!$this->checkPerm($session_id, 'mail_filter_get')) {
throw new SoapFault('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_content_filter.tform.php');
return $app->remoting_lib->getDataRecord($primary_id);
}
//* wpisy filtrow e-mail
public function mail_filter_add($session_id, $client_id, $params)
{
if (!$this->checkPerm($session_id, 'mail_filter_add'))
{
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$affected_rows = $this->insertQuery('../mail/form/mail_content_filter.tform.php', $client_id, $params);
return $affected_rows;
}
public function mail_filter_update($session_id, $client_id, $primary_id, $params)
{
if (!$this->checkPerm($session_id, 'mail_filter_update'))
{
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$affected_rows = $this->updateQuery('../mail/form/mail_content_filter.tform.php', $client_id, $primary_id, $params);
return $affected_rows;
}
public function mail_filter_delete($session_id, $primary_id)
{
if (!$this->checkPerm($session_id, 'mail_filter_delete'))
{
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$affected_rows = $this->deleteQuery('../mail/form/mail_content_filter.tform.php', $primary_id);
return $affected_rows;
/**
* Fetch the mail_domain record for the provided domain.
* @param int session_id
* @param string the fully qualified domain (or subdomain)
* @return array array of arrays corresponding to the mail_domain table's records
* @author till, benlake
*/
public function mail_domain_get_by_domain($session_id, $domain) {
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
global $app;
if(!$this->checkPerm($session_id, 'mail_domain_get_by_domain')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
if (!empty($domain)) {
$domain = $app->db->quote($domain);
$sql = "SELECT * FROM mail_domain WHERE domain = '$domain'";
$result = $app->db->queryAllRecords($sql);
return $result;
}
return false;
}
public function mail_domain_set_status($session_id, $primary_id, $status) {
global $app;
if(!$this->checkPerm($session_id, 'mail_domain_set_status')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
if(in_array($status, array('active', 'inactive'))) {
if ($status == 'active') {
$status = 'y';
} else {
$status = 'n';
}
$sql = "UPDATE mail_domain SET active = '$status' WHERE domain_id = ".$app->functions->intval($primary_id);
$app->db->query($sql);
$result = $app->db->affectedRows();
return $result;
} else {
throw new SoapFault('status_undefined', 'The status is not available');
return false;
//** 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);