обработка ошибки
This commit is contained in:
@ -1112,12 +1112,16 @@
|
|||||||
$expiration=false;
|
$expiration=false;
|
||||||
$overdue=false;
|
$overdue=false;
|
||||||
$sql="select * from ".$Schema."p__Login(".getSQLValue($idType,$_SESSION['USER_ID']).",'$login','$password',null,null,null);";
|
$sql="select * from ".$Schema."p__Login(".getSQLValue($idType,$_SESSION['USER_ID']).",'$login','$password',null,null,null);";
|
||||||
/*
|
try
|
||||||
$ga=new GoogleAuthenticator;
|
{
|
||||||
$code=$ga->getCode($user->ga_secret);
|
|
||||||
if ($code!=$_POST['code']) return new AuthError('invalid code');
|
|
||||||
*/
|
|
||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
|
} catch (Exception $e)
|
||||||
|
{
|
||||||
|
if(str_contains($e->getMessage(), ']]'))
|
||||||
|
sendError(1, $e->getMessage());
|
||||||
|
else
|
||||||
|
sendError(1, '[['.trt("SQL_query_error").']]'.$e->getMessage());
|
||||||
|
}
|
||||||
if($res->rowCount()>0)
|
if($res->rowCount()>0)
|
||||||
{
|
{
|
||||||
$result = $res->fetch(PDO::FETCH_ASSOC);
|
$result = $res->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|||||||
Reference in New Issue
Block a user