From f4142bd2a8508577ca0abc1f6d84b59dc6de26e5 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 16 Oct 2012 00:47:22 +0200 Subject: [PATCH] Move isUserVerified to OC_Util --- lib/json.php | 13 +------------ lib/util.php | 12 ++++++++++++ settings/ajax/changepassword.php | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/json.php b/lib/json.php index b6acaae4c9..3e55f61843 100644 --- a/lib/json.php +++ b/lib/json.php @@ -90,18 +90,7 @@ class OC_JSON{ 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 */ diff --git a/lib/util.php b/lib/util.php index db71262758..ba2a02922a 100755 --- a/lib/util.php +++ b/lib/util.php @@ -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 */ diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index 822a95c1bc..12d3b67037 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -23,7 +23,7 @@ if(OC_User::getUser() === $username) { { $userstatus = 'user'; } else { - if (!OC_JSON::isUserVerified()) { + if (!OC_Util::isUserVerified()) { $userstatus = null; } }