aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/php/generateUserFunction.php
diff options
context:
space:
mode:
Diffstat (limited to 'share/php/generateUserFunction.php')
-rw-r--r--share/php/generateUserFunction.php90
1 files changed, 45 insertions, 45 deletions
diff --git a/share/php/generateUserFunction.php b/share/php/generateUserFunction.php
index 52ebc9f..a262bf5 100644
--- a/share/php/generateUserFunction.php
+++ b/share/php/generateUserFunction.php
@@ -1,46 +1,46 @@
1<?php 1<?php
2 // GenerateUser (v1.0) 2 // GenerateUser (v1.0)
3 // Creates a new user account, and returns it into an associative array. 3 // Creates a new user account, and returns it into an associative array.
4 // -- 4 // --
5 // $firstname - The users firstname 5 // $firstname - The users firstname
6 // $lastname - The users lastname 6 // $lastname - The users lastname
7 // $password - the users password 7 // $password - the users password
8 // $home - the regionhandle of the users home location 8 // $home - the regionhandle of the users home location
9 // -- 9 // --
10 function generateUser($firstname,$lastname,$password,$home) { 10 function generateUser($firstname,$lastname,$password,$home) {
11 $user = array(); 11 $user = array();
12 $user['UUID'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 12 $user['UUID'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
13 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), 13 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
14 mt_rand( 0, 0x0fff ) | 0x4000, 14 mt_rand( 0, 0x0fff ) | 0x4000,
15 mt_rand( 0, 0x3fff ) | 0x8000, 15 mt_rand( 0, 0x3fff ) | 0x8000,
16 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); 16 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
17 $user['username'] = $firstname; 17 $user['username'] = $firstname;
18 $user['lastname'] = $lastname; 18 $user['lastname'] = $lastname;
19 19
20 $user['passwordSalt'] = md5(microtime() . mt_rand(0,0xffff)); 20 $user['passwordSalt'] = md5(microtime() . mt_rand(0,0xffff));
21 $user['passwordHash'] = md5(md5($password) . ":" . $user['passwordSalt']); 21 $user['passwordHash'] = md5(md5($password) . ":" . $user['passwordSalt']);
22 22
23 $user['homeRegion'] = $home; 23 $user['homeRegion'] = $home;
24 $user['homeLocationX'] = 128; 24 $user['homeLocationX'] = 128;
25 $user['homeLocationY'] = 128; 25 $user['homeLocationY'] = 128;
26 $user['homeLocationZ'] = 128; 26 $user['homeLocationZ'] = 128;
27 $user['homeLookAtX'] = 15; 27 $user['homeLookAtX'] = 15;
28 $user['homeLookAtY'] = 15; 28 $user['homeLookAtY'] = 15;
29 $user['homeLookAtZ'] = 15; 29 $user['homeLookAtZ'] = 15;
30 30
31 $user['created'] = time(); 31 $user['created'] = time();
32 $user['lastLogin'] = 0; 32 $user['lastLogin'] = 0;
33 33
34 $user['userInventoryURI'] = "http://inventory.server.tld:8004/"; 34 $user['userInventoryURI'] = "http://inventory.server.tld:8004/";
35 $user['userAssetURI'] = "http://asset.server.tld:8003/"; 35 $user['userAssetURI'] = "http://asset.server.tld:8003/";
36 36
37 $user['profileCanDoMask'] = 0; 37 $user['profileCanDoMask'] = 0;
38 $user['profileWantDoMask'] = 0; 38 $user['profileWantDoMask'] = 0;
39 $user['profileAboutText'] = "I am a user."; 39 $user['profileAboutText'] = "I am a user.";
40 $user['profileFirstText'] = "Stuff."; 40 $user['profileFirstText'] = "Stuff.";
41 $user['profileImage'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 0, 0, 0, 0, 0, 0, 0, 0 ); 41 $user['profileImage'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 0, 0, 0, 0, 0, 0, 0, 0 );
42 $user['profileFirstImage'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 0, 0, 0, 0, 0, 0, 0, 0 ); 42 $user['profileFirstImage'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 0, 0, 0, 0, 0, 0, 0, 0 );
43 43
44 return $user; 44 return $user;
45 } 45 }
46?> \ No newline at end of file 46?> \ No newline at end of file