View Full Version : How to restrict only 1 domain email during reg. & how to set new value to be unique?
hivehost
07-31-2008, 07:42 AM
I had recently bought a vBulletin license.
In the customization progress, I meet 2 problems as follows :
1. Staff ID to be unique
* I had already define a new value, Staff ID and I would like to make this field as unique where no duplication is allowed. Beside Staff ID to be unique, I had also set Username and Email to be unique. But, we are having problem to set Staff ID as unique field. How should I overcome this matter?
2. Staff Email to be only using xxx@makanfree.com
* I would like to restrict the registration email to accept @makanfree.com email ONLY. As to my knowledge, I can only restrict not to accept which email, is it possible for the code to be customized to accept only 1 domain which is @makanfree.com
It would be good if anyone is able to assist me with some guideline or manual which I am able to refer to.
Thank you.
Marco van Herwaarden
07-31-2008, 08:25 AM
1. Will need a bit more information. How did you add this staff-id?
2. Use the default email domain censor, and change the following line (vB 3.7.2)
File: ./includes/class_dm_user.php
Line: 634
Find:
if (is_banned_email($email) AND !$this->adminoverride)
and replace with:
if (!is_banned_email($email) AND !$this->adminoverride)
Not tested. This should reverse the banned email list (thus making it a whitelist instead of a blacklist)
hivehost
08-04-2008, 04:37 AM
Thank you for your help and I solved the 2. problem.
As for the problem no 1,
I want to get the global variable name in which the user defined variables value are contain... I have found that in vBulletin v3.0 but that line of code is not available in the vBulletin version installed in the server. It will be some type of "$userfield['field4] format.
hivehost
08-07-2008, 06:34 AM
Hi,
Anyone can help out on how to set the newly defined value in the registration page to be unique (means no duplication in the db) such as email address and username?
Is it possible to be done? Please provide me some guideline to solve my problems.
Thank you.
Dismounted
08-07-2008, 09:52 AM
If the value is user entered, just query for it in the database - if it results in 0 rows, it is "unique". If it is meant to be an automatically generated field, just use AUTO_INCREMENT on the field (I am assuming you want an integer).
hivehost
08-13-2008, 07:19 AM
I need the variable in which the user defined field values are stored during registration process. it would be like this format -$userfield['field6'].......$userfield[6],..... so on... I am unable to find it...
Can anyone assist on where to find the variable?
Dismounted
08-13-2008, 07:21 AM
Have you had a look at register.php?
hivehost
08-13-2008, 07:42 AM
Thank you for your reply.
Yes, I had a look at that page already. And I found the line of the input box for Staff Id as follows.
<input type="text" class="bginput" name="userfield[field6]" id="ctb_field6" value="" size="25" maxlength="100" />
But I need the php variable name which holds the staff id which is the value stored in userfield[field6]. This variable should be able to be found at /includes/class_dm_user.php, but I am unable to find it.
Just as $email holds the email address the user entered, there must be something which holds this staff id value.
I suppose if I am able to get the php variable that holds the staff id, I should be able to compare and make sure that there is no duplication of the staff id in the db.
Dismounted
08-13-2008, 12:01 PM
I meant actually looking in the register.php source (ie. the raw PHP code, not looking through a browser) ;).
hivehost
08-13-2008, 02:47 PM
Thanks for the reply! :)
I did look into the register.php. The problem is I am not able to find the php variable name which holds the staff id which is newly defined value. Staff ID is actually a new value that had been added on the registration page.
For example,
$email = $vbulletin->GPC['email'];
-- $email is storing the email that had been entered by the user during registration.
but, the I could not manage to find which php variable stores the newly defined value.
PaulSonny
08-13-2008, 03:16 PM
I believe anything over field4 is not a vBulletin default, as shown below. So this must mean that field5 and field6 are custom fields which means that are not likely to be in the default register.php?
Biography field1
Location field2
Interests field3
Occupation field4
Dismounted
08-14-2008, 07:25 AM
I believe anything over field4 is not a vBulletin default, as shown below. So this must mean that field5 and field6 are custom fields which means that are not likely to be in the default register.php?
Biography field1
Location field2
Interests field3
Occupation field4
vBulletin fetches all userfield[] input fields as an array :). This can be used to access field6:
$vbulletin->GPC['userfield']['field6']
hivehost
08-18-2008, 07:44 AM
Hi Sir,
Thank you for your reply.
Sorry to say that I have not found out the location of this mentioned variable in the entire vbulletin package. It seems to be that this variable exists in the earlier version of vBUlletin.
My current installed version of vBulletin is "vBulletin® v3.7.2 Patch Level 1".
Dismounted
08-19-2008, 08:58 AM
Certain POST variables are passed through the input cleaner, which populates the $vbulletin->GPC array.
MReardon
10-31-2008, 08:19 PM
guys i'm running vBulletin 3.5.8 and do not have this code in my class_dm_user.php file. what's up? since i cannot find it, i cannot proceed........ any help??
Dismounted
11-01-2008, 09:55 AM
Which code are you referring to?
MReardon
11-05-2008, 12:47 AM
I'm referring to :
File: ./includes/class_dm_user.php
Line: 634
Find:
PHP Code:
if (is_banned_email($email) AND !$this->adminoverride)
and replace with:
PHP Code:
if (!is_banned_email($email) AND !$this->adminoverride)
I am running 3.5.8 and therefore do not see this in the file specified above. Do i have any other options???? this is EXACTLY what i have been looking for for quite some time!!!
Marco van Herwaarden
11-06-2008, 11:48 AM
For 3.5.7
File: ./includes/class_dm_user.php
Line: ~515
find:
if (is_banned_email($email) AND !$this->adminoverride)
replace by:
if (!is_banned_email($email) AND !$this->adminoverride)
MReardon
11-06-2008, 01:11 PM
Can you provide instructions how to navigate to the whitelist (previously the blacklist) so that i may begin allowing the designated users to register?
Thank you for helping me locate the code!!
Dismounted
11-07-2008, 04:35 AM
Go to the default email censor (vBulletin Options > User Banning Options).
MReardon
11-07-2008, 11:14 AM
thank you i figured it out on my own yesterday and already have it working....
I want to thank all of you for your help and support......
:D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.