. * */ require_once('../lib/base.php'); oc_require( 'template.php' ); if( !OC_USER::isLoggedIn() || !OC_USER::ingroup( $_SESSION['username'], 'admin' )){ header( "Location: ".OC_UTIL::linkto( "index.php" )); exit(); } $users = array(); $groups = array(); foreach( OC_USER::getUsers() as $i ){ // Do some more work here soon $ingroups = array(); foreach( OC_USER::getUserGroups( $i ) as $userGroup){ $ingroup[] = OC_USER::getGroupName( $userGroup ); } $users[] = array( "name" => $i, "groups" => join( ",", $ingroups )); } foreach( OC_USER::getGroups() as $i ){ // Do some more work here soon $groups[] = array( "name" => $i ); } $tmpl = new OC_TEMPLATE( "admin", "users", "admin" ); $tmpl->assign( "users", $users ); $tmpl->assign( "groups", $groups ); $tmpl->printPage(); ?>