PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/openconstructor/security/editgroup.php

http://openconstructor.googlecode.com/
PHP | 56 lines | 30 code | 5 blank | 21 comment | 1 complexity | f7a8eab0a7e5cbeba8d5cd2f11d9b314 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * Copyright 2003 - 2007 eSector Solutions, LLC
  4. *
  5. * All rights reserved.
  6. *
  7. * This file is part of Open Constructor (http://www.openconstructor.org/).
  8. *
  9. * Open Constructor is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * Open Constructor is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * The GNU General Public License can be found at
  19. * http://www.gnu.org/copyleft/gpl.html
  20. *
  21. * $Id: editgroup.php,v 1.8 2007/03/02 10:06:41 sanjar Exp $
  22. */
  23. require_once($_SERVER['DOCUMENT_ROOT'].'/openconstructor/lib/wccommons._wc');
  24. WCS::requireAuthentication();
  25. require_once(LIBDIR.'/languagesets/'.LANGUAGE.'/security._wc');
  26. require_once(LIBDIR.'/security/groupfactory._wc');
  27. require_once(LIBDIR.'/smarty/ocmsmartybackend._wc');
  28. $smartybackend = & new OcmSmartyBackend();
  29. $smartybackend->caching = false;
  30. $group = &GroupFactory::getGroup(@$_GET['id']);
  31. assert($group != null);
  32. $smartybackend->assign_by_ref("group", $group);
  33. $WCS = new WCS();
  34. $smartybackend->assign_by_ref("WCS", $WCS);
  35. require_once(LIBDIR.'/security/user._wc');
  36. $owner = &User::load($group->sRes->owner);
  37. $ownerGroup = &GroupFactory::getGroup($group->sRes->group);
  38. $smartybackend->assign_by_ref("owner", $owner);
  39. $smartybackend->assign_by_ref("ownerGroup", $ownerGroup);
  40. $sRes = &$group->sRes;
  41. $authList = array();
  42. foreach($sRes->actions as $act) {
  43. $c = 'GROUP_'.strtoupper(strtr($act, '.', '_'));
  44. $title = defined($c) ? constant($c) : $act;
  45. $authList[] = array('act' => $act, 'title' => $title,
  46. 'ownerBit' => $sRes->getOwnerBit($act) ? true : false,
  47. 'groupBit' => $sRes->getGroupBit($act) ? true : false);
  48. }
  49. $smartybackend->assign("authList", $authList);
  50. $smartybackend->display('security/editgroup.tpl');
  51. ?>