Merge pull request #5642 from owncloud/fixing-5271-master
we should check if a user is logged in before we check for admin privil...
This commit is contained in:
commit
8f50d7680b
|
@ -579,6 +579,7 @@ class OC_Util {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function checkAdminUser() {
|
public static function checkAdminUser() {
|
||||||
|
OC_Util::checkLoggedIn();
|
||||||
if( !OC_User::isAdminUser(OC_User::getUser())) {
|
if( !OC_User::isAdminUser(OC_User::getUser())) {
|
||||||
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php' ));
|
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php' ));
|
||||||
exit();
|
exit();
|
||||||
|
@ -611,6 +612,7 @@ class OC_Util {
|
||||||
* @return array $groups where the current user is subadmin
|
* @return array $groups where the current user is subadmin
|
||||||
*/
|
*/
|
||||||
public static function checkSubAdminUser() {
|
public static function checkSubAdminUser() {
|
||||||
|
OC_Util::checkLoggedIn();
|
||||||
if(!OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
|
if(!OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
|
||||||
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php' ));
|
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php' ));
|
||||||
exit();
|
exit();
|
||||||
|
|
Loading…
Reference in New Issue