[Done] init|sync works
This commit is contained in:
parent
6b2422ee13
commit
e648656881
|
@ -301,11 +301,25 @@
|
||||||
->whereUnlockCode($unlock_code)
|
->whereUnlockCode($unlock_code)
|
||||||
->fetch();
|
->fetch();
|
||||||
|
|
||||||
var_dump($machine);
|
|
||||||
|
|
||||||
/* (2) On vérifie si on a bien le bon code */
|
/* (2) On vérifie si on a bien le bon code */
|
||||||
if( $machine === false )
|
if( $machine === false )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
/* [2] Si le code est bon, on le supprime et on met le token
|
||||||
|
=========================================================*/
|
||||||
|
/* (1) Update (edit) machine */
|
||||||
|
$updated = Table::get('machine')
|
||||||
|
->whereId($id_machine)
|
||||||
|
->whereIdWarehouse($id_warehouse)
|
||||||
|
->edit([
|
||||||
|
'unlock_code' => null,
|
||||||
|
'token' => $first_token
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* (2) Manage edition error */
|
||||||
|
return $updated;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -322,7 +336,7 @@
|
||||||
public static function checkToken($id_warehouse, $token, $newToken=null){
|
public static function checkToken($id_warehouse, $token, $newToken=null){
|
||||||
/* [1] On vérifie le token
|
/* [1] On vérifie le token
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$hash = secure_hash($token);
|
$hash = secure_hash($token, '');
|
||||||
|
|
||||||
$byToken = self::getByToken($id_warehouse, $hash);
|
$byToken = self::getByToken($id_warehouse, $hash);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue