Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-10-15 18:30:53 +0400
committerDaniel Molkentin <daniel@molkentin.de>2012-10-15 19:42:38 +0400
commit1c865f702c948dcc41b9a69f22d8a3e9e31b8f6b (patch)
tree66b1c20ac5f79339178ca5c849237107affbd119 /lib
parent842d6dad47f90730bcc0ac04b36891dfe119eb2a (diff)
Change verifyUser so that external json files can call it
Diffstat (limited to 'lib')
-rw-r--r--lib/json.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/json.php b/lib/json.php
index 89509710745..c362c66693b 100644
--- a/lib/json.php
+++ b/lib/json.php
@@ -58,7 +58,8 @@ class OC_JSON{
*/
public static function checkAdminUser() {
self::checkLoggedIn();
- if( !OC_Group::inGroup( OC_User::getUser(), 'admin' ) || self::verifyUser() === false) {
+ self::verifyUser();
+ if( !OC_Group::inGroup( OC_User::getUser(), 'admin' )) {
$l = OC_L10N::get('lib');
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
exit();
@@ -70,7 +71,8 @@ class OC_JSON{
*/
public static function checkSubAdminUser() {
self::checkLoggedIn();
- if(!OC_Group::inGroup(OC_User::getUser(),'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser()) || self::verifyUser() === false) {
+ self::verifyUser();
+ if(!OC_Group::inGroup(OC_User::getUser(),'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
$l = OC_L10N::get('lib');
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
exit();
@@ -84,9 +86,9 @@ class OC_JSON{
public static function verifyUser() {
// Check if the user verified his password in the last 15 minutes
if($_SESSION['verifiedLogin'] < time() OR !isset($_SESSION['verifiedLogin'])) {
- return false;
+ self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
+ exit();
}
- return true;
}
/**