Exemplo n.º 1
0
 function _group_submit()
 {
     $this->_assert_may('administer');
     $this->_import_profile_controller();
     $group = $this->_get_group_from_id_or_die($_POST['group_id']);
     $this->_init_group_from_post_data($group);
     $this->_add_profile_breadcrumbs($group);
     $profile = new ProfileController($this->api);
     // Make sure that the data is complete and valid.
     $err = $group->check_complete();
     if ($err) {
         $profile->add_hint(new \hint\Error($err));
         return $profile->show_group_editor($group);
     }
     // Save the group.
     if (!$this->_get_groupdb()->save_group($group)) {
         $profile->add_hint(new \hint\Error(_('Failed to save the group.')));
         return $profile->show_group_editor($group);
     }
     // Done.
     $profile->add_hint(new \hint\Ack(_('Your changes have been saved.')));
     $profile->show_group_editor($group);
 }