/** * @ingroup okt_module_users * @brief La page d'export des utilisateurs * */ # Accès direct interdit if (!defined('ON_USERS_MODULE')) { die; } /* Initialisations ----------------------------------------------------------*/ # Format d'export autorisés $aAllowedFormats = module_users::getAllowedFormats(); # Champs exportables autorisés $aAllowedFields = module_users::getAllowedFields(); # Liste des groupes exportables $params = array('group_id_not' => array(oktAuth::guest_group_id, oktAuth::superadmin_group_id)); $rsGroups = $okt->users->getGroups($params); $aGroups = array(); while ($rsGroups->fetch()) { $aGroups[$rsGroups->group_id] = $rsGroups->title; } unset($rsGroups); $p_group = array(); $p_field = array(); $p_format = null; /* Traitements ----------------------------------------------------------*/ if (!empty($_POST['form_sent'])) { $p_group = !empty($_POST['p_group']) && is_array($_POST['p_group']) ? array_map('intval', $_POST['p_group']) : array();
} } $okt->page->flashMessages->addSuccess(__('m_users_user_added')); http::redirect('module.php?m=users&action=edit&id=' . $new_id); } } /* Affichage ----------------------------------------------------------*/ # Langues $rs = $okt->languages->getLanguages(); $aLanguages = array(); while ($rs->fetch()) { $aLanguages[html::escapeHTML($rs->title)] = $rs->code; } # Civilités $aCivilities = array_merge(array(' ' => 0), module_users::getCivilities(true)); # Titre de la page $okt->page->addGlobalTitle(__('c_c_action_Add')); # Validation javascript $aJsValidateRules = new ArrayObject(array(array('id' => 'add_username', 'rules' => array('required: true', 'minlength: 2', 'maxlength: 125')), array('id' => 'add_email', 'rules' => array('required: true', 'email: true')), array('id' => 'add_password', 'rules' => array('required: true', 'minlength: 4')), array('id' => 'add_password_confirm', 'rules' => array('required: true', 'equalTo: \'#add_password\'')))); if ($okt->users->config->enable_custom_fields) { while ($rsFields->fetch()) { if ($rsFields->status != 2) { continue; } $aJsValidateRules[] = array('id' => $rsFields->html_id, 'rules' => array('required: true')); } } $okt->page->validate('add-user-form', $aJsValidateRules); # En-tête require OKT_ADMIN_HEADER_FILE;
/** * Retourne la listes des civilités * */ protected function getCivities($bEmptyField = true) { if ($bEmptyField) { return array_merge(array(' ' => 0), module_users::getCivilities(true)); } return module_users::getCivilities(true); }