. * */ require_once('../lib/base.php'); require( 'template.php' ); if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )){ header( "Location: ".OC_HELPER::linkTo( "index.php" )); exit(); } // We have some javascript foo! OC_UTIL::addScript( "admin", "users" ); $users = array(); $groups = array(); foreach( OC_USER::getUsers() as $i ){ // Do some more work here soon $ingroups = array(); foreach( OC_GROUP::getUserGroups( $i ) as $userGroup ){ $ingroups[] = $userGroup; } $users[] = array( "name" => $i, "groups" => join( ",", $ingroups )); } foreach( OC_GROUP::getGroups() as $i ){ // Do some more work here soon $groups[] = array( "name" => $i["gid"] ); } $tmpl = new OC_TEMPLATE( "admin", "users", "admin" ); $tmpl->assign( "users", $users ); $tmpl->assign( "groups", $groups ); $tmpl->printPage(); ?>