fix log session in edit

This commit is contained in:
aynsix
2021-05-27 17:39:04 +03:00
parent 33b7a937e9
commit 2c1f20f69e
7 changed files with 46 additions and 14 deletions

View File

@@ -170,6 +170,27 @@ class Session_Logger
return new self($databox, $row['id']);
}
public static function loadById($databox, $logId)
{
$sql = 'SELECT id, site FROM log
WHERE id = :log_id ';
$params = [
':log_id' => $logId
];
$stmt = $databox->get_connection()->prepare($sql);
$stmt->execute($params);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
if (!$row) {
throw new Exception_Session_LoggerNotFound('Logger not found');
}
return new self($databox, $logId);
}
public static function updateClientInfos(Application $app, $appId)
{
if (!$app->getAuthenticator()->isAuthenticated()) {