Open smaaroufi opened 9 years ago
this might be because of the request time out i haven't tested the lib yet, i'm just assuming that ------------- ^^ this have nothing to do with the request time has to do with the code in zklib/zkuser.php it does loop over the whole users, but then doesn't get all of em
anyways what you could do is change the way array loop on them here
$users[$uid] = array($userid, $name, intval( $role ), $password);
to
$users[$userid] = array($userid, $name, intval( $role ), $password);
or even an empty [] which will do the same
sorry I could not develop this library again because I already resigned from where I work and I do not have attendance machine to develop this library
Thank you very much @dnaextrim you already made wonderful work with the lib, and whenever any question will come up i'll try helping as much as i can ;)
Thanks @MostafaNaguib
Hello @MostafaNaguib I use python_zklib and I got several limitations :
file zkuser.php To read user, replace $uid = hexdec( substr($u[1], 0, 4) ).' '; with $u1 = hexdec( substr($u[1], 2, 2) ); $u2 = hexdec( substr($u[1], 4, 2) ); $uid = $u1+($u2*256);
To write user, replace $command_string = str_pad(chr( $uid ), 2, chr(0)).chr($role).str_pad($password, 8, chr(0)).str_pad($name, 28, chr(0)).str_pad(chr(1), 9, chr(0)).str_pad($userid, 8, chr(0)).str_repeat(chr(0),16); with $byte1 = chr((int)($uid % 256)); $byte2 = chr((int)($uid >> 8)); $command_string = $byte1.$byte2.chr($role).str_pad($password, 8, chr(0)).str_pad($name, 28, chr(0)).str_pad(chr(1), 9, chr(0)).str_pad($userid, 8, chr(0)).str_repeat(chr(0),16);
file zkattendance.php To read log, replace $uid = hexdec( substr( $u[1], 0, 6 ) ); $uid = explode(chr(0), $uid); $uid = intval( $uid[0] ); with $u1 = hexdec( substr($u[1], 4, 2) ); $u2 = hexdec( substr($u[1], 6, 2) ); $uid = $u1+($u2*256);
hello i can´t see the information of the device, What can i do?
@kamshory hello I use your solution but still cannot add more than 256 users to the device, or read the attendances of them. And from user 256 and on the role is set to administrator instead of user.
You can try this one https://github.com/kamshory/ZKLibrary
Hi, Thank you for this amazing library, great work ;) I tested it and it works almost very fine, however there's a bug, i have 431 users on my zk attendance machine, but the script shows only 256 users. Is there any advice to fix this ? Thanks