Fix exception handling for bad data in server-to-server access request

This commit is contained in:
Thomas Pike
2018-04-04 16:53:59 +02:00
parent bee24b9b5c
commit b2a093a743

View File

@@ -138,12 +138,10 @@ if(isset($_POST['sync']) && ($server_admin || $active_user->admin)) {
case 'server_account':
try {
$server_remote = $server_dir->get_server_by_hostname($_POST['hostname_remote']);
} catch(ServerNotFoundException $e) {
$content = new PageSection('server_not_found');
}
try {
$from = $server_remote->get_account_by_name($_POST['account_remote']);
$from_description = " from {$from->name}@{$server_remote->hostname}";
} catch(ServerNotFoundException $e) {
$content = new PageSection('server_not_found');
} catch(ServerAccountNotFoundException $e) {
$content = new PageSection('server_account_not_found');
}