| | |
| | | return ($app->db->affectedRows() == 1); |
| | | } |
| | | |
| | | // Get server details |
| | | /** |
| | | Gets the server configuration |
| | | @param int session id |
| | | @param int server id |
| | | @param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc |
| | | @author Julio Montoya <gugli100@gmail.com> |
| | | */ |
| | | public function server_get($session_id, $server_id, $section ='') { |
| | | global $app; |
| | | if(!$this->checkPerm($session_id, 'server_get')) { |
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | if (!empty($session_id) && !empty($server_id)) { |
| | | $app->uses('remoting_lib , getconf'); |
| | | $section_config = $app->getconf->get_server_config($server_id,$section); |
| | | return $section_config; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //* Get mail domain details |
| | | public function mail_domain_get($session_id, $primary_id) |
| | | { |
| | |
| | | $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); |
| | | $affected_rows = $this->insertQuery('../mail/form/mail_user_filter.tform.php', $client_id, $params,'mail:mail_user_filter:on_after_insert'); |
| | | // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_insert',$this); |
| | | return $affected_rows; |
| | | } |
| | | |
| | |
| | | $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); |
| | | $affected_rows = $this->updateQuery('../mail/form/mail_user_filter.tform.php', $client_id, $primary_id, $params,'mail:mail_user_filter:on_after_update'); |
| | | // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_update',$this); |
| | | return $affected_rows; |
| | | } |
| | | |
| | |
| | | //* Save changes to Datalog |
| | | if($app->remoting_lib->formDef["db_history"] == 'yes') { |
| | | $new_rec = $app->remoting_lib->getDataRecord($insert_id); |
| | | $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); |
| | | |
| | | $app->remoting_lib->ispconfig_sysuser_add($params,$insert_id); |
| | | |
| | | $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); |
| | | $app->remoting_lib->ispconfig_sysuser_add($params,$insert_id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return $insert_id; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private function insertQuery($formdef_file, $client_id, $params) |
| | | private function insertQuery($formdef_file, $client_id, $params,$event_identifier = '') |
| | | { |
| | | global $app, $tform, $remoting_lib; |
| | | |
| | |
| | | |
| | | $insert_id = $app->db->insertID(); |
| | | |
| | | // set a few values for compatibility with tform actions, mostly used by plugins |
| | | $this->id = $insert_id; |
| | | $this->dataRecord = $params; |
| | | |
| | | if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this); |
| | | |
| | | //$app->uses('tform'); |
| | | //* Save changes to Datalog |
| | | if($app->remoting_lib->formDef["db_history"] == 'yes') { |
| | | $new_rec = $app->remoting_lib->getDataRecord($insert_id); |
| | | $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); |
| | | |
| | | } |
| | | |
| | | // set a few values for compatibility with tform actions, mostly used by plugins |
| | | $this->id = $insert_id; |
| | | $this->dataRecord = $params; |
| | | |
| | | |
| | | $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); |
| | | } |
| | | return $insert_id; |
| | | } |
| | | |
| | | |
| | | private function updateQuery($formdef_file, $client_id, $primary_id, $params) |
| | | private function updateQuery($formdef_file, $client_id, $primary_id, $params, $event_identifier = '') |
| | | { |
| | | global $app; |
| | | |
| | |
| | | $this->id = $primary_id; |
| | | $this->dataRecord = $params; |
| | | |
| | | |
| | | $app->db->query($sql); |
| | | |
| | | if($app->db->errorMessage != '') { |
| | |
| | | |
| | | $affected_rows = $app->db->affectedRows(); |
| | | |
| | | if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this); |
| | | |
| | | //* Save changes to Datalog |
| | | if($app->remoting_lib->formDef["db_history"] == 'yes') { |
| | | $new_rec = $app->remoting_lib->getDataRecord($primary_id); |
| | | $app->remoting_lib->datalogSave('UPDATE',$primary_id,$old_rec,$new_rec); |
| | | } |
| | | |
| | | |
| | | |
| | | return $affected_rows; |
| | | } |
| | |
| | | $app->uses('remoting_lib'); |
| | | |
| | | //* load the user profile of the client |
| | | $app->remoting_lib->loadUserProfile($client_id); |
| | | $app->remoting_lib->loadUserProfile(0); |
| | | |
| | | //* Load the form definition |
| | | $app->remoting_lib->loadFormDef($formdef_file); |
| | | |
| | | $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; |
| | | |
| | | //* Get the SQL query |
| | | $sql = $app->remoting_lib->getDeleteSQL($primary_id); |
| | |
| | | |
| | | //* Save changes to Datalog |
| | | if($app->remoting_lib->formDef["db_history"] == 'yes') { |
| | | $rec = $app->remoting_lib->getDataRecord($primary_id); |
| | | $app->remoting_lib->datalogSave('DELETE',$primary_id,$rec,array()); |
| | | $app->remoting_lib->datalogSave('DELETE',$primary_id,$old_rec,array()); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | ?> |
| | | ?> |