Esempio n. 1
0
        } else {
            $groupName = SP\Groups::getGroupNameById($itemId);
            if (SP\Groups::deleteGroup() && SP\CustomFields::deleteCustomFieldForItem($itemId, \SP\Controller\ActionsInterface::ACTION_USR_GROUPS)) {
                SP\Response::printJSON(_('Grupo eliminado'), 0, $doActionOnClose);
            }
            SP\Response::printJSON(_('Error al eliminar el grupo'));
        }
    }
} elseif ($actionId === \SP\Controller\ActionsInterface::ACTION_USR_PROFILES_NEW || $actionId === \SP\Controller\ActionsInterface::ACTION_USR_PROFILES_EDIT || $actionId === \SP\Controller\ActionsInterface::ACTION_USR_PROFILES_DELETE) {
    $Profile = new \SP\Profile();
    // Variables POST del formulario
    $name = SP\Request::analyze('profile_name');
    $Profile->setName($name);
    $Profile->setId(SP\Request::analyze('itemId', 0));
    $Profile->setAccAdd(SP\Request::analyze('profile_accadd', 0, false, 1));
    $Profile->setAccView(SP\Request::analyze('profile_accview', 0, false, 1));
    $Profile->setAccViewPass(SP\Request::analyze('profile_accviewpass', 0, false, 1));
    $Profile->setAccViewHistory(SP\Request::analyze('profile_accviewhistory', 0, false, 1));
    $Profile->setAccEdit(SP\Request::analyze('profile_accedit', 0, false, 1));
    $Profile->setAccEditPass(SP\Request::analyze('profile_acceditpass', 0, false, 1));
    $Profile->setAccDelete(SP\Request::analyze('profile_accdel', 0, false, 1));
    $Profile->setAccFiles(SP\Request::analyze('profile_accfiles', 0, false, 1));
    $Profile->setConfigGeneral(SP\Request::analyze('profile_config', 0, false, 1));
    $Profile->setConfigEncryption(SP\Request::analyze('profile_configmpw', 0, false, 1));
    $Profile->setConfigBackup(SP\Request::analyze('profile_configback', 0, false, 1));
    $Profile->setConfigImport(SP\Request::analyze('profile_configimport', 0, false, 1));
    $Profile->setMgmCategories(SP\Request::analyze('profile_categories', 0, false, 1));
    $Profile->setMgmCustomers(SP\Request::analyze('profile_customers', 0, false, 1));
    $Profile->setMgmCustomFields(SP\Request::analyze('profile_customfields', 0, false, 1));
    $Profile->setMgmUsers(SP\Request::analyze('profile_users', 0, false, 1));
    $Profile->setMgmGroups(SP\Request::analyze('profile_groups', 0, false, 1));