Skip to Content Skip to Menu

Restrict registration to a specific domain

18 years 4 months ago #14788 by woonydanny
Restrict registration to a specific domain was created by woonydanny
Hi all, just seeing if there are any more CB users out there that are wanting this feature. i know of several so far that we have pm'd each other.

It would be great to have a plugin that allows only people with a certain email address able to sign up. In my case i am trying to restrict registrations to only university emails, for a university society page i am doing.

Does anyone know how to do this in Community Builder?

I have had some great responses from some of the CB members, however i have limited php experience and am putting it out there to see if there is someone who knows how to code this type of plugin, if they are willing to share it, or how much this might cost, so if there is some more people interested we could pool our money?

Silexian explains that

You'd have to use the "OnBeforeSaveRegistration" trigger.
Download and study the "condition plugin" where you'll find all the info to write a plugin

see original post at www.joomlapolis.com/component/option,com_joomlaboard/Itemid,/func,view/catid,12/id,14722/#14722

Let me know if someone in this community with a little more php experience is willing to help out several CB members with this plugin. thanks

Post edited by: peetree21, at: 2006/06/06 03:36

Please Log in or Create an account to join the conversation.

18 years 4 months ago #14911 by woonydanny
Replied by woonydanny on topic Re:Restrict registration to a specific domain
there must be some more people out there that need this type of registration??

and more importantly, is there anyone that knows how to write this plugin

Please Log in or Create an account to join the conversation.

  • mikko
  • mikko
  • OFFLINE
  • Posts: 703
  • Thanks: 0
  • Karma: 115
18 years 4 months ago #14915 by mikko

Please Log in or Create an account to join the conversation.

  • silexian
  • silexian
  • OFFLINE
  • Posts: 22
  • Thanks: 0
  • Karma: -2032
18 years 4 months ago #14926 by silexian
Replied by silexian on topic Re:Restrict registration to a specific domain
hi

the problem is that i have not so much time, besides my "official job", the work around my sites, and trying to code for joomla community...

so i'm available "after" all of that ;)

help me decrease my Karma ! i AM a bad boy ;) Hurry up or i'm gonna eat your soul :p

Please Log in or Create an account to join the conversation.

  • nickb
  • nickb
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 1
18 years 3 months ago #16447 by nickb
Hello,
I did this trick more then a here ago. I am now mooving this university community website from mambo to joomla but it should still work.

It's not related to cb but directly hardcoded in mambo and now joomla code.


in /includes/joomla.php

look for this line:

if ((trim($this->email == "")) || (preg_match("/[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}/", $this->email )==false)) {

and change it to this:

if ((trim($this->email == "")) || (preg_match("/[\w\.\-]+@yourdesireddomain.com/", $this->email )==false)) {

and put whatever u want insted of yourdesireddomain.com.

this will allow only people with this email domani to register and they will get there theyr confirmation link so if someone try to chit he will never be able to confirm and therefhore activate his account...simple but effective!!!

enjoy

Nick

Please Log in or Create an account to join the conversation.

18 years 3 months ago #16469 by woonydanny
Replied by woonydanny on topic Re:Restrict registration to a specific domain
Hi Nick,
thanks for the input. However, i could not get it to work. I used your code and changed it to my domain (student.uq.edu.au) and it did not work. The error was: "Please enter a valid email address", even though in includes/joomla.php i had changed it to student.uq.edu.au

Any thoughts? is it something to do with Joomla's new code?

The mambo code you posted:-

[code:1]if ((trim($this->email == ""«»)) || (preg_match("/[w.-]+@w+[w.-]*?.w{1,4}/", $this->email )==false)) { [/code:1]

Joomla 1.09 code:-
[code:1]if ((trim($this->email == ""«»)) || (preg_match("/[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}/", $this->email )==false)) {
[/code:1]

Post edited by: peetree21, at: 2006/07/04 05:21

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum