diff --git a/addressbook/setup/details.inc.php b/addressbook/setup/details.inc.php new file mode 100644 index 0000000000..71c8875a01 --- /dev/null +++ b/addressbook/setup/details.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/addressbook/setup/newtables.inc.php b/addressbook/setup/newtables.inc.php deleted file mode 100644 index d368458896..0000000000 --- a/addressbook/setup/newtables.inc.php +++ /dev/null @@ -1,89 +0,0 @@ -query($sql); - - $sql = "CREATE TABLE phpgw_addressbook_extra ( - contact_id int(11), - contact_owner int(11), - contact_name varchar(255), - contact_value varchar(255) - )"; - - $db->query($sql); - - $currentver = "0.9.8pre5"; - $oldversion = $currentver; - update_app_version("addressbook"); -?> diff --git a/addressbook/setup/setup_info.inc.php b/addressbook/setup/setup_info.inc.php deleted file mode 100644 index 11094c5dc5..0000000000 --- a/addressbook/setup/setup_info.inc.php +++ /dev/null @@ -1,2 +0,0 @@ - "Addressbook", "app_order" => 7, "version" => "0.0.1"); \ No newline at end of file diff --git a/addressbook/setup/tables_baseline.inc.php b/addressbook/setup/tables_baseline.inc.php new file mode 100644 index 0000000000..56c4d73a14 --- /dev/null +++ b/addressbook/setup/tables_baseline.inc.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/addressbook/setup/tables_current.inc.php b/addressbook/setup/tables_current.inc.php new file mode 100644 index 0000000000..745fceeb8f --- /dev/null +++ b/addressbook/setup/tables_current.inc.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/addressbook/setup/droptables.inc.php b/addressbook/setup/tables_drop.inc.php similarity index 84% rename from addressbook/setup/droptables.inc.php rename to addressbook/setup/tables_drop.inc.php index bc10895a3b..a1b56e57c7 100644 --- a/addressbook/setup/droptables.inc.php +++ b/addressbook/setup/tables_drop.inc.php @@ -5,12 +5,10 @@ * -------------------------------------------- * * 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 * + * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ - /* $Id$ */ + /* $Id $ */ - $db->query("DROP TABLE phpgw_addressbook"); - $db->query("DROP TABLE phpgw_addressbook_extra"); -?> +?> \ No newline at end of file diff --git a/addressbook/setup/tables_update.inc.php b/addressbook/setup/tables_update.inc.php new file mode 100644 index 0000000000..f1addedd67 --- /dev/null +++ b/addressbook/setup/tables_update.inc.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/addressbook/setup/upgrade.php b/addressbook/setup/upgrade.php deleted file mode 100644 index 3aa3049923..0000000000 --- a/addressbook/setup/upgrade.php +++ /dev/null @@ -1,153 +0,0 @@ -db; - - // create new contacts class tables - $sql = "DROP TABLE IF EXISTS phpgw_addressbook"; - $db1->query($sql); - - $sql = "DROP TABLE IF EXISTS phpgw_addressbook_extra"; - $db1->query($sql); - - $sql = "CREATE TABLE phpgw_addressbook ( - id int(8) DEFAULT '0' NOT NULL, - lid varchar(32), - tid char(1), - owner int(8), - fn varchar(64), - sound varchar(64), - org_name varchar(64), - org_unit varchar(64), - title varchar(64), - n_family varchar(64), - n_given varchar(64), - n_middle varchar(64), - n_prefix varchar(64), - n_suffix varchar(64), - label text, - adr_poaddr varchar(64), - adr_extaddr varchar(64), - adr_street varchar(64), - adr_locality varchar(32), - adr_region varchar(32), - adr_postalcode varchar(32), - adr_countryname varchar(32), - adr_work enum('y','n') DEFAULT 'n' NOT NULL, - adr_home enum('y','n') DEFAULT 'n' NOT NULL, - adr_parcel enum('y','n') DEFAULT 'n' NOT NULL, - adr_postal enum('y','n') DEFAULT 'n' NOT NULL, - tz varchar(8), - geo varchar(32), - a_tel varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, - a_tel_work enum('y','n') DEFAULT 'n' NOT NULL, - a_tel_home enum('y','n') DEFAULT 'n' NOT NULL, - a_tel_voice enum('y','n') DEFAULT 'n' NOT NULL, - a_tel_msg enum('y','n') DEFAULT 'n' NOT NULL, - a_tel_fax enum('y','n') DEFAULT 'n' NOT NULL, - a_tel_prefer enum('y','n') DEFAULT 'n' NOT NULL, - b_tel varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, - b_tel_work enum('y','n') DEFAULT 'n' NOT NULL, - b_tel_home enum('y','n') DEFAULT 'n' NOT NULL, - b_tel_voice enum('y','n') DEFAULT 'n' NOT NULL, - b_tel_msg enum('y','n') DEFAULT 'n' NOT NULL, - b_tel_fax enum('y','n') DEFAULT 'n' NOT NULL, - b_tel_prefer enum('y','n') DEFAULT 'n' NOT NULL, - c_tel varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, - c_tel_work enum('y','n') DEFAULT 'n' NOT NULL, - c_tel_home enum('y','n') DEFAULT 'n' NOT NULL, - c_tel_voice enum('y','n') DEFAULT 'n' NOT NULL, - c_tel_msg enum('y','n') DEFAULT 'n' NOT NULL, - c_tel_fax enum('y','n') DEFAULT 'n' NOT NULL, - c_tel_prefer enum('y','n') DEFAULT 'n' NOT NULL, - d_emailtype enum('INTERNET','CompuServe','AOL','Prodigy','eWorld','AppleLink','AppleTalk','PowerShare','IBMMail','ATTMail','MCIMail','X.400','TLX') DEFAULT 'INTERNET' NOT NULL, - d_email varchar(64), - d_email_work enum('y','n') DEFAULT 'n' NOT NULL, - d_email_home enum('y','n') DEFAULT 'n' NOT NULL, - PRIMARY KEY (id), - UNIQUE id (id) - )"; - - $db1->query($sql); - - $sql = "CREATE TABLE phpgw_addressbook_extra ( - contact_id int(11), - contact_owner int(11), - contact_name varchar(255), - contact_value varchar(255) - )"; - - $db1->query($sql); - - // read in old addressbook - $db1->query("select * from addressbook"); - - while ( $db1->next_record() ) { - // clear the arrays for subsequent passes - $fields = $extra = array(); - $fields["org_name"] = $db1->f("ab_company"); - $fields["n_given"] = $db1->f("ab_firstname"); - $fields["n_family"] = $db1->f("ab_lastname"); - $fields["fn"] = $db1->f("ab_firstname")." ".$db1->f("ab_lastname"); - $fields["d_email"] = $db1->f("ab_email"); - $fields["title"] = $db1->f("ab_title"); - $fields["a_tel"] = $db1->f("ab_wphone"); - $fields["a_tel_work"] = "y"; - $fields["b_tel"] = $db1->f("ab_hphone"); - $fields["b_tel_home"] = "y"; - $fields["c_tel"] = $db1->f("ab_fax"); - $fields["c_tel_fax"] = "y"; - $fields["adr_street"] = $db1->f("ab_street"); - $fields["adr_locality"] = $db1->f("ab_city"); - $fields["adr_region"] = $db1->f("ab_state"); - $fields["adr_postalcode"] = $db1->f("ab_zip"); - $fields["owner"] = $db1->f("ab_owner"); - $fields["id"] = $db1->f("ab_id"); - - $extra["pager"] = $db1->f("ab_pager"); - $extra["mphone"] = $db1->f("ab_mphone"); - $extra["ophone"] = $db1->f("ab_ophone"); - $extra["address2"] = $db1->f("ab_address2"); - $extra["bday"] = $db1->f("ab_bday"); - $extra["url"] = $db1->f("ab_url"); - $extra["notes"] = $db1->f("ab_notes"); - $extra["access"] = $db1->f("ab_access"); - - // add this record's standard fields with current entry's owner as owner - $sql="INSERT INTO phpgw_addressbook (" - . "id,org_name,n_given,n_family,fn,d_email,title,a_tel,a_tel_work," - . "b_tel,b_tel_home,c_tel,c_tel_fax,adr_street,adr_locality,adr_region,adr_postalcode,owner)" - . " VALUES ('".$fields["id"]."','".$fields["org_name"]."','".$fields["n_given"]."','".$fields["n_family"]."','" - . $fields["fn"]."','".$fields["d_email"]."','".$fields["title"]."','".$fields["a_tel"]."','" - . $fields["a_tel_work"]."','".$fields["b_tel"]."','".$fields["b_tel_home"]."','" - . $fields["c_tel"]."','".$fields["c_tel_fax"]."','".$fields["adr_street"]."','" - . $fields["adr_locality"]."','".$fields["adr_region"]."','".$fields["adr_postalcode"]."'," - . $fields["owner"].")"; - - $db2->query($sql); - - //echo "
Inserting id '".$fields["id"]."'"; - // insert extra fields for this record into extra fields table - while (list($name,$value) = each($extra)) { - //echo "
Inserting '".$name."' = '".$value."'"; - $db2->query("INSERT INTO phpgw_addressbook_extra VALUES ('".$fields["id"]."','" . $$fields["owner"] . "','" - . addslashes($name) . "','" . addslashes($value) . "')",__LINE__,__FILE__); - } - } - } - upgradeaddr(); -?> diff --git a/admin/setup/details.inc.php b/admin/setup/details.inc.php new file mode 100644 index 0000000000..92f66d77f8 --- /dev/null +++ b/admin/setup/details.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/admin/setup/setup_info.inc.php b/admin/setup/setup_info.inc.php deleted file mode 100644 index 23b3cc426c..0000000000 --- a/admin/setup/setup_info.inc.php +++ /dev/null @@ -1,2 +0,0 @@ - "Administration", "app_order" => 1, "version" => "0.0.1"); \ No newline at end of file diff --git a/admin/setup/tables_baseline.inc.php b/admin/setup/tables_baseline.inc.php new file mode 100644 index 0000000000..56c4d73a14 --- /dev/null +++ b/admin/setup/tables_baseline.inc.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/admin/setup/tables_current.inc.php b/admin/setup/tables_current.inc.php new file mode 100644 index 0000000000..745fceeb8f --- /dev/null +++ b/admin/setup/tables_current.inc.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/calendar/setup/droptables.inc.php b/admin/setup/tables_drop.inc.php similarity index 80% rename from calendar/setup/droptables.inc.php rename to admin/setup/tables_drop.inc.php index 05d047b129..a1b56e57c7 100644 --- a/calendar/setup/droptables.inc.php +++ b/admin/setup/tables_drop.inc.php @@ -5,13 +5,10 @@ * -------------------------------------------- * * 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 * + * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ - /* $Id$ */ + /* $Id $ */ - $db->query("DROP TABLE calendar_entry"); - $db->query("DROP TABLE calendar_entry_repeats"); - $db->query("DROP TABLE calendar_entry_user"); ?> \ No newline at end of file diff --git a/admin/setup/tables_update.inc.php b/admin/setup/tables_update.inc.php new file mode 100644 index 0000000000..f1addedd67 --- /dev/null +++ b/admin/setup/tables_update.inc.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/calendar/setup/create_tables.inc.php b/calendar/setup/create_tables.inc.php deleted file mode 100644 index 498e49d098..0000000000 --- a/calendar/setup/create_tables.inc.php +++ /dev/null @@ -1,3 +0,0 @@ -hellow world
"; -?> \ No newline at end of file diff --git a/calendar/setup/newtables.inc.php b/calendar/setup/newtables.inc.php deleted file mode 100644 index 1238055d84..0000000000 --- a/calendar/setup/newtables.inc.php +++ /dev/null @@ -1,53 +0,0 @@ -query($sql); - - $sql = "CREATE TABLE calendar_entry_repeats ( - cal_id int(11) DEFAULT '0' NOT NULL, - cal_type enum('daily','weekly','monthlyByDay','monthlyByDate','yearly') DEFAULT 'daily' NOT NULL, - cal_use_end int DEFAULT '0', - cal_end int(11), - cal_frequency int(11) DEFAULT '1', - cal_days char(7) - )"; - $db->query($sql); - - $sql = "CREATE TABLE calendar_entry_user ( - cal_id int(11) DEFAULT '0' NOT NULL, - cal_login int(11) DEFAULT '0' NOT NULL, - cal_status char(1) DEFAULT 'A', - PRIMARY KEY (cal_id, cal_login) - )"; - $db->query($sql); - - $currentver = "0.9.8pre5"; - $oldversion = $currentver; - update_app_version("calendar"); -?> diff --git a/calendar/setup/setup_info.inc.php b/calendar/setup/setup_info.inc.php deleted file mode 100644 index f88e1fe828..0000000000 --- a/calendar/setup/setup_info.inc.php +++ /dev/null @@ -1,2 +0,0 @@ - "Calendar", "app_order" => 9, "version" => "0.0.1"); \ No newline at end of file diff --git a/phpgwapi/inc/class.acl.inc.php b/phpgwapi/inc/class.acl.inc.php index 2d6f058970..f79afc77c5 100644 --- a/phpgwapi/inc/class.acl.inc.php +++ b/phpgwapi/inc/class.acl.inc.php @@ -23,6 +23,18 @@ /* $Id$ */ + /*!! + * @Type: class + * @Name: acl + * @Author: Seek3r + * @Title: Access Control List security system + * @Description: This class provides an ACL security scheme. + * This can manage rights to 'run' applications, and limit certain features within an application. + * It is also used for granting a user "membership" to a group, or making a user have the security equivilance of another user. + * It is also used for granting a user or group rights to various records, such as todo or calendar items of another user. + * @Syntax: CreateObject('phpgwapi.acl',int account_id); + * @Example1: $acl = CreateObject('phpgwapi.acl',5); // 5 is the user id + */ class acl { var $account_id; @@ -30,10 +42,16 @@ var $data = Array(); var $db; - /**************************************************************************\ - * Standard constructor for setting $this->account_id * - \**************************************************************************/ - + /*!! + * @Type: function + * @Name: acl + * @Author: Seek3r + * @Title: ACL constructor for setting account id. + * @Description: Sets the ID for $acl->account_id. Can be used to change a current instances id as well. + * Some functions are specific to this account, and others are generic. + * @Syntax: int acl(int account_id) + * @Example1: acl->acl(5); // 5 is the user id + */ function acl($account_id = False) { global $phpgw, $phpgw_info; @@ -45,6 +63,15 @@ * These are the standard $this->account_id specific functions * \**************************************************************************/ + /*!! + * @Type: function + * @Name: read_repository + * @Author: Seek3r + * @Title: Read acl records from repository. + * @Description: Reads ACL records for $acl->account_id and returns array along with storing it in $acl->data. + * @Syntax: array read_repository() + * @Example1: acl->read_repository(); + */ function read_repository() { global $phpgw, $phpgw_info; @@ -73,6 +100,15 @@ return $this->data; } + /*!! + * @Type: function + * @Name: read + * @Author: Seek3r + * @Title: Read acl records from $acl->data. + * @Description: Returns ACL records from $acl->data. + * @Syntax: array read() + * @Example1: acl->read(); + */ function read() { if (count($this->data) == 0){ $this->read_repository(); } @@ -80,6 +116,15 @@ return $this->data; } + /*!! + * @Type: function + * @Name: add + * @Author: Seek3r + * @Title: Adds ACL record to $acl->data. + * @Description: Adds ACL record to $acl->data. + * @Syntax: array read() + * @Example1: acl->read(); + */ function add($appname = False, $location, $rights) { if ($appname == False){ diff --git a/phpgwapi/inc/class.phpgw.inc.php b/phpgwapi/inc/class.phpgw.inc.php index a5cb323a4d..1b10cbb84d 100644 --- a/phpgwapi/inc/class.phpgw.inc.php +++ b/phpgwapi/inc/class.phpgw.inc.php @@ -24,9 +24,15 @@ /* $Id$ */ - /****************************************************************************\ - * Our API class starts here * - \****************************************************************************/ + /*!! + * @Type: class + * @Name: phpgw + * @Author: Seek3r + * @Title: Main class. + * @Description: Main class. Has a few functions but is more importantly used as a parent class for everything else. + * @Syntax: CreateObject('phpgwapi.phpgw'); + * @Example1: $phpgw = CreateObject('phpgwapi.acl'); + */ class phpgw { var $accounts; @@ -53,58 +59,52 @@ var $addressbook; var $todo; - /************************************************************************\ - * Load up the main instance of the db class. * - \************************************************************************/ - function phpgw() { - global $phpgw_info; - $this->db = CreateObject("phpgwapi.db"); - $this->db->Host = $phpgw_info["server"]["db_host"]; - $this->db->Type = $phpgw_info["server"]["db_type"]; - $this->db->Database = $phpgw_info["server"]["db_name"]; - $this->db->User = $phpgw_info["server"]["db_user"]; - $this->db->Password = $phpgw_info["server"]["db_pass"]; - if ($this->debug) { - $this->db->Debug = 1; - } - } - - function load_core_objects() - { - /************************************************************************\ - * Required classes * - \************************************************************************/ - $this->common = CreateObject("phpgwapi.common"); - $this->hooks = CreateObject("phpgwapi.hooks"); - $this->auth = createobject("phpgwapi.auth"); - $this->acl = CreateObject("phpgwapi.acl"); - $this->accounts = createobject("phpgwapi.accounts"); - $this->session = CreateObject("phpgwapi.sessions"); - $this->preferences = CreateObject("phpgwapi.preferences"); - $this->applications = CreateObject("phpgwapi.applications"); - $this->translation = CreateObject("phpgwapi.translation"); - } - /**************************************************************************\ * Core functions * \**************************************************************************/ + /*!! + * @Type: function + * @Name: strip_html + * @Author: Seek3r + * @Title: Strips out html chars. + * @Description: Used as a shortcut for stripping out html special chars. + * @Syntax: string strip_html(string as string) + * @Example1: $reg_string = strip_html($urlencode_string); + */ function strip_html($s) { return htmlspecialchars(stripslashes($s)); } - /* Wrapper to the session->link() */ + /*!! + * @Type: function + * @Name: link + * @Author: Seek3r + * @Title: Wrapper to session->link() + * @Description: Used for backward compatibility and as a shortcut. + * If no url is passed, it will use PHP_SELF + * @Syntax: string link(url as string, extra_vars as string) + * @Example1: click here + */ function link($url = "", $extravars = "") { global $phpgw, $phpgw_info, $usercookie, $kp3, $PHP_SELF; return $this->session->link($url, $extravars); } + /*!! + * @Type: function + * @Name: link + * @Author: Seek3r + * @Title: Handles redirects under iis and apache + * @Description: This function handles redirects under iis and apache + * it assumes that $phpgw->link() has already been called + * @Syntax: string redirect(url as string) + * @Example1: None yet + */ function redirect($url = "") { - // This function handles redirects under iis and apache - // it assumes that $phpgw->link() has already been called global $HTTP_ENV_VARS; @@ -127,10 +127,20 @@ } } + /*!! + * @Type: function + * @Name: lang + * @Author: Jengo + * @Title: Shortcut to translation class + * @Description: This function is a basic wrapper to translation->translate() + * @Syntax: string redirect(key as string) + * @Example1: None yet + */ function lang($key, $m1 = "", $m2 = "", $m3 = "", $m4 = "") { global $phpgw; return $this->translation->translate($key); } - } //end phpgw class + /* end of class */ + } ?> diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 99aca3eda3..5fdfc64214 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -29,6 +29,16 @@ * Direct functions, which are not part of the API class * * because they are require to be availble at the lowest level. * \****************************************************************************/ + /*!! + * @Type: function + * @Name: CreateObject + * @Author: mdean + * @Title: Load a class and include the class file if not done so already. + * @Description: This function is used to create an instance of a class, + * and if the class file has not been included it will do so. + * @Syntax: CreateObject('app.class', 'constructor_params'); + * @Example1: $phpgw->acl = CreateObject('phpgwapi.acl'); + */ function CreateObject($classname, $constructor_param = "") { global $phpgw, $phpgw_info, $phpgw_domain; @@ -85,7 +95,7 @@ \****************************************************************************/ error_reporting(7); /* Make sure the header.inc.php is current. */ - if ($phpgw_info["server"]["versions"]["header"] != $phpgw_info["server"]["versions"]["current_header"]){ + if ($phpgw_info["server"]["versions"]["header"] < $phpgw_info["server"]["versions"]["current_header"]){ echo "
You need to port your settings to the new header.inc.php version.
"; exit; } @@ -157,34 +167,47 @@ // This is where it belongs (jengo) /* Since LDAP will return system accounts, there are a few we don't want to login. */ $phpgw_info["server"]["global_denied_users"] = array('root' => True, - 'bin' => True, - 'daemon' => True, - 'adm' => True, - 'lp' => True, - 'sync' => True, - 'shutdown' => True, - 'halt' => True, - 'mail' => True, - 'news' => True, - 'uucp' => True, - 'operator' => True, - 'games' => True, - 'gopher' => True, - 'nobody' => True, - 'xfs' => True, - 'pgsql' => True, - 'mysql' => True, - 'postgres' => True, - 'ftp' => True, - 'gdm' => True, - 'named' => True - ); + 'bin' => True, + 'daemon' => True, + 'adm' => True, + 'lp' => True, + 'sync' => True, + 'shutdown' => True, + 'halt' => True, + 'mail' => True, + 'news' => True, + 'uucp' => True, + 'operator' => True, + 'games' => True, + 'gopher' => True, + 'nobody' => True, + 'xfs' => True, + 'pgsql' => True, + 'mysql' => True, + 'postgres' => True, + 'ftp' => True, + 'gdm' => True, + 'named' => True + ); /****************************************************************************\ * These lines load up the API, fill up the $phpgw_info array, etc * \****************************************************************************/ /* Load main class */ $phpgw = CreateObject("phpgwapi.phpgw"); + /************************************************************************\ + * Load up the main instance of the db class. * + \************************************************************************/ + $phpgw->db = CreateObject("phpgwapi.db"); + $phpgw->db->Host = $phpgw_info["server"]["db_host"]; + $phpgw->db->Type = $phpgw_info["server"]["db_type"]; + $phpgw->db->Database = $phpgw_info["server"]["db_name"]; + $phpgw->db->User = $phpgw_info["server"]["db_user"]; + $phpgw->db->Password = $phpgw_info["server"]["db_pass"]; + if ($this->debug) { + $phpgw->db->Debug = 1; + } + $phpgw->db->Halt_On_Error = "no"; @$phpgw->db->query("select count(*) from phpgw_config"); if (! @$phpgw->db->next_record()) { @@ -201,7 +224,18 @@ $phpgw_info["server"][$phpgw->db->f("config_name")] = stripslashes($phpgw->db->f("config_value")); } - $phpgw->load_core_objects(); + /************************************************************************\ + * Required classes * + \************************************************************************/ + $phpgw->common = CreateObject("phpgwapi.common"); + $phpgw->hooks = CreateObject("phpgwapi.hooks"); + $phpgw->auth = createobject("phpgwapi.auth"); + $phpgw->acl = CreateObject("phpgwapi.acl"); + $phpgw->accounts = createobject("phpgwapi.accounts"); + $phpgw->session = CreateObject("phpgwapi.sessions"); + $phpgw->preferences = CreateObject("phpgwapi.preferences"); + $phpgw->applications = CreateObject("phpgwapi.applications"); + $phpgw->translation = CreateObject("phpgwapi.translation"); print_debug('main class loaded'); /****************************************************************************\ diff --git a/phpgwapi/setup/details.inc.php b/phpgwapi/setup/details.inc.php new file mode 100644 index 0000000000..fa52b3c586 --- /dev/null +++ b/phpgwapi/setup/details.inc.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/phpgwapi/setup/tables_baseline.inc.php b/phpgwapi/setup/tables_baseline.inc.php new file mode 100644 index 0000000000..56c4d73a14 --- /dev/null +++ b/phpgwapi/setup/tables_baseline.inc.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php new file mode 100644 index 0000000000..745fceeb8f --- /dev/null +++ b/phpgwapi/setup/tables_current.inc.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/phpgwapi/setup/tables_drop.inc.php b/phpgwapi/setup/tables_drop.inc.php new file mode 100644 index 0000000000..a1b56e57c7 --- /dev/null +++ b/phpgwapi/setup/tables_drop.inc.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php new file mode 100644 index 0000000000..f1addedd67 --- /dev/null +++ b/phpgwapi/setup/tables_update.inc.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/phpgwapi/version.inc.php b/phpgwapi/version.inc.php index 11237e22b5..ebee3e534a 100644 --- a/phpgwapi/version.inc.php +++ b/phpgwapi/version.inc.php @@ -15,4 +15,5 @@ This is a completely redundant file, but Im keeping it here because I have some irrational feeling that I should. Seek3r */ - //$phpgw_info["server"]["versions"]["phpgwapi"] = $phpgw_info["server"]["versions"]["phpgwapi"]; +// $phpgw_info['server']['versions']['phpgwapi'] = $phpgw_info['server']['versions']['phpgwapi']; +?> \ No newline at end of file diff --git a/preferences/setup/details.inc.php b/preferences/setup/details.inc.php new file mode 100644 index 0000000000..ae1ba8168e --- /dev/null +++ b/preferences/setup/details.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index 39fb1da30c..fe729766bd 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -12,11 +12,11 @@ /* $Id$ */ /* ######## Start security check ########## */ - $d1 = strtolower(substr($phpgw_info["server"]["api_inc"],0,3)); - $d2 = strtolower(substr($phpgw_info["server"]["server_root"],0,3)); - $d3 = strtolower(substr($phpgw_info["server"]["app_inc"],0,3)); - if($d1 == "htt" || $d1 == "ftp" || $d2 == "htt" || $d2 == "ftp" || $d3 == "htt" || $d3 == "ftp") { - echo "Failed attempt to break in via an old Security Hole!
\n"; + $d1 = strtolower(substr($phpgw_info['server']['api_inc'],0,3)); + $d2 = strtolower(substr($phpgw_info['server']['server_root'],0,3)); + $d3 = strtolower(substr($phpgw_info['server']['app_inc'],0,3)); + if($d1 == 'htt' || $d1 == 'ftp' || $d2 == 'htt' || $d2 == 'ftp' || $d3 == 'htt' || $d3 == 'ftp') { + echo 'Failed attempt to break in via an old Security Hole!
'; exit; } unset($d1);unset($d2);unset($d3); /* ######## End security check ########## */ @@ -36,17 +36,17 @@ // password in ../header.inc.php to protect all of the setup // pages from unauthorized use. - if(file_exists("../version.inc.php")) { - include("../version.inc.php"); // To set the current core version + if(file_exists('../version.inc.php')) { + include('../version.inc.php'); // To set the current core version }else{ - $phpgw_info["server"]["versions"]["phpgwapi"] = "Undetected"; + $phpgw_info['server']['versions']['phpgwapi'] = 'Undetected'; } - $phpgw_info["server"]["app_images"] = "templates/default/images"; + $phpgw_info['server']['app_images'] = 'templates/default/images'; - if(file_exists("../header.inc.php")) { include("../header.inc.php"); } + if(file_exists('../header.inc.php')) { include('../header.inc.php'); } - include("./inc/phpgw_setup.inc.php"); -// include("./inc/phpgw_schema_proc.inc.php"); + include('./inc/phpgw_setup.inc.php'); +// include('./inc/phpgw_schema_proc.inc.php'); $phpgw_setup = new phpgw_setup; ?> \ No newline at end of file diff --git a/setup/inc/phpgw_setup.inc.php b/setup/inc/phpgw_setup.inc.php index 44ca4909be..7a1c9529a9 100644 --- a/setup/inc/phpgw_setup.inc.php +++ b/setup/inc/phpgw_setup.inc.php @@ -322,23 +322,23 @@ function app_status($appname = ""){ global $phpgw_info; $this->get_versions(); - reset ($phpgw_info["server"]["versions"]); + reset ($phpgw_info['server']['versions']); $this->db->query("select * from phpgw_applications"); while ($this->db->next_record()){ - $phpgw_info["server"]["current_versions"][$this->db->f("app_name")] = $this->db->f("app_version"); + $phpgw_info['server']['current_versions'][$this->db->f('app_name')] = $this->db->f('app_version'); } - while (list($key, $value) = each ($phpgw_info["server"]["versions"])){ - if ($key != "header" && $key != "current_header" && $key != "" && $key != "mcrypt"){ - if (!isset($phpgw_info["server"]["current_versions"][$key])){ - $phpgw_info["server"]["current_versions"][$key] = "new"; - $phpgw_info["setup"][$key]["status"] = "new"; - }elseif ($value != $phpgw_info["server"]["current_versions"][$key]){ - $phpgw_info["setup"][$key]["status"] = "upgrade"; + while (list($key, $value) = each ($phpgw_info['server']['versions'])){ + if ($key != 'header' && $key != 'current_header' && $key != '' && $key != 'mcrypt'){ + if (!isset($phpgw_info['server']['current_versions'][$key])){ + $phpgw_info['server']['current_versions'][$key] = 'new'; + $phpgw_info['setup'][$key]['status'] = 'new'; + }elseif ($value != $phpgw_info['server']['current_versions'][$key]){ + $phpgw_info['setup'][$key]['status'] = 'upgrade'; }else{ - $phpgw_info["setup"][$key]["status"] = "current"; + $phpgw_info['setup'][$key]['status'] = 'current'; } - echo "phpgw_info[setup][$key][status]: ".$phpgw_info["setup"][$key]["status"]."
"; + echo 'phpgw_info[setup][$key][status]: '.$phpgw_info['setup'][$key]['status'].'
'; } } diff --git a/setup/sql/default_applications.inc.php b/setup/sql/default_applications.inc.php index 452c6b24c8..e1ce2fb9db 100644 --- a/setup/sql/default_applications.inc.php +++ b/setup/sql/default_applications.inc.php @@ -11,41 +11,22 @@ /* $Id$ */ - $reserved_directorys = array('phpgwapi' => True, 'doc' => True, 'setup' => True, '.' => True, - '..' => True, 'CVS' => True, 'files' => True); - - $i = 30; - $dh = opendir(PHPGW_SERVER_ROOT); - while ($dir = readdir($dh)) { - if (! $reserved_directorys[$dir] && is_dir(PHPGW_SERVER_ROOT . SEP . $dir)) { - if (is_file(PHPGW_SERVER_ROOT . SEP . $dir . SEP . 'setup' . SEP . 'tables_new.inc.php')) { - $new_schema[] = $dir; - } - - if (is_file(PHPGW_SERVER_ROOT . SEP . $dir . SEP . 'setup' . SEP . 'setup_info.inc.php')) { - include(PHPGW_SERVER_ROOT . SEP . $dir . SEP . 'setup' . SEP . 'setup_info.inc.php'); - } else { - $setup_info[$dir] = array('name' => $dir, 'app_order' => $i++, 'version' => '0.0.0'); - } - } - } - - while ($app = each($setup_info)) { - $phpgw_setup->db->query("insert into phpgw_applications (app_name, app_title, app_enabled, app_order," - . " app_tables, app_version) values ('" . $app[0] . "', '" . $app[1]["name"] - . "',1," . $app[1]['app_order'] . ", '" . $app[1]['app_tables'] . "', '" - . $app[1]['version'] . "')"); - } - - include(PHPGW_SERVER_ROOT . "/setup/inc/phpgw_schema_current.inc.php"); - include(PHPGW_SERVER_ROOT . "/setup/inc/phpgw_schema_proc.inc.php"); - - $o = new phpgw_schema_proc($phpgw_domain[$ConfigDomain]["db_type"]); - $o->m_odb = $phpgw_setup->db; - - while (list(,$app) = each($new_schema)) { - include(PHPGW_SERVER_ROOT . SEP . $app . SEP . 'setup' . SEP . 'tables_new.inc.php'); - echo '
Creating tables for ' . $app . ''; - $o->ExecuteScripts($app_tables, True); - } + $phpgw_setup->db->query("insert into phpgw_applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into phpgw_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"]."')"); + $phpgw_setup->db->query("insert into phpgw_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"]."')"); + $phpgw_setup->db->query("insert into phpgw_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"]."')"); + $phpgw_setup->db->query("insert into phpgw_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"]."')"); + $phpgw_setup->db->query("insert into phpgw_applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into phpgw_applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into phpgw_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 + $phpgw_setup->db->query("insert into phpgw_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"]."')"); + $phpgw_setup->db->query("insert into phpgw_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"]."')"); + $phpgw_setup->db->query("insert into phpgw_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 phpgw_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 phpgw_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 phpgw_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 phpgw_applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into phpgw_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"]."')"); + $phpgw_setup->db->query("insert into phpgw_applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); ?> \ No newline at end of file