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 @@
-
- /**************************************************************************\
- * 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$ */
-
- function upgradeaddr() {
- global $phpgw_info, $phpgw_setup;
-
- // create db objects for the main and two nested queries below
- $db1 = $db2 = $phpgw_setup->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 "