Exemplo n.º 1
0
 /**
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_privileges($handler_id, array $args, array &$data)
 {
     midcom::get('auth')->require_user_do('org.openpsa.user:manage', null, 'org_openpsa_user_interface');
     // Check if we get the group
     $this->_group = new midcom_db_group($args[0]);
     $this->_group->require_do('midgard:privileges');
     $data['group'] = $this->_group;
     $data['acl_dm'] = $this->get_controller('simple', $this->_group);
     switch ($data['acl_dm']->process_form()) {
         case 'save':
             // Fall-through
         // Fall-through
         case 'cancel':
             return new midcom_response_relocate(midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "group/" . $this->_group->guid . "/");
     }
     midcom::get('head')->set_pagetitle($this->_group->official);
     org_openpsa_helpers::dm2_savecancel($this);
     $this->add_breadcrumb("group/{$this->_group->guid}/", $this->_group->name);
     $this->add_breadcrumb("", $this->_l10n->get('permissions'));
 }
Exemplo n.º 2
0
 /**
  * @param mixed $handler_id The ID of the handler.
  * @param Array $args The argument list.
  * @param Array &$data The local request data.
  */
 public function _handler_create($handler_id, array $args, array &$data)
 {
     midcom::get('auth')->require_user_do('org.openpsa.user:manage', null, 'org_openpsa_user_interface');
     if (count($args) > 0) {
         // Get the organization
         $this->_group = new midcom_db_group($args[0]);
         $this->_group->require_do('midgard:create');
         midcom::get('head')->set_pagetitle($this->_group->official);
         $this->add_breadcrumb('group/' . $this->_group->guid . '/', $this->_group->get_label());
     }
     $data['controller'] = $this->get_controller('create');
     switch ($data['controller']->process_form()) {
         case 'save':
             midcom::get('uimessages')->add($this->_l10n->get('org.openpsa.user'), sprintf($this->_l10n->get('person %s created'), $this->_person->name));
             $this->_master->create_account($this->_person, $data["controller"]->formmanager);
             return new midcom_response_relocate('view/' . $this->_person->guid . '/');
         case 'cancel':
             return new midcom_response_relocate('');
     }
     $this->add_breadcrumb('', sprintf($this->_l10n->get('create person')));
     org_openpsa_helpers::dm2_savecancel($this);
 }