Skip to content

Commit aeeae9c

Browse files
committed
fix: retrocompatibilità per introduzione del campo session_token
1 parent 4b8cef2 commit aeeae9c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/AuthOSM.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected function __construct()
9696
$id = $_SESSION['id_utente'];
9797
}
9898

99-
if (!empty($id)) {
99+
if (!empty($id) && database()->columnExists('zz_users', 'session_token')) {
100100
$this->identifyUser($id);
101101
}
102102

@@ -949,7 +949,7 @@ public static function canAccessIntended()
949949
public function identifyUser($user_id)
950950
{
951951
$database = database();
952-
952+
953953
try {
954954
$results = $database->fetchArray('SELECT `id`, `idanagrafica`, `username`, `session_token`, (SELECT `title` FROM `zz_groups` LEFT JOIN `zz_groups_lang` ON `zz_groups`.`id`=`zz_groups_lang`.`id_record` AND `zz_groups_lang`.`id_lang`='.prepare(Models\Locale::getDefault()->id).' WHERE `zz_groups`.`id` = `zz_users`.`idgruppo`) AS gruppo FROM `zz_users` WHERE `id` = :user_id AND `enabled` = 1 LIMIT 1', [
955955
':user_id' => $user_id,

0 commit comments

Comments
 (0)