Beispiel #1
0
/**
 * Retrieves the new vsite's data from a portal request and submit it to the
 * services layer's vsite functions.
 * @param \User $user current user
 * @return null
 */
function submit(\User $user = null)
{
    $serv = \Factory::getServiceGroupService();
    $newValues = getSGroupDataFromWeb();
    $sg = $serv->getServiceGroup($newValues['ID']);
    try {
        $sg = $serv->editServiceGroup($sg, $newValues, $user);
        $params = array('serviceGroup' => $sg);
        show_view("service_group/submit_edited_service_group.php", $params);
    } catch (Exception $e) {
        show_view('error.php', $e->getMessage());
        die;
    }
}
Beispiel #2
0
/**
 * Retrieves the new vsite's data from a portal request and submit it to the
 * services layer's vsite functions.
 * @return null
 */
function submit($user)
{
    $serv = \Factory::getServiceGroupService();
    try {
        //$serv->addAuthorization($user);
        if (is_null($user)) {
            throw new \Exception("Unregistered users can't create service groups.");
        }
        $newValues = getSGroupDataFromWeb();
        $sg = $serv->addServiceGroup($newValues, $user);
        $params = array('sg' => $sg);
        show_view("service_group/submit_add_service_group.php", $params);
    } catch (Exception $e) {
        show_view("error.php", $e->getMessage());
        die;
    }
}