Add isUserVerified()
This commit is contained in:
parent
c83a2a5517
commit
097f429816
13
lib/json.php
13
lib/json.php
|
@ -81,15 +81,26 @@ class OC_JSON{
|
|||
|
||||
/**
|
||||
* Check if the user verified the login with his password in the last 15 minutes
|
||||
* @return bool
|
||||
*/
|
||||
public static function verifyUser() {
|
||||
// Check if the user verified his password in the last 15 minutes
|
||||
if($_SESSION['verifiedLogin'] < time() OR !isset($_SESSION['verifiedLogin'])) {
|
||||
$l = OC_L10N::get('lib');
|
||||
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Check if the user verified the login with his password in the last 15 minutes
|
||||
* @return bool
|
||||
*/
|
||||
public static function isUserVerified() {
|
||||
// Check if the user verified his password in the last 15 minutes
|
||||
if($_SESSION['verifiedLogin'] < time() OR !isset($_SESSION['verifiedLogin'])) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send json error msg
|
||||
|
|
Loading…
Reference in New Issue