Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: moaltmann - heinäkuu 17, 2004, 09:51:48 IP

Otsikko: restrict access by email
Kirjoitti: moaltmann - heinäkuu 17, 2004, 09:51:48 IP
Hi,

I am a newbie but very much impressed with SMF. I've installed it and am planning to modify it to accommodate a bit more "personal" data in order to allow it to function as a basic Alumni Database.

I'd like to restrict certain areas (or even registration) to users with a certain email address (e.g. user that have emails @certain_domain.com). I know it is possible to hard-code this into the SMF code, however, I was wondering whether it could be implemented as a sort of "filter" (similar to the ban options just that you want to allow instead of ban certain domains/IPs

thanks, I appreciate your help,
  Mischa
Otsikko: Re: restrict access by email
Kirjoitti: moaltmann - heinäkuu 21, 2004, 08:40:21 AP
I think I'll wait a bit before I hardcode the feature into my board. Until then I@ll use member groups. However, I found that IU cant simultaneously enable multiple users to view only certain part to the forum. neither can i select accessible forums in the member group configuration as they are all grayed out.

any help is very much appreciated -- i'll post agin if i figure something out...

ciao,
  Mischa Altmann
Otsikko: Re: restrict access by email
Kirjoitti: Tomer - heinäkuu 21, 2004, 09:53:12 AP
Well if you want this as a future feature, try requesting it at "Feature Requests".

You can easily add a bit of code to your forum to get that result, something lke this to the registration file.


<?php

// Function to put everything after the @ into an variable called $email.

if ($email == "certain_domain.com")
   {
      echo 
"Error";
      exit;
   }

?>



Otsikko: Re: restrict access by email
Kirjoitti: yerg - helmikuu 08, 2006, 02:58:12 AP
Tomer where would you suggest I put this?

I have a forum where I need to restrict access to a specific government domain for registration. No address no can access.