| | |
| | | private $session_timeout = 600; |
| | | |
| | | private $server; |
| | | public $oldDataRecord; |
| | | public $dataRecord; |
| | | public $id; |
| | | |
| | | /* |
| | | These variables shall stay global. |
| | |
| | | |
| | | public function mail_user_filter_add($session_id, $client_id, $params) |
| | | { |
| | | global $app; |
| | | if (!$this->checkPerm($session_id, 'mail_user_filter_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_user_filter.tform.php', $client_id, $params); |
| | | $app->plugin->raiseEvent('mail:mail_user_filter:on_after_insert',$this); |
| | | return $affected_rows; |
| | | } |
| | | |
| | | public function mail_user_filter_update($session_id, $client_id, $primary_id, $params) |
| | | { |
| | | global $app; |
| | | if (!$this->checkPerm($session_id, 'mail_user_filter_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_user_filter.tform.php', $client_id, $primary_id, $params); |
| | | $app->plugin->raiseEvent('mail:mail_user_filter:on_after_update',$this); |
| | | return $affected_rows; |
| | | } |
| | | |
| | | public function mail_user_filter_delete($session_id,$domain_id) |
| | | { |
| | | global $app; |
| | | if (!$this->checkPerm($session_id, 'mail_user_filter_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_user_filter.tform.php',$domain_id); |
| | | $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this); |
| | | return $affected_rows; |
| | | } |
| | | |
| | |
| | | $app->uses('remoting_lib'); |
| | | $app->remoting_lib->loadFormDef('../client/form/client.tform.php'); |
| | | return $app->remoting_lib->getDataRecord($client_id); |
| | | } |
| | | |
| | | public function client_get_id($session_id, $sys_userid) |
| | | { |
| | | global $app; |
| | | if(!$this->checkPerm($session_id, 'client_get')) { |
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | |
| | | $sys_userid = intval($sys_userid); |
| | | |
| | | $rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ".$sys_userid); |
| | | if(isset($rec['client_id'])) { |
| | | return intval($rec['client_id']); |
| | | } else { |
| | | $this->server->fault('no_client_found', 'There is no sysuser account for this client ID.'); |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | $app->uses('remoting_lib'); |
| | | |
| | | //* Load the form definition |
| | | $app->remoting_lib->loadFormDef($formdef_file); |
| | | |
| | | //* load the user profile of the client |
| | | $app->remoting_lib->loadUserProfile($client_id); |
| | | |
| | | //* Load the form definition |
| | | $app->remoting_lib->loadFormDef($formdef_file); |
| | | |
| | | //* Get the SQL query |
| | | $sql = $app->remoting_lib->getSQL($params,'INSERT',0); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | // set a few values for compatibility with tform actions, mostly used by plugins |
| | | $this->id = $insert_id; |
| | | $this->dataRecord = $params; |
| | | |
| | | |
| | | return $insert_id; |
| | |
| | | |
| | | $app->uses('remoting_lib'); |
| | | |
| | | //* Load the form definition |
| | | $app->remoting_lib->loadFormDef($formdef_file); |
| | | |
| | | //* load the user profile of the client |
| | | $app->remoting_lib->loadUserProfile($client_id); |
| | | |
| | | //* Load the form definition |
| | | $app->remoting_lib->loadFormDef($formdef_file); |
| | | |
| | | //* Get the SQL query |
| | | $sql = $app->remoting_lib->getSQL($params,'UPDATE',$primary_id); |
| | |
| | | } |
| | | |
| | | $old_rec = $app->remoting_lib->getDataRecord($primary_id); |
| | | |
| | | // set a few values for compatibility with tform actions, mostly used by plugins |
| | | $this->oldDataRecord = $old_rec; |
| | | $this->id = $primary_id; |
| | | $this->dataRecord = $params; |
| | | |
| | | |
| | | $app->db->query($sql); |
| | | |
| | |
| | | |
| | | $app->uses('remoting_lib'); |
| | | |
| | | //* load the user profile of the client |
| | | $app->remoting_lib->loadUserProfile($client_id); |
| | | |
| | | //* Load the form definition |
| | | $app->remoting_lib->loadFormDef($formdef_file); |
| | | |