Auto Registration ?
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #1
Question Auto Registration ?
Hello Zinga .

I want to know about Auto registrations after every predefined intervals. Means If I select 15 minutes , the task can run and an registration made automatically.

We can use a list of usernames (arranged in an array) to manipulate so that the Sheduler picks up the usernames from the array randomly and start to make registrations.

I search member.php file of MyBB, and get the following code that give an hint and an idea for this:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
if($mybb->input['action'] == "do_register" && $mybb->request_method == "post")
{
	if($mybb->settings['regtype'] == "randompass")
	{
		$mybb->input['password'] = random_str();
		$mybb->input['password2'] = $mybb->input['password'];
	}

	if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->input['coppa'] == 1)
	{
		$usergroup = 5;
	}
	else
	{
		$usergroup = 2;
	}

	// Set up user handler.
	require_once MYBB_ROOT."inc/datahandlers/user.php";
	$userhandler = new UserDataHandler("insert");

	// Set the data for the new user.
	$user = array(
		"username" => $mybb->input['username'],
		"password" => $mybb->input['password'],
		"password2" => $mybb->input['password2'],
		"email" => $mybb->input['email'],
		"email2" => $mybb->input['email2'],
		"usergroup" => $usergroup,
		"referrer" => $mybb->input['referrername'],
		"timezone" => $mybb->input['timezoneoffset'],
		"language" => $mybb->input['language'],
		"profile_fields" => $mybb->input['profile_fields'],
		"regip" => $session->ipaddress,
		"longregip" => my_ip2long($session->ipaddress),
		"coppa_user" => intval($mybb->cookies['coppauser']),
	);
	
	if(isset($mybb->input['regcheck1']) && isset($mybb->input['regcheck2']))
	{
		$user['regcheck1'] = $mybb->input['regcheck1'];
		$user['regcheck2'] = $mybb->input['regcheck2'];
	}

	// Do we have a saved COPPA DOB?
	if($mybb->cookies['coppadob'])
	{
		list($dob_day, $dob_month, $dob_year) = explode("-", $mybb->cookies['coppadob']);
		$user['birthday'] = array(
			"day" => $dob_day,
			"month" => $dob_month,
			"year" => $dob_year
		);
	}

	$user['options'] = array(
		"allownotices" => $mybb->input['allownotices'],
		"hideemail" => $mybb->input['hideemail'],
		"subscriptionmethod" => $mybb->input['subscriptionmethod'],
		"receivepms" => $mybb->input['receivepms'],
		"pmnotice" => $mybb->input['pmnotice'],
		"emailpmnotify" => $mybb->input['emailpmnotify'],
		"invisible" => $mybb->input['invisible'],
		"dstcorrection" => $mybb->input['dstcorrection']
	);

	$userhandler->set_data($user);

	$errors = "";

	if(!$userhandler->validate_user())
	{
		$errors = $userhandler->get_friendly_errors();
	}


Can you help me, how to insert the values in db and how to make a fake user with this ? Zinga Eyes


[Image: logo.png]

[Image: twitter.png]
08-16-2010 06:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Auto Registration ? - Imran - 08-16-2010 06:30 AM
RE: Auto Registration ? - ZiNgA BuRgA - 08-16-2010, 08:12 AM
RE: Auto Registration ? - Imran - 08-17-2010, 01:24 AM
RE: Auto Registration ? - ZiNgA BuRgA - 08-17-2010, 07:11 AM
RE: Auto Registration ? - Imran - 08-17-2010, 10:12 AM
RE: Auto Registration ? - ZiNgA BuRgA - 08-17-2010, 01:45 PM
RE: Auto Registration ? - Imran - 08-17-2010, 05:25 PM
RE: Auto Registration ? - ZiNgA BuRgA - 08-17-2010, 07:00 PM

 Standard Tools
Forum Jump: