| | |
| | | $this->server->fault('permission_denied','You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | $affected_rows = $this->klientadd('../client/form/client.tform.php',$reseller_id, $params); |
| | | if(!isset($params['parent_client_id']) || $params['parent_client_id'] == 0) $params['parent_client_id'] = $reseller_id; |
| | | $affected_rows = $this->klientadd('../client/form/' . (isset($params['limit_client']) && $params['limit_client'] > 0 ? 'reseller' : 'client') . '.tform.php',$reseller_id, $params); |
| | | return $affected_rows; |
| | | |
| | | } |
| | |
| | | $this->server->fault('permission_denied','You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | $affected_rows = $this->updateQuery('../client/form/client.tform.php', $reseller_id, $client_id, $params); |
| | | if(!isset($params['parent_client_id']) || $params['parent_client_id'] == 0) $params['parent_client_id'] = $reseller_id; |
| | | $affected_rows = $this->updateQuery('../client/form/' . (isset($params['limit_client']) && $params['limit_client'] > 0 ? 'reseller' : 'client') . '.tform.php', $reseller_id, $client_id, $params); |
| | | |
| | | $app->remoting_lib->ispconfig_sysuser_update($params,$client_id); |
| | | |
| | |
| | | return false; |
| | | } |
| | | $app->uses('remoting_lib'); |
| | | $app->remoting_lib->loadFormDef('../domain/form/domain.tform.php'); |
| | | $app->remoting_lib->loadFormDef('../client/form/domain.tform.php'); |
| | | return $app->remoting_lib->getDataRecord($primary_id); |
| | | } |
| | | |
| | |
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | return $this->insertQuery('../domain/form/domain.tform.php',$client_id,$params); |
| | | return $this->insertQuery('../client/form/domain.tform.php',$client_id,$params); |
| | | } |
| | | |
| | | //* Delete a record |
| | |
| | | $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); |
| | | return false; |
| | | } |
| | | $affected_rows = $this->deleteQuery('../domain/form/domain.tform.php',$primary_id); |
| | | $affected_rows = $this->deleteQuery('../client/form/domain.tform.php',$primary_id); |
| | | return $affected_rows; |
| | | } |
| | | |
| | |
| | | //* load the user profile of the client |
| | | $app->remoting_lib->loadUserProfile($reseller_id); |
| | | |
| | | //* load the client template |
| | | if(isset($params['template_master']) and $params['template_master'] > 0) |
| | | { |
| | | $template=$app->db->queryOneRecord("SELECT * FROM client_template WHERE template_id=".intval($params['template_master'])); |
| | | if(is_array($template)) $params=array_merge($params,$template); |
| | | } |
| | | |
| | | //* Get the SQL query |
| | | $sql = $app->remoting_lib->getSQL($params,'INSERT',0); |
| | | |
| | |
| | | $this->id = $insert_id; |
| | | $this->dataRecord = $params; |
| | | |
| | | $app->plugin->raiseEvent('client:client:on_after_insert',$this); |
| | | $app->plugin->raiseEvent('client:' . ($reseller_id ? 'reseller' : 'client') . ':on_after_insert',$this); |
| | | |
| | | /* |
| | | if($app->db->errorMessage != '') { |
| | |
| | | protected function insertQuery($formdef_file, $client_id, $params,$event_identifier = '') |
| | | { |
| | | $sql = $this->insertQueryPrepare($formdef_file, $client_id, $params); |
| | | if($sql !== false) return $this->insertQueryExecute($sql, $params,$event_identifier = ''); |
| | | if($sql !== false) return $this->insertQueryExecute($sql, $params,$event_identifier); |
| | | else return false; |
| | | } |
| | | |
| | |
| | | $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); |
| | | return false; |
| | | } |
| | | |
| | | $app->log('Executed insertQueryPrepare', LOGLEVEL_DEBUG); |
| | | return $sql; |
| | | } |
| | | |
| | |
| | | // set a few values for compatibility with tform actions, mostly used by plugins |
| | | $this->id = $insert_id; |
| | | $this->dataRecord = $params; |
| | | |
| | | $app->log('Executed insertQueryExecute, raising events now if any: ' . $event_identifier, LOGLEVEL_DEBUG); |
| | | if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this); |
| | | |
| | | //$app->uses('tform'); |
| | |
| | | global $app; |
| | | |
| | | $sql = $this->updateQueryPrepare($formdef_file, $client_id, $primary_id, $params); |
| | | if($sql !== false) return $this->updateQueryExecute($sql, $primary_id, $params,$event_identifier = ''); |
| | | if($sql !== false) return $this->updateQueryExecute($sql, $primary_id, $params,$event_identifier); |
| | | else return false; |
| | | } |
| | | |