Explorar o código

fix index in cookie string

rajven %!s(int64=2) %!d(string=hai) anos
pai
achega
bd8016c997
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      html/inc/auth.utils.php

+ 1 - 1
html/inc/auth.utils.php

@@ -70,7 +70,7 @@ function login($db)
             #check session
             $current_hash = md5($session['id'] . ":" . $session['session_key'] . ":" . $auth_ip);
             #enable access
-            if ($current_hash === $data_array[3]) {
+            if (isset($data_array[2]) and $current_hash === $data_array[2]) {
                 $auth_record = get_record_sql($db, "SELECT * FROM `Customers` WHERE id='" . $data_array[0] . "'");
                 $_SESSION['IP'] = $auth_ip;
                 $_SESSION['user_id'] = $auth_record['id'];