SelfUrl == "people.php" && in_array(ForceIncomingString('PostBackAction', ''), array('ApplyForm', 'Apply'))) { $Context->SetDefinition('ErrNotAllowedCharsFound', 'There are characters in the username that are not allowed. Only Letters, Numbers and _ are allowed in the username.'); function ApplyForm_AddCheckNamesRequirements(&$ApplyForm) { /* /W stands for all characters expect "A-Z", "a-z", "0-9" and "_". When it finds one it returns 1 and if not 0. So 1 means theres an illegal character in the name. */ $pattern = '/\W/'; if (preg_match($pattern, $ApplyForm->Applicant->Name) == 1) { $ApplyForm->Context->WarningCollector->Add($ApplyForm->Context->GetDefinition('ErrNotAllowedCharsFound')); } } $Context->AddToDelegate("ApplyForm", "PreCreateUser", "ApplyForm_AddCheckNamesRequirements"); } ?>