Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2008, 07:42 AM
hivehost hivehost is offline
 
Join Date: Jul 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-31-2008, 08:25 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #3  
Old 08-04-2008, 04:37 AM
hivehost hivehost is offline
 
Join Date: Jul 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 08-07-2008, 06:34 AM
hivehost hivehost is offline
 
Join Date: Jul 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 08-07-2008, 09:52 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #6  
Old 08-13-2008, 07:19 AM
hivehost hivehost is offline
 
Join Date: Jul 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 08-13-2008, 07:21 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you had a look at register.php?
Reply With Quote
  #8  
Old 08-13-2008, 07:42 AM
hivehost hivehost is offline
 
Join Date: Jul 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 08-13-2008, 12:01 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I meant actually looking in the register.php source (ie. the raw PHP code, not looking through a browser) .
Reply With Quote
  #10  
Old 08-13-2008, 02:47 PM
hivehost hivehost is offline
 
Join Date: Jul 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04351 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete