diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-06-22 12:50:57 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-06-22 12:50:57 +0200 |
commit | 83958ebd4be58c64b23a3e9535f4246faeff8f4a (patch) | |
tree | 169321f7bb32e315c6a33ce139b799efdc224da4 /admin | |
parent | c0af177223f5ebd74614b775121ea7f3497d25a5 (diff) | |
download | nextcloud-server-83958ebd4be58c64b23a3e9535f4246faeff8f4a.tar.gz nextcloud-server-83958ebd4be58c64b23a3e9535f4246faeff8f4a.zip |
add oc_user::getUser to get the user id of the loggedin user
Diffstat (limited to 'admin')
-rw-r--r-- | admin/ajax/changepassword.php | 2 | ||||
-rw-r--r-- | admin/ajax/creategroup.php | 2 | ||||
-rw-r--r-- | admin/ajax/createuser.php | 2 | ||||
-rw-r--r-- | admin/ajax/removegroup.php | 2 | ||||
-rw-r--r-- | admin/ajax/removeuser.php | 2 | ||||
-rw-r--r-- | admin/ajax/togglegroups.php | 2 | ||||
-rw-r--r-- | admin/apps.php | 2 | ||||
-rw-r--r-- | admin/system.php | 2 | ||||
-rw-r--r-- | admin/users.php | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/admin/ajax/changepassword.php b/admin/ajax/changepassword.php index a8f3af15175..51634908a76 100644 --- a/admin/ajax/changepassword.php +++ b/admin/ajax/changepassword.php @@ -7,7 +7,7 @@ require_once('../../lib/base.php'); header( "Content-Type: application/jsonrequest" ); // Check if we are a user -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); exit(); } diff --git a/admin/ajax/creategroup.php b/admin/ajax/creategroup.php index eec27587930..df9a36aaa2f 100644 --- a/admin/ajax/creategroup.php +++ b/admin/ajax/creategroup.php @@ -7,7 +7,7 @@ require_once('../../lib/base.php'); header( "Content-Type: application/jsonrequest" ); // Check if we are a user -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); exit(); } diff --git a/admin/ajax/createuser.php b/admin/ajax/createuser.php index a6e4ec0e93d..507ded9079f 100644 --- a/admin/ajax/createuser.php +++ b/admin/ajax/createuser.php @@ -7,7 +7,7 @@ require_once('../../lib/base.php'); header( "Content-Type: application/jsonrequest" ); // Check if we are a user -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); exit(); } diff --git a/admin/ajax/removegroup.php b/admin/ajax/removegroup.php index c7991ba5819..e3d62e5fac8 100644 --- a/admin/ajax/removegroup.php +++ b/admin/ajax/removegroup.php @@ -7,7 +7,7 @@ require_once('../../lib/base.php'); header( "Content-Type: application/jsonrequest" ); // Check if we are a user -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); exit(); } diff --git a/admin/ajax/removeuser.php b/admin/ajax/removeuser.php index 7e587f16058..6b48146ad45 100644 --- a/admin/ajax/removeuser.php +++ b/admin/ajax/removeuser.php @@ -7,7 +7,7 @@ require_once('../../lib/base.php'); header( "Content-Type: application/jsonrequest" ); // Check if we are a user -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); exit(); } diff --git a/admin/ajax/togglegroups.php b/admin/ajax/togglegroups.php index f821ae0bfaa..5c7bd393e92 100644 --- a/admin/ajax/togglegroups.php +++ b/admin/ajax/togglegroups.php @@ -7,7 +7,7 @@ require_once('../../lib/base.php'); header( "Content-Type: application/jsonrequest" ); // Check if we are a user -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); exit(); } diff --git a/admin/apps.php b/admin/apps.php index 285cf9e90f5..b47611f536d 100644 --- a/admin/apps.php +++ b/admin/apps.php @@ -24,7 +24,7 @@ require_once('../lib/base.php'); include_once('../lib/installer.php'); require( 'template.php' ); -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ header( "Location: ".OC_HELPER::linkTo( "", "index.php" )); exit(); } diff --git a/admin/system.php b/admin/system.php index 310979295f0..284509144ee 100644 --- a/admin/system.php +++ b/admin/system.php @@ -23,7 +23,7 @@ require_once('../lib/base.php'); require( 'template.php' ); -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ header( "Location: ".OC_HELPER::linkTo( "index.php" )); exit(); } diff --git a/admin/users.php b/admin/users.php index e44feb40fe2..0848d57162a 100644 --- a/admin/users.php +++ b/admin/users.php @@ -23,7 +23,7 @@ require_once('../lib/base.php'); require( 'template.php' ); -if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ +if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){ header( "Location: ".OC_HELPER::linkTo( "index.php" )); exit(); } |