vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Add new Users (automatically) (https://vborg.vbsupport.ru/showthread.php?t=82836)

F5-MVH 01-07-2010 04:49 PM

Using the class ForumOps (which by the way is brilliant)...... I am trying to figure out how to pass a delimited txt file of user information to it. Any help would be appreciated.

To elaborate - We have a corporate text file with the following
'user name','email address'

I need to generate new VBulletin accounts for all them.

Cheers!
Dave

lanzeym 02-03-2010 03:08 PM

Hi,

I am now able to programmatically add user by modifying script above but I have a problem when I tried to insert user from our existing database that has more than 25 character. I?m getting an error ?Username cannot be longer than 25 characters?. Can you guide me on how can I disable the maximum characters allowed for username?

I have basic knowledge in php and I look through the following included files but I can't see the function for validation the maximum length.

require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_user.php');

Anybody have done this before?

Thanks!

bigtime 02-03-2010 03:50 PM

lanzeym, sounds like you may need to make your existing database field for username larger than 25 characters.

lanzeym 02-03-2010 04:09 PM

hi bigtime!

The save() methods uses vBulletin "user" table that has varchar(100) length, so there's no need for changing field lenght. There should be a hard coded "maxlength" that I don't know where it is.

bigtime 02-03-2010 04:37 PM

Oops, I misunderstood. I thought you were inserting users into your existing database...

lanzeym 02-04-2010 04:12 PM

here's how to remove the validation.

AdminCP > vBulletin Options > User Registration Options > Maximum Username Length

Tibald 05-29-2010 12:30 PM

Anybody can help with code example for manual users registration and login for vb 4 ?

ilbianconiglio 07-13-2010 11:59 AM

I'm trying to add a new user with VB 4.0.

I'm using the latest snippet of code but when I do $newuser->save(); it saves the record to the db but return to a Database error page ( of VB ).

What can I do?

--------------- Added [DATE]1279029801[/DATE] at [TIME]1279029801[/TIME] ---------------

Ok maybe I solved.

For VB 4 you need to add this:

$newuser->pre_save();

before save() or checking errors :)

calwebsnc 07-20-2010 07:09 AM

Hi,
I am trying to do something similar.
I wrote a class inside a file in the main directory of my forum.
This is the code:
Code:

<?php

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

        class codeigniter_bridge{
               
                function codeigniter_bridge(){
                       
                        $this->usernamager =& datamanager_init('User', $vbulletin); 
                       
                }
               
                function prova(){
                       
                        return $foruminfo = fetch_foruminfo(1);
                }
        }


?>

I receive this error:
Fatal error: Call to a member function do_db_fetch() on a non-object in /var/www/cyberludus.com/system/forum/includes/init.php on line 308

Where I do wrong?
Thank you

epolitica 11-23-2010 01:32 PM

The code seems to be working, but when in debug mode a lot of notices show up. I`d rather they shouldn`t:

PHP Code:

Notice (8): Undefined index:  username [/home/path2vb/forum/includes/class_dm_user.phpline 419]
Notice (8): Undefined index:  userid [/home/path2vb/forum/includes/class_dm_user.phpline 421]
Notice (8): Undefined index:  ajax [/home/path2vb/forum/includes/functions.phpline 2696]
Notice (8): Use of undefined constant LANGUAGEID assumed 'LANGUAGEID' [/home/path2vb/forum/includes/functions_misc.phpline 795]
Notice (8): Use of undefined constant LANGUAGEID assumed 'LANGUAGEID' [/home/path2vb/forum/includes/functions_misc.phpline 812]
Notice (8): Undefined variableerrsize [/home/path2vb/forum/includes/class_dm.phpline 322]
Notice (8): Only variable references should be returned by reference [/home/path2vb/forum/includes/class_dm.phpline 294


Then I got a question, is it possibile to add an user in an inactive state, and only after a third party email validation, enable him/her? I couldn`t find any column in the vb_user table that indicates this active/inactive state, any help?


All times are GMT. The time now is 06:51 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.02410 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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