Commit 6f226872 authored by BenC's avatar BenC

Nom unix et alias

parent 282f57b2
......@@ -93,6 +93,11 @@ else if ( isset($_REQUEST["id_asso"]) )
$Error = "Un ou plusieurs champs sont incomplets.";
$_REQUEST['page'] = "edit";
}
elseif ( !preg_match("#^([a-z0-9]+)$#i",strtolower($_REQUEST['nom_unix'])) )
{
$Error = "Le nom Unix ne doit comporter que des caractères alpha-numériques";
$_REQUEST['page'] = "edit";
}
else
{
if ( $site->user->is_in_group("gestion_ae") )
......
......@@ -125,7 +125,7 @@ elseif ( $_REQUEST["action"] == "saveinfos" && $can_edit )
if(!empty($user->alias) && !$site->user->is_in_group("root"))
$_REQUEST["alias"]=$user->alias;
if ( $_REQUEST["alias"] && !preg_match("#^([a-z0-9][a-z0-9\-\._]+)$#i",$_REQUEST["alias"]) )
if ( $_REQUEST["alias"] && !preg_match("#^([a-z0-9]+)$#i",$_REQUEST["alias"]) )
{
$ErreurMAJ = "Alias invalide, utilisez seulement des lettres, des chiffres, des tirets, des points, et des underscore.";
$_REQUEST["page"] = "edit";
......@@ -564,7 +564,7 @@ if ( $_REQUEST["page"] == "edit" && $can_edit )
else
$can_edit_alias = true;
if (empty($user->alias) || !preg_match("#^([a-z0-9][a-z0-9\-\._]+)$#i",strtolower($user->alias)))
if (empty($user->alias) || !preg_match("#^([a-z0-9]+)$#i",strtolower($user->alias)))
$frm->add_text_field("alias","Alias",$user->alias);
else // seul root a le droit de modifier l'alias s'il est déjà renseigné
$frm->add_text_field("alias","Alias",$user->alias,false,false,false,$can_edit_alias);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment