users.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. $shareNotice = '';
  30. if (\OC_App::isEnabled( "files_sharing" ) ) {
  31. $shareNotice = 'Note: users may only share to groups that they belong to, and their members';
  32. }
  33. $tmpl = new OC_Template( "settings", "users", "user" );
  34. $tmpl->assign( "users", $users );
  35. $tmpl->assign( "groups", $groups );
  36. $tmpl->assign( 'quota_preset', $quotaPreset);
  37. $tmpl->assign( 'default_quota', $defaultQuota);
  38. $tmpl->assign( 'share_notice', $shareNotice);
  39. $tmpl->printPage();