Move isUserVerified to OC_Util

This commit is contained in:
Lukas Reschke 2012-10-16 00:47:22 +02:00
parent 77e18b01ba
commit f4142bd2a8
3 changed files with 14 additions and 13 deletions

View File

@ -90,17 +90,6 @@ class OC_JSON{
exit(); 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(!isset($_SESSION['verifiedLogin']) OR $_SESSION['verifiedLogin'] < time()) {
return false;
}
return true;
}
/** /**
* Send json error msg * Send json error msg

View File

@ -405,6 +405,18 @@ class OC_Util {
} }
} }
/**
* 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(!isset($_SESSION['verifiedLogin']) OR $_SESSION['verifiedLogin'] < time()) {
return false;
}
return true;
}
/** /**
* Redirect to the user default page * Redirect to the user default page
*/ */

View File

@ -23,7 +23,7 @@ if(OC_User::getUser() === $username) {
{ {
$userstatus = 'user'; $userstatus = 'user';
} else { } else {
if (!OC_JSON::isUserVerified()) { if (!OC_Util::isUserVerified()) {
$userstatus = null; $userstatus = null;
} }
} }