Skip to content

Commit

Permalink
Update narodmon3.class.php
Browse files Browse the repository at this point in the history
Добавлен вывод информации об авторизации в лог.
  • Loading branch information
Aleks130699 committed Jul 20, 2020
1 parent d63d030 commit 42a095e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/narodmon3/narodmon3.class.php
Expand Up @@ -437,17 +437,28 @@ function Logon()
curl_setopt($ch, CURLOPT_USERAGENT, 'MajorDomo module');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($request));
$reply = curl_exec($ch);

$mes = json_decode($reply, true);

if($mes["login"]){
DebMes(date("Y-m-d H:i:s")." Authorization user ok - login: ".$mes["login"]." uid: ".$mes["uid"],"narodmon3");
}

if($mes["error"]){
DebMes(date("Y-m-d H:i:s")." Authorization error: ".$mes["error"],"narodmon3");
}

if(!$reply or empty($reply))
{
echo date("Y-m-d H:i:s")."Request: Connect error : ".$reply."\n";
DebMes(date("Y-m-d H:i:s")."Request: Connect error : ".$reply."\n","narodmon3");
return false;
}

$data = json_decode($reply, true);
if(!$data or !is_array($data))
{
echo date("Y-m-d H:i:s")."Request: Wrong data\n";
DebMes(date("Y-m-d H:i:s")."Request: Wrong data\n","narodmon3");
return false;
}

Expand Down

0 comments on commit 42a095e

Please sign in to comment.