dnaextrim / php_zklib

Attendance Machine Library for PHP with a connection to the network using the UDP protocol and port 4370
http://dnaextrim.github.io/php_zklib/
GNU General Public License v2.0
162 stars 135 forks source link

not showing role correctly #48

Open slorcadelgado opened 5 years ago

slorcadelgado commented 5 years ago

to fix this in "zkuser.php" change line 108:

$role = hexdec( substr($u[1], 4, 4) ).' ';

to:

$role = hexdec( substr($u[1], 6, 2) ).' ';

and "zktest.php" change lines 70-72:

if ($userdata[2] == LEVEL_ADMIN)
      $role = 'ADMIN';
elseif ($userdata[2] == LEVEL_USER)

to:

if ($userdata[4] == LEVEL_ADMIN)
       $role = 'ADMIN';
elseif ($userdata[4] == LEVEL_USER)

zk-attend.zip

cdmarioe commented 4 years ago

if ($userdata[2] == LEVEL_ADMIN) $role = 'ADMIN'; elseif ($userdata[2] == LEVEL_USER)

Change

if ($userdata[1] == LEVEL_ADMIN)