users.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
  4. * This file is licensed under the Affero General Public License version 3 or later.
  5. * See the COPYING-README file.
  6. */
  7. require_once('../lib/base.php');
  8. OC_Util::checkAdminUser();
  9. // We have some javascript foo!
  10. OC_Util::addScript( 'settings', 'users' );
  11. OC_Util::addScript( 'core', 'multiselect' );
  12. OC_Util::addStyle( 'settings', 'settings' );
  13. OC_App::setActiveNavigationEntry( 'core_users' );
  14. $users = array();
  15. $groups = array();
  16. foreach( OC_User::getUsers() as $i ){
  17. $users[] = array( "name" => $i, "groups" => join( ", ", OC_Group::getUserGroups( $i ) ),'quota'=>OC_Preferences::getValue($i,'files','quota','default'));
  18. }
  19. foreach( OC_Group::getGroups() as $i ){
  20. // Do some more work here soon
  21. $groups[] = array( "name" => $i );
  22. }
  23. $quotaPreset=OC_Appconfig::getValue('files','quota_preset','default,none,1 GB, 5 GB, 10 GB');
  24. $quotaPreset=explode(',',$quotaPreset);
  25. foreach($quotaPreset as &$preset){
  26. $preset=trim($preset);
  27. }
  28. $defaultQuota=OC_Appconfig::getValue('files','default_quota','none');
  29. $tmpl = new OC_Template( "settings", "users", "user" );
  30. $tmpl->assign( "users", $users );
  31. $tmpl->assign( "groups", $groups );
  32. $tmpl->assign( 'quota_preset', $quotaPreset);
  33. $tmpl->assign( 'default_quota', $defaultQuota);
  34. $tmpl->printPage();
  35. ?>