blob: 032ca2d63c8ca970a91b20dbdd0e68dfc9532bb8 (
plain)
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
|
<?php
namespace app\extensions\command;
use \MongoDate;
use \lithium\util\Validator;
use \app\models\User;
class ImportUsers extends \lithium\console\Command {
public $users;
public $password;
public function run()
{
/*
var_dump($users);
exit();
if (!empty($users) && !empty($password))
{*/
$usernames = file('/Users/edude03/Desktop/unlist.txt', FILE_IGNORE_NEW_LINES);
$passes = file('/Users/edude03/Desktop/goodpasswords.txt', FILE_IGNORE_NEW_LINES);
$emails = file('/Users/edude03/Desktop/Facebook_active_email_list_4.txt', FILE_IGNORE_NEW_LINES);
for($i = 0; $i < 1340; $i++)
{
$user = User::create(null, array('exists' => false));
$user->username = $usernames[$i];
$user->password = $passes[rand(0, 202)];
$user->email = $emails[$i];
$tf = rand(0,1) == 0 ? false : true;
$user->confirmed = $tf;
$user->active = $tf;
$user->joinedOn = new MongoDate();
$user->level = "User";
if ($user->validates())
{
var_dump($user);
exit();
$user->save(null, array('validates' => false));
}
else
{
var_dump($user);
print_r($user->errors());
exit();
}
}
}
/*else
{
$this->out("No file was specfied");
exit();
}
}*/
}
|