mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
fixed new install
This commit is contained in:
parent
f883269cfc
commit
2aea2d586c
@ -24,7 +24,7 @@
|
||||
}
|
||||
$phpgw_setup->loaddb();
|
||||
|
||||
include($phpgw_info["server"]["api_inc"]."/class.common.inc.php");
|
||||
include(PHPGW_API_INC."/class.common.inc.php");
|
||||
$common = new common;
|
||||
// this is not used
|
||||
//$sep = $common->filesystem_separator();
|
||||
@ -54,7 +54,7 @@
|
||||
}
|
||||
if (($addlang && $upgrademethod == "addonlynew") || ($upgrademethod != "addonlynew")) {
|
||||
//echo '<br>Test: loop above file()';
|
||||
$raw_file = file($phpgw_info["server"]["server_root"] . "/setup/phpgw_" . strtolower($lang) . ".lang");
|
||||
$raw_file = file(PHPGW_SERVER_ROOT . "/setup/phpgw_" . strtolower($lang) . ".lang");
|
||||
while (list($null,$line) = each($raw_file)) {
|
||||
$addit = False;
|
||||
list($message_id,$app_name,$phpgw_setup->db_lang,$content) = explode("\t",$line);
|
||||
|
@ -52,72 +52,89 @@
|
||||
}else{
|
||||
$phpgw_setup->loaddb();
|
||||
/* First clear out exsisting tables */
|
||||
$defaultprefs = 'a:5:{s:6:"common";a:1:{s:0:"";s:2:"en";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}i:8;a:1:{s:0:"";s:13:"workdaystarts";}i:15;a:1:{s:0:"";s:11:"workdayends";}s:6:"Monday";a:1:{s:0:"";s:13:"weekdaystarts";}}';
|
||||
$phpgw_setup->db->query("delete from phpgw_accounts");
|
||||
$phpgw_setup->db->query("delete from preferences");
|
||||
$phpgw_setup->db->query("delete from phpgw_acl");
|
||||
|
||||
/* Create records for demo accounts */
|
||||
$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 (1, 'demo', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)values('preferences', 'changepassword', 1, 'u', 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '1', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', 1, 'u', 1)");
|
||||
$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";}i:8;a:1:{s:0:"";s:13:"workdaystarts";}i:15;a:1:{s:0:"";s:11:"workdayends";}s:6:"Monday";a:1:{s:0:"";s:13:"weekdaystarts";}}';
|
||||
// $defaultprefs = 'a:5:{s:6:"common";a:1:{s:0:"";s:2:"en";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}i:8;a:1:{s:0:"";s:13:"workdaystarts";}i:15;a:1:{s:0:"";s:11:"workdayends";}s:6:"Monday";a:1:{s:0:"";s:13:"weekdaystarts";}}';
|
||||
|
||||
|
||||
$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')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$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')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
/* 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 (2, 'demo2', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo2', 'Account', ".time().", 'A')";
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('2', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)values('preferences', 'changepassword', 2, 'u', 0)") ;
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '1', 2, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', 2, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', 2, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', 2, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', 2, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', 2, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', 2, 'u', 1)");
|
||||
|
||||
$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 (3, 'demo3', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo3', 'Account', ".time().", 'A')";
|
||||
$sql .= "values (".$accountid.", 'demo', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('3', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)values('preferences', 'changepassword', 3, 'u', 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '1', 3, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', 3, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', 3, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', 3, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', 3, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', 3, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', 3, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)values('preferences', 'changepassword', ".$accountid.", 'u', 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', ".$accountid.", 'u', 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')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)values('preferences', 'changepassword', ".$accountid.", 'u', 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', ".$accountid.", 'u', 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')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)values('preferences', 'changepassword', ".$accountid.", 'u', 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', ".$accountid.", 'u', 1)");
|
||||
|
||||
/* 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 (4, '$username', 'u', '".md5($passwd)."', '$fname', '$lname', ".time().", 'A')";
|
||||
$sql .= "values (".$accountid.", '$username', 'u', '".md5($passwd)."', '$fname', '$lname', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('4', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '1', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '2', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('admin', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('nntp', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('transy', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('manual', 'run', 4, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '".$admingroupid."', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('admin', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('nntp', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', ".$accountid.", 'u', 1)");
|
||||
// $phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('transy', 'run', ".$accountid.", 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('manual', 'run', ".$accountid.", 'u', 1)");
|
||||
|
||||
Header("Location: index.php");
|
||||
exit;
|
||||
|
@ -11,13 +11,6 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$d1 = strtolower(substr($phpgw_info["server"]["include_root"],0,3));
|
||||
$d2 = strtolower(substr($phpgw_info["server"]["server_root"],0,3));
|
||||
if($d1 == "htt" || $d1 == "ftp" || $d2 == "htt" || $d2 == "ftp") {
|
||||
echo "Failed attempt to break in via an old Security Hole!<br>\n";
|
||||
exit;
|
||||
} unset($d1);unset($d2);
|
||||
|
||||
function add_default_server_config(){
|
||||
global $phpgw_info, $phpgw_setup;
|
||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('template_set', 'user_choice')");
|
||||
@ -60,7 +53,7 @@
|
||||
|
||||
if ($useglobalconfigsettings == "on"){
|
||||
if (is_file($basedir)){
|
||||
include ($phpgw_info["server"]["include_root"]."/globalconfig.inc.php");
|
||||
include (PHPGW_INCLUDE_ROOT."/globalconfig.inc.php");
|
||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('template_set', '".$phpgw_info["server"]["template_set"]."')");
|
||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('temp_dir', '".$phpgw_info["server"]["temp_dir"]."')");
|
||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('files_dir', '".$phpgw_info["server"]["files_dir"]."')");
|
||||
@ -107,20 +100,38 @@
|
||||
add_default_server_config();
|
||||
}
|
||||
|
||||
include($phpgw_info["server"]["server_root"] . "/setup/sql/default_applications.inc.php");
|
||||
include(PHPGW_SERVER_ROOT . "/setup/sql/default_applications.inc.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')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$phpgw_setup->db->query("insert into groups (group_name) values ('Default')");
|
||||
$phpgw_setup->db->query("insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,account_status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account','A')");
|
||||
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '1', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('admin', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', 1, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', 1, 'u', 1)");
|
||||
$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')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$defaultprefs = 'a:5:{s:6:"common";a:1:{s:0:"";s:2:"en";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}i:8;a:1:{s:0:"";s:13:"workdaystarts";}i:15;a:1:{s:0:"";s:11:"workdayends";}s:6:"Monday";a:1:{s:0:"";s:13:"weekdaystarts";}}';
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')");
|
||||
$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', '81dc9bdb52d04dc20036dbd8313ed055', 'Demo', 'Account', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('4', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('phpgw_group', '".$admingroupid."', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('admin', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('addressbook', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('filemanager', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('calendar', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('email', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('notes', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('nntp', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('todo', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('transy', 'run', $accountid, 'u', 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights) values('manual', 'run', $accountid, 'u', 1)");
|
||||
|
||||
@$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('aa','Afar','No')");
|
||||
@$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')");
|
||||
|
@ -20,7 +20,7 @@
|
||||
function update_version_table($tableschanged = True){
|
||||
global $phpgw_info, $phpgw_setup;
|
||||
if ($tableschanged == True){$phpgw_info["setup"]["tableschanged"] = True;}
|
||||
$phpgw_setup->db->query("update applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')");
|
||||
$phpgw_setup->db->query("update phpgw_applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')");
|
||||
}
|
||||
|
||||
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "drop"){
|
||||
@ -30,7 +30,7 @@
|
||||
include("./sql/".$phpgw_domain[$ConfigDomain]["db_type"]."_newtables.inc.php");
|
||||
include("./sql/common_default_records.inc.php");
|
||||
$included = True;
|
||||
include($phpgw_info["server"]["server_root"] . "/setup/lang.php");
|
||||
include(PHPGW_SERVER_ROOT . "/setup/lang.php");
|
||||
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "oldversion";
|
||||
}
|
||||
|
||||
|
@ -11,16 +11,16 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$phpgw_setup->db->query("DROP TABLE config");
|
||||
$phpgw_setup->db->query("DROP TABLE applications");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_config");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_applications");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_accounts");
|
||||
$phpgw_setup->db->query("DROP TABLE groups");
|
||||
$phpgw_setup->db->query("DROP TABLE preferences");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_preferences");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_sessions");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_app_sessions");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_acl");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_hooks");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_access_log");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_categories");
|
||||
$phpgw_setup->db->query("DROP TABLE profiles");
|
||||
$phpgw_setup->db->query("DROP TABLE addressbook");
|
||||
$phpgw_setup->db->query("DROP TABLE todo");
|
||||
@ -32,6 +32,13 @@
|
||||
$phpgw_setup->db->query("DROP TABLE lang");
|
||||
$phpgw_setup->db->query("DROP TABLE languages");
|
||||
$phpgw_setup->db->query("DROP TABLE customers");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_categories");
|
||||
$phpgw_setup->db->query("DROP TABLE notes");
|
||||
|
||||
/* Legacy tables */
|
||||
|
||||
$phpgw_setup->db->query("DROP TABLE config");
|
||||
$phpgw_setup->db->query("DROP TABLE applications");
|
||||
$phpgw_setup->db->query("DROP TABLE groups");
|
||||
$phpgw_setup->db->query("DROP TABLE accounts");
|
||||
$phpgw_setup->db->query("DROP TABLE preferences");
|
||||
?>
|
@ -47,11 +47,9 @@
|
||||
)";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$sql = "create table groups (
|
||||
group_id int NOT NULL auto_increment,
|
||||
group_name varchar(255),
|
||||
group_apps varchar(255),
|
||||
primary key(group_id)
|
||||
$sql = "CREATE TABLE phpgw_preferences (
|
||||
preference_owner int,
|
||||
preference_value text
|
||||
)";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
@ -300,7 +298,7 @@
|
||||
);";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.9";
|
||||
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre8";
|
||||
$phpgw_info["setup"]["oldver"]["phpgwapi"] = $phpgw_info["setup"]["currentver"]["phpgwapi"];
|
||||
update_version_table();
|
||||
// $phpgw_setup->update_version_table();
|
||||
|
@ -11,18 +11,20 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$phpgw_setup->db->query("DROP TABLE config");
|
||||
$phpgw_setup->db->query("DROP TABLE applications");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_config");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_applications");
|
||||
$phpgw_setup->db->query("drop sequence phpgw_accounts_account_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_accounts");
|
||||
$phpgw_setup->db->query("drop sequence groups_group_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE groups");
|
||||
$phpgw_setup->db->query("DROP TABLE preferences");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_preferences");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_sessions");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_app_sessions");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_acl");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_access_log");
|
||||
$phpgw_setup->db->query("drop sequence phpgw_categories_cat_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_categories");
|
||||
$phpgw_setup->db->query("drop sequence profiles_con_seq");
|
||||
$phpgw_setup->db->query("drop sequence phpgw_hooks_hook_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_hooks");
|
||||
$phpgw_setup->db->query("DROP TABLE profiles");
|
||||
$phpgw_setup->db->query("drop sequence addressbook_ab_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE addressbook");
|
||||
@ -40,10 +42,17 @@
|
||||
$phpgw_setup->db->query("DROP TABLE languages");
|
||||
$phpgw_setup->db->query("drop sequence categories_cat_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE categories");
|
||||
$phpgw_setup->db->query("drop sequence phpgw_categories_cat_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_categories");
|
||||
$phpgw_setup->db->query("DROP sequence notes_note_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE notes");
|
||||
$phpgw_setup->db->query("drop sequence phpgw_hooks_hook_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE phpgw_hooks");
|
||||
|
||||
$phpgw_setup->db->query("DROP TABLE config");
|
||||
$phpgw_setup->db->query("DROP TABLE applications");
|
||||
$phpgw_setup->db->query("DROP TABLE config");
|
||||
$phpgw_setup->db->query("DROP TABLE applications");
|
||||
$phpgw_setup->db->query("drop sequence groups_group_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE groups");
|
||||
$phpgw_setup->db->query("drop sequence accounts_account_id_seq");
|
||||
$phpgw_setup->db->query("DROP TABLE accounts");
|
||||
$phpgw_setup->db->query("DROP TABLE preferences");
|
||||
|
||||
?>
|
@ -31,7 +31,7 @@
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
|
||||
$sql = "create table accounts (
|
||||
$sql = "create table phpgw_accounts (
|
||||
account_id serial,
|
||||
account_lid varchar(25) NOT NULL,
|
||||
account_pwd char(32) NOT NULL,
|
||||
@ -46,13 +46,18 @@
|
||||
)";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$sql = "create table groups (
|
||||
group_id serial,
|
||||
group_name varchar(50),
|
||||
group_apps varchar(255)
|
||||
$sql = "create table preferences (
|
||||
preference_owner int,
|
||||
preference_value text
|
||||
)";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
|
||||
$sql = "create table phpgw_preferences (
|
||||
preference_owner int,
|
||||
preference_value text
|
||||
)";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$sql = "create table phpgw_sessions (
|
||||
session_id varchar(255),
|
||||
session_lid varchar(255),
|
||||
@ -91,12 +96,6 @@
|
||||
)";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$sql = "create table preferences (
|
||||
preference_owner int,
|
||||
preference_value text
|
||||
)";
|
||||
$phpgw_setup->db->query($sql);
|
||||
|
||||
$sql = "CREATE TABLE profiles (
|
||||
con serial,
|
||||
owner varchar(20),
|
||||
|
Loading…
Reference in New Issue
Block a user