diff options
author | Bart Visscher <bart@thisnet.nl> | 2011-09-18 21:31:56 +0200 |
---|---|---|
committer | Bart Visscher <bart@thisnet.nl> | 2011-09-18 21:31:56 +0200 |
commit | e990ef35426b7dde59ec74eb1568a8cfbd69f316 (patch) | |
tree | 9b4a276885378540812ce93c3cddcc73a00ba3b0 /settings/admin.php | |
parent | 8966ed5a004a9b830f093355170d381566d58554 (diff) | |
download | nextcloud-server-e990ef35426b7dde59ec74eb1568a8cfbd69f316.tar.gz nextcloud-server-e990ef35426b7dde59ec74eb1568a8cfbd69f316.zip |
Move some common code to OC_Util
Created the following function:
- checkLoggedIn
- checkAdminUser
- redirectToDefaultPage
Diffstat (limited to 'settings/admin.php')
-rw-r--r-- | settings/admin.php | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/settings/admin.php b/settings/admin.php index 15559a150e5..81ed6aa9516 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -6,14 +6,7 @@ */ require_once('../lib/base.php'); -if( !OC_User::isLoggedIn()){ - header( "Location: ".OC_Helper::linkTo( "", "index.php" )); - exit(); -} -if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){ - header( "Location: ".OC_Helper::linkTo( '', "index.php" )); - exit(); -} +OC_Util::checkAdminUser(); OC_Util::addStyle( "settings", "settings" ); OC_App::setActiveNavigationEntry( "admin" ); @@ -24,4 +17,4 @@ $tmpl->assign('forms',array()); foreach($forms as $form){ $tmpl->append('forms',$form); } -$tmpl->printPage();
\ No newline at end of file +$tmpl->printPage(); |