vodvud / php_zklib

GNU General Public License v2.0
24 stars 19 forks source link

can't display username #20

Open rajucs opened 4 years ago

rajucs commented 4 years ago

I am not able to display username of my zkteco mb200. but its working another zkteco device. How can i retrive username? where to change in get user info function? right now it displays only id please help me to findout this problem

[1] => Array
        (
            [0] => 1
            [1] => 1
            [2] => 0000000000 
            [3] => 1
            [4] => 0
            [5] => 
        )

    [2] => Array
        (
            [0] => 2
            [1] => 2
            [2] => 0000000000 
            [3] => 2
            [4] => 0
            [5] => 
        )

    [3] => Array
        (
            [0] => 3
            [1] => 3
            [2] => 0000000000 
            [3] => 3
            [4] => 0
            [5] => 
        )
vodvud commented 4 years ago

Hello! Did you really use this library? User array looks a bit difference.

See:https://github.com/vodvud/php_zklib/blob/e277b4bbe3bc93d11d2aacb773bf188770d78fd8/zklib/src/User.php#L101-L108

rajucs commented 4 years ago

@vodvud yes i am using this library

when trying retrieve user data i am not able to get username. Machine Name : MB2000/ID

rajucs commented 4 years ago

Array ( [1] => Array ( [userid] => 1 [name] => 1 [cardno] => 0000000000 [uid] => 1 [role] => 0 [password] => ) )

This is what i am getting now. In name field i am getting an id don't understand how can i get the name. Help please

vodvud commented 4 years ago

Hi! I see it is device with Face Identification, maybe have different data format.

And this why you see ID only https://github.com/vodvud/php_zklib/blob/e277b4bbe3bc93d11d2aacb773bf188770d78fd8/zklib/src/User.php#L97-L99

You may try to debug each data you receive and fix it for this device. https://github.com/vodvud/php_zklib/blob/e277b4bbe3bc93d11d2aacb773bf188770d78fd8/zklib/src/User.php#L77-L95