Exemple #1
0
 $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));
 $Profile->setMgmProfiles(SP\Request::analyze('profile_profiles', 0, false, 1));
 $Profile->setMgmApiTokens(SP\Request::analyze('profile_apitokens', 0, false, 1));
 $Profile->setEvl(SP\Request::analyze('profile_eventlog', 0, false, 1));
 if ($actionId === \SP\Controller\ActionsInterface::ACTION_USR_PROFILES_NEW || $actionId === \SP\Controller\ActionsInterface::ACTION_USR_PROFILES_EDIT) {
     if (!$Profile->getName()) {
         SP\Response::printJSON(_('Es necesario un nombre de perfil'), 2);
     } elseif (SP\Profile::checkProfileExist($Profile->getId(), $Profile->getName())) {
         SP\Response::printJSON(_('Nombre de perfil duplicado'), 2);
     }
     if ($actionId === \SP\Controller\ActionsInterface::ACTION_USR_PROFILES_NEW) {
         if ($Profile->profileAdd()) {
             SP\Response::printJSON(_('Perfil creado'), 0, $doActionOnClose);
         }
         SP\Response::printJSON(_('Error al crear el perfil'));
     } elseif ($actionId === \SP\Controller\ActionsInterface::ACTION_USR_PROFILES_EDIT) {
         if ($Profile->profileUpdate()) {
             SP\Response::printJSON(_('Perfil actualizado'), 0, $doActionOnClose);
         }
         SP\Response::printJSON(_('Error al actualizar el perfil'));
     }