CMXX - Link to asset in contract
This commit is contained in:
@@ -48,8 +48,12 @@ if ($stmt->rowCount() == 1) {
|
||||
} else { //STANDARD LOGIN
|
||||
if (password_verify($password, $user_data['password'])) {
|
||||
|
||||
//Check valid userkey
|
||||
$valid_key = strtotime('+30 minutes',strtotime($user_data['lastlogin']));
|
||||
$valid = ($valid_key <= time())?0:1;
|
||||
|
||||
//REFRESH USERKEY
|
||||
if ($user_data['userkey'] != ''){
|
||||
if ($user_data['userkey'] != '' && $valid == 0){
|
||||
$user_data['userkey'] = bin2hex(random_bytes(25));
|
||||
$sql_userkey = 'UPDATE users SET userkey = ? WHERE id = ?';
|
||||
$stmt_userkey = $pdo->prepare($sql_userkey);
|
||||
@@ -57,7 +61,7 @@ if ($stmt->rowCount() == 1) {
|
||||
}
|
||||
|
||||
//REFRESH USERKEY
|
||||
if ($user_data['service'] != ''){
|
||||
if ($user_data['service'] != '' && $valid == 0){
|
||||
$user_data['service'] = bin2hex(random_bytes(25));
|
||||
$sql_service = 'UPDATE users SET service = ? WHERE id = ?';
|
||||
$stmt_service = $pdo->prepare($sql_service);
|
||||
|
||||
@@ -55,6 +55,10 @@ if(isset($get_content) && $get_content!=''){
|
||||
//build up search
|
||||
$clause .= ' AND reference like :'.$v[0];
|
||||
}
|
||||
elseif ($v[0] == 'servicetool') {
|
||||
//build up search
|
||||
$clause .= ' AND servicetool like :'.$v[0];
|
||||
}
|
||||
else {//create clause
|
||||
$clause .= ' AND '.$v[0].' = :'.$v[0];
|
||||
}
|
||||
@@ -94,6 +98,10 @@ if (!empty($criterias)){
|
||||
$search_value = '%'.$value.'%';
|
||||
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||
}
|
||||
elseif ($key == 'servicetool'){
|
||||
$search_value = '%"'.$value.'"%';
|
||||
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||
}
|
||||
else {
|
||||
$stmt->bindValue($key, $value, PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user