summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-10-16 00:32:06 +0200
committerLukas Reschke <lukas@statuscode.ch>2012-10-16 00:47:38 +0200
commit097f4298165a7d028757de61c6fef49f1f8f6a9a (patch)
tree7774b3ca81ea370c0c9eb321587e9ab1300b8dd8 /lib
parentc83a2a5517bc320d418b31005efc6f37c9091b9a (diff)
downloadnextcloud-server-097f4298165a7d028757de61c6fef49f1f8f6a9a.tar.gz
nextcloud-server-097f4298165a7d028757de61c6fef49f1f8f6a9a.zip
Add isUserVerified()
Diffstat (limited to 'lib')
-rw-r--r--lib/json.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/json.php b/lib/json.php
index c362c66693b..0a62dc8a65b 100644
--- a/lib/json.php
+++ b/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