Commit a79341a3 authored by mcramer's avatar mcramer

Added function to get server data from ftp username via remoting

parent 74410e7a
......@@ -1330,6 +1330,26 @@ class remoting {
return $affected_rows;
}
//* Get server for an ftp user
public function sites_ftp_user_server_get($session_id, $ftp_user)
{
global $app;
if(!$this->checkPerm($session_id, 'sites_ftp_user_server_get')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$data = $app->db->queryOneRecord("SELECT server_id FROM ftp_user WHERE username = '".$app->db->quote($ftp_user)."'");
file_put_contents('/tmp/test.txt', serialize($data));
if(!isset($data['server_id'])) return false;
$server = $this->server_get($session_id, $data['server_id'], 'server');
file_put_contents('/tmp/test2.txt', serialize($server));
return $server;
}
// ----------------------------------------------------------------------------------------------------------
//* Get record details
......
......@@ -2,7 +2,7 @@
$function_list['sites_cron_get,sites_cron_add,sites_cron_update,sites_cron_delete'] = 'Sites cron functions';
$function_list['sites_database_get,sites_database_add,sites_database_update,sites_database_delete, sites_database_get_all_by_user'] = 'Sites database functions';
$function_list['sites_web_folder_get,sites_web_folder_add,sites_web_folder_update,sites_web_folder_delete,sites_web_folder_user_get,sites_web_folder_user_add,sites_web_folder_user_update,sites_web_folder_user_delete'] = 'Sites Protected folder functions';
$function_list['sites_ftp_user_get,sites_ftp_user_add,sites_ftp_user_update,sites_ftp_user_delete'] = 'Sites FTP-User functions';
$function_list['sites_ftp_user_get,sites_ftp_user_server_get,sites_ftp_user_add,sites_ftp_user_update,sites_ftp_user_delete'] = 'Sites FTP-User functions';
$function_list['sites_shell_user_get,sites_shell_user_add,sites_shell_user_update,sites_shell_user_delete'] = 'Sites Shell-User functions';
$function_list['sites_web_domain_get,sites_web_domain_add,sites_web_domain_update,sites_web_domain_delete,sites_web_domain_set_status'] = 'Sites Domain functions';
$function_list['sites_web_aliasdomain_get,sites_web_aliasdomain_add,sites_web_aliasdomain_update,sites_web_aliasdomain_delete'] = 'Sites Aliasdomain functions';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment