ftp_user_get($a_args)ftp_users/ftp_users.module, line 248
<?php
function ftp_user_get($a_args) {
try {
vpx_funcparam_add($a_funcparam, $a_args, 'app_id', VPX_TYPE_INT, TRUE);
vpx_funcparam_add_uri($a_funcparam, $a_args, 'user', VPX_TYPE_USER_ID, TRUE);
$app_id = vpx_funcparam_get_value($a_funcparam, 'app_id');
$user = vpx_funcparam_get_value($a_funcparam, 'user');
vpx_shared_webservice_must_be_active('batch_upload', $app_id);
$a_where[] = sprintf("userid='%s'", db_escape_string($user));
$a_where[] = sprintf("eua_id=%d", $app_id);
db_set_active('ftp');
$a_user = db_fetch_array(vpx_db_query("SELECT * FROM {ftpuser}". vpx_db_simple_where($a_where)));
db_set_active();
if (!$a_user) {
throw new vpx_exception_error(ERRORCODE_FTP_UNKNOWN_USER);
}
$rest_response = new rest_response(vpx_return_error(ERRORCODE_OKAY));
$rest_response->add_item(array(
"userid" => $a_user['userid'],
"active" => intval($a_user['active']) ? 'true' : 'false',
"modified" => $a_user['modified'],
));
return $rest_response;
}
catch (vpx_exception_error_access_denied $e) {
return $e->vpx_exception_rest_response();
}
}
?>