47 lines
953 B
PHP
Executable File
47 lines
953 B
PHP
Executable File
<?php
|
|
if (isset($_POST['RegTemp']) && !empty($_POST['RegTemp']))
|
|
{
|
|
include 'include/global.php';
|
|
include 'include/function.php';
|
|
|
|
$data = explode(";",$_POST['RegTemp']);
|
|
$vStamp = $data[0];
|
|
$sn = $data[1];
|
|
$user_id = $data[2];
|
|
$regTemp = $data[3];
|
|
|
|
$device = getDeviceBySn($sn);
|
|
|
|
$salt = md5($device[0]['ac'].$device[0]['vkey'].$regTemp.$sn.$user_id);
|
|
|
|
if (strtoupper($vStamp) == strtoupper($salt))
|
|
{
|
|
$data = getFingerId($user_id);
|
|
$fid=$data['0']['fid'];
|
|
|
|
if ($fid == 0)
|
|
{
|
|
$result2 = addFinger($user_id, $regTemp) ;
|
|
if ($result2)
|
|
{
|
|
$res['result'] = true;
|
|
}
|
|
else
|
|
{
|
|
$res['server'] = "Error insert registration data!";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$res['result'] = false;
|
|
$res['user_finger_'.$user_id] = "Template already exist.";
|
|
}
|
|
echo "empty";
|
|
}
|
|
else
|
|
{
|
|
$msg = "Parameter invalid..";
|
|
echo "flexcode/messages.php?msg=$msg";
|
|
}
|
|
}
|
|
?>
|