vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to restrict only 1 domain email during reg. & how to set new value to be unique? (https://vborg.vbsupport.ru/showthread.php?t=186834)

hivehost 07-31-2008 07:42 AM

How to restrict only 1 domain email during reg. & how to set new value to be unique?
 
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:
PHP Code:

  if (is_banned_email($email) AND !$this->adminoverride

and replace with:
PHP Code:

  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.


All times are GMT. The time now is 08:40 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01302 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete