commiting code so that jengo can merge in some other changes

This commit is contained in:
seek3r 2000-12-27 09:05:13 +00:00
parent 074e969ee1
commit 6cfdfaf372
22 changed files with 2459 additions and 1992 deletions

View File

@ -17,11 +17,11 @@
// Authorize the user to use setup app and load the database // Authorize the user to use setup app and load the database
// Does not return unless user is authorized // Does not return unless user is authorized
if (!auth()){ if (!$phpgw_setup->auth()){
Header("Location: index.php"); Header("Location: index.php");
exit; exit;
} }
loaddb(); $phpgw_setup->loaddb();
/* Guessing default paths. */ /* Guessing default paths. */
$current_config["files_dir"] = ereg_replace("/setup","/files",dirname($SCRIPT_FILENAME)); $current_config["files_dir"] = ereg_replace("/setup","/files",dirname($SCRIPT_FILENAME));
@ -32,19 +32,19 @@
} }
if ($submit) { if ($submit) {
@$db->query("delete from config"); @$phpgw_setup->db->query("delete from config");
while ($newsetting = each($newsettings)) { while ($newsetting = each($newsettings)) {
if ($newsetting[0] == "nntp_server") { if ($newsetting[0] == "nntp_server") {
$db->query("select config_value FROM config WHERE config_name='nntp_server'"); $phpgw_setup->db->query("select config_value FROM config WHERE config_name='nntp_server'");
if ($db->num_rows()) { if ($phpgw_setup->db->num_rows()) {
$db->next_record(); $phpgw_setup->db->next_record();
if ($db->f("config_value") <> $newsetting[1]) { if ($phpgw_setup->db->f("config_value") <> $newsetting[1]) {
$db->query("DELETE FROM newsgroups"); $phpgw_setup->db->query("DELETE FROM newsgroups");
$db->query("DELETE FROM users_newsgroups"); $phpgw_setup->db->query("DELETE FROM users_newsgroups");
} }
} }
} }
$db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0]) $phpgw_setup->db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0])
. "','" . addslashes($newsetting[1]) . "')"); . "','" . addslashes($newsetting[1]) . "')");
} }
if ($newsettings["auth_type"] == "ldap") { if ($newsettings["auth_type"] == "ldap") {
@ -58,12 +58,12 @@
} }
if ($newsettings["auth_type"] != "ldap") { if ($newsettings["auth_type"] != "ldap") {
show_header("Configuration"); $phpgw_setup->show_header("Configuration");
} }
@$db->query("select * from config"); @$phpgw_setup->db->query("select * from config");
while (@$db->next_record()) { while (@$phpgw_setup->db->next_record()) {
$current_config[$db->f("config_name")] = $db->f("config_value"); $current_config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value");
} }
if ($current_config["files_dir"] == "/path/to/dir/phpgroupware/files") { if ($current_config["files_dir"] == "/path/to/dir/phpgroupware/files") {

View File

@ -8,34 +8,34 @@
header("Content-type: application/octet-stream"); header("Content-type: application/octet-stream");
header("Pragma: no-cache"); header("Pragma: no-cache");
header("Expires: 0"); header("Expires: 0");
$newheader = generate_header(); $newheader = $phpgw_setup->generate_header();
echo $newheader; echo $newheader;
break; break;
case "view": case "view":
show_header("Generated header.inc.php"); $phpgw_setup->show_header("Generated header.inc.php");
echo "<br>Save this text as contents of your header.inc.php<br><hr>"; echo "<br>Save this text as contents of your header.inc.php<br><hr>";
$newheader = generate_header(); $newheader = $phpgw_setup->generate_header();
echo "<pre>"; echo "<pre>";
echo htmlentities($newheader); echo htmlentities($newheader);
echo "</pre></body></html>"; echo "</pre></body></html>";
break; break;
case "write config": case "write config":
if(is_writeable ("../header.inc.php")|| (!file_exists ("../header.inc.php") && is_writeable ("../"))){ if(is_writeable ("../header.inc.php")|| (!file_exists ("../header.inc.php") && is_writeable ("../"))){
show_header("Saved header.inc.php"); $phpgw_setup->show_header("Saved header.inc.php");
$newheader = generate_header(); $newheader = $phpgw_setup->generate_header();
$fsetup = fopen("../header.inc.php","w"); $fsetup = fopen("../header.inc.php","w");
fwrite($fsetup,$newheader); fwrite($fsetup,$newheader);
fclose($fsetup); fclose($fsetup);
echo "Created header.inc.php!<br>"; echo "Created header.inc.php!<br>";
}else{ }else{
show_header("Error generating header.inc.php"); $phpgw_setup->show_header("Error generating header.inc.php");
echo "Could not open header.inc.php for writing!<br>\n"; echo "Could not open header.inc.php for writing!<br>\n";
echo "Please check read/write permissions on directories or back up and use another option.<br>"; echo "Please check read/write permissions on directories or back up and use another option.<br>";
echo "</td></tr></table></body></html>"; echo "</td></tr></table></body></html>";
} }
break; break;
default: default:
show_header("Create/Edit your header.inc.php"); $phpgw_setup->show_header("Create/Edit your header.inc.php");
echo '<table> echo '<table>
<tr bgcolor="486591"><th colspan=2><font color="fefefe"> Analysis </font></th></tr> <tr bgcolor="486591"><th colspan=2><font color="fefefe"> Analysis </font></th></tr>
<tr><td colspan=2>'; <tr><td colspan=2>';

View File

@ -10,6 +10,8 @@
\**************************************************************************/ \**************************************************************************/
/* $Id$ */ /* $Id$ */
/* ######## Start security check ########## */
$d1 = strtolower(substr($phpgw_info["server"]["api_inc"],0,3)); $d1 = strtolower(substr($phpgw_info["server"]["api_inc"],0,3));
$d2 = strtolower(substr($phpgw_info["server"]["server_root"],0,3)); $d2 = strtolower(substr($phpgw_info["server"]["server_root"],0,3));
$d3 = strtolower(substr($phpgw_info["server"]["app_inc"],0,3)); $d3 = strtolower(substr($phpgw_info["server"]["app_inc"],0,3));
@ -17,6 +19,7 @@
echo "Failed attempt to break in via an old Security Hole!<br>\n"; echo "Failed attempt to break in via an old Security Hole!<br>\n";
exit; exit;
} unset($d1);unset($d2);unset($d3); } unset($d1);unset($d2);unset($d3);
/* ######## End security check ########## */
// Include to check user authorization against the // Include to check user authorization against the
// password in ../header.inc.php to protect all of the setup // password in ../header.inc.php to protect all of the setup
@ -30,291 +33,10 @@
$phpgw_info["server"]["app_images"] = "templates/default/images"; $phpgw_info["server"]["app_images"] = "templates/default/images";
function show_header($title = "",$nologoutbutton = False) include("./inc/phpgw_setup.inc.php");
{
global $phpgw_info, $PHP_SELF;
echo '
<html>
<head>
<title>phpGroupWare Setup';
if ($title != ""){echo " - ".$title;}
echo'</title>
<style type="text/css"><!-- .link { color: #FFFFFF; } --></style>
</head>
<BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" marginright="0" marginbottom="0">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="left" bgcolor="486591">&nbsp;<font color="fefefe">phpGroupWare version '.$phpgw_info["server"]["versions"]["phpgwapi"].' setup</font>
</td>
<td align="right" bgcolor="486591">';
if ($nologoutbutton) {
echo "&nbsp;";
} else {
echo '<a href="' . $PHP_SELF . '?FormLogout=True" class="link">Logout</a>&nbsp;';
}
echo "</td></tr></table>";
}
function loginForm($err="")
{
global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPW, $PHP_SELF;
echo "<p><body bgcolor='#ffffff'>\n";
echo "<table border=\"0\" align=\"center\">\n";
echo " <tr bgcolor=\"486591\">\n";
echo " <td colspan=\"2\"><font color=\"fefefe\">&nbsp;<b>Setup Login</b></font></td>\n";
echo " </tr>\n";
if ($err != "") {
echo " <tr bgcolor='#e6e6e6'><td colspan='2'><font color='#ff0000'>".$err."</font></td></tr>\n";
}
echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td><form action='".$PHP_SELF."' method='POST'>\n";
if (count($phpgw_domain) > 1){
echo " <table><tr><td>Domain: </td><td><input type='text' name='FormDomain' value=''></td></tr>\n";
echo " <tr><td>Password: </td><td><input type='password' name='FormPW' value=''></td></tr></table>\n";
}else{
reset($phpgw_domain);
$default_domain = each($phpgw_domain);
echo " <input type='password' name='FormPW' value=''>\n";
echo " <input type='hidden' name='FormDomain' value='".$default_domain[0]."'>\n";
}
echo " <input type='submit' name='Login' value='Login'>\n";
echo " </form></td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</body></html>\n";
}
function check_header()
{
global $phpgw_domain, $phpgw_info, $stage, $header_msg;
if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) {
$stage = 1.1;
$header_msg = "Stage One";
}else{
include("../header.inc.php");
if (!isset($phpgw_domain) || $phpgw_info["server"]["versions"]["header"] != $phpgw_info["server"]["versions"]["current_header"]) {
$stage = 1.2;
$header_msg = "Stage One (Upgrade your header.inc.php)";
}else{ /* header.inc.php part settled. Moving to authentication */
$stage = 1.3;
$header_msg = "Stage One (Completed)";
}
}
}
function generate_header(){
Global $SCRIPT_FILENAME, $HTTP_POST_VARS, $k, $v;
$ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r");
if($ftemplate){
$ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r");
$template = fread($ftemplate,filesize(dirname($SCRIPT_FILENAME)."/../header.inc.php.template"));
fclose($ftemplate);
while(list($k,$v) = each($HTTP_POST_VARS)) {
$template = ereg_replace("__".strtoupper($k)."__",$v,$template);
}
return $template;
}else{
echo "Could not open the header template for reading!<br>";
exit;
}
}
function auth()
{
global $phpgw_domain, $FormLogout, $FormDomain, $FormPW, $SetupPW, $SetupDomain, $db, $HTTP_POST_VARS, $login_msg;
if (isset($FormLogout)) {
setcookie("SetupPW"); // scrub the old one
setcookie("SetupDomain"); // scrub the old one
$login_msg = "You have sucessfully logged out";
return False;
} elseif (isset($SetupPW)) {
if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) {
setcookie("SetupPW"); // scrub the old one
setcookie("SetupDomain"); // scrub the old one
$login_msg = "Invalid session cookie (cookies must be enabled)";
return False;
}else{
return True;
}
} elseif (isset($FormPW)) {
if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) {
setcookie("SetupPW",$FormPW);
setcookie("SetupDomain",$FormDomain);
$SetupDomain = $FormDomain;
return True;
}else{
$login_msg = "Invalid password";
return False;
}
} else {
return False;
}
}
function loaddb()
{
global $phpgw_info, $phpgw_domain, $SetupDomain, $db;
/* Database setup */
if (!isset($phpgw_info["server"]["api_inc"])) {
$phpgw_info["server"]["api_inc"] = $phpgw_info["server"]["server_root"]."/phpgwapi/inc";
}
include($phpgw_info["server"]["api_inc"] . "/phpgw_db_".$phpgw_domain[$SetupDomain]["db_type"].".inc.php");
$db = new db;
$db->Host = $phpgw_domain[$SetupDomain]["db_host"];
$db->Type = $phpgw_domain[$SetupDomain]["db_type"];
$db->Database = $phpgw_domain[$SetupDomain]["db_name"];
$db->User = $phpgw_domain[$SetupDomain]["db_user"];
$db->Password = $phpgw_domain[$SetupDomain]["db_pass"];
}
function check_db()
{
global $phpgw_info, $oldversion, $db, $stage, $header_msg;
$db->Halt_On_Error = "no";
$tables = $db->table_names();
if (is_array($tables) && count($tables) > 0){
/* tables exists. checking for post beta version */
$db->query("select app_version from applications where app_name='admin'");
$db->next_record();
$oldversion = $db->f("app_version");
if (isset($oldversion)){
if ($oldversion == $phpgw_info["server"]["versions"]["phpgwapi"]){
$db->query("select config_value from config where config_name='freshinstall'");
$db->next_record();
$configed = $db->f("config_value");
if ($configed){
$stage = 3.1;
$header_msg = "Stage 3 (Needs Configuration)";
}else{
$stage = 3.2;
$header_msg = "Stage 3 (Configuration OK)";
}
}else{
$stage = 2.4;
$header_msg = "Stage 2 (Tables need upgrading)";
}
}else{
$stage = 2.2;
$header_msg = "Stage 2 (Tables appear to be pre-beta)";
}
}else{
/* no tables, so checking if we can create them */
/* I cannot get either to work properly
$isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3");
*/
$db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )");
if (isset($db_rights)){
//if (isset($isdb)){
$stage = 2.3;
$header_msg = "Stage 2 (Create tables)";
}else{
$stage = 2.1;
$header_msg = "Stage 2 (Create Database)";
}
$db->query("DROP TABLE phpgw_testrights");
}
}
function app_setups($appname = ""){
global $phpgw_info;
$d = dir($phpgw_info["server"]["server_root"]);
while($entry=$d->read()) {
if (is_dir ($phpgw_info["server"]["server_root"]."/".$entry."/setup")){
echo $entry."<br>\n";
}
}
$d->close();
}
function execute_script($script, $appname = ""){
global $phpgw_info, $currentver, $oldversion, $phpgw_domain, $db;
if ($appname == ""){
$d = dir($phpgw_info["server"]["server_root"]);
while($entry=$d->read()) {
$f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/".$script.".inc.php";
if (file_exists ($f)){include($f);}
}
$d->close();
}else{
$f = $phpgw_info["server"]["server_root"]."/".$appname."/setup/".$script.".inc.php";
if (file_exists ($f)){include($f);}
}
}
function update_app_version($appname, $tableschanged = True){
global $currentver, $phpgw_info, $db, $tablechanges;
if ($tableschanged == True){$tablechanges = True;}
$db->query("update applications set app_version='".$currentver."' where app_name='".$appname."'");
}
function manage_tables(){
global $currentver, $tablechanges, $phpgw_domain, $phpgw_info, $db;
if ($currentver == "drop"){
execute_script("droptables");
}
if ($currentver == "new") {
execute_script("newtables");
execute_script("common_default_records");
execute_script("lang");
}
if ($currentver == "oldversion") {
$currentver = $oldversion;
execute_script("upgradetables");
}
/* Not yet implemented
if (!$tablechanges == True){
echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td>No table changes were needed. The script only updated your version setting.</td>\n";
echo " </tr>\n";
}
*/
}
function setup_header($title = "",$nologoutbutton = False) {
global $phpgw_info, $PHP_SELF, $dontshowtheheaderagain;
// Ok, so it isn't the greatest idea, but it works for now. Setup needs to be rewritten.
if ($dontshowtheheaderagain) {
return False;
}
$dontshowtheheaderagain = True;
?>
<head>
<title>phpGroupWare setup <?php echo $title; ?></title>
<style type="text/css">
<!--
.link
{
color: #FFFFFF;
}
-->
</style>
</head>
<BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" marginright="0" marginbottom="0">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="left" bgcolor="486591">&nbsp;<font color="fefefe">phpGroupWare version <?php
echo $phpgw_info["server"]["versions"]["phpgwapi"]; ?> setup</font>
</td>
<td align="right" bgcolor="486591">
<?php
if ($nologoutbutton) {
echo "&nbsp;";
} else {
echo '<a href="' . $PHP_SELF . '?FormLogout=True" class="link">Logout</a>&nbsp;';
}
echo "</td></tr></table>";
}
include("./inc/phpgw_schema_proc.inc.php"); include("./inc/phpgw_schema_proc.inc.php");
// $phpgw_schema_proc = new phpgw_schema_proc($phpgw_domain[$SetupDomain]["db_type"]); include("./inc/phpgw_template.inc.php");
$phpgw_schema_proc = new phpgw_schema_proc("mysql");
?> $phpgw_setup = new phpgw_setup;
$phpgw_setup->template = new Template("../");
?>

View File

@ -0,0 +1,361 @@
<?php
/**************************************************************************\
* phpGroupWare - Setup *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
class phpgw_setup
{
var $db;
var $template;
function show_header($title = "",$nologoutbutton = False)
{
global $phpgw_info, $PHP_SELF;
echo '
<html>
<head>
<title>phpGroupWare Setup';
if ($title != ""){echo " - ".$title;}
echo'</title>
<style type="text/css"><!-- .link { color: #FFFFFF; } --></style>
</head>
<BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" marginright="0" marginbottom="0">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="left" bgcolor="486591">&nbsp;<font color="fefefe">phpGroupWare version '.$phpgw_info["server"]["versions"]["phpgwapi"].' setup</font>
</td>
<td align="right" bgcolor="486591">';
if ($nologoutbutton) {
echo "&nbsp;";
} else {
echo '<a href="' . $PHP_SELF . '?FormLogout=True" class="link">Logout</a>&nbsp;';
}
echo "</td></tr></table>";
}
function loginForm($err="")
{
global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPW, $PHP_SELF;
echo "<p><body bgcolor='#ffffff'>\n";
echo "<table border=\"0\" align=\"center\">\n";
echo " <tr bgcolor=\"486591\">\n";
echo " <td colspan=\"2\"><font color=\"fefefe\">&nbsp;<b>Setup/Config Admin Login</b></font></td>\n";
echo " </tr>\n";
if ($err != "") {
echo " <tr bgcolor='#e6e6e6'><td colspan='2'><font color='#ff0000'>".$err."</font></td></tr>\n";
}
echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td><form action='".$PHP_SELF."' method='POST'>\n";
if (count($phpgw_domain) > 1){
echo " <table><tr><td>Domain: </td><td><input type='text' name='FormDomain' value=''></td></tr>\n";
echo " <tr><td>Password: </td><td><input type='password' name='FormPW' value=''></td></tr></table>\n";
}else{
reset($phpgw_domain);
$default_domain = each($phpgw_domain);
echo " <input type='password' name='FormPW' value=''>\n";
echo " <input type='hidden' name='FormDomain' value='".$default_domain[0]."'>\n";
}
echo " <input type='submit' name='Login' value='Login'>\n";
echo " </form></td>\n";
echo " </tr>\n";
echo " <tr bgcolor=\"486591\">\n";
echo " <td colspan=\"2\"><font color=\"fefefe\">&nbsp;<b>Header Admin Login</b></font></td>\n";
echo " </tr>\n";
if ($err != "") {
echo " <tr bgcolor='#e6e6e6'><td colspan='2'><font color='#ff0000'>".$err."</font></td></tr>\n";
}
echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td><form action='".$PHP_SELF."' method='POST'>\n";
echo " <input type='password' name='HeaderPW' value=''>\n";
echo " <input type='submit' name='HeaderLogin' value='Login'>\n";
echo " </form></td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "</body></html>\n";
}
function check_header()
{
global $phpgw_domain, $phpgw_info;
if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) {
$phpgw_info["setup"]["stage"] = 1.1;
$phpgw_info["setup"]["header_msg"] = "Stage One";
}else{
include("../header.inc.php");
if (!isset($phpgw_domain) || $phpgw_info["server"]["versions"]["header"] != $phpgw_info["server"]["versions"]["current_header"]) {
$phpgw_info["setup"]["stage"] = 1.2;
$phpgw_info["setup"]["header_msg"] = "Stage One (Upgrade your header.inc.php)";
}else{ /* header.inc.php part settled. Moving to authentication */
$phpgw_info["setup"]["stage"] = 1.3;
$phpgw_info["setup"]["header_msg"] = "Stage One (Completed)";
}
}
}
function generate_header(){
global $SCRIPT_FILENAME, $HTTP_POST_VARS, $k, $v;
$ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r");
if($ftemplate){
$ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r");
$template = fread($ftemplate,filesize(dirname($SCRIPT_FILENAME)."/../header.inc.php.template"));
fclose($ftemplate);
while(list($k,$v) = each($HTTP_POST_VARS)) {
$template = ereg_replace("__".strtoupper($k)."__",$v,$template);
}
return $template;
}else{
echo "Could not open the header template for reading!<br>";
exit;
}
}
function config_auth()
{
global $phpgw_domain, $FormLogout, $FormDomain, $FormPW, $SetupPW, $SetupDomain, $HTTP_POST_VARS, $login_msg;
if (isset($FormLogout)) {
setcookie("SetupPW"); // scrub the old one
setcookie("SetupDomain"); // scrub the old one
$login_msg = "You have sucessfully logged out";
return False;
} elseif (isset($SetupPW)) {
if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) {
setcookie("SetupPW"); // scrub the old one
setcookie("SetupDomain"); // scrub the old one
$login_msg = "Invalid session cookie (cookies must be enabled)";
return False;
}else{
return True;
}
} elseif (isset($FormPW)) {
if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) {
setcookie("SetupPW",$FormPW);
setcookie("SetupDomain",$FormDomain);
$SetupDomain = $FormDomain;
return True;
}else{
$login_msg = "Invalid password";
return False;
}
} else {
return False;
}
}
function header_auth()
{
global $phpgw_domain, $FormLogout, $FormDomain, $FormPW, $SetupPW, $SetupDomain, $HTTP_POST_VARS, $login_msg;
if (isset($FormLogout)) {
setcookie("SetupPW"); // scrub the old one
setcookie("SetupDomain"); // scrub the old one
$login_msg = "You have sucessfully logged out";
return False;
} elseif (isset($SetupPW)) {
if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) {
setcookie("SetupPW"); // scrub the old one
setcookie("SetupDomain"); // scrub the old one
$login_msg = "Invalid session cookie (cookies must be enabled)";
return False;
}else{
return True;
}
} elseif (isset($FormPW)) {
if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) {
setcookie("SetupPW",$FormPW);
setcookie("SetupDomain",$FormDomain);
$SetupDomain = $FormDomain;
return True;
}else{
$login_msg = "Invalid password";
return False;
}
} else {
return False;
}
}
function loaddb()
{
global $phpgw_info, $phpgw_domain, $SetupDomain;
/* Database setup */
if (!isset($phpgw_info["server"]["api_inc"])) {
$phpgw_info["server"]["api_inc"] = $phpgw_info["server"]["server_root"]."/phpgwapi/inc";
}
include($phpgw_info["server"]["api_inc"] . "/phpgw_db_".$phpgw_domain[$SetupDomain]["db_type"].".inc.php");
$this->db = new db;
$this->db->Host = $phpgw_domain[$SetupDomain]["db_host"];
$this->db->Type = $phpgw_domain[$SetupDomain]["db_type"];
$this->db->Database = $phpgw_domain[$SetupDomain]["db_name"];
$this->db->User = $phpgw_domain[$SetupDomain]["db_user"];
$this->db->Password = $phpgw_domain[$SetupDomain]["db_pass"];
$phpgw_schema_proc = new phpgw_schema_proc($phpgw_domain[$SetupDomain]["db_type"]);
}
function check_db()
{
global $phpgw_info;
$this->db->Halt_On_Error = "no";
$tables = $this->db->table_names();
if (is_array($tables) && count($tables) > 0){
/* tables exists. checking for post beta version */
$this->db->query("select * from applications");
while (@$this->db->next_record()) {
if ($this->db->f("app_name") == "admin"){$phpgw_info["setup"]["oldver"]["phpgwapi"] = $this->db->f("app_version");}
$phpgw_info["setup"]["oldver"][$this->db->f("app_name")] = $this->db->f("app_version");
$phpgw_info["setup"][$this->db->f("app_name")]["title"] = $this->db->f("app_title");
}
if (isset($phpgw_info["setup"]["oldver"]["phpgwapi"])){
if ($phpgw_info["setup"]["oldver"]["phpgwapi"] == $phpgw_info["server"]["versions"]["phpgwapi"]){
$this->db->query("select config_value from config where config_name='freshinstall'");
$this->db->next_record();
$configed = $this->db->f("config_value");
if ($configed){
$phpgw_info["setup"]["stage"] = 3.1;
$phpgw_info["setup"]["header_msg"] = "Stage 3 (Needs Configuration)";
}else{
$phpgw_info["setup"]["stage"] = 3.2;
$phpgw_info["setup"]["header_msg"] = "Stage 3 (Configuration OK)";
}
}else{
$phpgw_info["setup"]["stage"] = 2.4;
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables need upgrading)";
}
}else{
$phpgw_info["setup"]["stage"] = 2.2;
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables appear to be pre-beta)";
}
}else{
/* no tables, so checking if we can create them */
/* I cannot get either to work properly
$isdb = $this->db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3");
*/
$db_rights = $this->db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )");
if (isset($db_rights)){
//if (isset($isdb)){
$phpgw_info["setup"]["stage"] = 2.3;
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Create tables)";
}else{
$phpgw_info["setup"]["stage"] = 2.1;
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Create Database)";
}
$this->db->query("DROP TABLE phpgw_testrights");
}
}
function app_setups($appname = ""){
global $phpgw_info;
$d = dir($phpgw_info["server"]["server_root"]);
while($entry=$d->read()) {
if (is_dir ($phpgw_info["server"]["server_root"]."/".$entry."/setup")){
echo $entry."<br>\n";
}
}
$d->close();
}
function execute_script($script, $appname = ""){
global $phpgw_info, $phpgw_domain;
if ($appname == ""){
$d = dir($phpgw_info["server"]["server_root"]);
while($entry=$d->read()) {
$f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/version.inc.php";
if (file_exists ($f)){
include($f);
}else{
$phpgw_info["server"]["versions"][$entry] = $phpgw_info["setup"]["currentver"]["phpgwapi"];
}
$f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/".$script.".inc.php";
if (file_exists ($f)){include($f);}
}
$d->close();
}else{
$f = $phpgw_info["server"]["server_root"]."/".$appname."/setup/".$script.".inc.php";
if (file_exists ($f)){include($f);}
}
}
function update_app_version($appname, $tableschanged = True){
global $phpgw_info;
if ($tableschanged == True){$phpgw_info["setup"]["tableschanged"] = True;}
$this->db->query("update applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where app_name='".$appname."'");
}
function manage_tables(){
global $phpgw_domain, $phpgw_info;
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "drop"){
$this->execute_script("droptables");
}
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "new") {
$this->execute_script("newtables");
$this->execute_script("common_default_records");
$this->execute_script("lang");
}
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "oldversion") {
$phpgw_info["setup"]["currentver"]["phpgwapi"] = $phpgw_info["setup"]["oldver"]["phpgwapi"];
$this->execute_script("upgradetables");
}
/* Not yet implemented
if (!$phpgw_info["setup"]["tableschanged"] == True){
echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td>No table changes were needed. The script only updated your version setting.</td>\n";
echo " </tr>\n";
}
*/
}
function setup_header($title = "",$nologoutbutton = False) {
global $phpgw_info, $PHP_SELF;
// Ok, so it isn't the greatest idea, but it works for now. Setup needs to be rewritten.
if ($phpgw_info["setup"]["dontshowtheheaderagain"]) {
return False;
}
$phpgw_info["setup"]["dontshowtheheaderagain"] = True;
?>
<head>
<title>phpGroupWare setup <?php echo $title; ?></title>
<style type="text/css">
<!--
.link
{
color: #FFFFFF;
}
-->
</style>
</head>
<BODY BGCOLOR="FFFFFF" margintop="0" marginleft="0" marginright="0" marginbottom="0">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="left" bgcolor="486591">&nbsp;<font color="fefefe">phpGroupWare version <?php
echo $phpgw_info["server"]["versions"]["phpgwapi"]; ?> setup</font>
</td>
<td align="right" bgcolor="486591">
<?php
if ($nologoutbutton) {
echo "&nbsp;";
} else {
echo '<a href="' . $PHP_SELF . '?FormLogout=True" class="link">Logout</a>&nbsp;';
}
echo "</td></tr></table>";
}
}
?>

View File

@ -0,0 +1,346 @@
<?php
/*
* Session Management for PHP3
*
* (C) Copyright 1999-2000 NetUSE GmbH
* Kristian Koehntopp
*
* $Id$
*
*/
class Template {
var $classname = "Template";
/* if set, echo assignments */
var $debug = false;
/* $file[handle] = "filename"; */
var $file = array();
/* relative filenames are relative to this pathname */
var $root = "";
/* $varkeys[key] = "key"; $varvals[key] = "value"; */
var $varkeys = array();
var $varvals = array();
/* "remove" => remove undefined variables
* "comment" => replace undefined variables with comments
* "keep" => keep undefined variables
*/
var $unknowns = "remove";
/* "yes" => halt, "report" => report error, continue, "no" => ignore error quietly */
var $halt_on_error = "yes";
/* last error message is retained here */
var $last_error = "";
/***************************************************************************/
/* public: Constructor.
* root: template directory.
* unknowns: how to handle unknown variables.
*/
function Template($root = ".", $unknowns = "remove") {
$this->set_root($root);
$this->set_unknowns($unknowns);
}
/* public: setroot(pathname $root)
* root: new template directory.
*/
function set_root($root) {
if (!is_dir($root)) {
$this->halt("set_root: $root is not a directory.");
return false;
}
$this->root = $root;
return true;
}
/* public: set_unknowns(enum $unknowns)
* unknowns: "remove", "comment", "keep"
*
*/
function set_unknowns($unknowns = "keep") {
$this->unknowns = $unknowns;
}
/* public: set_file(array $filelist)
* filelist: array of handle, filename pairs.
*
* public: set_file(string $handle, string $filename)
* handle: handle for a filename,
* filename: name of template file
*/
function set_file($handle, $filename = "") {
if (!is_array($handle)) {
if ($filename == "") {
$this->halt("set_file: For handle $handle filename is empty.");
return false;
}
$this->file[$handle] = $this->filename($filename);
} else {
reset($handle);
while(list($h, $f) = each($handle)) {
$this->file[$h] = $this->filename($f);
}
}
}
/* public: set_block(string $parent, string $handle, string $name = "")
* extract the template $handle from $parent,
* place variable {$name} instead.
*/
function set_block($parent, $handle, $name = "") {
if (!$this->loadfile($parent)) {
$this->halt("subst: unable to load $parent.");
return false;
}
if ($name == "")
$name = $handle;
$str = $this->get_var($parent);
$reg = "/<!--\s+BEGIN $handle\s+-->(.*)\n\s*<!--\s+END $handle\s+-->/sm";
preg_match_all($reg, $str, $m);
$str = preg_replace($reg, "{" . "$name}", $str);
$this->set_var($handle, $m[1][0]);
$this->set_var($parent, $str);
}
/* public: set_var(array $values)
* values: array of variable name, value pairs.
*
* public: set_var(string $varname, string $value)
* varname: name of a variable that is to be defined
* value: value of that variable
*/
function set_var($varname, $value = "") {
if (!is_array($varname)) {
if (!empty($varname))
if ($this->debug) print "scalar: set *$varname* to *$value*<br>\n";
$this->varkeys[$varname] = "/".$this->varname($varname)."/";
$this->varvals[$varname] = $value;
} else {
reset($varname);
while(list($k, $v) = each($varname)) {
if (!empty($k))
if ($this->debug) print "array: set *$k* to *$v*<br>\n";
$this->varkeys[$k] = "/".$this->varname($k)."/";
$this->varvals[$k] = $v;
}
}
}
/* public: subst(string $handle)
* handle: handle of template where variables are to be substituted.
*/
function subst($handle) {
if (!$this->loadfile($handle)) {
$this->halt("subst: unable to load $handle.");
return false;
}
$str = $this->get_var($handle);
$str = @preg_replace($this->varkeys, $this->varvals, $str);
return $str;
}
/* public: psubst(string $handle)
* handle: handle of template where variables are to be substituted.
*/
function psubst($handle) {
print $this->subst($handle);
return false;
}
/* public: parse(string $target, string $handle, boolean append)
* public: parse(string $target, array $handle, boolean append)
* target: handle of variable to generate
* handle: handle of template to substitute
* append: append to target handle
*/
function parse($target, $handle, $append = false) {
if (!is_array($handle)) {
$str = $this->subst($handle);
if ($append) {
$this->set_var($target, $this->get_var($target) . $str);
} else {
$this->set_var($target, $str);
}
} else {
reset($handle);
while(list($i, $h) = each($handle)) {
$str = $this->subst($h);
$this->set_var($target, $str);
}
}
return $str;
}
function pparse($target, $handle, $append = false) {
print $this->parse($target, $handle, $append);
return false;
}
/* public: get_vars()
*/
function get_vars() {
reset($this->varkeys);
while(list($k, $v) = each($this->varkeys)) {
$result[$k] = $this->varvals[$k];
}
return $result;
}
/* public: get_var(string varname)
* varname: name of variable.
*
* public: get_var(array varname)
* varname: array of variable names
*/
function get_var($varname) {
if (!is_array($varname)) {
return $this->varvals[$varname];
} else {
reset($varname);
while(list($k, $v) = each($varname)) {
$result[$k] = $this->varvals[$k];
}
return $result;
}
}
/* public: get_undefined($handle)
* handle: handle of a template.
*/
function get_undefined($handle) {
if (!$this->loadfile($handle)) {
$this->halt("get_undefined: unable to load $handle.");
return false;
}
preg_match_all("/\{([^}]+)\}/", $this->get_var($handle), $m);
$m = $m[1];
if (!is_array($m))
return false;
reset($m);
while(list($k, $v) = each($m)) {
if (!isset($this->varkeys[$v]))
$result[$v] = $v;
}
if (count($result))
return $result;
else
return false;
}
/* public: finish(string $str)
* str: string to finish.
*/
function finish($str) {
switch ($this->unknowns) {
case "keep":
break;
case "remove":
$str = preg_replace('/{[^ \t\r\n}]+}/', "", $str);
break;
case "comment":
$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
break;
}
return $str;
}
/* public: p(string $varname)
* varname: name of variable to print.
*/
function p($varname) {
print $this->finish($this->get_var($varname));
}
function get($varname) {
return $this->finish($this->get_var($varname));
}
/***************************************************************************/
/* private: filename($filename)
* filename: name to be completed.
*/
function filename($filename) {
if (substr($filename, 0, 1) != "/") {
$filename = $this->root."/".$filename;
}
if (!file_exists($filename))
$this->halt("filename: file $filename does not exist.");
return $filename;
}
/* private: varname($varname)
* varname: name of a replacement variable to be protected.
*/
function varname($varname) {
return preg_quote("{".$varname."}");
}
/* private: loadfile(string $handle)
* handle: load file defined by handle, if it is not loaded yet.
*/
function loadfile($handle) {
if (isset($this->varkeys[$handle]) and !empty($this->varvals[$handle]))
return true;
if (!isset($this->file[$handle])) {
$this->halt("loadfile: $handle is not a valid handle.");
return false;
}
$filename = $this->file[$handle];
$str = implode("", @file($filename));
if (empty($str)) {
$this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
return false;
}
$this->set_var($handle, $str);
return true;
}
/***************************************************************************/
/* public: halt(string $msg)
* msg: error message to show.
*/
function halt($msg) {
$this->last_error = $msg;
if ($this->halt_on_error != "no")
$this->haltmsg($msg);
if ($this->halt_on_error == "yes")
die("<b>Halted.</b>");
return false;
}
/* public, override: haltmsg($msg)
* msg: error message to show.
*/
function haltmsg($msg) {
printf("<b>Template Error:</b> %s<br>\n", $msg);
}
}

View File

@ -19,15 +19,15 @@
include("./inc/functions.inc.php"); include("./inc/functions.inc.php");
/* processing and discovery phase */ /* processing and discovery phase */
check_header(); $phpgw_setup->check_header();
if ( $stage >= 1.3){ if ( $phpgw_info["setup"]["stage"] >= 1.3){
if (!auth()){ if (!$phpgw_setup->config_auth()){
show_header("Please login",True); $phpgw_setup->show_header("Please login",True);
loginForm($login_msg); $phpgw_setup->loginForm($login_msg);
exit; exit;
}else{ /* authentication settled. Moving to the database portion. */ }else{ /* authentication settled. Moving to the database portion. */
loaddb(); $phpgw_setup->loaddb();
check_db(); $phpgw_setup->check_db();
} }
} }
@ -36,28 +36,28 @@
$subtitle = "Deleting Tables"; $subtitle = "Deleting Tables";
$submsg = "At your request, this script is going to take the evil action of deleting your existing tables and re-creating them in the new format."; $submsg = "At your request, this script is going to take the evil action of deleting your existing tables and re-creating them in the new format.";
$subaction = "deleted"; $subaction = "deleted";
$currentver = "drop"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "drop";
$stage = 2.5; $phpgw_info["setup"]["stage"] = 2.5;
break; break;
case "Upgrade": case "Upgrade":
$subtitle = "Upgrading Tables"; $subtitle = "Upgrading Tables";
$submsg = "At your request, this script is going to attempt to upgrade your old tables to the new format."; $submsg = "At your request, this script is going to attempt to upgrade your old tables to the new format.";
$subaction = "upgraded"; $subaction = "upgraded";
$currentver = "oldversion"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "oldversion";
$stage = 2.5; $phpgw_info["setup"]["stage"] = 2.5;
break; break;
case "Create": case "Create":
$subtitle = "Creating Tables"; $subtitle = "Creating Tables";
$submsg = "At your request, this script is going to attempt to the tables for you."; $submsg = "At your request, this script is going to attempt to the tables for you.";
$subaction = "created"; $subaction = "created";
$currentver = "new"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "new";
$stage = 2.5; $phpgw_info["setup"]["stage"] = 2.5;
break; break;
} }
/* Display code */ /* Display code */
show_header($header_msg); $phpgw_setup->show_header($phpgw_info["setup"]["header_msg"]);
if (PHP_VERSION < "3.0.16") { if (PHP_VERSION < "3.0.16") {
echo "You appear to be running an old version of PHP. It its recommend that you upgrade " echo "You appear to be running an old version of PHP. It its recommend that you upgrade "
. "to a new version. Older version of PHP might not run phpGroupWare correctly, if at all."; . "to a new version. Older version of PHP might not run phpGroupWare correctly, if at all.";
@ -85,20 +85,20 @@
echo '<table border="1" width="100%" cellspacing="0" cellpadding="2">'; echo '<table border="1" width="100%" cellspacing="0" cellpadding="2">';
echo ' <tr><td align="left" WIDTH="20%" bgcolor="486591"><font color="fefefe">Step 1 - header.inc.php</td><td align="right" bgcolor="486591">&nbsp;</td></tr>'; echo ' <tr><td align="left" WIDTH="20%" bgcolor="486591"><font color="fefefe">Step 1 - header.inc.php</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($stage == 1.1) { if ($phpgw_info["setup"]["stage"] == 1.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="./createheader.php" method=post>You have not created your header.inc.php yet.<br> <input type=submit value="Create one now"></form></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="./createheader.php" method=post>You have not created your header.inc.php yet.<br> <input type=submit value="Create one now"></form></td></tr>';
}elseif ($stage == 1.2) { }elseif ($phpgw_info["setup"]["stage"] == 1.2) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="./createheader.php" method=post>Your header.inc.php is out of date. Please upgrade it.<br> <input type=submit value="Upgrade now"></form></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="./createheader.php" method=post>Your header.inc.php is out of date. Please upgrade it.<br> <input type=submit value="Upgrade now"></form></td></tr>';
}elseif ($stage >= 1.3) { }elseif ($phpgw_info["setup"]["stage"] >= 1.3) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td><form action="./createheader.php" method=post> echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td><form action="./createheader.php" method=post>
Your header.inc.php is in place and current.<br> <input type=submit value="Edit existing header.inc.php"></form></td></tr>'; Your header.inc.php is in place and current.<br> <input type=submit value="Edit existing header.inc.php"></form></td></tr>';
} }
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 2 - database management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>'; echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 2 - database management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($stage < 2.1) { if ($phpgw_info["setup"]["stage"] < 2.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
}elseif ($stage == 2.1) { }elseif ($phpgw_info["setup"]["stage"] == 2.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database does not exist.<br> <input type=submit value="Create one now"></form></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database does not exist.<br> <input type=submit value="Create one now"></form></td></tr>';
}elseif ($stage == 2.2) { }elseif ($phpgw_info["setup"]["stage"] == 2.2) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo ' echo '
You appear to be running a pre-beta version of phpGroupWare<br> You appear to be running a pre-beta version of phpGroupWare<br>
@ -121,7 +121,7 @@
<input type="submit" name="action" value="Delete all my tables and data"> <input type="submit" name="action" value="Delete all my tables and data">
</form>'; </form>';
echo '</td></tr>'; echo '</td></tr>';
}elseif ($stage == 2.3) { }elseif ($phpgw_info["setup"]["stage"] == 2.3) {
/* commented out because I cannot accuratly figure out if the DB exists */ /* commented out because I cannot accuratly figure out if the DB exists */
//echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database exist, would you like to create your tables now?<br> <input type=submit value="Create tables"></form></td></tr>'; //echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td><form action="index.php" method=post>Your database exist, would you like to create your tables now?<br> <input type=submit value="Create tables"></form></td></tr>';
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Make sure that your database is created and the account permissions are set.<br>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Make sure that your database is created and the account permissions are set.<br>';
@ -146,13 +146,13 @@
echo '<form action="index.php" method=post>'; echo '<form action="index.php" method=post>';
echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n"; echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n";
echo 'Once the database is setup correctly <br><input type=submit name="action" value="Create"> the tables</form></td></tr>'; echo 'Once the database is setup correctly <br><input type=submit name="action" value="Create"> the tables</form></td></tr>';
}elseif ($stage == 2.4) { }elseif ($phpgw_info["setup"]["stage"] == 2.4) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo "You appear to be running version $oldversion of phpGroupWare.<br>\n"; echo "You appear to be running version ".$phpgw_info["setup"]["oldver"]["phpgwapi"]." of phpGroupWare.<br>\n";
echo "We will automaticly update your tables/records to ".$phpgw_info["server"]["versions"]["phpgwapi"].", but we highly recommend backing up your tables in case the script causes damage to your data.\n"; echo "We will automaticly update your tables/records to ".$phpgw_info["server"]["versions"]["phpgwapi"].", but we highly recommend backing up your tables in case the script causes damage to your data.\n";
echo "These automated scripts can easily destroy your data. Please backup before going any further!\n"; echo "These automated scripts can easily destroy your data. Please backup before going any further!\n";
echo "<form method=\"POST\" action=\"index.php\">\n"; echo "<form method=\"POST\" action=\"index.php\">\n";
echo "<input type=\"hidden\" name=\"oldversion\" value=\"".$oldversion."\">\n"; echo "<input type=\"hidden\" name=\"oldversion\" value=\"".$phpgw_info["setup"]["oldver"]["phpgwapi"]."\">\n";
echo "<input type=\"hidden\" name=\"useglobalconfigsettings\">\n"; echo "<input type=\"hidden\" name=\"useglobalconfigsettings\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Upgrade\">\n"; echo "<input type=\"submit\" name=\"action\" value=\"Upgrade\">\n";
echo "<input type=\"submit\" name=\"action\" value=\"Delete all my tables and data\">\n"; echo "<input type=\"submit\" name=\"action\" value=\"Delete all my tables and data\">\n";
@ -161,15 +161,15 @@
echo "<input type=\"submit\" name=\"action\" value=\"Dont touch my data\">\n"; echo "<input type=\"submit\" name=\"action\" value=\"Dont touch my data\">\n";
echo "</form>\n"; echo "</form>\n";
echo '</td></tr>'; echo '</td></tr>';
}elseif ($stage == 2.5) { }elseif ($phpgw_info["setup"]["stage"] == 2.5) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>';
echo "<table width=\"100%\">\n"; echo "<table width=\"100%\">\n";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>$subtitle</b></font></td></tr>\n"; echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>$subtitle</b></font></td></tr>\n";
echo " <tr bgcolor=\"e6e6e6\"><td>$submsg</td></tr>\n"; echo " <tr bgcolor=\"e6e6e6\"><td>$submsg</td></tr>\n";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Table Change Messages</b></font></td></tr>\n"; echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Table Change Messages</b></font></td></tr>\n";
$db->Halt_On_Error = "report"; $phpgw_setup->db->Halt_On_Error = "report";
include ("./sql/common_main.inc.php"); include ("./sql/common_main.inc.php");
$db->Halt_On_Error = "no"; $phpgw_setup->db->Halt_On_Error = "no";
echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Status</b></font></td></tr>\n"; echo " <tr bgcolor=\"486591\"><td><font color=\"fefefe\">&nbsp;<b>Status</b></font></td></tr>\n";
echo " <tr bgcolor=\"e6e6e6\"><td>If you did not recieve any errors, your tables have been $subaction.<br></tr>\n"; echo " <tr bgcolor=\"e6e6e6\"><td>If you did not recieve any errors, your tables have been $subaction.<br></tr>\n";
echo "</table>\n"; echo "</table>\n";
@ -177,7 +177,7 @@
echo "<br><input type=\"submit\" value=\"Re-Check My Installation\">\n"; echo "<br><input type=\"submit\" value=\"Re-Check My Installation\">\n";
echo '</form>'; echo '</form>';
echo '</td></tr>'; echo '</td></tr>';
}elseif ($stage >= 2.6) { }elseif ($phpgw_info["setup"]["stage"] >= 2.6) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Your tables are current.'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Your tables are current.';
echo "<form method=\"POST\" action=\"index.php\">\n"; echo "<form method=\"POST\" action=\"index.php\">\n";
echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n"; echo "<input type=\"hidden\" name=\"oldversion\" value=\"new\">\n";
@ -186,35 +186,31 @@
echo '</td></tr>'; echo '</td></tr>';
} }
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - Configuration</td><td align="right" bgcolor="486591">&nbsp;</td></tr>'; echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - Configuration</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($stage < 3.1) { if ($phpgw_info["setup"]["stage"] < 3.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
}elseif ($stage == 3.1) { }elseif ($phpgw_info["setup"]["stage"] == 3.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Please phpGroupWare for your environment.'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Please phpGroupWare for your environment.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Configure Now\"></form>"; echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Configure Now\"></form>";
echo '</td></tr>'; echo '</td></tr>';
}elseif ($stage == 3.2) { }elseif ($phpgw_info["setup"]["stage"] == 3.2) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Configuration completed.'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="X" border="0"></td><td>Configuration completed.';
echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Edit Current Configuration\"></form>"; echo "<form method=\"POST\" action=\"config.php\"><input type=\"submit\" value=\"Edit Current Configuration\"></form>";
echo '</td></tr>'; echo '</td></tr>';
} }
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 4 - language management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>'; echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 4 - language management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($stage < 3.1) { if ($phpgw_info["setup"]["stage"] < 4.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.<br></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
} }elseif ($phpgw_info["setup"]["stage"] == 4.1) {
if ($stage < 4.1 || $stage > 3.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="O" border="0"></td><td><a href="lang.php">Click here for now</a></td></tr>';
}elseif ($stage == 4.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 4.1.<br></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 4.1.<br></td></tr>';
}elseif ($stage == 4.2) { }elseif ($phpgw_info["setup"]["stage"] == 4.2) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 4.2.<br></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 4.2.<br></td></tr>';
} }
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 5 - Add-on Application Installation</td><td align="right" bgcolor="486591">&nbsp;</td></tr>'; echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 5 - Add-on Application Installation</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
if ($stage < 5.1) { if ($phpgw_info["setup"]["stage"] < 5.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet. (under construction)</td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';
}elseif ($stage == 5.1) { }elseif ($phpgw_info["setup"]["stage"] == 5.1) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 5.1.<br></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 5.1.<br></td></tr>';
}elseif ($stage == 5.2) { }elseif ($phpgw_info["setup"]["stage"] == 5.2) {
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 5.2.<br></td></tr>'; echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>stage 5.2.<br></td></tr>';
} }

View File

@ -11,120 +11,167 @@
/* $Id$ */ /* $Id$ */
if (! $included) { $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True,
"currentapp" => "home", "noapi" => True);
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True);
include("./inc/functions.inc.php");
include("../header.inc.php"); include("../header.inc.php");
include("./inc/functions.inc.php");
// Authorize the user to use setup app and load the database // Authorize the user to use setup app and load the database
// include("./inc/setup_auth.inc.php");
// Does not return unless user is authorized // Does not return unless user is authorized
if (!auth()){ $phpgw_info["server"]["api_inc"] = $phpgw_info["server"]["include_root"]."/phpgwapi/inc";
Header("Location: index.php"); include($phpgw_info["server"]["api_inc"] . "/phpgw_common.inc.php");
exit;
}
loaddb();
echo "<html><head><title>phpGroupWare Setup</title></head>\n"; $common = new common;
echo "<body bgcolor='#ffffff'>\n"; $phpgw_setup->loaddb();
include($phpgw_info["server"]["include_root"]."/phpgwapi/inc/phpgw_common.inc.php"); $phpgw_setup->db->query("select config_name,config_value from config where config_name like 'ldap%'",__LINE__,__FILE__);
$common = new common; while ($phpgw_setup->db->next_record()) {
$sep = $common->filesystem_separator(); $config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value");
} else {
$newinstall = True;
$lang_selected["en"] = "en";
$submit = True;
} }
// First, see if we can connect to the LDAP server, if not send `em back to config.php with an
// error message.
// connect to ldap server
if (! $ldap = @ldap_connect($config["ldap_host"])) {
$noldapconnection = True;
}
// bind as admin, we not to able to do everything
if (! @ldap_bind($ldap,$config["ldap_root_dn"],$config["ldap_root_pw"])) {
$noldapconnection = True;
}
if ($noldapconnection) {
Header("Location: config.php?error=badldapconnection");
exit;
}
$sr = ldap_search($ldap,$config["ldap_context"],"(|(uid=*))",array("sn","givenname","uid","uidnumber"));
$info = ldap_get_entries($ldap, $sr);
for ($i=0; $i<$info["count"]; $i++) {
if (! $phpgw_info["server"]["global_denied_users"][$info[$i]["uid"][0]]) {
$account_info[$i]["account_id"] = $info[$i]["uidnumber"][0];
$account_info[$i]["account_lid"] = $info[$i]["uid"][0];
$account_info[$i]["account_lastname"] = $info[$i]["givenname"][0];
$account_info[$i]["account_firstname"] = $info[$i]["sn"][0];
}
}
$phpgw_setup->db->query("select app_name,app_title from applications where app_enabled != '0' and "
. "app_name != 'admin'",__LINE__,__FILE__);
while ($phpgw_setup->db->next_record()) {
$apps[$phpgw_setup->db->f("app_name")] = $phpgw_setup->db->f("app_title");
}
if ($submit) { if ($submit) {
if (count($lang_selected)) { if (! count($admins)) {
if ($upgrademethod == "dumpold") { $error = "<br>You must select at least 1 admin";
$db->query("delete from lang"); }
//echo "<br>Test: dumpold";
if (! count($s_apps)) {
$error .= "<br>You must select at least 1 application";
}
if (! $error) {
include($phpgw_info["server"]["api_inc"] . "/phpgw_accounts_ldap.inc.php");
include($phpgw_info["server"]["api_inc"] . "/phpgw_accounts_shared.inc.php");
$accounts = new accounts;
while ($app = each($s_apps)) {
$permissions_string = $accounts->add_app($app[1]);
} }
while (list($null,$lang) = each($lang_selected)) { $permissions_string = $accounts->add_app("",True);
$addlang = False; $admin_permissions_string = $permissions_string . "admin:";
if ($upgrademethod == "addonlynew") {
//echo "<br>Test: addonlynew - select count(*) from lang where lang='$lang'"; while ($admin = each($admins)) {
$db->query("select count(*) from lang where lang='$lang'"); $s_admin[$admin[1]] = True;
$db->next_record(); }
if ($db->f(0) == 0) { while ($account = each($account_info)) {
//echo "<br>Test: addonlynew - True"; if ($s_admin[$account[1]["account_id"]]) {
$addlang = True; $np = $admin_permissions_string;
} } else {
$np = $permissions_string;
} }
if (($addlang && $upgrademethod == "addonlynew") || ($upgrademethod != "addonlynew")) { // do some checks before we try to import the data
//echo '<br>Test: loop above file()'; if (!empty($account[1]["account_id"]) && !empty($account[1]["account_lid"]))
$raw_file = file($phpgw_info["server"]["server_root"] . "/setup/phpgw_" . strtolower($lang) . ".lang"); $phpgw_setup->db->query("insert into accounts (account_id,account_lid,account_pwd,account_permissions,"
while (list($null,$line) = each($raw_file)) { . "account_groups,account_status,account_lastpwd_change) values ('" . $account[1]["account_id"] . "','"
$addit = False; . $account[1]["account_lid"] . "','x','$np',',1:0,','A','".time()."')",__LINE__,__FILE__);
list($message_id,$app_name,$db_lang,$content) = explode("\t",$line); }
$message_id = addslashes(chop($message_id)); $setup_complete = True;
$app_name = addslashes(chop($app_name)); }
$db_lang = addslashes(chop($db_lang));
$content = addslashes(chop($content));
if ($upgrademethod == "addmissing") {
//echo "<br>Test: addmissing";
$db->query("select count(*) from lang where message_id='$message_id' and lang='$db_lang'");
$db->next_record();
if ($db->f(0) == 0) {
//echo "<br>Test: addmissing - True - Total: " . $db->f(0);
$addit = True;
}
}
if ($addit || ($upgrademethod == "dumpold" || $newinstall || $upgrademethod == "addonlynew")) {
//echo "<br>adding - insert into lang values ('$message_id','$app_name','$db_lang','$content')";
$db->query("insert into lang values ('$message_id','$app_name','$db_lang','$content')");
}
}
}
}
}
if (! $included) {
echo "<center>Language files have been installed</center>";
exit;
}
} else {
if (! $included) {
setup_header();
?>
<p><table border="0" align="center" width="<?php echo ($newinstall?"60%":"80%"); ?>">
<tr bgcolor="486591">
<td colspan="<?php echo ($newinstall?"1":"2"); ?>">&nbsp;<font color="fefefe">Multi-Language support setup</font></td>
</tr>
<tr bgcolor="e6e6e6">
<td colspan="<?php echo ($newinstall?"1":"2"); ?>">This program will help you upgrade or installing different languages for phpGroupWare</td>
</tr>
<tr bgcolor="e6e6e6">
<td<?php echo ($newinstall?' align="center"':""); ?>>Select which languages you would like to use.
<form action="lang.php">
<?php echo ($newinstall?'<input type="hidden" name="newinstall" value="True">':""); ?>
<select name="lang_selected[]" multiple size="10">
<?php
$db->query("select lang_id,lang_name from languages where available='Yes'");
while ($db->next_record()) {
echo '<option value="' . $db->f("lang_id") . '">' . $db->f("lang_name") . '</option>';
}
?>
</select>
</td>
<?php
if (! $newinstall) {
echo '<td valign="top">Select which method of upgrade you would like to do'
. '<br><input type="radio" name="upgrademethod" value="dumpold">&nbsp;Delete all old langagues and install new ones'
. '<br><input type="radio" name="upgrademethod" value="addmissing">&nbsp;Only add new pharses'
. '<br><input type="radio" name="upgrademethod" value="addonlynew">&nbsp;only add languages that are not in the database already.'
. '</td>';
}
?>
</tr>
</table>
<?php
echo '<center><input type="submit" name="submit" value="Install"></center>';
} }
}
// Add a check to see if there is no users in LDAP, if not create a default user.
$phpgw_setup->setup_header();
if ($error) {
echo "<br><center><b>Error:</b> $error</center>";
}
if ($setup_complete) {
$phpgw_setup->db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__);
$phpgw_setup->db->next_record();
echo '<br><center>Setup has been completed! Click <a href="' . $phpgw_setup->db->f("config_value")
. '/login.php">here</a> to login</center>';
exit;
}
?>
<form action="ldap.php" method="POST">
<table border="0" align="center" width="70%">
<tr bgcolor="486591">
<td colspan="2">&nbsp;<font color="fefefe">LDAP import users</font></td>
</tr>
<tr bgcolor="e6e6e6">
<td colspan="2">&nbsp;This section will help you import users from your LDAP tree into phpGroupWare's account tables.<br>&nbsp;</td>
</tr>
<tr bgcolor="e6e6e6">
<td align="left" valign="top">
&nbsp;Select which user(s) will have the admin privileges
</td>
<td align="center">
<select name="admins[]" multiple size="5">
<?php
while ($account = each($account_info)) {
echo '<option value="' . $account[1]["account_id"] . '">'
. $common->display_fullname($account[1]["account_lid"],$account[1]["account_firstname"],$account[1]["account_lastname"])
. '</option>';
echo "\n";
}
?>
</select>
</td>
</tr>
<tr bgcolor="e6e6e6">
<td align="left" valign="top">
&nbsp;Select the default applications your users will have access to.
<br>&nbsp;Note: You will be able to customize this later.
</td>
<td>
<select name="s_apps[]" multiple size="5">
<?php
while ($app = each($apps)) {
echo '<option value="' . $app[0] . '" selected>' . $app[1] . '</option>';
echo "\n";
}
?>
</select>
</td>
</tr>
<tr bgcolor="e6e6e6">
<td colspan="2" align="center">
<input type="submit" name="submit" value="import">
</td>
</tr>
</table>
</form>

View File

@ -23,11 +23,11 @@
include($phpgw_info["server"]["include_root"] . "/phpgwapi/inc/phpgw_common.inc.php"); include($phpgw_info["server"]["include_root"] . "/phpgwapi/inc/phpgw_common.inc.php");
$common = new common; $common = new common;
loaddb(); $phpgw_setup->loaddb();
$db->query("select config_name,config_value from config where config_name like 'ldap%'",__LINE__,__FILE__); $phpgw_setup->db->query("select config_name,config_value from config where config_name like 'ldap%'",__LINE__,__FILE__);
while ($db->next_record()) { while ($phpgw_setup->db->next_record()) {
$config[$db->f("config_name")] = $db->f("config_value"); $config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value");
} }
// First, see if we can connect to the LDAP server, if not send `em back to config.php with an // First, see if we can connect to the LDAP server, if not send `em back to config.php with an
@ -60,10 +60,10 @@
} }
} }
$db->query("select app_name,app_title from applications where app_enabled != '0' and " $phpgw_setup->db->query("select app_name,app_title from applications where app_enabled != '0' and "
. "app_name != 'admin'",__LINE__,__FILE__); . "app_name != 'admin'",__LINE__,__FILE__);
while ($db->next_record()) { while ($phpgw_setup->db->next_record()) {
$apps[$db->f("app_name")] = $db->f("app_title"); $apps[$phpgw_setup->db->f("app_name")] = $phpgw_setup->db->f("app_title");
} }
if ($submit) { if ($submit) {
@ -98,7 +98,7 @@
} }
// do some checks before we try to import the data // do some checks before we try to import the data
if (!empty($account[1]["account_id"]) && !empty($account[1]["account_lid"])) if (!empty($account[1]["account_id"]) && !empty($account[1]["account_lid"]))
$db->query("insert into accounts (account_id,account_lid,account_pwd,account_permissions," $phpgw_setup->db->query("insert into accounts (account_id,account_lid,account_pwd,account_permissions,"
. "account_groups,account_status,account_lastpwd_change) values ('" . $account[1]["account_id"] . "','" . "account_groups,account_status,account_lastpwd_change) values ('" . $account[1]["account_id"] . "','"
. $account[1]["account_lid"] . "','x','$np',',1:0,','A','".time()."')",__LINE__,__FILE__); . $account[1]["account_lid"] . "','x','$np',',1:0,','A','".time()."')",__LINE__,__FILE__);
} }
@ -108,16 +108,16 @@
// Add a check to see if there is no users in LDAP, if not create a default user. // Add a check to see if there is no users in LDAP, if not create a default user.
setup_header(); $phpgw_setup->setup_header();
if ($error) { if ($error) {
echo "<br><center><b>Error:</b> $error</center>"; echo "<br><center><b>Error:</b> $error</center>";
} }
if ($setup_complete) { if ($setup_complete) {
$db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__); $phpgw_setup->db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__);
$db->next_record(); $phpgw_setup->db->next_record();
echo '<br><center>Setup has been completed! Click <a href="' . $db->f("config_value") echo '<br><center>Setup has been completed! Click <a href="' . $phpgw_setup->db->f("config_value")
. '/login.php">here</a> to login</center>'; . '/login.php">here</a> to login</center>';
exit; exit;
} }
@ -175,5 +175,3 @@
</table> </table>
</form> </form>

View File

@ -53,60 +53,59 @@
</form> </form>
<?php <?php
}else{ }else{
loaddb(); $phpgw_setup->loaddb();
/* First clear out exsisting tables */ /* 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";}}'; $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";}}';
$db->query("delete from accounts"); $phpgw_setup->db->query("delete from accounts");
$db->query("delete from preferences"); $phpgw_setup->db->query("delete from preferences");
$db->query("delete from phpgw_acl"); $phpgw_setup->db->query("delete from phpgw_acl");
/* Create records for demo accounts */ /* Create records for demo accounts */
$sql = "insert into accounts"; $sql = "insert into accounts";
$sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)";
$sql .= "values (1, 'demo', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:', ',1:0,', ".time().", 'A')"; $sql .= "values (1, 'demo', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:', ',1:0,', ".time().", 'A')";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')");
$sql = "insert into phpgw_acl"; $sql = "insert into phpgw_acl";
$sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; $sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)";
$sql .= "values('preferences', 'changepassword', 1, 'u', 0)"; $sql .= "values('preferences', 'changepassword', 1, 'u', 0)";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "insert into accounts"; $sql = "insert into accounts";
$sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)";
$sql .= "values (2, 'demo2', '084e0343a0486ff05530df6c705c8bb4', 'Demo2', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:manual:', ',1:0,', ".time().", 'A')"; $sql .= "values (2, 'demo2', '084e0343a0486ff05530df6c705c8bb4', 'Demo2', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:manual:', ',1:0,', ".time().", 'A')";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')");
$sql = "insert into phpgw_acl"; $sql = "insert into phpgw_acl";
$sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; $sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)";
$sql .= "values('preferences', 'changepassword', 2, 'u', 0)"; $sql .= "values('preferences', 'changepassword', 2, 'u', 0)";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "insert into accounts"; $sql = "insert into accounts";
$sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)";
$sql .= "values (3, 'demo3', '084e0343a0486ff05530df6c705c8bb4', 'Demo3', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:transy:manual:', ',1:0,', ".time().", 'A')"; $sql .= "values (3, 'demo3', '084e0343a0486ff05530df6c705c8bb4', 'Demo3', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:transy:manual:', ',1:0,', ".time().", 'A')";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')");
$sql = "insert into phpgw_acl"; $sql = "insert into phpgw_acl";
$sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; $sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)";
$sql .= "values('preferences', 'changepassword', 3, 'u', 0)"; $sql .= "values('preferences', 'changepassword', 3, 'u', 0)";
$db->query($sql); $phpgw_setup->db->query($sql);
/* Create records for administrator account */ /* Create records for administrator account */
$sql = "insert into accounts"; $sql = "insert into accounts";
$sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)";
$sql .= "values (4, '$username', '".md5($passwd)."', '$fname', '$lname', ':admin:addressbook:filemanager:calendar:email:nntp:notes:todo:transy:manual:', ',1:0,', ".time().", 'A')"; $sql .= "values (4, '$username', '".md5($passwd)."', '$fname', '$lname', ':admin:addressbook:filemanager:calendar:email:nntp:notes:todo:transy:manual:', ',1:0,', ".time().", 'A')";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')");
/* Create system records */ /* Create system records */
$this_dir = dirname($SCRIPT_FILENAME); $this_dir = dirname($SCRIPT_FILENAME);
$rootdir = ereg_replace("/setup","",$this_dir); $rootdir = ereg_replace("/setup","",$this_dir);
$db->query("update config set config_value = '/tmp' where config_name = 'temp_dir'"); $phpgw_setup->db->query("update config set config_value = '/tmp' where config_name = 'temp_dir'");
$db->query("update config set config_value = '$rootdir/files' where config_name = 'files_dir'"); $phpgw_setup->db->query("update config set config_value = '$rootdir/files' where config_name = 'files_dir'");
$db->query("update config set config_value = '$mail_suffix' where config_name = 'mail_suffix'"); $phpgw_setup->db->query("update config set config_value = '$mail_suffix' where config_name = 'mail_suffix'");
$db->query("update config set config_value = '$mail_login_type' where config_name = 'mail_login_type'"); $phpgw_setup->db->query("update config set config_value = '$mail_login_type' where config_name = 'mail_login_type'");
$db->query("delete from config where config_name = 'freshinstall'"); $phpgw_setup->db->query("delete from config where config_name = 'freshinstall'");
echo "Done"; echo "Done";
} }
?> ?>

View File

@ -19,79 +19,79 @@
} unset($d1);unset($d2); } unset($d1);unset($d2);
function add_default_server_config(){ function add_default_server_config(){
global $db, $phpgw_info, $currentver; global $phpgw_info, $phpgw_setup;
$db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', 'default')");
$db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
$db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
$db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else')");
$db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')");
$db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')");
$db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')");
$db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('ldap_context', 'ou=People,dc=my-domain,dc=com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', 'ou=People,dc=my-domain,dc=com')");
$db->query("insert into config (config_name, config_value) values ('ldap_encryption_type', 'DES')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_encryption_type', 'DES')");
$db->query("insert into config (config_name, config_value) values ('ldap_root_dn', 'cn=Manager,dc=my-domain,dc=com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_root_dn', 'cn=Manager,dc=my-domain,dc=com')");
$db->query("insert into config (config_name, config_value) values ('ldap_root_pw', 'secret')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_root_pw', 'secret')");
$db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', 'True')");
$db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')");
$db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')");
$db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')");
$db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')");
$db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '25')");
$db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '119')");
$db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')");
$db->query("insert into config (config_name, config_value) values ('charset', 'iso-8859-1')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('charset', 'iso-8859-1')");
$db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')");
$db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$db->query("insert into config (config_name, config_value) values ('htmlcompliant', 'False')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('htmlcompliant', 'False')");
$db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')");
$db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')");
} }
if ($useglobalconfigsettings == "on"){ if ($useglobalconfigsettings == "on"){
if (is_file($basedir)){ if (is_file($basedir)){
include ($phpgw_info["server"]["include_root"]."/globalconfig.inc.php"); include ($phpgw_info["server"]["include_root"]."/globalconfig.inc.php");
$db->query("insert into config (config_name, config_value) values ('template_set', '".$phpgw_info["server"]["template_set"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', '".$phpgw_info["server"]["template_set"]."')");
$db->query("insert into config (config_name, config_value) values ('temp_dir', '".$phpgw_info["server"]["temp_dir"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '".$phpgw_info["server"]["temp_dir"]."')");
$db->query("insert into config (config_name, config_value) values ('files_dir', '".$phpgw_info["server"]["files_dir"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '".$phpgw_info["server"]["files_dir"]."')");
$db->query("insert into config (config_name, config_value) values ('encryptkey', '".$phpgw_info["server"]["encryptkey"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', '".$phpgw_info["server"]["encryptkey"]."')");
$db->query("insert into config (config_name, config_value) values ('site_title', '".$phpgw_info["server"]["site_title"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', '".$phpgw_info["server"]["site_title"]."')");
$db->query("insert into config (config_name, config_value) values ('hostname', '".$phpgw_info["server"]["hostname"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', '".$phpgw_info["server"]["hostname"]."')");
$db->query("insert into config (config_name, config_value) values ('webserver_url', '".$phpgw_info["server"]["webserver_url"].")"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '".$phpgw_info["server"]["webserver_url"].")");
$db->query("insert into config (config_name, config_value) values ('auth_type', '".$phpgw_info["server"]["auth_type"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', '".$phpgw_info["server"]["auth_type"]."')");
$db->query("insert into config (config_name, config_value) values ('ldap_host', '".$phpgw_info["server"]["ldap_host"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', '".$phpgw_info["server"]["ldap_host"]."')");
$db->query("insert into config (config_name, config_value) values ('ldap_context', '".$phpgw_info["server"]["ldap_context"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', '".$phpgw_info["server"]["ldap_context"]."')");
$db->query("insert into config (config_name, config_value) values ('usecookies', '".$phpgw_info["server"]["usecookies"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', '".$phpgw_info["server"]["usecookies"]."')");
$db->query("insert into config (config_name, config_value) values ('mail_server', '".$phpgw_info["server"]["mail_server"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', '".$phpgw_info["server"]["mail_server"]."')");
$db->query("insert into config (config_name, config_value) values ('mail_server_type', '".$phpgw_info["server"]["mail_server_type"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', '".$phpgw_info["server"]["mail_server_type"]."')");
$db->query("insert into config (config_name, config_value) values ('imap_server_type', '".$phpgw_info["server"]["imap_server_type"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', '".$phpgw_info["server"]["imap_server_type"]."')");
$db->query("insert into config (config_name, config_value) values ('mail_suffix', '".$phpgw_info["server"]["mail_suffix"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', '".$phpgw_info["server"]["mail_suffix"]."')");
$db->query("insert into config (config_name, config_value) values ('mail_login_type', '".$phpgw_info["server"]["mail_login_type"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', '".$phpgw_info["server"]["mail_login_type"]."')");
$db->query("insert into config (config_name, config_value) values ('smtp_server', '".$phpgw_info["server"]["smtp_server"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', '".$phpgw_info["server"]["smtp_server"]."')");
$db->query("insert into config (config_name, config_value) values ('smtp_port', '".$phpgw_info["server"]["smtp_port"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '".$phpgw_info["server"]["smtp_port"]."')");
$db->query("insert into config (config_name, config_value) values ('nntp_server', '".$phpgw_info["server"]["nntp_server"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', '".$phpgw_info["server"]["nntp_server"]."')");
$db->query("insert into config (config_name, config_value) values ('nntp_port', '".$phpgw_info["server"]["nntp_port"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '".$phpgw_info["server"]["nntp_port"]."')");
$db->query("insert into config (config_name, config_value) values ('nntp_sender', '".$phpgw_info["server"]["nntp_sender"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', '".$phpgw_info["server"]["nntp_sender"]."')");
$db->query("insert into config (config_name, config_value) values ('nntp_organization', '".$phpgw_info["server"]["nntp_organization"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', '".$phpgw_info["server"]["nntp_organization"]."')");
$db->query("insert into config (config_name, config_value) values ('nntp_admin', '".$phpgw_info["server"]["nntp_admin"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', '".$phpgw_info["server"]["nntp_admin"]."')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_username', '".$phpgw_info["server"]["nntp_login_username"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '".$phpgw_info["server"]["nntp_login_username"]."')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_password', '".$phpgw_info["server"]["nntp_login_password"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '".$phpgw_info["server"]["nntp_login_password"]."')");
$db->query("insert into config (config_name, config_value) values ('charset', '".$phpgw_info["server"]["charset"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('charset', '".$phpgw_info["server"]["charset"]."')");
$db->query("insert into config (config_name, config_value) values ('default_ftp_server', '".$phpgw_info["server"]["default_ftp_server"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', '".$phpgw_info["server"]["default_ftp_server"]."')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_server', '".$phpgw_info["server"]["httpproxy_server"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '".$phpgw_info["server"]["httpproxy_server"]."')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_port', '".$phpgw_info["server"]["httpproxy_port"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '".$phpgw_info["server"]["httpproxy_port"]."')");
$db->query("insert into config (config_name, config_value) values ('showpoweredbyon', '".$phpgw_info["server"]["showpoweredbyon"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', '".$phpgw_info["server"]["showpoweredbyon"]."')");
$db->query("insert into config (config_name, config_value) values ('checkfornewversion', '".$phpgw_info["server"]["checkfornewversion"]."')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', '".$phpgw_info["server"]["checkfornewversion"]."')");
}else{ }else{
echo "<table border=\"0\" align=\"center\">\n"; echo "<table border=\"0\" align=\"center\">\n";
echo " <tr bgcolor=\"486591\">\n"; echo " <tr bgcolor=\"486591\">\n";
@ -109,147 +109,146 @@
include($phpgw_info["server"]["server_root"] . "/setup/sql/default_applications.inc.php"); include($phpgw_info["server"]["server_root"] . "/setup/sql/default_applications.inc.php");
$db->query("insert into groups (group_name) values ('Default')"); $phpgw_setup->db->query("insert into groups (group_name) values ('Default')");
$db->query("insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,account_permissions,account_groups,account_status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',':admin:email:todo:addressbook:calendar:',',1:0,','A')"); $phpgw_setup->db->query("insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,account_permissions,account_groups,account_status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',':admin:email:todo:addressbook:calendar:',',1:0,','A')");
$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";}}'; $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";}}';
$db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')");
@$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 ('aa','Afar','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')");
@$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')"); @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')");
?>
?>

View File

@ -18,32 +18,32 @@
} unset($d1); } unset($d1);
function update_version_table($tableschanged = True){ function update_version_table($tableschanged = True){
global $currentver, $phpgw_info, $db, $tablechanges; global $phpgw_info, $phpgw_setup;
if ($tableschanged == True){$tablechanges = True;} if ($tableschanged == True){$phpgw_info["setup"]["tableschanged"] = True;}
$db->query("update applications set app_version='".$currentver."' 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 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 ($currentver == "drop"){ if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "drop"){
include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_droptables.inc.php"); include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_droptables.inc.php");
} }
if ($currentver == "new") { if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "new") {
include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_newtables.inc.php"); include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_newtables.inc.php");
include("./sql/common_default_records.inc.php"); include("./sql/common_default_records.inc.php");
$included = True; $included = True;
include($phpgw_info["server"]["server_root"] . "/setup/lang.php"); include($phpgw_info["server"]["server_root"] . "/setup/lang.php");
$currentver = "oldversion"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "oldversion";
} }
if ($currentver == "oldversion") { if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "oldversion") {
$currentver = $oldversion; $phpgw_info["setup"]["currentver"]["phpgwapi"] = $phpgw_info["setup"]["oldver"]["phpgwapi"];
if ($currentver == "7122000" || $currentver == "8032000" || $currentver == "8072000" || $currentver == "8212000" || $currentver == "9052000" || $currentver == "9072000") { if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "7122000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "8032000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "8072000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "8212000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "9052000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "9072000") {
include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_upgrade_prebeta.inc.php"); include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_upgrade_prebeta.inc.php");
} }
include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_upgrade_beta.inc.php"); include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_upgrade_beta.inc.php");
} }
/* Not yet implemented /* Not yet implemented
if (!$tablechanges == True){ if (!$phpgw_info["setup"]["tableschanged"] == True){
echo " <tr bgcolor=\"e6e6e6\">\n"; echo " <tr bgcolor=\"e6e6e6\">\n";
echo " <td>No table changes were needed. The script only updated your version setting.</td>\n"; echo " <td>No table changes were needed. The script only updated your version setting.</td>\n";
echo " </tr>\n"; echo " </tr>\n";

View File

@ -13,22 +13,22 @@
// This is so we can enable or disable apps for the phpGroupWare and phpGroupWare Plus packges // This is so we can enable or disable apps for the phpGroupWare and phpGroupWare Plus packges
// This is for the base apps, which should always be included // This is for the base apps, which should always be included
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '$currentver')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
// This is for the add-on application, which are enabled/disabled based being in the regular or plus version // This is for the add-on application, which are enabled/disabled based being in the regular or plus version
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '$currentver')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '$currentver')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
?> ?>

View File

@ -13,22 +13,22 @@
// This is so we can enable or disable apps for the phpGroupWare and phpGroupWare Plus packges // This is so we can enable or disable apps for the phpGroupWare and phpGroupWare Plus packges
// This is for the base apps, which should always be included // This is for the base apps, which should always be included
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '$currentver')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
// This is for the add-on application, which are enabled/disabled based being in the regular or plus version // This is for the add-on application, which are enabled/disabled based being in the regular or plus version
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$currentver."')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '$currentver')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '$currentver')"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')");
?> ?>

View File

@ -11,26 +11,26 @@
/* $Id$ */ /* $Id$ */
$db->query("DROP TABLE config"); $phpgw_setup->db->query("DROP TABLE config");
$db->query("DROP TABLE applications"); $phpgw_setup->db->query("DROP TABLE applications");
$db->query("DROP TABLE accounts"); $phpgw_setup->db->query("DROP TABLE accounts");
$db->query("DROP TABLE groups"); $phpgw_setup->db->query("DROP TABLE groups");
$db->query("DROP TABLE preferences"); $phpgw_setup->db->query("DROP TABLE preferences");
$db->query("DROP TABLE phpgw_sessions"); $phpgw_setup->db->query("DROP TABLE phpgw_sessions");
$db->query("DROP TABLE phpgw_app_sessions"); $phpgw_setup->db->query("DROP TABLE phpgw_app_sessions");
$db->query("DROP TABLE phpgw_acl"); $phpgw_setup->db->query("DROP TABLE phpgw_acl");
$db->query("DROP TABLE phpgw_access_log"); $phpgw_setup->db->query("DROP TABLE phpgw_access_log");
$db->query("DROP TABLE profiles"); $phpgw_setup->db->query("DROP TABLE profiles");
$db->query("DROP TABLE addressbook"); $phpgw_setup->db->query("DROP TABLE addressbook");
$db->query("DROP TABLE todo"); $phpgw_setup->db->query("DROP TABLE todo");
$db->query("DROP TABLE calendar_entry"); $phpgw_setup->db->query("DROP TABLE calendar_entry");
$db->query("DROP TABLE calendar_entry_repeats"); $phpgw_setup->db->query("DROP TABLE calendar_entry_repeats");
$db->query("DROP TABLE calendar_entry_user"); $phpgw_setup->db->query("DROP TABLE calendar_entry_user");
$db->query("DROP TABLE newsgroups"); $phpgw_setup->db->query("DROP TABLE newsgroups");
$db->query("DROP TABLE news_msg"); $phpgw_setup->db->query("DROP TABLE news_msg");
$db->query("DROP TABLE lang"); $phpgw_setup->db->query("DROP TABLE lang");
$db->query("DROP TABLE languages"); $phpgw_setup->db->query("DROP TABLE languages");
$db->query("DROP TABLE customers"); $phpgw_setup->db->query("DROP TABLE customers");
$db->query("DROP TABLE categories"); $phpgw_setup->db->query("DROP TABLE categories");
$db->query("DROP TABLE notes"); $phpgw_setup->db->query("DROP TABLE notes");
?> ?>

View File

@ -18,7 +18,7 @@
config_value varchar(100), config_value varchar(100),
UNIQUE config_name (config_name) UNIQUE config_name (config_name)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE applications ( $sql = "CREATE TABLE applications (
app_name varchar(25) NOT NULL, app_name varchar(25) NOT NULL,
@ -29,7 +29,7 @@
app_version varchar(20) NOT NULL default '0.0', app_version varchar(20) NOT NULL default '0.0',
UNIQUE app_name (app_name) UNIQUE app_name (app_name)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE accounts ( $sql = "CREATE TABLE accounts (
account_id int(11) DEFAULT '0' NOT NULL auto_increment, account_id int(11) DEFAULT '0' NOT NULL auto_increment,
@ -46,7 +46,7 @@
PRIMARY KEY (account_id), PRIMARY KEY (account_id),
UNIQUE account_lid (account_lid) UNIQUE account_lid (account_lid)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table groups ( $sql = "create table groups (
group_id int NOT NULL auto_increment, group_id int NOT NULL auto_increment,
@ -54,13 +54,13 @@
group_apps varchar(255), group_apps varchar(255),
primary key(group_id) primary key(group_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE preferences ( $sql = "CREATE TABLE preferences (
preference_owner int, preference_owner int,
preference_value text preference_value text
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE phpgw_sessions ( $sql = "CREATE TABLE phpgw_sessions (
session_id varchar(255) NOT NULL, session_id varchar(255) NOT NULL,
@ -71,7 +71,7 @@
session_info text, session_info text,
UNIQUE sessionid (session_id) UNIQUE sessionid (session_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE phpgw_acl ( $sql = "CREATE TABLE phpgw_acl (
acl_appname varchar(50), acl_appname varchar(50),
@ -80,7 +80,7 @@
acl_account_type char(1), acl_account_type char(1),
acl_rights int acl_rights int
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE phpgw_app_sessions ( $sql = "CREATE TABLE phpgw_app_sessions (
sessionid varchar(255) NOT NULL, sessionid varchar(255) NOT NULL,
@ -88,7 +88,7 @@
app varchar(20), app varchar(20),
content text content text
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table phpgw_access_log ( $sql = "create table phpgw_access_log (
sessionid varchar(255), sessionid varchar(255),
@ -97,7 +97,7 @@
li int, li int,
lo varchar(255) lo varchar(255)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE profiles ( $sql = "CREATE TABLE profiles (
con int(11) DEFAULT '0' NOT NULL auto_increment, con int(11) DEFAULT '0' NOT NULL auto_increment,
@ -109,7 +109,7 @@
picture blob, picture blob,
PRIMARY KEY (con) PRIMARY KEY (con)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE addressbook ( $sql = "CREATE TABLE addressbook (
ab_id int(11) NOT NULL auto_increment, ab_id int(11) NOT NULL auto_increment,
@ -137,7 +137,7 @@
ab_url varchar(255), ab_url varchar(255),
PRIMARY KEY (ab_id) PRIMARY KEY (ab_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE customers ( $sql = "CREATE TABLE customers (
@ -154,7 +154,7 @@
notes text, notes text,
PRIMARY KEY (company_id) PRIMARY KEY (company_id)
);"; );";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE todo ( $sql = "CREATE TABLE todo (
todo_id int(11) DEFAULT '0' NOT NULL auto_increment, todo_id int(11) DEFAULT '0' NOT NULL auto_increment,
@ -169,7 +169,7 @@
todo_enddate int(11), todo_enddate int(11),
PRIMARY KEY (todo_id) PRIMARY KEY (todo_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE calendar_entry ( $sql = "CREATE TABLE calendar_entry (
cal_id int(11) DEFAULT '0' NOT NULL auto_increment, cal_id int(11) DEFAULT '0' NOT NULL auto_increment,
@ -185,7 +185,7 @@
cal_description text, cal_description text,
PRIMARY KEY (cal_id) PRIMARY KEY (cal_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE calendar_entry_repeats ( $sql = "CREATE TABLE calendar_entry_repeats (
cal_id int(11) DEFAULT '0' NOT NULL, cal_id int(11) DEFAULT '0' NOT NULL,
@ -195,7 +195,7 @@
cal_frequency int(11) DEFAULT '1', cal_frequency int(11) DEFAULT '1',
cal_days char(7) cal_days char(7)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE calendar_entry_user ( $sql = "CREATE TABLE calendar_entry_user (
cal_id int(11) DEFAULT '0' NOT NULL, cal_id int(11) DEFAULT '0' NOT NULL,
@ -203,7 +203,7 @@
cal_status char(1) DEFAULT 'A', cal_status char(1) DEFAULT 'A',
PRIMARY KEY (cal_id, cal_login) PRIMARY KEY (cal_id, cal_login)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE newsgroups ( $sql = "CREATE TABLE newsgroups (
con int(11) NOT NULL auto_increment, con int(11) NOT NULL auto_increment,
@ -215,7 +215,7 @@
PRIMARY KEY (con), PRIMARY KEY (con),
UNIQUE name (name) UNIQUE name (name)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE news_msg ( $sql = "CREATE TABLE news_msg (
con int(11) NOT NULL, con int(11) NOT NULL,
@ -251,7 +251,7 @@
body longtext NOT NULL, body longtext NOT NULL,
primary key(con,msg) primary key(con,msg)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE lang ( $sql = "CREATE TABLE lang (
message_id varchar(150) DEFAULT '' NOT NULL, message_id varchar(150) DEFAULT '' NOT NULL,
@ -260,7 +260,7 @@
content text NOT NULL, content text NOT NULL,
PRIMARY KEY (message_id,app_name,lang) PRIMARY KEY (message_id,app_name,lang)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE categories ( $sql = "CREATE TABLE categories (
cat_id int(9) DEFAULT '0' NOT NULL auto_increment, cat_id int(9) DEFAULT '0' NOT NULL auto_increment,
@ -270,7 +270,7 @@
cat_description text NOT NULL, cat_description text NOT NULL,
PRIMARY KEY (cat_id) PRIMARY KEY (cat_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE languages ( $sql = "CREATE TABLE languages (
lang_id varchar(2) NOT NULL, lang_id varchar(2) NOT NULL,
@ -278,7 +278,7 @@
available char(3) NOT NULL DEFAULT 'No', available char(3) NOT NULL DEFAULT 'No',
PRIMARY KEY (lang_id) PRIMARY KEY (lang_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE notes ( $sql = "CREATE TABLE notes (
note_id int(20) NOT NULL auto_increment, note_id int(20) NOT NULL auto_increment,
@ -287,7 +287,7 @@
note_content text, note_content text,
PRIMARY KEY (note_id) PRIMARY KEY (note_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table phpgw_hooks ( $sql = "create table phpgw_hooks (
hook_id int not null auto_increment, hook_id int not null auto_increment,
@ -296,9 +296,10 @@
hook_filename varchar(255), hook_filename varchar(255),
primary key hook_id (hook_id) primary key hook_id (hook_id)
);"; );";
$db->query($sql); $phpgw_setup->db->query($sql);
$currentver = "0.9.8pre5"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5";
$oldversion = $currentver; $phpgw_info["setup"]["oldver"]["phpgwapi"] = $phpgw_info["setup"]["currentver"]["phpgwapi"];
update_version_table(); update_version_table();
// $phpgw_setup->update_version_table();
?> ?>

File diff suppressed because it is too large Load Diff

View File

@ -13,161 +13,160 @@
$test[] = "7122000"; $test[] = "7122000";
function upgrade7122000(){ function upgrade7122000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
echo "Upgrading from 7122000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n"; echo "Upgrading from 7122000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n";
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "8032000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8032000";
} }
$test[] = "8032000"; $test[] = "8032000";
function upgrade8032000(){ function upgrade8032000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
echo "Upgrading from 8032000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n"; echo "Upgrading from 8032000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n";
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "8072000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8072000";
} }
$test[] = "8072000"; $test[] = "8072000";
function upgrade8072000(){ function upgrade8072000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
$sql = "CREATE TABLE applications (" $sql = "CREATE TABLE applications ("
."app_name varchar(25) NOT NULL," ."app_name varchar(25) NOT NULL,"
."app_title varchar(50)," ."app_title varchar(50),"
."app_enabled int," ."app_enabled int,"
."UNIQUE app_name (app_name)" ."UNIQUE app_name (app_name)"
.")"; .")";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)");
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "8212000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8212000";
} }
$test[] = "8212000"; $test[] = "8212000";
function upgrade8212000(){ function upgrade8212000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
$db->query("alter table chat_channel change name name varchar(10) not null"); $phpgw_setup->db->query("alter table chat_channel change name name varchar(10) not null");
$db->query("alter table chat_messages change channel channel char(20) not null"); $phpgw_setup->db->query("alter table chat_messages change channel channel char(20) not null");
$db->query("alter table chat_messages change loginid loginid varchar(20) not null"); $phpgw_setup->db->query("alter table chat_messages change loginid loginid varchar(20) not null");
$db->query("alter table chat_currentin change loginid loginid varchar(25) not null"); $phpgw_setup->db->query("alter table chat_currentin change loginid loginid varchar(25) not null");
$db->query("alter table chat_currentin change channel channel char(20)"); $phpgw_setup->db->query("alter table chat_currentin change channel channel char(20)");
$db->query("alter table chat_privatechat change user1 user1 varchar(25) not null"); $phpgw_setup->db->query("alter table chat_privatechat change user1 user1 varchar(25) not null");
$db->query("alter table chat_privatechat change user2 user2 varchar(25) not null"); $phpgw_setup->db->query("alter table chat_privatechat change user2 user2 varchar(25) not null");
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "9052000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9052000";
} }
$test[] = "9052000"; $test[] = "9052000";
function upgrade9052000(){ function upgrade9052000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
echo "Upgrading from 9052000 is not available.<br> I dont believe there were any changes, so this should be fine.<br>\n"; echo "Upgrading from 9052000 is not available.<br> I dont believe there were any changes, so this should be fine.<br>\n";
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "9072000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9072000";
} }
$test[] = "9072000"; $test[] = "9072000";
function upgrade9072000(){ function upgrade9072000(){
global $currentver, $oldversion, $phpgw_info, $db; global $phpgw_info, $phpgw_setup;
$db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment"); $phpgw_setup->db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment");
$db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL"); $phpgw_setup->db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL");
$db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL"); $phpgw_setup->db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL");
$db->query("alter table accounts change firstname account_firstname varchar(50)"); $phpgw_setup->db->query("alter table accounts change firstname account_firstname varchar(50)");
$db->query("alter table accounts change lastname account_lastname varchar(50)"); $phpgw_setup->db->query("alter table accounts change lastname account_lastname varchar(50)");
$db->query("alter table accounts change permissions account_permissions text"); $phpgw_setup->db->query("alter table accounts change permissions account_permissions text");
$db->query("alter table accounts change groups account_groups varchar(30)"); $phpgw_setup->db->query("alter table accounts change groups account_groups varchar(30)");
$db->query("alter table accounts change lastlogin account_lastlogin int(11)"); $phpgw_setup->db->query("alter table accounts change lastlogin account_lastlogin int(11)");
$db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)"); $phpgw_setup->db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)");
$db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)"); $phpgw_setup->db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)");
$db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL"); $phpgw_setup->db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL");
$db->query("alter table applications add app_order int"); $phpgw_setup->db->query("alter table applications add app_order int");
$db->query("alter table applications add app_tables varchar(255)"); $phpgw_setup->db->query("alter table applications add app_tables varchar(255)");
$db->query("alter table applications add app_version varchar(20) not null default '0.0'"); $phpgw_setup->db->query("alter table applications add app_version varchar(20) not null default '0.0'");
$db->query("alter table preferences change owner preference_owner varchar(20)"); $phpgw_setup->db->query("alter table preferences change owner preference_owner varchar(20)");
$db->query("alter table preferences change name preference_name varchar(50)"); $phpgw_setup->db->query("alter table preferences change name preference_name varchar(50)");
$db->query("alter table preferences change value preference_value varchar(50)"); $phpgw_setup->db->query("alter table preferences change value preference_value varchar(50)");
$db->query("alter table preferences add preference_appname varchar(50) default ''"); $phpgw_setup->db->query("alter table preferences add preference_appname varchar(50) default ''");
$db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL"); $phpgw_setup->db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL");
$db->query("alter table sessions change loginid session_lid varchar(20)"); $phpgw_setup->db->query("alter table sessions change loginid session_lid varchar(20)");
$db->query("alter table sessions change passwd session_pwd varchar(255)"); $phpgw_setup->db->query("alter table sessions change passwd session_pwd varchar(255)");
$db->query("alter table sessions change ip session_ip varchar(255)"); $phpgw_setup->db->query("alter table sessions change ip session_ip varchar(255)");
$db->query("alter table sessions change logintime session_logintime int(11)"); $phpgw_setup->db->query("alter table sessions change logintime session_logintime int(11)");
$db->query("alter table sessions change dla session_dla int(11)"); $phpgw_setup->db->query("alter table sessions change dla session_dla int(11)");
$db->query("alter table todo change con todo_id int(11)"); $phpgw_setup->db->query("alter table todo change con todo_id int(11)");
$db->query("alter table todo change owner todo_owner varchar(25)"); $phpgw_setup->db->query("alter table todo change owner todo_owner varchar(25)");
$db->query("alter table todo change access todo_access varchar(255)"); $phpgw_setup->db->query("alter table todo change access todo_access varchar(255)");
$db->query("alter table todo change des todo_des text"); $phpgw_setup->db->query("alter table todo change des todo_des text");
$db->query("alter table todo change pri todo_pri int(11)"); $phpgw_setup->db->query("alter table todo change pri todo_pri int(11)");
$db->query("alter table todo change status todo_status int(11)"); $phpgw_setup->db->query("alter table todo change status todo_status int(11)");
$db->query("alter table todo change datecreated todo_datecreated int(11)"); $phpgw_setup->db->query("alter table todo change datecreated todo_datecreated int(11)");
$db->query("alter table todo change datedue todo_datedue int(11)"); $phpgw_setup->db->query("alter table todo change datedue todo_datedue int(11)");
// The addressbook section is missing. // The addressbook section is missing.
$db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'"); $phpgw_setup->db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'");
$db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'"); $phpgw_setup->db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'");
$db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'"); $phpgw_setup->db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'");
$db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'"); $phpgw_setup->db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'");
$db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'"); $phpgw_setup->db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'");
$db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'"); $phpgw_setup->db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'");
$db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'"); $phpgw_setup->db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'");
$db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'"); $phpgw_setup->db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'");
$db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'"); $phpgw_setup->db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'");
$db->query("update applications set app_order=10,app_tables=NULL where app_name='email'"); $phpgw_setup->db->query("update applications set app_order=10,app_tables=NULL where app_name='email'");
$db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'"); $phpgw_setup->db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'");
$db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'"); $phpgw_setup->db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'");
$sql = "CREATE TABLE config (" $sql = "CREATE TABLE config ("
."config_name varchar(25) NOT NULL," ."config_name varchar(25) NOT NULL,"
."config_value varchar(100)," ."config_value varchar(100),"
."UNIQUE config_name (config_name)" ."UNIQUE config_name (config_name)"
.")"; .")";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', 'default')");
$db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
$db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
$db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'");
$db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')");
$db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')");
$db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')");
$db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', 'True')");
$db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')");
$db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')");
$db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')");
$db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')");
$db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '25')");
$db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '119')");
$db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')");
$db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')");
$db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')");
$currentver = "0.9.1"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.1";
} }
?> ?>

View File

@ -11,35 +11,35 @@
/* $Id$ */ /* $Id$ */
$db->query("DROP TABLE config"); $phpgw_setup->db->query("DROP TABLE config");
$db->query("DROP TABLE applications"); $phpgw_setup->db->query("DROP TABLE applications");
$db->query("drop sequence accounts_account_id_seq"); $phpgw_setup->db->query("drop sequence accounts_account_id_seq");
$db->query("DROP TABLE accounts"); $phpgw_setup->db->query("DROP TABLE accounts");
$db->query("drop sequence groups_group_id_seq"); $phpgw_setup->db->query("drop sequence groups_group_id_seq");
$db->query("DROP TABLE groups"); $phpgw_setup->db->query("DROP TABLE groups");
$db->query("DROP TABLE preferences"); $phpgw_setup->db->query("DROP TABLE preferences");
$db->query("DROP TABLE phpgw_sessions"); $phpgw_setup->db->query("DROP TABLE phpgw_sessions");
$db->query("DROP TABLE phpgw_app_sessions"); $phpgw_setup->db->query("DROP TABLE phpgw_app_sessions");
$db->query("DROP TABLE phpgw_acl"); $phpgw_setup->db->query("DROP TABLE phpgw_acl");
$db->query("DROP TABLE phpgw_access_log"); $phpgw_setup->db->query("DROP TABLE phpgw_access_log");
$db->query("drop sequence profiles_con_seq"); $phpgw_setup->db->query("drop sequence profiles_con_seq");
$db->query("DROP TABLE profiles"); $phpgw_setup->db->query("DROP TABLE profiles");
$db->query("drop sequence addressbook_ab_id_seq"); $phpgw_setup->db->query("drop sequence addressbook_ab_id_seq");
$db->query("DROP TABLE addressbook"); $phpgw_setup->db->query("DROP TABLE addressbook");
$db->query("drop sequence calendar_entry_cal_id_seq"); $phpgw_setup->db->query("drop sequence calendar_entry_cal_id_seq");
$db->query("drop sequence todo_todo_id_seq"); $phpgw_setup->db->query("drop sequence todo_todo_id_seq");
$db->query("DROP TABLE todo"); $phpgw_setup->db->query("DROP TABLE todo");
$db->query("DROP TABLE calendar_entry"); $phpgw_setup->db->query("DROP TABLE calendar_entry");
$db->query("DROP TABLE calendar_entry_user"); $phpgw_setup->db->query("DROP TABLE calendar_entry_user");
$db->query("DROP TABLE calendar_entry_repeats"); $phpgw_setup->db->query("DROP TABLE calendar_entry_repeats");
$db->query("drop sequence newsgroups_con_seq"); $phpgw_setup->db->query("drop sequence newsgroups_con_seq");
$db->query("DROP TABLE newsgroups"); $phpgw_setup->db->query("DROP TABLE newsgroups");
$db->query("DROP TABLE lang"); $phpgw_setup->db->query("DROP TABLE lang");
$db->query("drop sequence news_msg_con_seq"); $phpgw_setup->db->query("drop sequence news_msg_con_seq");
$db->query("DROP TABLE news_msg"); $phpgw_setup->db->query("DROP TABLE news_msg");
$db->query("DROP TABLE languages"); $phpgw_setup->db->query("DROP TABLE languages");
$db->query("drop sequence categories_cat_id_seq"); $phpgw_setup->db->query("drop sequence categories_cat_id_seq");
$db->query("DROP TABLE categories"); $phpgw_setup->db->query("DROP TABLE categories");
$db->query("DROP sequence notes_note_id_seq"); $phpgw_setup->db->query("DROP sequence notes_note_id_seq");
$db->query("DROP TABLE notes"); $phpgw_setup->db->query("DROP TABLE notes");
?> ?>

View File

@ -17,7 +17,7 @@
config_name varchar(255) NOT NULL UNIQUE, config_name varchar(255) NOT NULL UNIQUE,
config_value varchar(100) NOT NULL config_value varchar(100) NOT NULL
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table applications ( $sql = "create table applications (
app_name varchar(25) NOT NULL, app_name varchar(25) NOT NULL,
@ -28,7 +28,7 @@
app_version varchar(20) NOT NULL default '0.0', app_version varchar(20) NOT NULL default '0.0',
unique(app_name) unique(app_name)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table accounts ( $sql = "create table accounts (
@ -45,14 +45,14 @@
account_status char(1), account_status char(1),
unique(account_lid) unique(account_lid)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table groups ( $sql = "create table groups (
group_id serial, group_id serial,
group_name varchar(50), group_name varchar(50),
group_apps varchar(255) group_apps varchar(255)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table phpgw_sessions ( $sql = "create table phpgw_sessions (
session_id varchar(255), session_id varchar(255),
@ -63,7 +63,7 @@
session_info text, session_info text,
unique(session_id) unique(session_id)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE phpgw_acl ( $sql = "CREATE TABLE phpgw_acl (
acl_appname varchar(50), acl_appname varchar(50),
@ -72,7 +72,7 @@
acl_account_type char(1), acl_account_type char(1),
acl_rights int acl_rights int
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE phpgw_app_sessions ( $sql = "CREATE TABLE phpgw_app_sessions (
sessionid varchar(255) NOT NULL, sessionid varchar(255) NOT NULL,
@ -80,7 +80,7 @@
app varchar(20), app varchar(20),
content text content text
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table phpgw_access_log ( $sql = "create table phpgw_access_log (
sessionid varchar(255), sessionid varchar(255),
@ -89,13 +89,13 @@
li int, li int,
lo varchar(255) lo varchar(255)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table preferences ( $sql = "create table preferences (
preference_owner int, preference_owner int,
preference_value text preference_value text
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE profiles ( $sql = "CREATE TABLE profiles (
con serial, con serial,
@ -106,7 +106,7 @@
picture_format varchar(255), picture_format varchar(255),
picture text picture text
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table addressbook ( $sql = "create table addressbook (
ab_id serial, ab_id serial,
@ -133,7 +133,7 @@
ab_address2 varchar(60), ab_address2 varchar(60),
ab_url varchar(255) ab_url varchar(255)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table todo ( $sql = "create table todo (
todo_id serial, todo_id serial,
@ -147,7 +147,7 @@
todo_startdate int, todo_startdate int,
todo_enddate int todo_enddate int
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE calendar_entry ( $sql = "CREATE TABLE calendar_entry (
cal_id serial, cal_id serial,
@ -162,14 +162,14 @@
cal_name varchar(80) NOT NULL, cal_name varchar(80) NOT NULL,
cal_description text cal_description text
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE calendar_entry_user ( $sql = "CREATE TABLE calendar_entry_user (
cal_id int DEFAULT 0 NOT NULL, cal_id int DEFAULT 0 NOT NULL,
cal_login int DEFAULT 0 NOT NULL, cal_login int DEFAULT 0 NOT NULL,
cal_status char(1) DEFAULT 'A' cal_status char(1) DEFAULT 'A'
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table calendar_entry_repeats ( $sql = "create table calendar_entry_repeats (
cal_id int DEFAULT 0 NOT NULL, cal_id int DEFAULT 0 NOT NULL,
@ -179,7 +179,7 @@
cal_frequency int default 1, cal_frequency int default 1,
cal_days char(7) cal_days char(7)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE newsgroups ( $sql = "CREATE TABLE newsgroups (
con serial, con serial,
@ -189,7 +189,7 @@
active char DEFAULT 'N' NOT NULL, active char DEFAULT 'N' NOT NULL,
lastread int lastread int
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE news_msg ( $sql = "CREATE TABLE news_msg (
con serial, con serial,
@ -224,7 +224,7 @@
msglines int DEFAULT 0, msglines int DEFAULT 0,
body text NOT NULL body text NOT NULL
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE lang ( $sql = "CREATE TABLE lang (
@ -234,7 +234,7 @@
content text NOT NULL, content text NOT NULL,
unique(message_id,app_name,lang) unique(message_id,app_name,lang)
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE categories ( $sql = "CREATE TABLE categories (
cat_id serial, cat_id serial,
@ -243,14 +243,14 @@
cat_name varchar(150) NOT NULL, cat_name varchar(150) NOT NULL,
cat_description text NOT NULL cat_description text NOT NULL
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE languages ( $sql = "CREATE TABLE languages (
lang_id varchar(2) NOT NULL, lang_id varchar(2) NOT NULL,
lang_name varchar(50) NOT NULL, lang_name varchar(50) NOT NULL,
available varchar(3) NOT NULL DEFAULT 'No' available varchar(3) NOT NULL DEFAULT 'No'
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE notes ( $sql = "CREATE TABLE notes (
note_id serial, note_id serial,
@ -258,7 +258,7 @@
note_date int, note_date int,
note_content text note_content text
)"; )";
$db->query($sql); $phpgw_setup->db->query($sql);
$sql = "create table phpgw_hooks ( $sql = "create table phpgw_hooks (
hook_id serial, hook_id serial,
@ -266,9 +266,9 @@
hook_location varchar(255), hook_location varchar(255),
hook_filename varchar(255) hook_filename varchar(255)
);"; );";
$db->query($sql); $phpgw_setup->db->query($sql);
$currentver = "0.9.8pre5"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5";
$oldversion = $currentver; $phpgw_info["setup"]["oldver"]["phpgwapi"] = $phpgw_info["setup"]["currentver"]["phpgwapi"];
update_version_table(); update_version_table();
?> ?>

File diff suppressed because it is too large Load Diff

View File

@ -14,149 +14,149 @@
$test[] = "7122000"; $test[] = "7122000";
function upgrade7122000(){ function upgrade7122000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
echo "Upgrading from 7122000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n"; echo "Upgrading from 7122000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n";
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "8032000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8032000";
} }
$test[] = "8032000"; $test[] = "8032000";
function upgrade8032000(){ function upgrade8032000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
echo "Upgrading from 8032000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n"; echo "Upgrading from 8032000 is not yet ready.<br> You can do this manually if you choose, otherwise dump your tables and start over.<br>\n";
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "8072000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8072000";
} }
$test[] = "8072000"; $test[] = "8072000";
function upgrade8072000(){ function upgrade8072000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
$sql = "CREATE TABLE applications (" $sql = "CREATE TABLE applications ("
."app_name varchar(25) NOT NULL," ."app_name varchar(25) NOT NULL,"
."app_title varchar(50)," ."app_title varchar(50),"
."app_enabled int," ."app_enabled int,"
."UNIQUE app_name (app_name)" ."UNIQUE app_name (app_name)"
.")"; .")";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)");
$db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)"); $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)");
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "8212000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8212000";
} }
$test[] = "8212000"; $test[] = "8212000";
function upgrade8212000(){ function upgrade8212000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
$db->query("alter table chat_channel change name name varchar(10) not null"); $phpgw_setup->db->query("alter table chat_channel change name name varchar(10) not null");
$db->query("alter table chat_messages change channel channel char(20) not null"); $phpgw_setup->db->query("alter table chat_messages change channel channel char(20) not null");
$db->query("alter table chat_messages change loginid loginid varchar(20) not null"); $phpgw_setup->db->query("alter table chat_messages change loginid loginid varchar(20) not null");
$db->query("alter table chat_currentin change loginid loginid varchar(25) not null"); $phpgw_setup->db->query("alter table chat_currentin change loginid loginid varchar(25) not null");
$db->query("alter table chat_currentin change channel channel char(20)"); $phpgw_setup->db->query("alter table chat_currentin change channel channel char(20)");
$db->query("alter table chat_privatechat change user1 user1 varchar(25) not null"); $phpgw_setup->db->query("alter table chat_privatechat change user1 user1 varchar(25) not null");
$db->query("alter table chat_privatechat change user2 user2 varchar(25) not null"); $phpgw_setup->db->query("alter table chat_privatechat change user2 user2 varchar(25) not null");
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "9052000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9052000";
} }
$test[] = "9052000"; $test[] = "9052000";
function upgrade9052000(){ function upgrade9052000(){
global $currentver, $oldversion, $phpgw_info, $db, $prebeta; global $phpgw_info, $phpgw_setup;
echo "Upgrading from 9052000 is not available.<br> I dont believe there were any changes, so this should be fine.<br>\n"; echo "Upgrading from 9052000 is not available.<br> I dont believe there were any changes, so this should be fine.<br>\n";
$prebeta = True; $phpgw_info["setup"]["prebeta"] = True;
$currentver = "9072000"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9072000";
} }
$test[] = "9072000"; $test[] = "9072000";
function upgrade9072000(){ function upgrade9072000(){
global $currentver, $oldversion, $phpgw_info, $db; global $phpgw_info, $phpgw_setup;
$db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment"); $phpgw_setup->db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment");
$db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL"); $phpgw_setup->db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL");
$db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL"); $phpgw_setup->db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL");
$db->query("alter table accounts change firstname account_firstname varchar(50)"); $phpgw_setup->db->query("alter table accounts change firstname account_firstname varchar(50)");
$db->query("alter table accounts change lastname account_lastname varchar(50)"); $phpgw_setup->db->query("alter table accounts change lastname account_lastname varchar(50)");
$db->query("alter table accounts change permissions account_permissions text"); $phpgw_setup->db->query("alter table accounts change permissions account_permissions text");
$db->query("alter table accounts change groups account_groups varchar(30)"); $phpgw_setup->db->query("alter table accounts change groups account_groups varchar(30)");
$db->query("alter table accounts change lastlogin account_lastlogin int(11)"); $phpgw_setup->db->query("alter table accounts change lastlogin account_lastlogin int(11)");
$db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)"); $phpgw_setup->db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)");
$db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)"); $phpgw_setup->db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)");
$db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL"); $phpgw_setup->db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL");
$db->query("alter table applications add app_order int"); $phpgw_setup->db->query("alter table applications add app_order int");
$db->query("alter table applications add app_tables varchar(255)"); $phpgw_setup->db->query("alter table applications add app_tables varchar(255)");
$db->query("alter table applications add app_version varchar(20) not null default '0.0'"); $phpgw_setup->db->query("alter table applications add app_version varchar(20) not null default '0.0'");
$db->query("alter table preferences change owner preference_owner varchar(20)"); $phpgw_setup->db->query("alter table preferences change owner preference_owner varchar(20)");
$db->query("alter table preferences change name preference_name varchar(50)"); $phpgw_setup->db->query("alter table preferences change name preference_name varchar(50)");
$db->query("alter table preferences change value preference_value varchar(50)"); $phpgw_setup->db->query("alter table preferences change value preference_value varchar(50)");
$db->query("alter table preferences add preference_appname varchar(50) default ''"); $phpgw_setup->db->query("alter table preferences add preference_appname varchar(50) default ''");
$db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL"); $phpgw_setup->db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL");
$db->query("alter table sessions change loginid session_lid varchar(20)"); $phpgw_setup->db->query("alter table sessions change loginid session_lid varchar(20)");
$db->query("alter table sessions change passwd session_pwd varchar(255)"); $phpgw_setup->db->query("alter table sessions change passwd session_pwd varchar(255)");
$db->query("alter table sessions change ip session_ip varchar(255)"); $phpgw_setup->db->query("alter table sessions change ip session_ip varchar(255)");
$db->query("alter table sessions change logintime session_logintime int(11)"); $phpgw_setup->db->query("alter table sessions change logintime session_logintime int(11)");
$db->query("alter table sessions change dla session_dla int(11)"); $phpgw_setup->db->query("alter table sessions change dla session_dla int(11)");
$db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'"); $phpgw_setup->db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'");
$db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'"); $phpgw_setup->db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'");
$db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'"); $phpgw_setup->db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'");
$db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'"); $phpgw_setup->db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'");
$db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'"); $phpgw_setup->db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'");
$db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'"); $phpgw_setup->db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'");
$db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'"); $phpgw_setup->db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'");
$db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'"); $phpgw_setup->db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'");
$db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'"); $phpgw_setup->db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'");
$db->query("update applications set app_order=10,app_tables=NULL where app_name='email'"); $phpgw_setup->db->query("update applications set app_order=10,app_tables=NULL where app_name='email'");
$db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'"); $phpgw_setup->db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'");
$db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'"); $phpgw_setup->db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'");
$sql = "CREATE TABLE config (" $sql = "CREATE TABLE config ("
."config_name varchar(25) NOT NULL," ."config_name varchar(25) NOT NULL,"
."config_value varchar(100)," ."config_value varchar(100),"
."UNIQUE config_name (config_name)" ."UNIQUE config_name (config_name)"
.")"; .")";
$db->query($sql); $phpgw_setup->db->query($sql);
$db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', 'default')");
$db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
$db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
$db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'");
$db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')");
$db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')");
$db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')");
$db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', 'True')");
$db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')");
$db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')");
$db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')");
$db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')");
$db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '25')");
$db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '119')");
$db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')");
$db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')");
$db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')");
$currentver = "0.9.1"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.1";
} }
?> ?>

View File

@ -7,7 +7,7 @@
loaddb(); loaddb();
// $currentver = "drop"; // $currentver = "drop";
$currentver = "new"; $currentver = "new";
manage_tables(); $phpgw_setup->manage_tables();
execute_script("create_tables"); $phpgw_setup->execute_script("create_tables");
?> ?>