cobisja / tad-php

PHP Library for ZK Time & Attendance Devices
MIT License
213 stars 159 forks source link

Setting user trouble #46

Open Alemko opened 6 years ago

Alemko commented 6 years ago

Hello, I am currently using tad-php but I have a problem when I am setting user options.

For example, I need to set name users, so I use set_user_info (I extract user's template first, and I provide them after I set user's configuration). This is an example:

     $settingUser = $tad->set_user_info([
        'pin' => $user->PIN,
        'name'=> $userNames[$key],
        'privilege'=> $user->Privilege,
        'group'=>$user->Group,
        'password' => $user->Password,
        'card'=> $user->Card,
        'pin2'=> $user->PIN2,
        'tz1'=> $user->TZ1,
        'tz2'=> $user->TZ2,
        'tz3'=> $user->TZ3,
      ]);

The problem is after running this code, the user's group is set to 12, if I change the group directly from code (to 1, for example) it is changed to -12 in the device.

I think the error occurs parsing the data. The device model is F18. Do you know what could it be the parse error?

Thanks in advance.