1
bubuche93
emails that should not be used in user profile
  • 2008/9/13 10:24

  • bubuche93

  • Just popping in

  • Posts: 25

  • Since: 2006/11/19


Hello !

I would like to allow a user registration only if his email domain name match @xxx.com or @yyy.com

How can I do this using a regex? I tried several but none of them worked.

Also that would be great if we could have a field to test the regex (I had to go through the registration process each time to test the regex)

2
noo-b
Re: emails that should not be used in user profile
  • 2008/9/13 14:38

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


I Love Xoops

3
bubuche93
Re: emails that should not be used in user profile
  • 2008/9/13 15:25

  • bubuche93

  • Just popping in

  • Posts: 25

  • Since: 2006/11/19


Hello noo-b,

Thank you for your answer !
I already read this post a few months ago when I was using XOOPS 2.0.16 and the hack in the config file using "!" was working great.

However, I am now using 2.2 and the hack doesnt work anymore because I would like to allow 2 (or more) domains.

a regex like "disallow everything but(xxx.com OR yyy.com)" is what I need.

Also if someone could give us more info about XOOPS regex implementation that would be great.

All the best,
Franck

4
bubuche93
Re: emails that should not be used in user profile
  • 2008/9/15 11:53

  • bubuche93

  • Just popping in

  • Posts: 25

  • Since: 2006/11/19


up!

5
ghia
Re: emails that should not be used in user profile
  • 2008/9/15 12:52

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Is the hack not working with
^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*(@xxx.com|@yyy.com)
?

6
bubuche93
Re: emails that should not be used in user profile
  • 2008/9/17 17:42

  • bubuche93

  • Just popping in

  • Posts: 25

  • Since: 2006/11/19


all good ! thanks :)

That would be great if we could have the option directly in the admin panel for the 2.3 final instead of using a hack ... drupal even has a regex tester for the email !!

7
ghia
Re: emails that should not be used in user profile
  • 2008/9/17 18:29

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


When I review, I see that some slashes are missing before the dots. It should be \. in stead of .

The stupid code tag eats my slashes!

Here under [ code]\.[ /code] .
.

8
bubuche93
Re: emails that should not be used in user profile
  • 2008/9/18 8:14

  • bubuche93

  • Just popping in

  • Posts: 25

  • Since: 2006/11/19


hmm thanks, but I can't find the place to "patch" the code in the new XOOPS 2.3

if (!empty($be) && preg_match("/".$be."/i", $email)) {
$stop .= _US_INVALIDMAIL.'
';
break;

in the link above someone said that it was not in register.php anymore but in modules/profile/include/functions.php
... problem, I can't find it. DO you know where it is now?

Thanks !
Franck

9
bubuche93
Re: emails that should not be used in user profile
  • 2008/9/18 16:47

  • bubuche93

  • Just popping in

  • Posts: 25

  • Since: 2006/11/19


Ok there is something wrong with my XOOPS 2.3 RC3

1)In the "emails that should not be used in user profile" field I entered "test@test.com" (without the "" of course)
2) I tried to register a new account, I had no error message... "confirmation email has been sent to test@test.com"
3)on the registration page, I could not see any captcha.. is it normal? how can I activate the feature in XOOPS 2.3 RC3 ?

Thanks
Franck

IMPORTANT EDIT: i tried to register while i was still loggued as "admin"... after logging out and registering, "test@test.com" was recognized as "invalid email" !!

So it means that the email check is not performed when a user try to register a new user (even if it makes no sense to access register.php when you are already logged in...)

Same for the captcha, it worked when you try to register (and after logging out from your previous user account)

10
ghia
Re: emails that should not be used in user profile
  • 2008/9/18 17:00

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
So it means that the email check is not performed when a user try to register a new user (even if it makes no sense to access register.php when you are already logged in...)
Only administrators should be able to do that, and they should know what they are doing. Regular users should not be able to do this, check your preferences for the group permissions.
Quote:
Same for the captcha, it worked when you try to register (and after logging out from your previous user account)
Captchas are only active for anonymous users (not logged in), the regular users should not be bothered with this.

Login

Who's Online

510 user(s) are online (347 user(s) are browsing Support Forums)


Members: 0


Guests: 510


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits