diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-01-14 12:53:18 -0800 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-01-14 12:53:18 -0800 |
commit | 53ca0db434f3ad8d043a0a9b76bd59f22af38f99 (patch) | |
tree | fd69b40c08932941f31edbb57d8911d847ff230a /lib/json.php | |
parent | 8b2307ce4b258f103506f85e787acbd552e83302 (diff) | |
parent | eab6d7eb23f66ac4a662a036336b292138e4484c (diff) | |
download | nextcloud-server-53ca0db434f3ad8d043a0a9b76bd59f22af38f99.tar.gz nextcloud-server-53ca0db434f3ad8d043a0a9b76bd59f22af38f99.zip |
Merge pull request #1177 from owncloud/OC_User--isAdminUser()
Check if user is admin - bool
Diffstat (limited to 'lib/json.php')
-rw-r--r-- | lib/json.php | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/json.php b/lib/json.php index 204430411c0..c87de3e200b 100644 --- a/lib/json.php +++ b/lib/json.php @@ -57,9 +57,7 @@ class OC_JSON{ * Check if the user is a admin, send json error msg if not */ public static function checkAdminUser() { - self::checkLoggedIn(); - self::verifyUser(); - if( !OC_Group::inGroup( OC_User::getUser(), 'admin' )) { + if( !OC_User::isAdminUser(OC_User::getUser())) { $l = OC_L10N::get('lib'); self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); exit(); @@ -70,27 +68,12 @@ class OC_JSON{ * Check if the user is a subadmin, send json error msg if not */ public static function checkSubAdminUser() { - self::checkLoggedIn(); - self::verifyUser(); - if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())) { + if(!OC_SubAdmin::isSubAdmin(OC_User::getUser())) { $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 - */ - public static function verifyUser() { - if(OC_Config::getValue('enhancedauth', false) === true) { - if(!isset($_SESSION['verifiedLogin']) OR $_SESSION['verifiedLogin'] < time()) { - $l = OC_L10N::get('lib'); - self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); - exit(); - } - } - } /** * Send json error msg |