Removed random account numbers for maximum db portability.

This commit is contained in:
mdean 2001-09-17 02:23:41 +00:00
parent 73b04851cc
commit f7d1715195

View File

@ -83,27 +83,27 @@
$phpgw_setup->db->query("delete from phpgw_acl");
$defaultprefs = 'a:5:{s:6:"common";a:10:{s:9:"maxmatchs";s:2:"15";s:12:"template_set";s:8:"verdilak";s:5:"theme";s:6:"purple";s:13:"navbar_format";s:5:"icons";s:9:"tz_offset";N;s:10:"dateformat";s:5:"m/d/Y";s:10:"timeformat";s:2:"12";s:4:"lang";s:2:"en";s:11:"default_app";N;s:8:"currency";s:1:"$";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}:s:8:"calendar";a:4:{s:13:"workdaystarts";s:1:"7";s:11:"workdayends";s:2:"15";s:13:"weekdaystarts";s:6:"Monday";s:15:"defaultcalendar";s:9:"month.php";}}';
$defaultgroupid = mt_rand (100, 600000);
$sql = "insert into phpgw_accounts";
$sql .= "(account_id, account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values (".$defaultgroupid.", 'Default', 'g', '".md5($passwd)."', 'Default', 'Group', ".time().", 'A')";
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values ('Default', 'g', '".md5($passwd)."', 'Default', 'Group', ".time().", 'A')";
$phpgw_setup->db->query($sql);
$defaultgroupid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
$admingroupid = mt_rand (100, 600000);
$sql = "insert into phpgw_accounts";
$sql .= "(account_id, account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values (".$admingroupid.", 'Admins', 'g', '".md5($passwd)."', 'Admin', 'Group', ".time().", 'A')";
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values ('Admins', 'g', '".md5($passwd)."', 'Admin', 'Group', ".time().", 'A')";
$phpgw_setup->db->query($sql);
$admingroupid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
/* Creation of the demo accounts is now optional - the checkbox is on by default. */
if ($create_demo)
{
/* Create records for demo accounts */
$accountid = mt_rand (100, 600000);
$sql = "insert into phpgw_accounts";
$sql .= "(account_id, account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values (".$accountid.", 'demo', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ".time().", 'A')";
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values ('demo', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ".time().", 'A')";
$phpgw_setup->db->query($sql);
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights)values('preferences', 'changepassword', ".$accountid.", 0)");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
@ -114,11 +114,11 @@
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('notes', 'run', ".$accountid.", 1)");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('todo', 'run', ".$accountid.", 1)");
$accountid = mt_rand (100, 600000);
$sql = "insert into phpgw_accounts";
$sql .= "(account_id, account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values (".$accountid.", 'demo2', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo2', 'Account', ".time().", 'A')";
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values ('demo2', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo2', 'Account', ".time().", 'A')";
$phpgw_setup->db->query($sql);
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights)values('preferences', 'changepassword', ".$accountid.", 0)");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_account, acl_location, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
@ -129,11 +129,11 @@
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('notes', 'run', ".$accountid.", 1)");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('todo', 'run', ".$accountid.", 1)");
$accountid = mt_rand (100, 600000);
$sql = "insert into phpgw_accounts";
$sql .= "(account_id, account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values (".$accountid.", 'demo3', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo3', 'Account', ".time().", 'A')";
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values ('demo3', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo3', 'Account', ".time().", 'A')";
$phpgw_setup->db->query($sql);
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights)values('preferences', 'changepassword', ".$accountid.", 0)");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
@ -146,11 +146,11 @@
}
/* Create records for administrator account */
$accountid = mt_rand (100, 600000);
$sql = "insert into phpgw_accounts";
$sql .= "(account_id, account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values (".$accountid.", '$username', 'u', '".md5($passwd)."', '$fname', '$lname', ".time().", 'A')";
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
$sql .= "values ('$username', 'u', '".md5($passwd)."', '$fname', '$lname', ".time().", 'A')";
$phpgw_setup->db->query($sql);
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$admingroupid."', $accountid, 1)");