X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=api.php;h=e74f3b46ff1e0d873f486053ae8f47f0aa157bbb;hp=bb89c55d924e572ae048d443e89f739738683991;hb=66ab59c4ef98a83f250557511efd09df69af9903;hpb=756e90840f47c110d346c863238375bb59a10475 diff --git a/api.php b/api.php index bb89c55..e74f3b4 100644 --- a/api.php +++ b/api.php @@ -3,7 +3,8 @@ license. */ function exit_document ($body) { - exit ("$body"); + $charset_meta = ''; + exit ("$charset_meta$body"); } function success ($reason) { @@ -343,6 +344,9 @@ function main ($con) { try { $con->setpwd ($user, $newpass); } catch (Exception $e) { + if ($e->getMessage () == anydbConnection::err_query) { + error_request (); + } error_server (); } setcookies ($user, $newpass); @@ -363,6 +367,9 @@ function main ($con) { try { $con->setpwd ($newuser_name, $newuser_password); } catch (Exception $e) { + if ($e->getMessage () == anydbConnection::err_query) { + error_request (); + } error_server (); } success_newuser ($newuser_name);