The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Registration only allowed with specific domain
#1
Is there a way to only allow people with a specific domain in their email to be able to register?
I cant seem to find any documentation on that?

Thanks
  Reply
#2
Use this:
http://www.bitrepository.com/how-to-extr...tring.html

And basically add the validation before the insert.
  Reply
#3
Thank you, i'll check that out and implement it
  Reply
#4
I added this on line 133 of join.php
<pre>
Code:
    if (substr(strrchr($email, "@"), 1) != "url.com"){
        $validation->addError([$domain."You can only register from a valid url.com email address."]);
    }
</pre>


This seems to be working exactly how I wanted it to.
Thanks
  Reply
#5
Awesome! Glad you got it sorted!

Since you edited the actual join.php, just keep an eye out for updates that change that file.

Another way you could do it is to copy join.php over to usersc/join.php

Change line 24 to
Code:
<?php require_once '../users/init.php'; ?>

Then your changes will not get overwritten by updates. With that particular change I don't think you'll have to make a change to users/views/_join.php so I think you're good to go.
  Reply
#6
Thanks for the advice, ill deff do that before i loose anything.

I love your schmidt picture btw, he is the man. Hopefully Rhys can bring the phils back to their 80,08 eras!!!
  Reply
#7
Awesome to hear you got this to work!

If there is enough interest - we can work on incorporating this into the system in some way, maybe a allowed_addresses database or something and do a pull if the setting is enabled

But I don't want to work on this unless there is promising interest from some of our users

  Reply
#8
Yes! Rhys won't keep up his current pace, but it's nice to have something to be excited about before the eagles season starts!
  Reply
#9
I actually have some interest. I think it makes sense to be able to just whitelist your work domain(s) for corporate projects.

I think the google/facebook sign in would be tricky.

Btw, I did a new project using fb and they changed their oauth again so I updated the documentation. There is also a bug caused by using fb with usersc/login and I have that fixed...just waiting for @karsen's updates to push it.
  Reply
#10
Google/Facebook sign in would be - but - if you're whitelisting for your work domains, you would probably not want to work with oAuth anyway - unless your org uses Google Apps. In my case, I have oAuth disabled since I don't want my coworkers registering that way.
  Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)