From fb03d1cbaaf15a4c0ec8e88748c15235fa30af7e Mon Sep 17 00:00:00 2001 From: seek3r Date: Fri, 18 Aug 2000 03:24:22 +0000 Subject: [PATCH] Initial revision --- addressbook/add.php | 92 ++ addressbook/delete.php | 54 ++ addressbook/edit.php | 115 +++ addressbook/inc/functions.inc.php | 287 ++++++ addressbook/index.php | 183 ++++ addressbook/lang/br_addressbook.inc.php | 29 + addressbook/lang/de_addressbook.inc.php | 32 + addressbook/lang/en_addressbook.inc.php | 30 + addressbook/lang/fr_addressbook.inc.php | 29 + addressbook/lang/kr_addressbook.inc.php | 29 + addressbook/lang/nl_addressbook.inc.php | 29 + addressbook/lang/no_addressbook.inc.php | 29 + addressbook/lang/sp_addressbook.inc.php | 29 + addressbook/view.php | 83 ++ admin/accesslog.php | 84 ++ admin/accounts.php | 50 + admin/creategroup.php | 72 ++ admin/currentusers.php | 82 ++ admin/deleteaccount.php | 102 +++ admin/deletegroup.php | 86 ++ admin/deleteheadline.php | 64 ++ admin/editaccount.php | 232 +++++ admin/editgroup.php | 61 ++ admin/editheadline.php | 93 ++ admin/groups.php | 41 + admin/headlines.php | 47 + admin/index.php | 41 + admin/killsession.php | 51 ++ admin/lang/br_admin.inc.php | 103 +++ admin/lang/de_admin.inc.php | 98 ++ admin/lang/en_admin.inc.php | 107 +++ admin/lang/fr_admin.inc.php | 94 ++ admin/lang/it_admin.inc.php | 100 ++ admin/lang/kr_admin.inc.php | 102 +++ admin/lang/nl_admin.inc.php | 102 +++ admin/lang/no_admin.inc.php | 94 ++ admin/lang/sp_admin.inc.php | 101 +++ admin/newaccount.php | 187 ++++ admin/newheadline.php | 117 +++ admin/nntp.php | 151 +++ admin/viewaccount.php | 101 +++ admin/viewheadline.php | 51 ++ calendar/day.php | 183 ++++ calendar/delete.php | 35 + calendar/edit_entry.php | 416 +++++++++ calendar/edit_entry_handler.php | 243 +++++ calendar/inc/footer.inc.php | 133 +++ calendar/inc/functions.inc.php | 647 +++++++++++++ calendar/inc/header.inc.php | 34 + calendar/inc/styles.inc.php | 45 + calendar/index.php | 175 ++++ calendar/lang/br_calendar.inc.php | 84 ++ calendar/lang/de_calendar.inc.php | 98 ++ calendar/lang/en_calendar.inc.php | 95 ++ calendar/lang/fr_calendar.inc.php | 90 ++ calendar/lang/it_calendar.inc.php | 84 ++ calendar/lang/kr_calendar.inc.php | 88 ++ calendar/lang/nl_calendar.inc.php | 89 ++ calendar/lang/no_calendar.inc.php | 82 ++ calendar/lang/sp_calendar.inc.php | 89 ++ calendar/search.php | 97 ++ calendar/view.php | 216 +++++ calendar/week.php | 173 ++++ calendar/year.php | 75 ++ doc/CHANGELOG | 187 ++++ doc/CREDITS | 75 ++ doc/FAQ.html | 55 ++ doc/FAQ.sgml | 65 ++ doc/FAQ.txt | 132 +++ doc/HOWTO.html | 159 ++++ doc/HOWTO.sgml | 184 ++++ doc/HOWTO.txt | 264 ++++++ doc/INSTALL | 7 + doc/LICENSE | 342 +++++++ doc/README | 63 ++ doc/RELEASE-NOTES | 4 + doc/SECURITY | 18 + doc/create_tables.mysql | 255 ++++++ doc/create_tables.pgsql | 244 +++++ doc/developers/.cvswrappers | 7 + doc/developers/CODES | 35 + doc/developers/dos2unix.pl | 137 +++ doc/developers/phpGW_Developers-HOWTO-1.html | 34 + doc/developers/phpGW_Developers-HOWTO-2.html | 74 ++ doc/developers/phpGW_Developers-HOWTO-3.html | 62 ++ doc/developers/phpGW_Developers-HOWTO-4.html | 122 +++ doc/developers/phpGW_Developers-HOWTO-5.html | 144 +++ doc/developers/phpGW_Developers-HOWTO-6.html | 122 +++ doc/developers/phpGW_Developers-HOWTO-7.html | 63 ++ doc/developers/phpGW_Developers-HOWTO-8.html | 31 + doc/developers/phpGW_Developers-HOWTO-9.html | 50 + doc/developers/phpGW_Developers-HOWTO.html | 104 +++ doc/developers/phpGW_Developers-HOWTO.sgml | 503 ++++++++++ doc/developers/phpGW_Developers-HOWTO.txt | 858 ++++++++++++++++++ doc/developers/phpgwapi/msg_pop3.txt | 139 +++ doc/developers/phpgwapi/send.txt | 117 +++ ...permission_tables_07122000_to_08032000.php | 126 +++ header.inc.php.sample | 30 + index.php | 149 +++ login.php | 140 +++ logout.php | 71 ++ notify.php | 63 ++ phpGroupWare.jpg | Bin 0 -> 8465 bytes preferences/changepassword.php | 85 ++ preferences/changeprofile.php | 99 ++ preferences/changetheme.php | 48 + preferences/index.php | 36 + preferences/lang/br_preferences.inc.php | 86 ++ preferences/lang/de_preferences.inc.php | 97 ++ preferences/lang/en_preferences.inc.php | 97 ++ preferences/lang/fr_preferences.inc.php | 88 ++ preferences/lang/it_preferences.inc.php | 86 ++ preferences/lang/kr_preferences.inc.php | 88 ++ preferences/lang/nl_preferences.inc.php | 88 ++ preferences/lang/no_preferences.inc.php | 85 ++ preferences/lang/sp_preferences.inc.php | 85 ++ preferences/nntp.php | 169 ++++ preferences/settings.php | 328 +++++++ 118 files changed, 13735 insertions(+) create mode 100755 addressbook/add.php create mode 100755 addressbook/delete.php create mode 100755 addressbook/edit.php create mode 100755 addressbook/inc/functions.inc.php create mode 100755 addressbook/index.php create mode 100644 addressbook/lang/br_addressbook.inc.php create mode 100755 addressbook/lang/de_addressbook.inc.php create mode 100755 addressbook/lang/en_addressbook.inc.php create mode 100755 addressbook/lang/fr_addressbook.inc.php create mode 100755 addressbook/lang/kr_addressbook.inc.php create mode 100755 addressbook/lang/nl_addressbook.inc.php create mode 100755 addressbook/lang/no_addressbook.inc.php create mode 100755 addressbook/lang/sp_addressbook.inc.php create mode 100755 addressbook/view.php create mode 100755 admin/accesslog.php create mode 100755 admin/accounts.php create mode 100755 admin/creategroup.php create mode 100755 admin/currentusers.php create mode 100755 admin/deleteaccount.php create mode 100755 admin/deletegroup.php create mode 100755 admin/deleteheadline.php create mode 100755 admin/editaccount.php create mode 100755 admin/editgroup.php create mode 100755 admin/editheadline.php create mode 100755 admin/groups.php create mode 100755 admin/headlines.php create mode 100755 admin/index.php create mode 100755 admin/killsession.php create mode 100644 admin/lang/br_admin.inc.php create mode 100755 admin/lang/de_admin.inc.php create mode 100755 admin/lang/en_admin.inc.php create mode 100755 admin/lang/fr_admin.inc.php create mode 100755 admin/lang/it_admin.inc.php create mode 100755 admin/lang/kr_admin.inc.php create mode 100755 admin/lang/nl_admin.inc.php create mode 100755 admin/lang/no_admin.inc.php create mode 100755 admin/lang/sp_admin.inc.php create mode 100755 admin/newaccount.php create mode 100755 admin/newheadline.php create mode 100755 admin/nntp.php create mode 100755 admin/viewaccount.php create mode 100755 admin/viewheadline.php create mode 100644 calendar/day.php create mode 100755 calendar/delete.php create mode 100755 calendar/edit_entry.php create mode 100755 calendar/edit_entry_handler.php create mode 100644 calendar/inc/footer.inc.php create mode 100755 calendar/inc/functions.inc.php create mode 100644 calendar/inc/header.inc.php create mode 100644 calendar/inc/styles.inc.php create mode 100755 calendar/index.php create mode 100644 calendar/lang/br_calendar.inc.php create mode 100755 calendar/lang/de_calendar.inc.php create mode 100755 calendar/lang/en_calendar.inc.php create mode 100755 calendar/lang/fr_calendar.inc.php create mode 100755 calendar/lang/it_calendar.inc.php create mode 100755 calendar/lang/kr_calendar.inc.php create mode 100755 calendar/lang/nl_calendar.inc.php create mode 100755 calendar/lang/no_calendar.inc.php create mode 100755 calendar/lang/sp_calendar.inc.php create mode 100755 calendar/search.php create mode 100755 calendar/view.php create mode 100755 calendar/week.php create mode 100755 calendar/year.php create mode 100755 doc/CHANGELOG create mode 100755 doc/CREDITS create mode 100644 doc/FAQ.html create mode 100644 doc/FAQ.sgml create mode 100644 doc/FAQ.txt create mode 100644 doc/HOWTO.html create mode 100644 doc/HOWTO.sgml create mode 100644 doc/HOWTO.txt create mode 100755 doc/INSTALL create mode 100755 doc/LICENSE create mode 100755 doc/README create mode 100755 doc/RELEASE-NOTES create mode 100755 doc/SECURITY create mode 100755 doc/create_tables.mysql create mode 100755 doc/create_tables.pgsql create mode 100644 doc/developers/.cvswrappers create mode 100755 doc/developers/CODES create mode 100644 doc/developers/dos2unix.pl create mode 100644 doc/developers/phpGW_Developers-HOWTO-1.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-2.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-3.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-4.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-5.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-6.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-7.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-8.html create mode 100644 doc/developers/phpGW_Developers-HOWTO-9.html create mode 100644 doc/developers/phpGW_Developers-HOWTO.html create mode 100644 doc/developers/phpGW_Developers-HOWTO.sgml create mode 100644 doc/developers/phpGW_Developers-HOWTO.txt create mode 100644 doc/developers/phpgwapi/msg_pop3.txt create mode 100644 doc/developers/phpgwapi/send.txt create mode 100644 doc/update_permission_tables_07122000_to_08032000.php create mode 100644 header.inc.php.sample create mode 100755 index.php create mode 100755 login.php create mode 100755 logout.php create mode 100644 notify.php create mode 100644 phpGroupWare.jpg create mode 100755 preferences/changepassword.php create mode 100644 preferences/changeprofile.php create mode 100755 preferences/changetheme.php create mode 100755 preferences/index.php create mode 100644 preferences/lang/br_preferences.inc.php create mode 100755 preferences/lang/de_preferences.inc.php create mode 100755 preferences/lang/en_preferences.inc.php create mode 100755 preferences/lang/fr_preferences.inc.php create mode 100755 preferences/lang/it_preferences.inc.php create mode 100755 preferences/lang/kr_preferences.inc.php create mode 100755 preferences/lang/nl_preferences.inc.php create mode 100755 preferences/lang/no_preferences.inc.php create mode 100755 preferences/lang/sp_preferences.inc.php create mode 100755 preferences/nntp.php create mode 100755 preferences/settings.php diff --git a/addressbook/add.php b/addressbook/add.php new file mode 100755 index 0000000000..848afedffe --- /dev/null +++ b/addressbook/add.php @@ -0,0 +1,92 @@ + * + * -------------------------------------------- * + * 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$ */ + + if ($submit) { + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "addressbook"; + include("../header.inc.php"); + + if ($add_email) { + list($fields["lastname"],$fields["firstname"]) = explode(" ", $name); + $fields["email"] = $add_email; + form("","add.php","Add",$fields); + } else if (! $submit && ! $add_email) { + form("","add.php","Add","","",""); + } else { + if ($bday_month == "" && $bday_day == "" && $bday_year == "") + $bday = ""; + else + $bday = "$bday_month/$bday_day/$bday_year"; + + $access = $phpgw->groups->array_to_string($access,$n_groups); + + $sql = "insert into addressbook (owner,access,firstname,lastname,email," + . "hphone,wphone,fax,pager,mphone,ophone,street,city,state,zip,bday," + . "notes,company) values ('" . $phpgw->session->loginid . "','$access','" + . addslashes($firstname). "','" + . addslashes($lastname) . "','" + . addslashes($email) . "','" + . addslashes($hphone) . "','" + . addslashes($wphone) . "','" + . addslashes($fax) . "','" + . addslashes($pager) . "','" + . addslashes($mphone) . "','" + . addslashes($ophone) . "','" + . addslashes($street) . "','" + . addslashes($city) . "','" + . addslashes($state) . "','" + . addslashes($zip) . "','" + . addslashes($bday) . "','" + . addslashes($notes) . "','" + . addslashes($company). "')"; + $phpgw->db->query($sql); + + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/", + "cd=14")); + } + +?> + + + + + + +
+ + + + + + + + +
+ + + + + " . lang_common("Cancel"); ?> +
+
+ + + + + + * + * -------------------------------------------- * + * 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$ */ + + if ($confirm) { + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "addressbook"; + include("../header.inc.php"); + + if (! $con) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/")); + } + + if ($confirm != "true") { + $phpgw->db->query("select owner from addressbook where con='$con'"); + $phpgw->db->next_record(); + + if ($phpgw->db->f("owner") != $phpgw->session->loginid) + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/")); + + ?> + +
+
">         + ">
+ db->query("delete from addressbook where owner='" . $phpgw->session->loginid + . "' and con='$con'"); + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/", + "cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query")); + } + + diff --git a/addressbook/edit.php b/addressbook/edit.php new file mode 100755 index 0000000000..0a8c4de7e3 --- /dev/null +++ b/addressbook/edit.php @@ -0,0 +1,115 @@ + * + * -------------------------------------------- * + * 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$ */ + + if ($submit) { + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "addressbook"; + include("../header.inc.php"); + + if (! $con) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/", + "cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query")); + exit; + } + + if (! $submit) { + $phpgw->db->query("SELECT * FROM addressbook WHERE owner='" + . $phpgw->session->loginid . "' AND con='$con'"); + $phpgw->db->next_record(); + + $fields = array( + 'con' => $phpgw->db->f("con"), + 'owner' => $phpgw->db->f("owner"), + 'access' => $phpgw->db->f("access"), + 'firstname' => $phpgw->db->f("firstname"), + 'lastname' => $phpgw->db->f("lastname"), + 'email' => $phpgw->db->f("email"), + 'hphone' => $phpgw->db->f("hphone"), + 'wphone' => $phpgw->db->f("wphone"), + 'fax' => $phpgw->db->f("fax"), + 'pager' => $phpgw->db->f("pager"), + 'mphone' => $phpgw->db->f("mphone"), + 'ophone' => $phpgw->db->f("ophone"), + 'street' => $phpgw->db->f("street"), + 'city' => $phpgw->db->f("city"), + 'state' => $phpgw->db->f("state"), + 'zip' => $phpgw->db->f("zip"), + 'bday' => $phpgw->db->f("bday"), + 'notes' => $phpgw->db->f("notes"), + 'company' => $phpgw->db->f("company") + ); + + form("","edit.php","Edit",$fields); + + } else { + $bday = $bday_month . "/" . $bday_day . "/" . $bday_year; + $access = $phpgw->groups->array_to_string($access,$n_groups); + + $sql = "UPDATE addressbook set email='" . addslashes($email) + . "', firstname='" . addslashes($firstname) + . "', lastname='" . addslashes($lastname) + . "', hphone='" . addslashes($hphone) + . "', wphone='" . addslashes($wphone) + . "', fax='" . addslashes($fax) + . "', pager='" . addslashes($pager) + . "', mphone='" . addslashes($mphone) + . "', ophone='" . addslashes($ophone) + . "', street='" . addslashes($street) + . "', city='" . addslashes($city) + . "', state='" . addslashes($state) + . "', zip='" . addslashes($zip) + . "', bday='" . addslashes($bday) + . "', notes='" . addslashes($notes) + . "', company='" . addslashes($company) + . "', access='" . addslashes($access) + . "' WHERE owner='" . $phpgw->session->loginid . "' AND con='$con'"; + + $phpgw->db->query($sql); + + Header("Location: " . $phpgw->link("view.php","&con=$con&order=$order&sort=$sort&filter=" + . "$filter&start=$start")); + exit; + } + +?> + + + + + + + + + + + + + + +
+ "> + + " . lang_common("Cancel"); ?> + + " . lang_common("Delete"); ?> +
+ + + + + + * + * -------------------------------------------- * + * 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 form($format,$action,$title,$fields) + { + global $phpgw; + + $email = $fields["email"]; + $firstname = $fields["firstname"]; + $lastname = $fields["lastname"]; + $hphone = $fields["hphone"]; + $wphone = $fields["wphone"]; + $fax = $fields["fax"]; + $pager = $fields["pager"]; + $mphone = $fields["mphone"]; + $ophone = $fields["ophone"]; + $street = $fields["street"]; + $city = $fields["city"]; + $state = $fields["state"]; + $zip = $fields["zip"]; + $bday = $fields["bday"]; + $notes = $fields["notes"]; + $access = $fields["access"]; + $company = $fields["company"]; + + if ($format != "view") { + $email = ""; + $firstname = ""; + $lastname = ""; + $hphone = ""; + $wphone = ""; + $fax = ""; + $pager = ""; + $mphone = ""; + $ophone = ""; + $street = ""; + $city = ""; + $state = ""; + $zip = ""; + $company = ""; + + if (strlen($bday) > 2) { + list( $month, $day, $year ) = split( '/', $bday ); + $temp_month[$month] = "SELECTED"; + + $bday ="" + . "" + . "" + . "(e.g. 1969)"; + } else { + $bday ="" + . "" + . "" + . "(e.g. 1969)"; + } + + $notes = ""; + } else { + $notes = "
"; + if ($bday == "//") + $bday = ""; + } + + if ($action) { + echo "
\n" + . $phpgw->session->hidden_var(); + } + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + " . lang_common("Group access") . ":" + . "" + . " + + "; + } + + if ($format == "view") + echo "" + . " + + + + + +
: + + + : + + +
+ : + + + + : + + +
: + + + : + + +
: + + + : + + +
: + + + : + + +
: + + + : + + +
: + + +
: + + +
: + + +
" + . $phpgw->groups->convert_string_to_names($access); + } else { + echo "" . lang_common("access") . ":" + . $access; + } + } else { + ?> + : + + + "; + } + ?> +
" . lang_common("Which groups") + . ":
" . lang_common("Created by") . ":" + . grab_owner_name($fields[owner]); + + ?> +
: + + + + +
+ * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "addressbook"; + + include("../header.inc.php"); + + echo "
" . lang_addressbook("Address book"); + + if (! $start) + $start = 0; + + $limit =$phpgw->nextmatchs->sql_limit($start); + + if ($order) + $ordermethod = "order by $order $sort"; + else + $ordermethod = "order by lastname,firstname,email asc"; + + if ($filter != "private") + $filtermethod = " or access='public' " . $phpgw->groups->sql_search(); + + if ($query) { + $phpgw->db->query("select count(*) from addressbook where ( owner='" + . $phpgw->session->loginid + . "' $filtermethod ) AND (lastname like '%$query%' OR firstname like " + . "'%$query%' OR email like '%$query%' OR street like '%$query%' OR " + . "city like '%$query%' OR state like '%$query%' OR zip like '%$query%'" + . " OR notes like '%$query%' OR company like '%$query%')"); + + $phpgw->db->next_record(); + + if ($phpgw->db->f(0) == 1) + echo "
" . lang_common("your search returned 1 match"); + else + echo "
" . lang_common("your search returned x matchs",$phpgw->db->f(0)); + } else { + $phpgw->db->query("select count(*) from addressbook where owner='" + . $phpgw->session->loginid . "' $filtermethod"); + } + + $phpgw->db->next_record(); + + if ($phpgw->db->f(0) > $phpgw_info["user"]["preferences"]["maxmatchs"]) + echo "
" . lang_common("showing x - x of x",($start + 1), + ($start + $phpgw_info["user"]["preferences"]["maxmatchs"]),$phpgw->db->f(0)); + else + echo "
" . lang_common("showing x",$phpgw->db->f(0)); +?> + +nextmatchs->show("index.php",$start,$phpgw->db->f(0), + "&order=$order&filter=$filter&sort=" + . "$sort&query=$query", "75%", $phpgw_info["theme"][th_bg]); +?> + + + "> + + + + + + + +db->query("SELECT * FROM addressbook WHERE (owner='" . $phpgw->session->loginid + . "' $filtermethod ) AND (lastname like '%$query%' OR " + . "firstname like '%$query%' OR email like '%$query%' OR " + . "street like '%$query%' OR city like '%$query%' OR state " + . "like '%$query%' OR zip like '%$query%' OR notes like " + . "'%$query%') $ordermethod limit $limit"); + } else { + $phpgw->db->query("SELECT * FROM addressbook WHERE owner='" . $phpgw->session->loginid + . "' $filtermethod $ordermethod limit $limit"); + } + + while ($phpgw->db->next_record()) { + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + + $firstname = $phpgw->db->f("firstname"); + $lastname = $phpgw->db->f("lastname"); + $con = $phpgw->db->f("con"); + + /* This for for just showing the company name stored in lastname. */ + if (($lastname) && (! $firstname)) + $t_colspan = " colspan=2"; + else { + $t_colspan = ""; + if ($firstname == "") $firstname = " "; + if ($lastname == "") $lastname = " "; + } + + ?> + > + + + + $firstname + + "; + ?> + + + + +
+ + nextmatchs->show_sort_order($sort,"lastname",$order,"index.php", + lang_common("Last Name")); + ?> + + "> + + nextmatchs->show_sort_order($sort,"firstname",$order,"index.php", + lang_common("First Name")); + ?> + + + + + + + + + +
> + + + + + + "> + + + + db->f("owner"),$phpgw->db->f("con")); ?> + +
+ +
+ session->hidden_var(); ?> + + + + + + + + + + + +
+
+ "> +
+
  
+
+
+ + diff --git a/addressbook/lang/br_addressbook.inc.php b/addressbook/lang/br_addressbook.inc.php new file mode 100644 index 0000000000..0a10cc4e85 --- /dev/null +++ b/addressbook/lang/br_addressbook.inc.php @@ -0,0 +1,29 @@ +* ". $message; + } + return $s; + } diff --git a/addressbook/lang/de_addressbook.inc.php b/addressbook/lang/de_addressbook.inc.php new file mode 100755 index 0000000000..386b7fb5fe --- /dev/null +++ b/addressbook/lang/de_addressbook.inc.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/addressbook/lang/en_addressbook.inc.php b/addressbook/lang/en_addressbook.inc.php new file mode 100755 index 0000000000..9e9688825c --- /dev/null +++ b/addressbook/lang/en_addressbook.inc.php @@ -0,0 +1,30 @@ +* ". $message; + } + return $s; + } diff --git a/addressbook/lang/fr_addressbook.inc.php b/addressbook/lang/fr_addressbook.inc.php new file mode 100755 index 0000000000..3644941f70 --- /dev/null +++ b/addressbook/lang/fr_addressbook.inc.php @@ -0,0 +1,29 @@ +* ". $message; + } + return $s; + } diff --git a/addressbook/lang/nl_addressbook.inc.php b/addressbook/lang/nl_addressbook.inc.php new file mode 100755 index 0000000000..67837e0751 --- /dev/null +++ b/addressbook/lang/nl_addressbook.inc.php @@ -0,0 +1,29 @@ +* ". $message; + } + return $s; + } diff --git a/addressbook/lang/no_addressbook.inc.php b/addressbook/lang/no_addressbook.inc.php new file mode 100755 index 0000000000..bf84ada82f --- /dev/null +++ b/addressbook/lang/no_addressbook.inc.php @@ -0,0 +1,29 @@ +* ". $message; + } + return $s; + } +?> \ No newline at end of file diff --git a/addressbook/view.php b/addressbook/view.php new file mode 100755 index 0000000000..9aa07321d6 --- /dev/null +++ b/addressbook/view.php @@ -0,0 +1,83 @@ + * + * -------------------------------------------- * + * 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$ */ + + if ($submit) { + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "addressbook"; + include("../header.inc.php"); + if (! $con) + Header("Location: " . $phpgw_info["server"]["webserver_url"] . + "/addressbook/?sessionid=" . $phpgw->session->id); + + if ($filter != "private") + $filtermethod = " or access='public' " . $phpgw->groups->sql_search(); + + $phpgw->db->query("SELECT * FROM addressbook WHERE con='$con' AND (owner='" + . $phpgw->session->loginid . "' $filtermethod)"); + $phpgw->db->next_record(); + + $fields = array( + 'con' => $phpgw->db->f("con"), + 'owner' => $phpgw->db->f("owner"), + 'access' => $phpgw->db->f("access"), + 'firstname' => $phpgw->db->f("firstname"), + 'lastname' => $phpgw->db->f("lastname"), + 'email' => $phpgw->db->f("email"), + 'hphone' => $phpgw->db->f("hphone"), + 'wphone' => $phpgw->db->f("wphone"), + 'fax' => $phpgw->db->f("fax"), + 'pager' => $phpgw->db->f("pager"), + 'mphone' => $phpgw->db->f("mphone"), + 'ophone' => $phpgw->db->f("ophone"), + 'street' => $phpgw->db->f("street"), + 'city' => $phpgw->db->f("city"), + 'state' => $phpgw->db->f("state"), + 'zip' => $phpgw->db->f("zip"), + 'bday' => $phpgw->db->f("bday"), + 'company' => $phpgw->db->f("company"), + 'notes' => $phpgw->db->f("notes") + ); + + $owner = $phpgw->db->f("owner"); + $con = $phpgw->db->f("con"); + + form("view","","View",$fields); +?> + + + + + + +
+ + + + + + + +
+ + + ">Done +
+
+ + +
+ + + + + "> + + + + + + + db->query("select loginid,ip,li,lo from access_log order by li desc " + . "limit $show_maxlog"); + while ($phpgw->db->next_record()) { + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + + // In case there was a problem creating there session. eg, bad login time + // I still want it to be printed here. This will alert the admin there + // is a problem. + if ($phpgw->db->f("li") && $phpgw->db->f("lo")) { + $total = $phpgw->db->f("lo") - $phpgw->db->f("li"); + if ($total > 86400 && $total > 172800) + $total = gmdate("z \d\a\y\s - G:i:s",$total); + else if ($total > 172800) + $total = gmdate("z \d\a\y - G:i:s",$total); + else + $total = gmdate("G:i:s",$total); + } else + $total = " "; + + if ($phpgw->db->f("li")) + $li = $phpgw->preferences->show_date($phpgw->db->f("li")); + else + $li = " "; + + if ($phpgw->db->f("lo")) + $lo = $phpgw->preferences->show_date($phpgw->db->f("lo")); + else + $lo = " "; + + echo ""; + } + + $phpgw->db->query("select count(*) from access_log"); + $phpgw->db->next_record(); + $total = $phpgw->db->f(0); + + $phpgw->db->query("select count(*) from access_log where lo!='0'"); + $phpgw->db->next_record(); + $loggedout = $phpgw->db->f(0); + + $percent = round((10000 * ($loggedout / $total)) / 100); + + echo ""; + + echo "
" align="center" colspan="5"> + +
" . $phpgw->db->f("loginid") . "" + . $phpgw->db->f("ip") . "$li$lo$total
" + . lang_admin("Total records") . ": $total
" + . lang_admin("Percent of users that logged out") . ": $percent%
"; + + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); + diff --git a/admin/accounts.php b/admin/accounts.php new file mode 100755 index 0000000000..1028550538 --- /dev/null +++ b/admin/accounts.php @@ -0,0 +1,50 @@ +
" . lang_admin("user accounts") . "
" + . "\n"; + + $phpgw->db->query("select con,firstname,lastname,loginid from accounts order by " + . "lastname, firstname"); + + while ($phpgw->db->next_record()) { + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + + $lastname = $phpgw->db->f("lastname"); + $firstname = $phpgw->db->f("firstname"); + + if (! $lastname) $lastname = ' '; + if (! $firstname) $firstname = ' '; + + echo "" + . ""; + + if ($phpgw->session->loginid != $phpgw->db->f("loginid")) + echo ""; + else + echo ""; + echo "\n"; + } + echo "\n" + . $phpgw->session->hidden_var() + . "
" . lang_common("Last name") . "" + . lang_common("First name") . " " . lang_common("Edit") . " " + . lang_common("Delete") . " " . lang_common("View") . "
$lastname$firstnamelink("editaccount.php", + "con=" . $phpgw->db->f("con")) . "\"> " . lang_common("Edit") . " link("deleteaccount.php", + "con=" . $phpgw->db->f("con")) . "\"> " . lang_common("Delete") . "  link("viewaccount.php", + "con=" . $phpgw->db->f("con")) . "\"> " . lang_common("View") . "
"; + + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); diff --git a/admin/creategroup.php b/admin/creategroup.php new file mode 100755 index 0000000000..dcd7b508e0 --- /dev/null +++ b/admin/creategroup.php @@ -0,0 +1,72 @@ + True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + if (! $submit) { + ?> +
+ session->hidden_var(); ?> +
+

  +
  + \n"; + + $phpgw->db->query("SELECT con, firstname, lastname FROM accounts ORDER BY lastname asc"); + while ($phpgw->db->next_record()) { + echo ""; + } + echo "\n"; + ?> +
"> +

+
+ db->lock(array("accounts","groups")); + + $phpgw->db->query("INSERT INTO groups (group_name) VALUES ('$n_group') "); + $phpgw->db->query("SELECT group_id FROM groups WHERE group_name='$n_group'"); + $groups_con = $phpgw->db->f("group_id"); + + for($i=0; $idb->query("SELECT groups FROM accounts WHERE con=".$n_users[$i]); + $user_groups = $phpgw->db->f("groups") . ",$group_con,"; + $user_groups = ereg_replace(",,",",",$user_groups); + $phpgw->db->query("UPDATE accounts SET groups='$user_groups' WHERE con=".$n_users[$i]); + } + + $basedir = $phpgw_info["server"]["server_root"] + . $phpgw_info["server"]["dir_separator"] + . "filemanager" + . $phpgw_info["server"]["dir_separator"] + . "groups" + . $phpgw_info["server"]["dir_separator"]; + + $cd = 31; + + if (!mkdir ($basedir . $n_group, 0707)) $cd = 37; + + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link("groups.php","cd=$cd")); + } diff --git a/admin/currentusers.php b/admin/currentusers.php new file mode 100755 index 0000000000..8bbb9706d7 --- /dev/null +++ b/admin/currentusers.php @@ -0,0 +1,82 @@ +nextmatchs->sql_limit($start); + $phpgw->db->query("select count(*) from sessions"); + $phpgw->db->next_record(); + + $total = $phpgw->db->f(0); + $limit = $phpgw->nextmatchs->sql_limit($start); +?> +
+: + +"> + nextmatchs->left("currentusers.php",$start,$total); + ?> + + nextmatchs->right("currentusers.php",$start,$total); + ?> + + + "> + + + + + + + +db->query("select * from sessions $ordermethod limit $limit"); + + while ($phpgw->db->next_record()) { + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + + ?> + + + + + + + + + +
 
nextmatchs->show_sort_order($sort,"loginid",$order,"currentusers.php", + lang_admin("LoginID")); ?>nextmatchs->show_sort_order($sort,"ip",$order,"currentusers.php", + lang_admin("IP")); ?>nextmatchs->show_sort_order($sort,"logintime",$order,"currentusers.php", + lang_admin("Login Time"));?>nextmatchs->show_sort_order($sort,"dla",$order,"currentusers.php", + lang_admin("idle")); ?>
db->f("loginid"); ?>db->f("ip"); ?>preferences->show_date($phpgw->db->f("logintime")); ?>db->f("dla")) ); ?>db->f("sessionid") != $phpgw->session->id) { + echo "link("killsession.php","ksession=" + . $phpgw->db->f("sessionid") . "&kill=true\">" + . lang_admin("Kill")); + } else { + echo " "; + } + ?>
+ + diff --git a/admin/deleteaccount.php b/admin/deleteaccount.php new file mode 100755 index 0000000000..46d09e0f8e --- /dev/null +++ b/admin/deleteaccount.php @@ -0,0 +1,102 @@ + True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + // Make sure they are not attempting to delete there own account. + // If they are, they should not reach this point anyway. + if ($phpgw->session->con == $con) { + Header("Location: " . $phpgw->link("accounts.php")); + exit; + } + + if (($con) && (! $confirm)) { + ?> +
+ + + + + + + + + + +
+ + +
+ +
+ " . lang_common("No"); ?> + + " . lang_common("Yes"); ?> +
+
+ db->query("select loginid from accounts where con='$con'"); + $phpgw->db->next_record(); + $lid = $phpgw->db->f(0); + + $phpgw->db->query("select cal_id from webcal_entry where cal_create_by='$lid'"); + while ($phpgw->db->next_record()) { + $cal_id[$i] = $phpgw->db->f("cal_id"); + echo "
" . $phpgw->db->f("cal_id"); + $i++; + } + + $table_locks = array('preferences','todo','addressbook','accounts','users_headlines', + 'webcal_entry','webcal_entry_user','webcal_entry_repeats', + 'webcal_entry_groups'); + $phpgw->db->lock($table_locks); + + for ($i=0; $idb->query("delete from webcal_entry_repeats where cal_id='$cal_id[$i]'"); + $phpgw->db->query("delete from webcal_entry_groups where cal_id='$cal_id[$i]'"); + } + + $phpgw->db->query("delete from webcal_entry where cal_create_by='$lid'"); + $phpgw->db->query("delete from webcal_entry_user where cal_login='$lid'"); + + $phpgw->db->query("delete from preferences where owner='$lid'"); + $phpgw->db->query("delete from todo where owner='$lid'"); + $phpgw->db->query("delete from addressbook where owner='$lid'"); + $phpgw->db->query("delete from accounts where loginid='$lid'"); + $phpgw->db->query("delete from users_headlines where owner='$lid'"); + $phpgw->db->query("delete from profiles where owner='$lid'"); + + $phpgw->db->unlock(); + + $sep = $phpgw->common->filesystem_sepeartor(); + + $basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep . "users" + . $sep; + + if (! @rmdir($basedir . $lid)) { + $cd = 34; + } else { + $cd = 29; + } + + Header("Location: " . $phpgw->link("accounts.php","cd=$cd")); + } +?> diff --git a/admin/deletegroup.php b/admin/deletegroup.php new file mode 100755 index 0000000000..97ce897b41 --- /dev/null +++ b/admin/deletegroup.php @@ -0,0 +1,86 @@ + True, "nonavbar" => True); + } + + if (! $group_id) + Header("Location: " . $phpgw->link("groups.php")); + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + // I would like to have an option to auto remove users from the group + if (($group_id) && (! $confirm)) { + $phpgw->db->query("select group_name from groups where group_id='$group_id'"); + $phpgw->db->next_record(); + + $group_name = $phpgw->db->f("group_name"); + + $phpgw->db->query("select con,loginid from accounts where groups like '%$group_id%'"); + if ($phpgw->db->num_rows()) { + echo '

'; + echo lang_admin("Sorry, the follow users are still a member of the group x",$group_name) + . '
' . lang_admin("They must be removed before you can continue") + . ''; + + echo ''; + } + echo "
'; + + while ($phpgw->db->next_record()) { + echo '
' . $phpgw->db->f("loginid") . '
"; + exit; + } + + ?> +
+ + + + + + + +
+ + +
+ " . lang_common("No") . ""; ?> + + " . lang_common("Yes") . ""; ?> +
+
+ db->query("select group_name from groups where group_id='$group_id'"); + $phpgw->db->next_record(); + $group_name = $phpgw->db->f("group_name"); + + $phpgw->db->query("delete from groups where group_id='$group_id'"); + + $sep = $phpgw->common->filesystem_sepeartor(); + + $basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep . "users" + . $sep; + + if (! @rmdir($basedir . $group_name)) { + $cd = 38; + } else { + $cd = 32; + } + + Header("Location: " . $phpgw->link("groups.php","cd=$cd")); + } diff --git a/admin/deleteheadline.php b/admin/deleteheadline.php new file mode 100755 index 0000000000..52c0881f34 --- /dev/null +++ b/admin/deleteheadline.php @@ -0,0 +1,64 @@ + True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + + function remove_account_data($query,$t) + { + global $phpgw->db; + $phpgw->db->query("delete from $t where $query"); + } + + if (($con) && (! $confirm)) { +?> +
+ + + + + + + + + + +
+ + +
+ +
+ " . lang_common("No"); ?> + + " . lang_common("Yes"); ?> +
+
+db->lock($table_locks); + + remove_account_data("con=$con","news_site"); + remove_account_data("site=$con","news_headlines"); + remove_account_data("site=$con","users_headlines"); + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link("headlines.php","cd=29")); + } diff --git a/admin/editaccount.php b/admin/editaccount.php new file mode 100755 index 0000000000..852f41a25d --- /dev/null +++ b/admin/editaccount.php @@ -0,0 +1,232 @@ + True, "nonavbar" => True); + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + if (! $con) + Header("Location: " . $phpgw->link("accounts.php")); + + function change_owner($app,$table,$field,$new,$old) + { + global $phpgw, $phpgw_info; + + if ($phpgw_info["apps"][$app]["enabled"] || ! $app) { + $phpgw->db->query("update $table set $field='$new' where $field='$old'"); + } + } + + if ($submit) { + $phpgw->db->query("select loginid from accounts where con='$con'"); + $phpgw->db->next_record(); + $lid = $phpgw->db->f("loginid"); + + $phpgw->db->lock(array('accounts','preferences','sessions')); + + if ($n_passwd || $n_passwd_2) { + if ($n_passwd != $n_passwd_2) + $error .= lang_admin("The two passwords are not the same"); + + if (! $n_passwd) + $error .= lang_admin("You must enter a password"); + } + + if ($lid != $n_loginid) { + $phpgw->db->query("select loginid from accounts where loginid='$n_loginid'"); + if ($phpgw->db->num_rows() != 0) { + $error .= "
" . lang_admin("That loginid has already been taken"); + } + } + + if (! $error) { + if ($n_passwd) { + $phpgw->db->query("update accounts set passwd='" . md5($n_passwd) . "', " + . "lastpasswd_change='" . time() . "' where loginid='" + . "$lid'"); + + $phpgw->db->query("update sessions set passwd='" . addslashes($n_passwd) + . "' where loginid='$lid'"); + } + + while ($permission = each($new_permissions)) { + if ($phpgw_info["apps"][$permission[0]]["enabled"]) { + $phpgw->permissions->add($permission[0]); + } + } + $phpgw->permissions->add("hr"); + + if ($new_permissions["anonymous"] && ! $new_permissions["admin"]) + $phpgw->permissions->add("anonymous"); + + if (! $n_account_status) + $n_account_status = "L"; + + $cd = 27; + + // If they changed there loginid, we need to change the owner in ALL + // tables to reflect on the new one + if ($lid != $n_loginid) { + change_owner("","preferences","owner",$n_loginid,$lid); + change_owner("addressbook","addressbook","owner",$n_loginid,$lid); + change_owner("todo","todo","owner",$n_loginid,$lid); + change_owner("","accounts","loginid",$n_loginid,$lid); + change_owner("","sessions","loginid",$n_loginid,$lid); + change_owner("calendar","webcal_entry","cal_create_by",$n_loginid,$lid); + change_owner("calendar","webcal_entry_user","cal_login",$n_loginid,$lid); + + $sep = $phpgw->common->filesystem_sepeartor(); + + $basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep + . "users" . $sep; + + if (! rename($basedir . $lid, $basedir . $n_loginid)) { + $cd = 35; + } + } + + $phpgw->db->query("update accounts set firstname='" . addslashes($n_firstname) . "'," + . " lastname='" . addslashes($n_lastname) . "', permissions='" + . $phpgw->permissions->add_rebuild() . "', status='" + . "$n_account_status', groups='" + . $phpgw->groups->array_to_string("none",$n_groups) + . "' where loginid='$n_loginid'"); + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link("accounts.php", "cd=$cd")); + exit; + } // if ! $error + } // if $submit + + $phpgw->common->header(); + $phpgw->common->navbar(); + + $phpgw->db->query("select * from accounts where con='$con'"); + $phpgw->db->next_record(); + + $account_status = $phpgw->db->f("status"); + $db_perms = $phpgw->permissions->read_other($phpgw->db->f("loginid")); + ?> + +
+ session->hidden_var(); ?> + + " . lang_common("Error") . ":$error
"; + } + ?> +
+ + + + + + + + + + + + + + + + + ' + . '"; + + $i++; + + if (! $perm_display[$i][1]) break; + + echo '' + . '"; + + $i++; + } + + echo ""; + + echo ""; + + ?> + + + + + + + + + + + + + + + + +
">
">
">
+
' . lang_common($perm_display[$i][1]) . '' . lang_common($perm_display[$i][1]) . '
" . lang_admin("Anonymous user") . "" . lang_admin("Manager") . "
>
">
+
+ + True, "nonavbar" => True); + } + + if (! $group_id) + Header("Location: " . $phpgw->link("groups.php")); + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + if (! $submit) { + $phpgw->db->query("select group_name from groups where group_id='$group_id'"); + $phpgw->db->next_record(); + ?> +
+ + session->hidden_var(); ?> + +
+

"> +
"> +

+
+ db->query("select group_name from groups where group_id='$group_id'"); + $phpgw->db->next_record(); + + $group_name = $phpgw->db->f("group_name"); + + $phpgw->db->query("update groups set group_name='" . addslashes($n_group) + . "' where group_id='$group_id'"); + + $sep = $phpgw->common->filesystem_sepeartor(); + + $basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep . "groups" + . $sep; + + if (! rename($basedir . $group_name,$basedir . $n_group)) { + $cd = 39; + } else { + $cd = 33; + } + + Header("Location: " . $phpgw->link("groups.php","cd=$cd")); + } + diff --git a/admin/editheadline.php b/admin/editheadline.php new file mode 100755 index 0000000000..0057d361d3 --- /dev/null +++ b/admin/editheadline.php @@ -0,0 +1,93 @@ + True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + if (! $con) + Header("Location: " . $phpgw->link("headlines.php")); + + if ((! $submit) && ($con)) { + + $phpgw->db->query("select * from news_site where con=$con"); + $phpgw->db->next_record(); + + ?> + +
+ session->hidden_var(); ?> + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
">
">
">
">
">
+db->f("newstype") == $news_type[$i]) echo " checked"; + echo "> $news_type[$i]
"; + } +?> +
">
+
+
+ db->lock("news_site"); + + $phpgw->db->query("UPDATE news_site SET display='" . addslashes($n_display) . "', " + . "base_url='" . addslashes($n_base_url) . "', " + . "newsfile='" . addslashes($n_newsfile) . "', " + . "lastread=0, newstype='" . $n_newstype . "', " + . "cachetime=$n_cachetime, listings=$n_listings " + . "WHERE con=$o_con"); + + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] + . "/admin/headlines.php", "cd=27")); + } +?> diff --git a/admin/groups.php b/admin/groups.php new file mode 100755 index 0000000000..5c60974d47 --- /dev/null +++ b/admin/groups.php @@ -0,0 +1,41 @@ +
" . lang_admin("User groups") . "
" + . "" + . ""; + + $phpgw->db->query("select * from groups order by group_name"); + while ($phpgw->db->next_record()) { + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + + $group_name = $phpgw->db->f("group_name"); + + if (! $group_name) $group_name = ' '; + + echo "" + . "" . ""; + } + echo "" + . $phpgw->session->hidden_var() + . "" + . "
" . lang_common("Name") . " " . lang_common("Edit") . " " . lang_common("Delete") + . "
$group_namelink("editgroup.php","group_id=" . $phpgw->db->f("group_id")) + . "\"> " . lang_common("Edit") . " link("deletegroup.php","group_id=" . $phpgw->db->f("group_id")) + . "\"> " . lang_common("Delete") . "
"; + + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); +?> diff --git a/admin/headlines.php b/admin/headlines.php new file mode 100755 index 0000000000..73442a429a --- /dev/null +++ b/admin/headlines.php @@ -0,0 +1,47 @@ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + echo "

" . lang_admin("Headline Sites") . "
" + . "" + . ""; + $phpgw->db->query("select con,display from news_site order by " + . "display"); + + while ($phpgw->db->next_record()) { + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + + $display = $phpgw->db->f("display"); + + if (! $display) + $display = ' '; + + echo "" + . ""; + + echo ""; + echo "\n"; + } + echo "" + . $phpgw->session->hidden_var() + . "
" . lang_admin("Site") . " " . lang_common("Edit") . " " . lang_common("Delete") . " " + . lang_common("View") . "
$displaylink("editheadline.php", + "con=".$phpgw->db->f("con"))."\"> ".lang_common("Edit")." link("deleteheadline.php", + "con=".$phpgw->db->f("con"))."\"> ".lang_common("Delete")." link("viewheadline.php", + "con=".$phpgw->db->f("con"))."\"> ".lang_common("View")."
"; + + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); +?> diff --git a/admin/index.php b/admin/index.php new file mode 100755 index 0000000000..cdf11fb65a --- /dev/null +++ b/admin/index.php @@ -0,0 +1,41 @@ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "admin"; + + include("../header.inc.php"); + check_code($cd); +?> + +

+
" . lang_admin("User accounts"); ?> +
" . lang_admin("User groups"); ?> +

" . lang_admin("View sessions"); ?> +
" . lang_admin("View Access Log"); ?> +

" . lang_admin("Headline Sites"); ?> +

" . lang_admin("Network News"); ?> + 0 ) { + echo "

link($PHP_SELF, "SHOW_INFO=0")."\">Hide PHP Information"; + echo "


\n"; + phpinfo(); + echo "
\n"; +} +else { + echo "

link($PHP_SELF, "SHOW_INFO=1")."\">PHP Information"; +} +?> + diff --git a/admin/killsession.php b/admin/killsession.php new file mode 100755 index 0000000000..b6f6dde0bb --- /dev/null +++ b/admin/killsession.php @@ -0,0 +1,51 @@ + True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + if ($ksessionid == $phpgw->session->id) { + Header("Location: " . $phpgw->link("currentusers.php")); + exit; + } + + if ($confirm) { + $phpgw->db->query("delete from sessions where sessionid='$ksession'"); + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/admin/currentusers.php", + "cd=19")); + } else { + ?> +

+ + + + + + + +
+ + +
+ " . lang_common("No"); ?> + + " . lang_common("Yes"); ?> +
+
+ diff --git a/admin/lang/de_admin.inc.php b/admin/lang/de_admin.inc.php new file mode 100755 index 0000000000..f6d36e5542 --- /dev/null +++ b/admin/lang/de_admin.inc.php @@ -0,0 +1,98 @@ + \ No newline at end of file diff --git a/admin/lang/en_admin.inc.php b/admin/lang/en_admin.inc.php new file mode 100755 index 0000000000..16d0e32372 --- /dev/null +++ b/admin/lang/en_admin.inc.php @@ -0,0 +1,107 @@ +* ". $message; + } + return $s; + } +?> diff --git a/admin/lang/fr_admin.inc.php b/admin/lang/fr_admin.inc.php new file mode 100755 index 0000000000..cf77bf43e0 --- /dev/null +++ b/admin/lang/fr_admin.inc.php @@ -0,0 +1,94 @@ + \ No newline at end of file diff --git a/admin/lang/it_admin.inc.php b/admin/lang/it_admin.inc.php new file mode 100755 index 0000000000..34fd33360a --- /dev/null +++ b/admin/lang/it_admin.inc.php @@ -0,0 +1,100 @@ + \ No newline at end of file diff --git a/admin/lang/kr_admin.inc.php b/admin/lang/kr_admin.inc.php new file mode 100755 index 0000000000..694c5ea49b --- /dev/null +++ b/admin/lang/kr_admin.inc.php @@ -0,0 +1,102 @@ +* ". $message; + } + return $s; + } +?> diff --git a/admin/lang/nl_admin.inc.php b/admin/lang/nl_admin.inc.php new file mode 100755 index 0000000000..21c8788b1c --- /dev/null +++ b/admin/lang/nl_admin.inc.php @@ -0,0 +1,102 @@ +* ". $message; + } + return $s; + } +?> diff --git a/admin/lang/no_admin.inc.php b/admin/lang/no_admin.inc.php new file mode 100755 index 0000000000..2d5982ac3c --- /dev/null +++ b/admin/lang/no_admin.inc.php @@ -0,0 +1,94 @@ + \ No newline at end of file diff --git a/admin/lang/sp_admin.inc.php b/admin/lang/sp_admin.inc.php new file mode 100755 index 0000000000..fe27124c91 --- /dev/null +++ b/admin/lang/sp_admin.inc.php @@ -0,0 +1,101 @@ +* ". $message; + } + return $s; + } +?> \ No newline at end of file diff --git a/admin/newaccount.php b/admin/newaccount.php new file mode 100755 index 0000000000..4c97faad7e --- /dev/null +++ b/admin/newaccount.php @@ -0,0 +1,187 @@ + True, "nonavbar" => True); + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + if ($submit) { + if (! $n_loginid) + $error = "
" . lang_admin("You must enter a loginid"); + + if (! $n_passwd) + $error .= "
" . lang_admin("You must enter a password"); + + if ($n_passwd == $n_loginid) + $error = "
" . lang_admin("The login and password can not be the same"); + + if ($n_passwd != $n_passwd_2) + $error .= "
" . lang_admin("The two passwords are not the same"); + + $phpgw->db->query("select loginid from accounts where loginid='$n_loginid'"); + $phpgw->db->next_record(); + if ($phpgw->db->f("loginid")) + $error .= "
" . lang_admin("That loginid has already been taken"); + + if (! $error) { + $phpgw->db->lock(array("accounts","preferences")); + + $phpgw->preferences->add_with_value($n_loginid,"maxmatchs","15"); + $phpgw->preferences->add_with_value($n_loginid,"theme","default"); + $phpgw->preferences->add_with_value($n_loginid,"tz_offset","0"); + $phpgw->preferences->add_with_value($n_loginid,"dateformat","m/d/Y"); + $phpgw->preferences->add_with_value($n_loginid,"timeformat","12"); + $phpgw->preferences->add_with_value($n_loginid,"lang","en"); + + // Even if they don't have access to the calendar, we will add these. + // Its better then the calendar being all messed up, they will be deleted + // the next time the update there preferences. + $phpgw->preferences->add_with_value($n_loginid,"weekstarts","Monday"); + $phpgw->preferences->add_with_value($n_loginid,"workdaystarts","9"); + $phpgw->preferences->add_with_value($n_loginid,"workdayends","17"); + + while ($permission = each($new_permissions)) { + if ($phpgw_info["apps"][$permission[0]]["enabled"]) { + $phpgw->permissions->add($permission[0]); + } + } + $phpgw->permissions->add("hr"); + + if ($n_anonymous && ! $n_admin) + $phpgwpermissions->add("anonymous"); + + $sql = "insert into accounts (loginid,passwd,firstname,lastname," + . "permissions,groups,status) values ('$n_loginid'" + . ",'" . md5($n_passwd) . "','" . addslashes($n_firstname) . "','" + . addslashes($n_lastname) . "','" . $phpgw->permissions->add_rebuild() + . "','" . $phpgw->groups->array_to_string("none",$n_groups) . "','A')"; + + $phpgw->db->query($sql); + $phpgw->db->unlock(); + + $sep = $phpgw->common->filesystem_sepeartor(); + + $basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep + . "users" . $sep; + + if (!mkdir($basedir . $n_loginid, 0707)) { + $cd = 36; + } else { + $cd = 28; + } + + Header("Location: " . $phpgw->link("accounts.php","cd=$cd")); + exit; + } + } + + $phpgw->common->header(); + $phpgw->common->navbar(); + ?> +
+ session->hidden_var(); ?> + " . lang_common("Error") . ":$error
"; + } + ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + ' + . '"; + + $i++; + + if (! $perm_display[$i][1]) break; + + echo '' + . '"; + + $i++; + } + + // Just until we can get thing the $phpgw_info["apps"] then figured out + echo ""; + + echo ""; + + ?> + + + +
' . lang_common($perm_display[$i][1]) . '' . lang_common($perm_display[$i][1]) . '
" . lang_admin("Anonymous user") . " " . lang_admin("Manager") . "
+ "> +
+
+ + True, "nonavbar" => True); + } + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + if (! $submit) { + ?> +
+ session->hidden_var(); ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ $news_type[$i]
"; + } +?> +
+ "> +
+
+
+ " . lang_admin("You must enter a display"); + + if (! $n_base_url) + $error = "
" . lang_admin("You must enter a base url"); + + if (! $n_newsfile) + $error = "
" . lang_admin("You must enter a news url"); + + if (! $n_cachetime) + $error = "
" . lang_admin("You must enter the number of minutes between reload"); + + if (! $n_listings) + $error = "
" . lang_admin("You must enter the number of listings display"); + + if (! $n_newstype) + $error = "
" . lang_admin("You must select a file type"); + + if ($error) + exit; + + $phpgw->db->query("select display from news_site where base_url='" + . addslashes(strtolower($n_base_url)) . "' and newsfile='" + . addslashes(strtolower($n_newsfile)) . "'"); + $phpgw->db->next_record(); + if ($phpgw->db->f("display")) { + navigation_bar(); + echo "
" . lang_admin("That site has already been entered") . "
"; + exit; + } + + $phpgw->db->lock("news_site"); + + $sql = "insert into news_site (display,base_url,newsfile," + . "lastread,newstype,cachetime,listings) " + . "values ('" . addslashes($n_display) . "','" + . addslashes(strtolower($n_base_url)) . "','" + . addslashes(strtolower($n_newsfile)) . "',0,'" + . $n_newstype . "',$n_cachetime,$n_listings)"; + + $phpgw->db->query($sql); + + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link($directorys["webserver_url"] + . "/admin/headlines.php", "cd=28")); + } +?> diff --git a/admin/nntp.php b/admin/nntp.php new file mode 100755 index 0000000000..cbb792bf5a --- /dev/null +++ b/admin/nntp.php @@ -0,0 +1,151 @@ + * + * -------------------------------------------- * + * 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$ */ + + if ($submit && $nntplist) { + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "admin"; + include("../header.inc.php"); + + $phpgw->include_lang("nntp"); + + function get_tg() + { + global $phpgw; + + $phpgw->db->query("SELECT count(con) FROM newsgroups"); + $phpgw->db->next_record(); + return $phpgw->db->f(0); + } + + if(!$submit && !$nntplist) { + + $t = new Template($phpgw_info["server"]["template_dir"]); + + $t->set_file(array( "nntp_header" => "nntp.tpl", + "nntp_list" => "nntp.tpl", + "nntp_footer" => "nntp.tpl" )); + + $t->set_block("nntp_header","nntp_list","nntp_footer","output"); + + if (! $tg) + { + $tg = get_tg(); + } + + if ($tg == 0) + { + set_time_limit(0); + include($phpgw_info["server"]["include_root"]."/nntp/nntp.inc.php"); + $nntp = new NNTP; + $nntp->load_table(); + $tg = get_tg(); + } + + if (! $start) $start = 0; + + $urlname = $phpgw_info["server"]["webserver_url"]."/admin/nntp.php"; + + $common_hidden_vars = $phpgw->session->hidden_var() . "\n" + . "\n" + . "\n" + . "\n"; + + $t->set_var("nml",$phpgw->nextmatchs->left($urlname,$start,$tg, + "&tg=$tg&sort=$sort&order=$order")); + $t->set_var("nmr",$phpgw->nextmatchs->right($urlname,$start,$tg, + "&tg=$tg&sort=$sort&order=$order")); + $t->set_var("title",lang_nntp("Newsgroups")); + $t->set_var("action_url",$phpgw->link($urlname)); + $t->set_var("common_hidden_vars",$common_hidden_vars); + $t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); + $t->set_var("th_font",$phpgw_info["theme"]["font"]); + $t->set_var("sort_con",$phpgw->nextmatchs->show_sort_order($sort,"1",$order,$urlname," # ","&tg=$tg")); + $t->set_var("sort_group",$phpgw->nextmatchs->show_sort_order($sort,"2",$order,$urlname,"Group","&tg=$tg")); + $t->set_var("sort_active",$phpgw->nextmatchs->show_sort_order($sort,"3",$order,$urlname," Active ","&tg=$tg")); + + $t->parse("out","nntp_header"); + + if ($phpgw_info["user"]["preferences"]["maxmatchs"] <= $tg - $start) + $totaltodisplay = $phpgw_info["user"]["preferences"]["maxmatchs"]; + else + $totaltodisplay = ($tg - $start); + + $orderby = ""; + if ($order) + { + switch ($order) + { + case 1: + $orderby = " ORDER BY CON $sort"; + break; + case 2: + $orderby = " ORDER BY NAME $sort"; + break; + case 3: + $orderby = " ORDER BY ACTIVE $sort"; + break; + } + } + + $phpgw->db->query("SELECT con, name, active FROM newsgroups$orderby LIMIT " + .$phpgw->nextmatchs->sql_limit($start,$totaltodisplay)); + + for ($i=0;$i<$totaltodisplay;$i++) + { + $phpgw->db->next_record(); + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + $t->set_var("tr_color",$tr_color); + $con = $phpgw->db->f("con"); + $t->set_var("con",$con); + + $name = $phpgw->db->f("name"); + if (! $name) $name = " "; + $group_name = "link( + $phpgw_info["server"]["webserver_url"] + ."/admin/editnntp.php","con=$con") + . "\">$name"; + $t->set_var("group",$group_name); + + $active = $phpgw->db->f("active"); + if ($active == "Y") $checked = " checked"; else $checked = ""; + $active_var = ""; + $t->set_var("active",$active_var); + + if ($i+1 <> $totaltodisplay) + $t->parse("output","nntp_list",True); + } + $t->set_var("lang_update",lang_nntp("update")); + $t->set_var("checkmark",$phpgw_info["server"]["webserver_url"]."/email/images/check.gif"); + + $t->pparse("out","nntp_footer"); + + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); + + } else { + $phpgw->db->lock("newsgroups"); + + $phpgw->db->query("UPDATE newsgroups SET active='N' WHERE con>=$start AND con<=$stop"); + + for ($i=0;$idb->query("UPDATE newsgroups SET active='Y' WHERE con=".$nntplist[$i]); + } + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link($urlname,"start=$start&tg=$tg")); + } +?> diff --git a/admin/viewaccount.php b/admin/viewaccount.php new file mode 100755 index 0000000000..bc6a7bcce6 --- /dev/null +++ b/admin/viewaccount.php @@ -0,0 +1,101 @@ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "admin"; + + include("../header.inc.php"); + if (! $con) + Header("Location: accounts.php?sessionid=" . $phpgw->session->id); + + $phpgw->db->query("select * from accounts where con='$con'"); + $phpgw->db->next_record(); + + $db_perms = $phpgw->permissions->read_other($phpgw->db->f("loginid")); + + ?> +
+

+ + "> + + + + "> + + + + + "> + + + + + "> + + + + + "> + + " . implode(", ", $perm_display) . ""; + + echo " + "> + + + + "> + + "> + + + +
 
db->f("loginid"); ?>
db->f("firstname"); ?>
db->f("lastname"); ?>
" + . lang_admin("account active") . " "; + if ($phpgw->db->f("status") == "A") + echo lang_common("yes"); + else + echo "" . lang_common("no") . ""; + + ?>
Groups: groups->read_names($phpgw->db->f("loginid")); + + for ($i=0;$i 
Last login db->f("lastlogin")) + echo "Never"; + else + echo $phpgw->preferences->show_date($phpgw->db->f("lastlogin")); + + ?>
Last login fromdb->f("lastloginfrom"); ?> 
+

+ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "admin"; + + include("../header.inc.php"); + if (! $con) + Header("Location: ".$phpgw->link("headlines.php")); + + $phpgw->db->query("select * from news_site where con=$con"); + $phpgw->db->next_record(); + + ?> +
+ + + + + + + + +db->query("select title,link from news_headlines where site=$con"); + + if ($phpgw->db->num_rows() <> 0) { + echo ""; + while($phpgw->db->next_record()) { +?> + + +
db->f("display"); ?>
db->f("base_url"); ?>
db->f("newsfile"); ?>
preferences->show_date($phpgw->db->f("lastread")); ?>
db->f("cachetime"); ?>
db->f("listings"); ?>
db->f("newstype"); ?>






" target="_new">db->f("title") ?>
+
+ + diff --git a/calendar/day.php b/calendar/day.php new file mode 100644 index 0000000000..3e13cbc4fa --- /dev/null +++ b/calendar/day.php @@ -0,0 +1,183 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + if ($friendly) + $phpgw_flags["noheader"] = True; + + $phpgw_flags["currentapp"] = "calendar"; + include("../header.inc.php"); + + $view = "day"; + + if (strlen($date) > 0) { + $thisyear = substr($date,0,4); + $thismonth = substr($date,4,2); + $thisday = substr($date,6,2); + } else { + if ($month == 0) { + $thismonth = date("m"); + } else { + $thismonth = $month; + } + + if ($year == 0) { + $thisyear = date("Y"); + } else { + $thisyear = $year; + } + + if ($day == 0) { + $thisday = date("d"); + } else { + $thisday = $day; + } + } + + $now = mktime (2, 0, 0, $thismonth, $thisday, $thisyear); + + $next = mktime(2, 0, 0, $thismonth, $thisday + 1, $thisyear); + $nextyear = date("Y", $next); + $nextmonth = date("m", $next); + $nextday = date("d", $next); + $month_ago = date("Ymd", mktime(2, 0, 0,$thismonth - 1,$thisday,$thisyear)); + + $prev = mktime(2, 0, 0, $thismonth, $day - 1, $thisyear); + $prevyear = date("Y", $prev); + $prevmonth = date("m", $prev); + $prevday = date("d", $prev); + $month_ahead = date("Ymd", mktime(2,0,0,$thismonth + 1,$thisday,$thisyear)); + + /* Pre-Load the repeated events for quckier access */ + $repeated_events = read_repeated_events(); + +?> + + +
+ + + + +
+ + + + + +
+session->firstname) || strlen($phpgw->session->lastname)) { + if (strlen($phpgw->session->firstname)) + echo $phpgw->session->firstname . " "; + if (strlen($phpgw->session->lastname)) + echo $phpgw->session->lastname . " "; + } else + echo $phpgw->session->loginid; +?> +
+
+ + + +
+ + + + + +
+
+
+ +
+ +
+ + + + + + + +"; + if ($WEEK_START == 0) + echo ""; +for ($i = 1; $i < 7; $i++) { + echo ""; +} +if ($WEEK_START == 1) + echo ""; +echo "\n"; + +// generate values for first day and last day of month +$monthstart = mktime(2, 0, 0, $thismonth, 1, $thisyear); +$monthend = mktime(2, 0, 0, $thismonth + 1, 0, $thisyear); + +if ($WEEK_START == "1") + $wkstart = get_monday_before($thisyear, $thismonth, 1) + 7200; +else + $wkstart = get_sunday_before($thisyear, $thismonth, 1) + 7200; + +$wkend = $wkstart + (3600 * 24 * 7); + +for ($i = $wkstart; date("Ymd", $i) <= date("Ymd", $monthend); $i += (24 * 3600 * 7)) { + for ($i = $wkstart; date("Ymd", $i) <= date("Ymd", $monthend); $i += (24 * 3600 * 7)) { + echo "\n"; + for ($j = 0; $j < 7; $j++) { + $date = $i + ($j * 24 * 3600); + if (date("Ymd", $date) >= date("Ymd", $monthstart) && date("Ymd", $date) <= date("Ymd", $monthend)) { + if (date("Ymd", $date) == date("Ymd", $now)) + echo "\n"; + } else { + print "\n"; + } + } + echo "\n"; + } +} +?> + +
" CLASS="monthlink"><" CLASS="monthlink">>
" . + +substr($weekday_names[0], 0, 2) . "" . + substr($weekday_names[$i], 0, 2) . "" . + substr($weekday_names[0], 0, 2) . "
"; + else + echo ""; + echo ""; + echo "link("day.php","date=".date("Ymd",$date)); + echo "\" CLASS=\"monthlink\">" . + date("d", $date) . " 
+
+
+ +
+ +link("day.php"); + if ($thisyear) + echo "&year=$thisyear&month=$thismonth&day=$thisday"; + + ?>&friendly=1" TARGET="cal_printer_friendly" onMouseOver="window.status = '[" . lang_calendar("Printer Friendly"); ?>] + + diff --git a/calendar/delete.php b/calendar/delete.php new file mode 100755 index 0000000000..814e4e1a50 --- /dev/null +++ b/calendar/delete.php @@ -0,0 +1,35 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "calendar"; + include("../header.inc.php"); + + if ($id > 0) { + $phpgw->db->query("SELECT cal_date FROM webcal_entry WHERE cal_id = $id"); + // date format is 19991231 + $phpgw->db->next_record(); + + $thisyear = (int)($phpgw->db->f(0) / 10000); + $thismonth = ($phpgw->db->f(0) / 100) % 100; + + $phpgw->db->query("DELETE FROM webcal_entry WHERE cal_id = $id"); + $phpgw->db->query("DELETE FROM webcal_entry_user WHERE cal_id = $id"); + $phpgw->db->query("DELETE FROM webcal_entry_repeats WHERE cal_id = $id"); + $phpgw->db->query("DELETE FROM webcal_entry_groups WHERE cal_id = $id"); + } + + Header("Location: index.php?sessionid=" . $phpgw->session->id . "&" + . ($thisyear > 0 ? "year=$thisyear&month=$thismonth" : "") ); diff --git a/calendar/edit_entry.php b/calendar/edit_entry.php new file mode 100755 index 0000000000..3591fd42e4 --- /dev/null +++ b/calendar/edit_entry.php @@ -0,0 +1,416 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "calendar"; + + include("../header.inc.php"); + +if ($id > 0) { + $can_edit = false; + $phpgw->db->query("SELECT cal_id FROM webcal_entry_user WHERE cal_login=" + . "'" . $phpgw->session->loginid . "' AND cal_id = $id"); + $phpgw->db->next_record(); + if ($phpgw->db->f("cal_id") > 0) + $can_edit = true; + + $phpgw->db->query("SELECT cal_create_by, cal_date, cal_time, cal_mod_date, " + . "cal_mod_time, cal_duration, cal_priority, cal_type, " + . "cal_access, cal_name, cal_description FROM webcal_entry " + . "WHERE cal_id=$id"); + + $phpgw->db->next_record(); + $year = (int)($phpgw->db->f(1) / 10000); + $month = ($phpgw->db->f(1) / 100) % 100; + $day = $phpgw->db->f(1) % 100; + $time = $phpgw->db->f(2); + if ($time > 0) { + $hour = $time / 10000; + $minute = ($time / 100) % 100; + } + $duration = $phpgw->db->f(5); + $priority = $phpgw->db->f(6); + $type = $phpgw->db->f(7); + $access = $phpgw->db->f(8); + $name = $phpgw->db->f(9); + $description = $phpgw->db->f(10); + + $phpgw->db->query("SELECT cal_login FROM webcal_entry_user WHERE cal_id=$id"); + while ($phpgw->db->next_record()) { + $participants[$phpgw->db->f("cal_login")] = 1; + } + $phpgw->db->query("select * from webcal_entry_repeats where cal_id='$id" + . "'"); + + $phpgw->db->next_record(); + $rpt_type = $phpgw->db->f("cal_type"); + if ($phpgw->db->f("cal_end")) + $rpt_end = date_to_epoch($phpgw->db->f("cal_end")); + else + $rpt_end = 0; + + $rpt_freq = $phpgw->db->f("cal_frequency"); + $rpt_days = $phpgw->db->f("cal_days"); + + $rpt_sun = (substr($rpt_days,0,1)=='y'); + $rpt_mon = (substr($rpt_days,1,1)=='y'); + $rpt_tue = (substr($rpt_days,2,1)=='y'); + $rpt_wed = (substr($rpt_days,3,1)=='y'); + $rpt_thu = (substr($rpt_days,4,1)=='y'); + $rpt_fri = (substr($rpt_days,5,1)=='y'); + $rpt_sat = (substr($rpt_days,6,1)=='y'); + +} else { + $can_edit = true; +} + + if ($year) + $thisyear = $year; + if ($month) + $thismonth = $month; + if (! $rpt_type) + $rpt_type = "none"; +?> + + + + + +

+ + +
+session->hidden_var(); ?> + +\n"; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +db->query("select loginid, lastname, firstname from accounts where " + . "status !='L' and loginid != '" . $phpgw->session->loginid . "' and " + . "permissions like '%:calendar:%' order by lastname,firstname,loginid"); + + if ($phpgw->db->num_rows() > 50) + $size = 15; + else if ($phpgw->db->num_rows() > 5) + $size = 5; + else + $size = $phpgw->db->num_rows(); + + echo "" + . "\n"; + +?> + + + + + + + + + + + + + + + + + +
: + +
: + +
: +"; + if ($day == 0) + $day = date("d"); + for ($i = 1; $i <= 31; $i++) + $day_html .= "\n"; + $day_html .= ""; + + $month_html = ""; + + $year_html = ""; + + echo $phpgw->preferences->dateformatorder($year_html,$month_html,$day_html); +?> + +
: + :" MAXLENGTH=2> +am\n"; + echo "pm\n"; + } +?> +
:
:
: +
:
" . lang_calendar("Participants") . ":\nsession->loginid ."\">" + . "
: +
:> + +"; + for ($i = 1; $i <= 31; $i++) { + $day_html .= "\n"; + } + $day_html .= ""; + + $month_html = ""; + + $year_html = ""; + + echo $phpgw->preferences->dateformatorder($year_html,$month_html,$day_html); +?> + +
: " . lang_common("Sunday"); + echo " " . lang_common("Monday"); + echo " " . lang_common("Tuesday"); + echo " " . lang_common("Wednesday"); + echo " " . lang_common("Thursday"); + echo " " . lang_common("Friday"); + echo " " . lang_common("Saturday"); + ?>
: + +
+ + + + + + +
+ + 0) { + echo "session->id + . "&id=$id\" onClick=\"return confirm('" + . lang_calendar("Are you sure\\nyou want to\\ndelete this entry ?") . "');\">" + . lang_common("Delete") . "
"; + } + } // ***** This might be out of place. I was getting tons of parse errors + // from if ($can_edit) { This needs to be rewritten, because if you do + // not own the entry. You should not get into this portion of the program. + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); +?> diff --git a/calendar/edit_entry_handler.php b/calendar/edit_entry_handler.php new file mode 100755 index 0000000000..d4139d1322 --- /dev/null +++ b/calendar/edit_entry_handler.php @@ -0,0 +1,243 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["noheader"]="True"; + $phpgw_flags["currentapp"]="calendar"; + include("../header.inc.php"); + // Input time format "2359" + function add_duration($time, $duration) + { + $hour = (int)($time / 10000); + $min = $time % 100; + $minutes = $hour * 60 + $min + $duration; + $h = $minutes / 60; + $m = $minutes % 60; + $ret = sprintf ("%d%02d",$h,$m); + //echo "add_duration ( $time, $duration ) = $ret
"; + return $ret; + } + + // check to see if two events overlap + function times_overlap($time1, $duration1, $time2, $duration2) + { + //echo "times_overlap ( $time1, $duration1, $time2, $duration2 )
"; + $hour1 = (int) ($time1 / 100); + $min1 = $time1 % 100; + $hour2 = (int) ($time2 / 100); + $min2 = $time2 % 100; + // convert to minutes since midnight + $tmins1start = $hour1 * 60 + $min1; + $tmins1end = $tmins1start + $duration1; + $tmins2start = $hour2 * 60 + $min2; + $tmins2end = $tmins2start + $duration2; + //echo "tmins1start=$tmins1start, tmins1end=$tmins1end, tmins2start=" + // . "$tmins2start, tmins2end=$tmins2end
"; + + if ($tmins1start >= $tmins2start && $tmins1start <= $tmins2end) + return true; + if ($tmins1end >= $tmins2start && $tmins1end <= $tmins2end) + return true; + if ($tmins2start >= $tmins1start && $tmins2start <= $tmins1end) + return true; + if ($tmins2end >= $tmins1start && $tmins2end <= $tmins1end) + return true; + return false; + } + + $phpgw->db->lock(array('webcal_entry','webcal_entry_user','webcal_entry_groups', + 'webcal_entry_repeats')); + + // first check for any schedule conflicts + if (strlen($hour) > 0) { + $date = mktime(0,0,0,$month,$day,$year); + if ($phpgw_info["user"]["preferences"]["timeformat"] == "12") { + $hour %= 12; + if ($ampm == "pm") + $hour += 12; + } + + $sql = "SELECT webcal_entry_user.cal_login, webcal_entry.cal_time," . + "webcal_entry.cal_duration, webcal_entry.cal_name, " . + "webcal_entry.cal_id, webcal_entry.cal_access " . + "FROM webcal_entry, webcal_entry_user " . + "WHERE webcal_entry.cal_id = webcal_entry_user.cal_id " . + "AND webcal_entry.cal_date = " . date("Ymd", $date) . " AND ( "; + + for ($i = 0; $i < count($participants); $i++) { + if ($i) $sql .= " OR "; + $sql .= " webcal_entry_user.cal_login = '" . $participants[$i] . "'"; + } + $sql .= " )"; + + $phpgw->db->query($sql); + $time1 = sprintf("%d:%02d", $hour, $minute); + $duration1 = sprintf("%d", $duration); + + while ($phpgw->db->next_record()) { + // see if either event overlaps one another + if ($phpgw->db->f(4) != $id) { + $time2 = $phpgw->db->f(1); + $duration2 = $phpgw->db->f(2); + if (times_overlap($time1, $duration1, $time2, $duration2)) { + $overlap .= "
  • "; + if ($phpgw->db->f(5) == 'R' && $phpgw->db->f(0) != $login) + $overlap .= "(PRIVATE)"; + else { + $overlap .= "link("view.php", + "id=".$phpgw->db->f(4))."\">" + . $phpgw->db->f(3) . ""; + } + $overlap .= " (" . display_time($time2); + if ($duration2 > 0) + $overlap .= "-" . display_time(add_duration($time2,$duration2)) + . ")"; + } + } + } + } + +if ($overlap) + $error = lang_calendar("The following conflicts with the suggested time:
      x
    ", + $overlap); + +if (! $error) { + // now add the entries + + if ($id != 0) { + $phpgw->db->query("DELETE FROM webcal_entry WHERE cal_id = $id"); + $phpgw->db->query("DELETE FROM webcal_entry_user WHERE cal_id = $id"); + $phpgw->db->query("DELETE FROM webcal_entry_repeats WHERE cal_id = $id"); + $phpgw->db->query("DELETE FROM webcal_entry_groups WHERE cal_id = $id"); + } + + $sql = "INSERT INTO webcal_entry (cal_create_by, cal_date, " . + "cal_time, cal_mod_date, cal_mod_time, cal_duration, cal_priority, " . + "cal_access, cal_type, cal_name, cal_description ) " . + "VALUES ('" . $phpgw->session->loginid . "', "; + + $date = mktime(0,0,0,$month,$day,$year); + $sql .= date("Ymd", $date) . ", "; + if (strlen($hour) > 0) { + if ($phpgw_info["user"]["preferences"]["timeformat"] == "12") { + $hour %= 12; + if ($ampm == "pm") + $hour += 12; + } + $sql .= sprintf("%02d%02d00, ",$hour,$minute); + } else + $sql .= "'-1', "; + + $sql .= date("Ymd") . ", " . date("Gis") . ", "; + $sql .= sprintf("%d, ",$duration); + $sql .= sprintf("%d, ",$priority); + $sql .= "'$access', "; + + if ($rpt_type != 'none') + $sql .= "'M', "; + else + $sql .= "'E', "; + + if (strlen($name) == 0) + $name = "Unnamed Event"; + + $sql .= "'" . addslashes($name) . "', "; + if (! $description) + $sql .= "'" . addslashes($name) . "')"; + else + $sql .= "'" . addslashes($description) . "' )"; + + $error = ""; + $phpgw->db->query($sql); + + $phpgw->db->query("SELECT MAX(cal_id) FROM webcal_entry"); + $phpgw->db->next_record(); + $id = $phpgw->db->f(0); + + + for ($i = 0; $i < count($participants); $i++) { + // Rewrite + $sql = "INSERT INTO webcal_entry_user (cal_id,cal_login,cal_status ) " + . "VALUES ($id, '" . $participants[$i] . "', 'A')"; + $phpgw->db->query($sql); + } + + if (count($participants) == 0) + $phpgw->db->query("insert into webcal_entry_user (cal_id,cal_login,cal_status" + . ") values ($id,'" . $phpgw->session->loginid . "','A' )"); + } + + if (strlen($rpt_type) || ! strcmp($rpt_type,'none') == 0) { + // clearly, we want to delete the old repeats, before inserting new... + $phpgw->db->query("delete from webcal_entry_repeats where cal_id='$id'"); + $freq = ($rpt_freq?$rpt_freq:1); + + if ($rpt_end_use) { + $end = "'" . date("Ymd",mktime(0,0,0,$rpt_month,$rpt_day,$rpt_year)) + . "'"; + } else + $end = 'NULL'; + + if ($rpt_type == 'weekly') { + $days = ($rpt_sun?'y':'n') + . ($rpt_mon?'y':'n') + . ($rpt_tue?'y':'n') + . ($rpt_wed?'y':'n') + . ($rpt_thu?'y':'n') + . ($rpt_fri?'y':'n') + . ($rpt_sat?'y':'n'); + } else { + $days = "nnnnnnn"; + } + + $phpgw->db->query("insert into webcal_entry_repeats (cal_id,cal_type," + . "cal_end,cal_days,cal_frequency) values($id,'$rpt_type'," + . "$end,'$days',$freq)"); + } + $phpgw->db->query("insert into webcal_entry_groups values ('$id','" + . $phpgw->groups->array_to_string($access,$n_groups) . "') "); + + + Header("Location: ".$phpgw->link("index.php","year=$year&month=$month&cd=14")); + +?> + +$phpgw->common->header(); + + + +

    Scheduling Conflict

    + x - x conflicts with the following existing calendar entries:", display_time($time),display_time(add_duration($time,$duration))); ?> + +?> + +
      + +
    + + +

    Error

    +
    + +
    + +db->unlock(); + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); +?> diff --git a/calendar/inc/footer.inc.php b/calendar/inc/footer.inc.php new file mode 100644 index 0000000000..3cbac3ecab --- /dev/null +++ b/calendar/inc/footer.inc.php @@ -0,0 +1,133 @@ + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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. * + \**************************************************************************/ + + if ($friendly) { + include($phpgw_info["server"]["core_include_root"]."/footer.inc.php"); + exit; + } + +?> + +
    +
    + + + +session->hidden_var(); ?> + + + + + +session->hidden_var(); ?> + + + + + + +
    +session->hidden_var(); ?> + +
    + + + +
    +: + + + + +
    +: + + + + + +: + + + + +
    diff --git a/calendar/inc/functions.inc.php b/calendar/inc/functions.inc.php new file mode 100755 index 0000000000..0f40b2a196 --- /dev/null +++ b/calendar/inc/functions.inc.php @@ -0,0 +1,647 @@ + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + // only temp + $BGCOLOR = "#C0C0C0"; // document background color + $H2COLOR = "#000000"; // color of page titles + $CELLBG = $phpgw_info["theme"]["cal_dayview"]; // color of table cells in month view + $TABLEBG = "#000000"; // lines separating table cells + $THBG = "#FFFFFF"; // background color of table column headers + $THFG = "#000000"; // text color of table column headers + $POPUP_FG = "#000000"; // text color in popup of event description + $POPUP_BG = "#FFFFFF"; // background color in popup of event description + $TODAYCELLBG = "#E0E0E0";// color of table cells of current day in month view + + + $month_names = array("01" => lang_common("January"), "07" => lang_common("July"), + "02" => lang_common("February"),"08" => lang_common("August"), + "03" => lang_common("March"), "09" => lang_common("September"), + "04" => lang_common("April"), "10" => lang_common("October"), + "05" => lang_common("May"), "11" => lang_common("November"), + "06" => lang_common("June"), "12" => lang_common("December") + ); + + $weekday_names = array( "0" => lang_common("Sunday"), "1" => lang_common("Monday"), + "2" => lang_common("Tuesday"), "3" => lang_common("Wednesday"), + "4" => lang_common("Thursday"),"5" => lang_common("Friday"), + "6" => lang_common("Saturday") + ); + + function display_small_month($thismonth,$thisyear,$showyear, $link = "") + { + global $phpgw, $phpgw_info, $friendly; + + if (! $link) + $link = "edit_entry.php"; + + echo ""; + $sun = get_sunday_before($thisyear, $thismonth, 1); + + $monthstart = mktime(2,0,0,$thismonth,1,$thisyear); + $monthend = mktime(2,0,0,$thismonth + 1,0,$thisyear); + + echo ""; + else + echo lang_common(date("F",$monthstart)) . ""; + + echo "" + . "" + . "" + . "" + . "" + . "" + . "" + . "" + . ""; + + for ($i = $sun; date("Ymd",$i) <= date ("Ymd",$monthend); + $i += (24 * 3600 * 7) ) { + echo ""; + + for ($j = 0; $j < 7; $j++) { + $date = $i + ($j * 24 * 3600); + if ( date("Ymd",$date) >= date ("Ymd",$monthstart) && + date("Ymd",$date) <= date ("Ymd",$monthend) ) { + echo ""; + } else + echo ""; + } // end for $j + echo ""; + } // end for $i + echo "
    "; + + if (! $friendly) + echo "link( + $phpgw_info["server"]["app_root"]."/", + "year=$thisyear&month=$thismonth") + . "\">"; + + if ($showyear) + echo lang_common(date("F",$monthstart)) . " $thisyear" . "
    " . lang_calendar("Su") . "" . lang_calendar("Mo") . "" . lang_calendar("Tu") . "" . lang_calendar("We") . "" . lang_calendar("Th") . "" . lang_calendar("Fr") . "" . lang_calendar("Sa") . "
    "; + if (! $friendly) + echo "link($link, + "year=".date("Y",$date) + ."&month=".date("m",$date) + ."&day=".date("d",$date)) . "\">"; + echo "" . date ( "j", $date ) . "" + . "
    "; + } // end function + + // LC: links back to an entry view for $id using $pic + function link_to_entry($id, $pic, $description) + { + global $phpgw, $phpgw_info, $friendly; + if (! $friendly) + echo "link($phpgw_info["server"]["app_root"] + ."/view.php","id=$id")."\">\"".htmlentities($description)."\""; + } + + // Get all the repeating events for the specified data and return them + // in an array (which is sorted by time of day). + // This NEEDS to be combined with make_repeating_entires(), + // this just needs an array returned. Thats tommorows job. + + function get_repeating_entries($date) + { + global $repeated_events, $phpgw; + $n = 0; + + $thisyear = substr($date, 0, 4); + $thismonth = substr($date, 4, 2); + for ($i=0; $i < count($repeated_events); $i++) { + $start = date_to_epoch($repeated_events[$i][cal_date]); + $end = date_to_epoch($repeated_events[$i][cal_end]); + $freq = $repeated_events[$i][cal_frequency]; + + // only repeat after the beginning, and if there is an end + // before the end + if ($repeated_events[$i][cal_end] && date("Ymd",$date) > date("Ymd",$end)) + continue; + + if (date("Ymd",$date) < date("Ymd",$start)) + continue; + $id = $repeated_events[$i][cal_id]; + + if ($repeated_events[$i][cal_type] == 'daily') { + if ((floor(($date - $start)/86400)%$freq)) + continue; + $ret[$n++] = $repeated_events[$i]; + } else if ($repeated_events[$i][cal_type] == 'weekly') { + $dow = date("w", $date); + $isDay = substr($repeated_events[$i][cal_days], $dow, 1); + if (floor(($date - $start)/604800)%$freq) + continue; + if (strcmp($isDay,"y") == 0) { + $ret[$n++] = $repeated_events[$i]; + } + + } else if ($repeated_events[$i][cal_type] == 'monthlyByDay') { + $dowS = date("w", $start); + $dayS = floor(date("d", $start)/7); + $mthS = date("m", $start); + $yrS = date("Y", $start); + + $dow = date("w", $date); + $day = floor(date("d", $date)/7); + $mth = date("m", $date); + $yr = date("Y", $date); + + if ((($yr - $yrS)*12 + $mth - $mthS) % $freq) + continue; + + if (($dowS == $dow) && ($day == $dayS)) { + $ret[$n++] = $repeated_events[$i]; + } + + } else if ($repeated_events[$i][cal_type] == 'monthlyByDate') { + $mthS = date("m", $start); + $yrS = date("Y", $start); + + $mth = date("m", $date); + $yr = date("Y", $date); + + if ((($yr - $yrS)*12 + $mth - $mthS) % $freq) + continue; + + if (date("d", $date) == date("d", $start)) { + $ret[$n++] = $repeated_events[$i]; + } + } + + else if ($repeated_events[$i][cal_type] == 'yearly') { + $yrS = date("Y", $start); + $yr = date("Y", $date); + + if (($yr - $yrS)%$freq) + continue; + + if (date("dm", $date) == date("dm", $start)) { + $ret[$n++] = $repeated_events[$i]; + } + } else { + // unknown repeat type + } + } + return $ret; +} + + // LC: does the repeating entry thang + // There is no need to pass $user, needs to be removed. + function make_repeating_entries($date,$hide_icons) + { + global $repeated_events; // Pass it through? + + $thisyear = substr($date, 0, 4); + $thismonth = substr($date, 4, 2); + + for ($i=0; $i < count($repeated_events); $i++ ) { + $start = date_to_epoch($repeated_events[$i][cal_date]); + $end = date_to_epoch($repeated_events[$i][cal_end]); + + $freq = $repeated_events[$i][cal_frequency]; + // only repeat after the beginning, and if there is an end + // before the end + if ($repeated_events[$i][cal_end] && date("Ymd",$date) > date("Ymd",$end) ) + continue; + + if (date("Ymd",$date) < date("Ymd",$start)) + continue; + + $id = $repeated_events[$i][cal_id]; + + if ($repeated_events[$i][cal_type] == 'daily') { + if ( (floor(($date - $start)/86400)%$freq) ) + continue; + link_to_entry( $id, "rpt.gif", $repeated_events[$i][cal_description]); + echo $repeated_events[$i][cal_name] . "
    "; + } else if ($repeated_events[$i][cal_type] == 'weekly') { + $dow = date("w", $date); + $isDay = substr($repeated_events[$i][cal_days], $dow, 1); + + /*if ( (floor($diff/86400)%$freq) ) // Whats this for ? + ** continue; + */ + + if (floor(($date - $start)/604800)%$freq) + continue; + if (strcmp($isDay,"y") == 0) { + link_to_entry($id, "rpt.gif", $repeated_events[$i][cal_description]); + echo $repeated_events[$i][cal_name] . "
    "; + } + } else if ($repeated_events[$i][cal_type] == 'monthlyByDay') { + $dowS = date("w", $start); + $dayS = floor(date("d", $start)/7); + $mthS = date("m", $start); + $yrS = date("Y", $start); + $dow = date("w", $date); + $day = floor(date("d", $date)/7); + $mth = date("m", $date); + $yr = date("Y", $date); + if ((($yr - $yrS)*12 + $mth - $mthS) % $freq) + continue; + + if (($dowS == $dow) && ($day == $dayS)) { + link_to_entry($id, "rpt.gif", $repeated_events[$i][cal_description]); + echo $repeated_events[$i][cal_name] . "
    "; + } + } else if ($repeated_events[$i][cal_type] == 'monthlyByDate') { + $mthS = date("m", $start); + $yrS = date("Y", $start); + $mth = date("m", $date); + $yr = date("Y", $date); + if ((($yr - $yrS)*12 + $mth - $mthS) % $freq) + continue; + if (date("d", $date) == date("d", $start)) { + link_to_entry($id, "rpt.gif", $repeated_events[$i][cal_description]); + echo $repeated_events[$i][cal_name] . "
    "; + } + } else if ($repeated_events[$i][cal_type] == 'yearly') { + $yrS = date("Y", $start); + $yr = date("Y", $date); + if (($yr - $yrS)%$freq) + continue; + if (date("dm", $date) == date("dm", $start)) { + link_to_entry($id, "rpt.gif", $repeated_events[$i][cal_description]); + echo $repeated_events[$i][cal_name] . "
    "; + } + } else { + // unknown rpt type - because of all our else ifs + } + } // end for loop + } // end function + + + // The orginal patch read this 30+ times in a loop, only read it once. + function read_repeated_events() + { + global $phpgw; + + $sql = "SELECT webcal_entry.cal_name, webcal_entry.cal_date, " + . "webcal_entry_repeats.*, webcal_entry.cal_description, " + . "webcal_entry.cal_time,webcal_entry.cal_priority, " + . "webcal_entry.cal_duration " + . "FROM webcal_entry, webcal_entry_repeats, webcal_entry_user " + . "WHERE webcal_entry.cal_id = webcal_entry_repeats.cal_id " + . "AND webcal_entry.cal_id = webcal_entry_user.cal_id " + . "AND webcal_entry_user.cal_login = '" . $phpgw->session->loginid . "' " + . "AND webcal_entry.cal_type='M'"; + + $phpgw->db->query($sql); + + $i = 0; + while ($phpgw->db->next_record()) { + $repeated_events[$i] = array("cal_name" => $phpgw->db->f("cal_name"), + "cal_date" => $phpgw->db->f("cal_date"), + "cal_id" => $phpgw->db->f("cal_id"), + "cal_type" => $phpgw->db->f("cal_type"), + "cal_end" => $phpgw->db->f("cal_end"), + "cal_frequency" => $phpgw->db->f("cal_frequency"), + "cal_days" => $phpgw->db->f("cal_days"), + "cal_description" => $phpgw->db->f("cal_description"), + "cal_time" => $phpgw->db->f("cal_time"), + "cal_priority" => $phpgw->db->f("cal_priority"), + "cal_duration" => $phpgw->db->f("cal_duration") + ); + $i++; + } + return $repeated_events; + } + + + function get_sunday_before($year,$month,$day) + { + $weekday = date("w", mktime(0,0,0,$month,$day,$year) ); + $newdate = mktime(0,0,0,$month,$day - $weekday,$year); + return $newdate; + } + + + function sql_search_calendar() + { + global $phpgw; + $s .= $phpgw->groups->cal_sql_search(); + $s .= " OR webcal_entry.cal_access='public'"; + return $s; + } + + + function print_date_entries($date,$hide_icons,$sessionid) + { + global $phpgw, $phpgw_info; + + if (! $hide_icons) { + echo "link("edit_entry.php", + "year=".date("Y",$date) + ."&month=".date("m",$date) + ."&day=".date("d",$date)) + . "\">" + . "\"""; + } + echo "[ " . "link("day.php", + "month=".date("m",$date) + ."&day=".date("d",$date) + ."&year=".date("Y",$date)) + . "\">" . date("d", $date) + . " ]
    \n"; + echo ""; + + // This is only a temporey fix + if ($phpgw_info["server"]["db_type"] == "mysql") { + $sql = "SELECT DISTINCT webcal_entry.cal_id, webcal_entry.cal_name, " + . "webcal_entry.cal_priority, webcal_entry.cal_time, " + . "webcal_entry_user.cal_status, webcal_entry.cal_create_by, " + . "webcal_entry.cal_access,webcal_entry.cal_description " + . "FROM webcal_entry LEFT JOIN webcal_entry_user " + . "ON webcal_entry.cal_id=webcal_entry_user.cal_id " + . "LEFT JOIN webcal_entry_groups " + . "ON webcal_entry_groups.cal_id=webcal_entry.cal_id " + . "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' " + . "AND webcal_entry.cal_type != 'M' " + . "AND (webcal_entry_user.cal_login='" . $phpgw->session->loginid . "' " + . sql_search_calendar() . ") " + . "ORDER BY webcal_entry.cal_priority, webcal_entry.cal_time"; + } else { + $sql = "SELECT DISTINCT webcal_entry.cal_id, webcal_entry.cal_name, " + . "webcal_entry.cal_priority, webcal_entry.cal_time, " + . "webcal_entry_user.cal_status, webcal_entry.cal_create_by, " + . "webcal_entry.cal_access,webcal_entry.cal_description " + . "FROM webcal_entry, webcal_entry_user, webcal_entry_groups " + . "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' " + . "AND webcal_entry.cal_type != 'M' AND " + . "(webcal_entry_user.cal_login='" . $phpgw->session->loginid . "' " + . " AND webcal_entry.cal_id=webcal_entry_user.cal_id OR " + . "(webcal_entry_groups.cal_id=webcal_entry.cal_id " + . sql_search_calendar() . ")) ORDER " + . "BY webcal_entry.cal_priority, webcal_entry.cal_time"; + } + + make_repeating_entries($date, $hide_icons); + + $phpgw->db->query($sql); + echo ""; + while ($phpgw->db->next_record()) { + if (! $hide_icons) { + echo "link("view.php","id=".$phpgw->db->f(0)) + . "\" onMouseOver=\"window.status='" + . lang_calendar("View this entry") . "'; return true;\">\""db->f("cal_description") + . "\" BORDER=0>"; + } + if ($phpgw->db->f(2) == 3) + echo ""; // ***** put into theme + if ($phpgw->db->f(3) > 0) { + if ($phpgw_info["user"]["preferences"]["timeformat"] == "24") + printf ("%02d:%02d",$phpgw->db->f(3) / 10000, ($phpgw->db->f(3) / 100) % 100); + else { + $h = ((int)($phpgw->db->f(3) / 10000)) % 12; + if ($h == 0) + $h = 12; + echo $h; + $m = ($phpgw->db->f(3) / 100) % 100; + if ($m > 0) + printf(":%02d",$m); + echo ((int)($phpgw->db->f(3) / 10000)) < 12 ? "am" : "pm"; + } + echo ">"; + } + echo ""; + echo htmlentities($phpgw->db->f(1)); + + if ($phpgw->db->f(2) == 3) + echo ""; + if ($phpgw->db->f(4) == "W") + echo ""; + echo "
    "; + } // end ? + print "
    "; + } // end function + + // display a time in either 12 or 24 hour format + // Input time is an interger like 235900 + function display_time($time) + { + global $phpgw, $phpgw_info; + $hour = (int)($time / 10000); + $min = ($time / 100) % 100; + if ($phpgw_info["user"]["preferences"]["timeformat"] == "12") { + $ampm = $hour >= 12 ? "pm" : "am"; + $hour %= 12; + if ($hour == 0) + $hour = 12; + $ret = sprintf("%d:%02d%s",$hour,$min,$ampm); + } else + $ret = sprintf("%d:%02d",$hour,$min); + return $ret; + } + + // convert a date from an int format "19991231" into "31 Dec 1999" + function date_to_str($indate) + { + if (strlen($indate) > 0) { + $y = (int)($indate / 10000); + $m = ($indate / 100) % 100; + $d = $indate % 100; + $d = mktime(0,0,0,$m,$d,$y); + return strftime("%A, %B %d, %Y", $d); + } else + return strftime("%A, %B %d, %Y"); + } + + // This should be a common function. (todo list) + function date_to_epoch($d) + { + return mktime(0,0,0,substr($d,4,2),substr($d,6,2),substr($d,0,4)); + } + + function html_for_event_day_at_a_glance ($id, $date, $time, + $name, $description, $status, $pri, $access, $duration, $hide_icons) + { + global $first_hour, $last_hour, $hour_arr, $rowspan_arr, $rowspan, + $eventinfo, $phpgw, $phpgw_info; + + if ($time >= 0) { + $ind = (int)($time / 10000); + if ($ind < $first_hour) + $first_hour = $ind; + if ($ind > $last_hour) + $last_hour = $ind; + } else + $ind = 99; + + $class = "entry"; + if (! $hide_icons) { + $hour_arr[$ind] .= "link("view.php","id=$id"); + $hour_arr[$ind] .= "\" onMouseOver=\"window.status='" . lang_calendar("View this entry") + . "'; return true;\">"; + } + + if ($time >= 0) { + $hour_arr[$ind] .= "[" . display_time($time); + if ($duration > 0) { + // calc end time + $h = (int)($time / 10000); + $m = ($time / 100) % 100; + $m += $duration; + $d = $duration; + while ( $m >= 60 ) { + $h++; + $m -= 60; + } + $end_time = sprintf("%02d%02d00", $h, $m); + $hour_arr[$ind] .= "-" . display_time($end_time); + if ($m == 0) + $rowspan = $h - $ind; + else + $rowspan = $h - $ind + 1; + if ($rowspan > $rowspan_arr[$ind] && $rowspan > 1) + $rowspan_arr[$ind] = $rowspan; + } + $hour_arr[$ind] .= "] "; + } + $hour_arr[$ind] .= "\"""; + if ($pri == 3) + $hour_arr[$ind] .= ""; + $hour_arr[$ind] .= htmlspecialchars($name); + + if ($pri == 3) + $hour_arr[$ind] .= ""; + $hour_arr[$ind] .= "
    "; +} + + + function print_day_at_a_glance($date, $hide_icons) + { + global $hour_arr, $rowspan_arr, $rowspan, $phpgw, $phpgw_info, + $CELLBG, $TODAYCELLBG, $THFG, $THBG; + + // get all the repeating events for this date and store in array $rep + $rep = get_repeating_entries($date, $user); + $cur_rep = 0; + $sql = "SELECT DISTINCT webcal_entry.cal_id, webcal_entry.cal_name, " + . "webcal_entry.cal_priority, webcal_entry.cal_time, " + . "webcal_entry_user.cal_status, webcal_entry.cal_create_by, " + . "webcal_entry.cal_access,webcal_entry.cal_description " + . "FROM webcal_entry " + . "LEFT JOIN webcal_entry_user " + . "ON webcal_entry.cal_id=webcal_entry_user.cal_id " + . "LEFT JOIN webcal_entry_groups " + . "ON webcal_entry_groups.cal_id=webcal_entry.cal_id " + . "WHERE webcal_entry.cal_date='" . date("Ymd", $date) . "' " + . "AND webcal_entry.cal_type != 'M' " + . "AND (webcal_entry_user.cal_login='" . $phpgw->session->loginid . "' " + . sql_search_calendar() . ") " + . "ORDER BY webcal_entry.cal_priority, webcal_entry.cal_time"; + + $phpgw->db->query($sql); + $hour_arr = Array(); + $first_hour = ($phpgw_info["user"]["preferences"]["workdaystarts"] + 1); + $last_hour = ($phpgw_info["user"]["preferences"]["workdayends"] + 1); + + $rowspan_arr = Array(); + + while ($phpgw->db->next_record()) { + // print out any repeating events that are before this one... + while ($cur_rep < count($rep) && $rep[$cur_rep]["cal_time"] < $phpgw->db->f(3)) { + html_for_event_day_at_a_glance($rep[$cur_rep]["cal_id"], + $date, $rep[$cur_rep]["cal_time"], + $rep[$cur_rep]["cal_name"], $rep[$cur_rep]["cal_description"], + $rep[$cur_rep]["cal_status"], $rep[$cur_rep]["cal_priority"], + $rep[$cur_rep]["cal_access"], $rep[$cur_rep]["cal_duration"], + $hide_icons ); + $cur_rep++; + } + + html_for_event_day_at_a_glance($phpgw->db->f("cal_id"),$date,$phpgw->db->f("cal_time"), + $phpgw->db->f("cal_name"),$phpgw->db->f("cal_description"), + $phpgw->db->f("cal_status"),$phpgw->db->f("cal_priority"), + $phpgw->db->f("cal_access"),$phpgw->db->f("cal_duration"), + $hide_icons); + } + + // print out any remaining repeating events + while ($cur_rep < count($rep)) { + html_for_event_day_at_a_glance ( $rep[$cur_rep]["cal_id"], + $date, $rep[$cur_rep]["cal_time"], + $rep[$cur_rep]["cal_name"], $rep[$cur_rep]["cal_description"], + $rep[$cur_rep]["cal_status"], $rep[$cur_rep]["cal_priority"], + $rep[$cur_rep]["cal_access"], $rep[$cur_rep]["cal_duration"], + $hide_icons ); + $cur_rep++; + } + + // squish events that use the same cell into the same cell. + // For example, an event from 8:00-9:15 and another from 9:30-9:45 both + // want to show up in the 8:00-9:59 cell. + $rowspan = 0; + $last_row = -1; + for ($i = 0; $i < 24; $i++) { + if ($rowspan > 1) { + if (strlen($hour_arr[$i])) { + $hour_arr[$last_row] .= $hour_arr[$i]; + $hour_arr[$i] = ""; + $rowspan_arr[$i] = 0; + } + $rowspan--; + } else if ($rowspan_arr[$i] > 1) { + $rowspan = $rowspan_arr[$i]; + $last_row = $i; + } + } + if (strlen($hour_arr[99])) { + echo " " + . "$hour_arr[99]\n"; + } + $rowspan = 0; + for ($i = $first_hour; $i <= $last_hour; $i++) { + $time = display_time($i * 10000); +// echo "" . "" +// . $time . "\n"; + echo ""; + + // tooley: the hour - 36400 is a HACK for improper storage of hour allows + // in user preference land. + echo "link("edit_entry.php", + "year=" . date("Y",$date) + . "&month=" . date("m",$date) + . "&day=" . date("d",$date) + . "&hour=" . substr($time,0,2) + . "&minute=" . substr($time,2,2)) + . "\">$time"; + + if ($rowspan > 1) { + // this might mean there's an overlap, or it could mean one event + // ends at 11:15 and another starts at 11:30. + if (strlen($hour_arr[$i])) + echo "$hour_arr[$i]"; + $rowspan--; + } else { + if (! strlen($hour_arr[$i])) + echo " \n"; + else { + $rowspan = $rowspan_arr[$i]; + if ($rowspan > 1) + echo "" + . "$hour_arr[$i]\n"; + else + echo "$hour_arr[$i]\n"; + } + } + } // end for + } // end function +?> \ No newline at end of file diff --git a/calendar/inc/header.inc.php b/calendar/inc/header.inc.php new file mode 100644 index 0000000000..5f968be83a --- /dev/null +++ b/calendar/inc/header.inc.php @@ -0,0 +1,34 @@ + + + + + + + + +
    +   + + "> + /today.gif" alt="" border="0"> + + + "> + /week.gif" alt="" border="0"> + + + "> + /month.gif" alt="" border="0"> + + +
    /search.php"> + session->hidden_var(); ?> + + + + + + + "> +
    +
    diff --git a/calendar/inc/styles.inc.php b/calendar/inc/styles.inc.php new file mode 100644 index 0000000000..5918ffbba6 --- /dev/null +++ b/calendar/inc/styles.inc.php @@ -0,0 +1,45 @@ + + diff --git a/calendar/index.php b/calendar/index.php new file mode 100755 index 0000000000..6b4034c5cf --- /dev/null +++ b/calendar/index.php @@ -0,0 +1,175 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + if (! $friendly) { + $phpgw_flags["noheader"] = True; + } + + $phpgw_flags["currentapp"] = "calendar"; + include("../header.inc.php"); + if (strlen($date) > 0) { + $thisyear = substr($date, 0, 4); + $thismonth = substr($date, 4, 2); + $thisday = substr($date, 6, 2); + } else { + if ($day == 0) + $thisday = date("d"); + else + $thisday = $day; + if ($month == 0) + $thismonth = date("m"); + else + $thismonth = $month; + if ($year == 0) + $thisyear = date("Y"); + else + $thisyear = $year; + } + + $next = mktime(2,0,0,$thismonth + 1,1,$thisyear); + $nextyear = date("Y", $next); + $nextmonth = date("m", $next); + $nextdate = date("Ymd"); + + $prev = mktime(2,0,0,$thismonth - 1,1,$thisyear); + $prevyear = date("Y",$prev); + $prevmonth = date("m",$prev); + $prevdate = date("Ymd"); + + if (! $friendly) { + $phpgw->common->header(); + } else + echo ""; + $view = "month"; +?> + + + + + + + +"; + display_small_month($prevmonth,$prevyear,True); + } +?> + + +'; + display_small_month($nextmonth,$nextyear,True); + } +?> + +
    + + + +
    +session->firstname) + echo $phpgw->session->firstname . " "; + if ($phpgw->session->lastname) + echo $phpgw->session->lastname; +?> +
    + + + + + + + + + + + + + +sun = " . date("D, m-d-Y", $sun) . "
    "; + //echo "

    monthstart = " . date("D, m-d-Y", $monthstart) . "
    "; + //echo "

    monthend = " . date("D, m-d-Y", $monthend) . "
    "; + + $today = mktime(2,0,0,date("m"),date("d"),date("Y")); + + for ($i = $sun; date("Ymd",$i) <= date("Ymd",$monthend); $i += (24 * 3600 * 7) ) { + $CELLBG = $phpgw->nextmatchs->alternate_row_color($CELLBG); + + echo "

    \n"; + for ($j = 0; $j < 7; $j++) { + $date = $i + ($j * 24 * 3600); + if (date("Ymd",$date) >= date("Ymd",$monthstart) && + date("Ymd",$date) <= date("Ymd",$monthend) ) { + echo "\n"; + } else { + echo "\n"; + } + } + print "\n"; + } + +?> + +
    ">">">">">">">">">">">">">">
    "; + } else { + echo " BGCOLOR=\"$CELLBG\">"; + } + print_date_entries($date,$friendly,$phpgw->session->id); + echo "
    +

    +

    + +link($PHP_SELF,$param)."\">"; + echo "[". lang_calendar("Printer Friendly") . "]"; + } + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); +?> diff --git a/calendar/lang/br_calendar.inc.php b/calendar/lang/br_calendar.inc.php new file mode 100644 index 0000000000..79b90cee18 --- /dev/null +++ b/calendar/lang/br_calendar.inc.php @@ -0,0 +1,84 @@ +x": + $s = "os seguintes conflitos com o horario sugerido:

      $m1
    "; break; + + case "Your suggested time of x - x conflicts with the following existing calendar entries:": + $s = "Horiario Sugerido: $m1 - $m2 esta em conflito com as seguintes entradas no calendario:"; break; + + case "you must enter one or more search keywords": + $s = "voce deve digitar uma ou mais palavras chave"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": + $s = "Tem certeza\\nvoce quer\\napagar esta entrada ?\\n\\nIsto apagara a entrada\\npara todos usuarios."; break; + + default: $s = "* $message"; + } + return $s; + } + +?> diff --git a/calendar/lang/de_calendar.inc.php b/calendar/lang/de_calendar.inc.php new file mode 100755 index 0000000000..1e04c7fae9 --- /dev/null +++ b/calendar/lang/de_calendar.inc.php @@ -0,0 +1,98 @@ +x": + $s = "Es gibt folgende Überschneidungen mit dem angegebenen Termin:
      $m1
    "; break; + + case "your suggested time of x - x conflicts with the following existing calendar entries:"; + $s = "Der angegebene Zeitraum von $m1 - $m2 steht in Konflikt mit bestehenden Terminen:"; break; + + case "you must enter one or more search keywords": + $s = "Sie müssen einen oder mehrere Suchbegriffe angeben"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": + $s = "Sind Sie sicher, daß Sie diesen Eintrag löschen wollen ?\\n\\nDies löscht diesen Eintrag für alle Benutzer.."; + break; + + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + + default: $s = "* ". $message; + } + return $s; + } +?> \ No newline at end of file diff --git a/calendar/lang/en_calendar.inc.php b/calendar/lang/en_calendar.inc.php new file mode 100755 index 0000000000..d315f4191f --- /dev/null +++ b/calendar/lang/en_calendar.inc.php @@ -0,0 +1,95 @@ +x": + $s = "The following conflicts with the suggested time:
      $m1
    "; break; + + case "your suggested time of x - x conflicts with the following existing calendar entries:": + $s = "Your suggested time of $m1 - $m2 conflicts with the following existing calendar entries:"; break; + + case "you must enter one or more search keywords": + $s = "You must enter one or more search keywords"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": $s = "Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users."; break; + + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + default: $s = "* ". $message; + } + return $s; + } +?> diff --git a/calendar/lang/fr_calendar.inc.php b/calendar/lang/fr_calendar.inc.php new file mode 100755 index 0000000000..227aff2311 --- /dev/null +++ b/calendar/lang/fr_calendar.inc.php @@ -0,0 +1,90 @@ +x": + $s = "Les entrées suivantes entrent en conflit avec l'heure proposée :
      $m1
    "; break; + + case "your suggested time of x - x conflicts with the following existing calendar entries:": + $s = "La plage horaire $m1 - $m2 que vous proposez entre en conflit avec les entrées suivantes du calendrier :"; break; + + case "you must enter one or more search keywords": + $s = "Vous devez entrer au moins un mot clef pour la recherche"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": + $s = "Étes vous certain\\nde vouloir\\nsupprimer cette entrée ?\\n\\nCeci détruira\\ncette entrée pour tous les utilisateurs."; break; + + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + + default: $s = "* ". $message; + } + return $s; + } +?> diff --git a/calendar/lang/it_calendar.inc.php b/calendar/lang/it_calendar.inc.php new file mode 100755 index 0000000000..962ce32dff --- /dev/null +++ b/calendar/lang/it_calendar.inc.php @@ -0,0 +1,84 @@ +x": + $s = "Il seguente è in conflitto con l'orario suggerito:
      $m1
    "; break; + + case "Your suggested time of x - x conflicts with the following existing calendar entries:": + $s = "L'orario da te suggerito: $m1 - $m2 è in conflitto con i seguenti appuntamenti in calendario:"; break; + + case "you must enter one or more search keywords": + $s = "Devi specificare una o più parole chiave per la ricerca"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": + $s = "Sei sicuro\\ndi voler\\ncancellare questo appuntamento ?\\n\\nQuesta azione lo cancellerà per\\ntutti gli utenti."; break; + + default: $s = "* $message"; + } + return $s; + } + +?> \ No newline at end of file diff --git a/calendar/lang/kr_calendar.inc.php b/calendar/lang/kr_calendar.inc.php new file mode 100755 index 0000000000..51e5b9861d --- /dev/null +++ b/calendar/lang/kr_calendar.inc.php @@ -0,0 +1,88 @@ +x": + $s = "´ÙÀ½ Ç׸ñÀÌ Á¦¾ÈµÈ ½Ã°£°ú Ãæµ¹ÇÕ´Ï´Ù. :
      $m1
    "; break; + + case "your suggested time of x - x conflicts with the following existing calendar entries:": + $s = " $m1 - $m2 ÀÌ Ç׸ñÀÌ ´Þ·Â¿¡ ÀÖ´Â ³»¿ë°ú °°½À´Ï´Ù."; break; + + case "you must enter one or more search keywords": + $s = "Çϳª ÀÌ»óÀÇ °Ë»öÅ°¿öµå¸¦ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù."; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": $s = "ÀÌ Ç׸ñÀ» Á¤¸»·Î »èÁ¦ÇϽðڽÀ´Ï±î?"; break; + + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + default: $s = "* ". $message; + } + return $s; + } +?> diff --git a/calendar/lang/nl_calendar.inc.php b/calendar/lang/nl_calendar.inc.php new file mode 100755 index 0000000000..f635f8ef89 --- /dev/null +++ b/calendar/lang/nl_calendar.inc.php @@ -0,0 +1,89 @@ +x": + $s = "Het volgende levert een conflict op met de aangegeven tijd:
      $m1
    "; break; + + case "your suggested time of x - x conflicts with the following existing calendar entries:": + $s = "De door u opgegeven tijd $m1 - $m2 levert een confilct op met de volgende afspraken:"; break; + + case "you must enter one or more search keywords": + $s = "U moet een of meer trefwoorden opgeven om op te zoeken"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": + $s = "Weet u zeker dat \\nu deze afspraak \\nwilt verwijderen?\\n \\nDit zal deze \\nafspraak voor alle \\ngebruikers verwijderen."; break; + + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + default: $s = "* ". $message; + } + return $s; + } +?> \ No newline at end of file diff --git a/calendar/lang/no_calendar.inc.php b/calendar/lang/no_calendar.inc.php new file mode 100755 index 0000000000..06d6154280 --- /dev/null +++ b/calendar/lang/no_calendar.inc.php @@ -0,0 +1,82 @@ +x": + $s = "De følgende konflikter ved den foreslåtte tidene:
      $m1
    "; break; + + case "Your suggested time of x - x conflicts with the following existing calendar entries:": + $s = "Din foreslåtte tid av $m1 - $m2 er i konflikt med de følgende kalender entries:"; break; + + case "you must enter one or more search keywords": + $s = "Du må skrive inn ett eller flere søkeord"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": $s = "Er du sikker på at\\ndu vil\\nslette denne entry ?\\n\\nDette vil slette\\ndenne entry for alle brukere."; break; + + default: $s = "* $message"; + } + return $s; + } +?> \ No newline at end of file diff --git a/calendar/lang/sp_calendar.inc.php b/calendar/lang/sp_calendar.inc.php new file mode 100755 index 0000000000..8f385b6dac --- /dev/null +++ b/calendar/lang/sp_calendar.inc.php @@ -0,0 +1,89 @@ +x": + $s = "Los siguientes conflictos con las horas sugeridas:
      $m1
    "; break; + + case "Your suggested time of x - x conflicts with the following existing calendar entries:": + $s = "Sus horas sugeridas de $m1 - $m2 estan en conflicto con las siguientes entradas en el calendario:"; break; + + case "you must enter one or more search keywords": + $s = "Ud. debe entrar una o mas claves de busqueda"; break; + + case "are you sure\\nyou want to\\ndelete this entry ?\\n\\nthis will delete\\nthis entry for all users.": + $s = "Esta seguro\\nde querer\\nborrar esta entrarda ?\\n\\nEsto borrara\\nla entrada para todos los usuarios."; break; + + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + case "": $s = ""; break; + default: $s = "* ". $message; + } + return $s; + } +?> \ No newline at end of file diff --git a/calendar/search.php b/calendar/search.php new file mode 100755 index 0000000000..f855652904 --- /dev/null +++ b/calendar/search.php @@ -0,0 +1,97 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "calendar"; + + include("../header.inc.php"); + + if (! $keywords) { + // If we reach this it becuase they didn't search for anything, + // attempt to send them back to where they where. + Header("Location: $from?sessionid=" . $phpgw->session->id . "&date=$date" + . "month=$month&day=$day&year=$year"); + } else { // else keywords + $phpgw->common->header(); + + $error = ""; + + if (strlen($keywords) == 0) + $error = lang_calendar("You must enter one or more search keywords."); + + $matches = 0; + +?> + +

    " . lang_calendar("Search Results"); ?>

    + +" . lang_common("Error") . ": $error"; + } else { + $ids = array(); + $words = split(" ", $keywords); + for ($i = 0; $i < count($words); $i++) { + $sql = "SELECT DISTINCT webcal_entry.cal_id, webcal_entry.cal_name, " + . "webcal_entry.cal_date,webcal_entry_repeats.cal_type " + . "FROM webcal_entry, webcal_entry_user, webcal_entry_repeats, " + . "webcal_entry_groups WHERE (UPPER(webcal_entry.cal_name) LIKE UPPER('%" + . $words[$i] . "%') OR UPPER(webcal_entry.cal_description) " + . "LIKE UPPER('%" . $words[$i] . "%')) AND (webcal_entry_user.cal_login = '" + . $phpgw->session->loginid. "' OR (webcal_entry.cal_access='public' " + . sql_search_calendar() . ")) ORDER BY cal_date"; + + $phpgw->db->query($sql); + while ($phpgw->db->next_record()) { + $matches++; + $ids[strval( $phpgw->db->f(0) )]++; + $info[strval( $phpgw->db->f(0) )] = $phpgw->db->f(1) . " (" + . date_to_str($phpgw->db->f(2)) . ")"; + } + } + } + + if ($matches > 0) + $matches = count($ids); + + if ($matches == 1) + echo "1 match found.

    "; + else if ($matches > 0) + echo "" . lang_calendar("x matches found",$matches) . ".

    "; + else + $error = lang_calendar("no matches found."); + +// now sort by number of hits + if (! strlen($error)) { + arsort ($ids); + for (reset($ids); $key = key($ids); next($ids)) { + echo "

  • session->id + . "&id=$key\">" . $info[$key] . "\n"; + + } + } else { + echo $error; + } + + } // End else keywords +?> + +

    + diff --git a/calendar/view.php b/calendar/view.php new file mode 100755 index 0000000000..89c1aed253 --- /dev/null +++ b/calendar/view.php @@ -0,0 +1,216 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["currentapp"] = "calendar"; + include("../header.inc.php"); + // This will take the loginid and convert it into firstname and lastname. + // This function will be moved out of here someday and be used through out + // the program. + function convert_login_name($db,$l) + { + $db->query("select firstname,lastname from accounts where loginid='$l'"); + $db->next_record(); + return array($db->f("firstname"),$db->f("lastname")); + } + + function grab_group($db,$id) + { + $db->query("select groups from webcal_entry_groups where cal_id='$id'"); + $db->next_record(); + + return $db->f("groups"); + } + + if ($year) $thisyear = $year; + if ($month) $thismonth = $month; + + $pri[1] = lang_common("Low"); + $pri[2] = lang_common("Medium"); + $pri[3] = lang_common("High"); + + $unapproved = FALSE; + + if ($id < 1) { + echo lang_calendar("Invalid entry id."); + exit; + } + + // first see who has access to view this entry + $is_my_event = false; + $phpgw->db->query("SELECT cal_id FROM webcal_entry_user WHERE cal_login='" + . "$loginid' AND cal_id = $id"); + + $phpgw->db->next_record(); + if ($phpgw->db->f(0) == $id) + $is_my_event = true; + + $phpgw->db->query("SELECT cal_create_by, cal_date, cal_time, cal_mod_date, " + . "cal_mod_time,cal_duration,cal_priority,cal_type,cal_access, " + . "cal_name,cal_description FROM webcal_entry WHERE cal_id=$id"); + + $phpgw->db->next_record(); + + $create_by = $phpgw->db->f(0); + $name = $phpgw->db->f(9); + $description = $phpgw->db->f(10); + + $description = htmlspecialchars($description); + $description = nl2br($description); + +?> +

    + + + +

    + + +"; + } + +?> + + + + + + +db->f(1)); + $thisyear = (int)($phpgw->db->f(1) / 10000); + $thismonth = ($phpgw->db->f(1) / 100) % 100; + $thisday = $phpgw->db->f(1) % 100; + + if ($phpgw->db->f(2) > 0) { + ?> + + + + + db->f(5) > 0) { + echo ""; + } +?> + + + + + + +\n"; + + // Isn't there a function somewhere to do this ?? + list($fn,$ln) = convert_login_name($phpgw->db,$phpgw->db->f(0)); + if ($fn && $ln) + echo "\n"; + else + echo "\n"; +?> + + + + + +groups->convert_string_to_names(grab_group($phpgw->db,$id)); + if ($cal_groups) + echo ""; +?> + + + + + + + +
    " . lang_calendar("Description") . ":" + . "$description
    :db->f(1)); ?>
    :db->f(2)); ?>
    " . lang_calendar("Duration") . ":" + . $phpgw->db->f(5) . " " . lang_calendar("minutes") . "
    :db->f(6)]; ?>
    " . lang_common("Created by") . ":$fn $ln
    " . $phpgw->db->f(0) . "
    :db->f(3)) . " " . display_time($phpgw->db->f(4)); + ?>
    " . lang_common("Groups") . ":$cal_groups
    :db->query("SELECT webcal_entry_user.cal_login, accounts.lastname, " + . "accounts.firstname, webcal_entry_user.cal_status " + . "FROM webcal_entry_user, accounts WHERE webcal_entry_user." + . "cal_id='$id' AND webcal_entry_user.cal_login = accounts." + . "loginid"); + + $first = 1; + while ($phpgw->db->next_record()) { + if ($first) + $first = 0; + else + echo "
    "; + if (strlen($phpgw->db->f(1)) > 0) + echo $phpgw->db->f(1) . ", " . $phpgw->db->f(2); + else + echo $phpgw->db->f(0); + } +?> +
    : + db->query("SELECT * from webcal_entry_repeats WHERE cal_id=$id"); + $phpgw->db->next_record(); + if (substr($phpgw->db->f(5),0,1) == 'y') + $t_repeat_days = lang_common("Sunday "); + if (substr($phpgw->db->f(5),1,1) == 'y') + $t_repeat_days .= lang_common("Monday "); + if (substr($phpgw->db->f(5),2,1) == 'y') + $t_repeat_days .= lang_common("Tuesday "); + if (substr($phpgw->db->f(5),3,1) == 'y') + $t_repeat_days .= lang_common("Wednesday "); + if (substr($phpgw->db->f(5),4,1) == 'y') + $t_repeat_days .= lang_common("Thursday "); + if (substr($phpgw->db->f(5),5,1) == 'y') + $t_repeat_days .= lang_common("Friday "); + if (substr($phpgw->db->f(5),6,1) == 'y') + $t_repeat_days .= lang_common("Saturday "); + + echo $phpgw->db->f(2) . " ("; + if ($phpgw->db->f(3)) + echo "ends: " . $phpgw->db->f(3) . ", "; + if ($phpgw->db->f(2) == 'weekly') + echo lang_calendar("days repeated") . ": " . $t_repeat_days . ", "; + + echo lang_calendar("frequency") . ": " . $phpgw->db->f(4) . ")"; + + ?> + +
    + +

    + +session->loginid == $create_by) { + echo "session->id . "&id=$id\">" + . lang_common("Edit") . "
    \nsession->id . "&id=$id\" onClick=\"return confirm('" + . lang_calendar("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.") . "');\">" . lang_common("Delete") . "
    \n"; + } +?> + + + diff --git a/calendar/week.php b/calendar/week.php new file mode 100755 index 0000000000..274fe1d6e6 --- /dev/null +++ b/calendar/week.php @@ -0,0 +1,173 @@ + + * + * http://www.radix.net/~cknudsen * + * -------------------------------------------- * + * 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$ */ + if (!$friendly){ + $phpgw_flags["noheader"]="True"; + } + + $phpgw_flags["currentapp"] = "calendar"; + include("../header.inc.php"); + + if (! $friendly) { + $phpgw->common->header(); + } else + echo ""; + + $view = "week"; +?> + + + + + 0) { + $thisyear = substr($date, 0, 4); + $thismonth = substr($date, 4, 2); + $thisday = substr($date, 6, 2); + } else { + if ($month == 0) + $thismonth = date("m"); + else + $thismonth = $month; + + if ($year == 0) + $thisyear = date("Y"); + else + $thisyear = $year; + + if ($day == 0) + $thisday = date("d"); + else + $thisday = $day; + } + + $next = mktime(2, 0, 0, $thismonth, $thisday + 7, $thisyear); + $nextyear = date("Y", $next); + $nextmonth = date("m", $next); + $nextday = date("d", $next); + + $prev = mktime(2, 0, 0, $thismonth, $thisday - 7, $thisyear); + $prevyear = date("Y", $prev); + $prevmonth = date("m", $prev); + $prevday = date("d", $prev); + + // We add 2 hours on to the time so that the switch to DST doesn't + // throw us off. So, all our dates are 2AM for that day. + $sun = get_sunday_before($thisyear, $thismonth, $thisday) + 7200; + $sat = $sun + (3600 * 24 * 7); +?> + + + + + + + +session->id + . "&year=$nextyear&month=$nextmonth&day=$nextday\">>>"; + } +?> + +
    << + + + +db->query("SELECT lastname, firstname FROM accounts WHERE loginid='" + . $phpgw->session->loginid . "'"); + echo "
    \n"; + if ($phpgw->db->next_record()) { + if (strlen($phpgw->db->f(0)) || strlen($phpgw->db->f(1))) { + if (strlen($phpgw->db->f(1))) + echo $phpgw->db->f(1) . " "; + if (strlen($phpgw->db->f(0))) + echo $phpgw->db->f(0) . " "; + } else + echo $user; + } +?> +
    +
    + + + + + + + + + + + + + + +session->loginid); + + $today = mktime(2,0,0,date("m"), date("d"), date("Y")); + for ($j = 0; $j < 7; $j++) { + $date = $sun + ($j * 24 * 3600); + $CELLBG = $phpgw->nextmatchs->alternate_row_color($CELLBG); + + echo "\n"; + } + +?> + + +
    ">">">">">">">
    "; + else + echo "BGCOLOR=\"$CELLBG\">"; + + print_date_entries($date,$hide_icons,$phpgw->session->id); + + echo "
    + + link("week.php","$yeartext&friendly=1"); + } +?>" TARGET="cal_printer_friendly" +onMouseOver="window.status = ''">[] + + * + * -------------------------------------------- * + * 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$ */ + + if ($friendly) { + $phpgw_flags["noheader"] = True; + } + + $phpgw_flags["currentapp"] = "calendar"; + include("../header.inc.php"); + + if ($friendly) { + echo ""; + } +?> + +

    + + + session->id + . "&year=" . ($year - 1) . "\"><<"; + ?> + + + + session->id + . "&year=" . ($year + 1) . "\">>>"; + ?> + + + + + + + + + + + + + + + + + + +
    " align="center"> + +
    +
    + +session->id . "&friendly=1&" + . "&year=$year\"TARGET=\"cal_printer_friendly\" onMouseOver=\"window." + . "status = '" . lang_calendar("Generate printer-friendly version") . "'\">[" + . lang_calendar("Printer Friendly") . "]"; + } + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); + + diff --git a/doc/CHANGELOG b/doc/CHANGELOG new file mode 100755 index 0000000000..9d935bbc47 --- /dev/null +++ b/doc/CHANGELOG @@ -0,0 +1,187 @@ +[08--2000] - removed db_lock() and db_unlock() I changed the phpgw_db_* to use them + properly + - remove all remaining references to $dbase and $phpgw_db we are now using + $phpgw->db for database stuff + - Added unlock() in halt() for the database class. This should help prevent + database lockups if the program executes some invailed SQL. + - Moved around the directory layout. The include files and images are now + in the applications directory. + +[08152000] - Fixed a problem with the calendar not showing the months in the users + langague preference. + - Added the new alpha human resources section + - Added the new alpha inventory program + - Added new global var $phpgw_flags + replaces $currentapp, $noheader, $nonavbar + - Small change in the API with the lang files. + - Added missing files for french + - pop_sort() accelerated by using temp file for storing header + information - speed factor > 2 for re-sorts! + - Added a temp quick fix for PostgreSQL not working in the calendar + I am using the old code, so there might be bugs. This is + just until we can find a better solution. + - Added a warning message if users are still apart of a group thats + about to be deleted. + - a bunch of error messages where shown when some header info was + split into multiple lines (on pop account), and address info + could not be built in this case. Fixed. + - Added Dutch and Korean langague support + - Added default app and default sorting order preference + - Fixed multipart handling on pop3 + - Added config option for where the "Powered by" can go, top or bottom + - add/edit/delete accounts code has been cleaned up greatly. + - Better error control in the accounts section + - Fixed check_owner() in session class not reporting the owner properly + +[08072000] - Fixed current users next matchs icons not showing up properly + - Added support to save sent-messages into Sent folder + - Fixed bug where users always see the mail server connection + error on a new installation + - Added cookie support so you can save your session id as a cookie + - Fixed permission bug in preferences with anonymous users + - Fixed permission bug in calendar + - Greatly improved ftp app + - Started adding the new manager permission + - Added link in the admin section to find out your phpinfo() + - A few bug fixes in the admin section + +[08042000] - Fixed repeating events in calendar day view + - Started refering to modules as applications + - Fixed todo list not showing list properly + - Started adding new application layout + - Clean up documentation + - Added better german langague file support. + - Fixed addressbook not showing the group access properly + - Added nextmatchs to email + - Deleting a message will now forward you to the next message + instead of the inbox. + - Added spanish, Itailian and Norwegien lang files. + - EMail now supports POP-3 + - Next matchs icons in email + - Many other fixes and features that we can't remeber :) + +[07122000] - Added multi-langague support + - Added confirms before records are deleted. + - Fixed the footer not being called in the calendar + - Fixed the todo list not showing the list properly + - Added date format thanks vinz + - Renamed session.class to session.inc.php + - Added feature to allow stale uploads to be deleted on + systems that don't support cron + - Fixed calendar searchs + - Added preferences to have text under icons on navigation bar + +[07062000] - Fixed javascript pop-up window upadting wrong fields. + thanks vinz + - Fixed security hole in logout.php + - Added support support for todo list showing who created + the record. + - Added support for date due in todo list. + - Fixed bug in killsession.php thanks vinz + - Added support for day view in calendar + - Added support for hovering descriptions using the alt tag + - Added support for newsheadlines program + thanks Mark Peters + - The calendar sports a new layout. + - Started converting HTML to be HTML 4.0 complient + - Added new filemanager program + - New experimental look for the user section. + +[06302000] - Moved around the inc directorys for better security. + - Fixed the file attachments and parse errors. + - Fixed file uploads for Windows thanks vinz + - Added to bring you back to the same folder you are in + (email) thanks smoser + - Fixed directorys not be deleted properly and should + now work under windows. + - Updated docs a little + - Include pre-alpha release of trouble ticket system + - A few other small bug fixes. + +[06272000] - Updated most of the docs for the new name (phpGroupWare) + - Resolve a few issues with installing on PHP 4. + - editaccounts.php3 now updated the calendar tables properly + - Cleaned up groups.inc and removed no longer used and repeated code + - Fixed broken link in calendar + - Renamed all .php3 so program works in PHP 4. + - Added next and previous links in calendar year view + - Printer friendly version of the calendar no longer show the + navigation bar on top + +[06222000] - Fixed problem with timeformat only showing up if you have calendar + access. + - Added support to select from a few pre-defined date formats + Anyone have suggestions on some more ? + - Fixed problem with create_tables.mysql for calendar global events + thanks Vincent Larchet + - Added support for multiable file uploads. + - Fixed table locking issues in editaccount.php3 + - There is now a config option to point to a differant directory that webdistro is install on. + - A couple of other small bug fixes and code cleanup. + - Fixed a problem with email signatures not working + +[06172000] - Added db_lock() and db_unlock. That should fix the table locking + problems. + - Fixed problem with filtering in todo list. + - Fixed admin viewaccount.php3 not showing permissions properly. + +[06162000] - included new theme thanks Marl + - Made sure that the docs where included this time. + - Fixed javascript error in edit_entry.php thanks marvinhorst + - Fixed problem with edit_entry.php not including current users + loginid + - Renamed functions.inc to calendar.inc to make things easier to + understand. + - Renamed all .php file to .php3 + - Fixed small calendar days, Sa and Su where backwords. + - Removed cal_eventid from webcal_entry_repeats, wasn't needed and was causing problems. + - Fixed a few problems with create_tables.* + - Global public items should now work in the calendar + - Added feature to change users passwords (admin) + - Update some of the docs. + - Renamed and merged some files in the calendar. + - Added percent of users that logged out to accesslog + +[06092000] - Fixed lastlogin information that wasn't updating. + - Added table locks in edit_entry_handler.php (calendar) + - Added feature to annoy users that haven't changed there + password for more then 30 days. + - Added javascript popup window for addressbook in email + Thanks Brian King + +[06082000] - Added new groups class + - Combined permissions and preferences into session.inc + - Renamed session.inc to webdistro_common.inc + - Fixed blank items showing up in the todo list. + - Cleaned up create_tables.* Took out all of the uneeded things. + - Included a new theme, it looks pretty bad on some computers. + But, we need to test things out a little with it. + +[06052000] - Fixed a few permission bugs in the addressbook + - Started converting all programs to use the new session class + - Light code cleanup + - Fixed parse errors in a few places + - Added timezone support + - Updated stalesessions.pl + - Fixed a few possiable security problems with addressbook + +[06032000] - Fixed problems editing accounts using postgresql + - Fixed problems creating account in create_tables.* + - Admin section updated. Sorting features. New layout for current + sessions. + - login.php3 Fixed problem with it not updating users lastlogin + - Fixed problems with adding events to the calendar. + - Fixed problems with repeating events with a frequency of more + then 1. I think I have finally narrowed most of the problems + down. + - Addressbook had the city and street mixed. Thanks Eric Degner + - Added feature to show who created the addressbook entry. + I will add support for this in the todolist later. + - Cleaned up some unneeded files in some of the directorys. + - Added next and previous link in message.php3 for email. + - Converted program to start using the new permissions and + preferences class. + - Fixed session table for mysql + +[06022000] - Calendar bug fixes and code cleanup. + - Security fix for login.php3 diff --git a/doc/CREDITS b/doc/CREDITS new file mode 100755 index 0000000000..471e1f38ca --- /dev/null +++ b/doc/CREDITS @@ -0,0 +1,75 @@ +### Core Developers ### + +* Joseph Engo (aka Jengo) |jengo@phpgroupware.org| +- Man who started it all. +- Provides project direction, documentation. +- Works on core services session management, permissions, groups class, etc... +- Wrote the following applications +--- Addressbook (orignal work) +--- ToDolist (orignal work) +--- Bookmarks (orignal work) +--- Email (Adapted from Aeromail, which was written by Mark Cushman http://the.cushman.net/) +--- Calendar (Adapted from WebCalendar, which was written by Craig Knudsen http://www.radix.net/~cknudsen) +- Continues development and project direction. + +* Dan Kuykendall (aka Seek3r) |dan@kuykendall.org| +- Project Administrator/Supervisor. +- Provides project direction, documentation. +- Works on core services such as the $phpgw[] array for application developers. +- Hosts website, and offers commercial support thru Clear River Technologies (http://www.clearrivertech.com) +- Wrote the following applications +--- File Manager (Based on filemanager, which was written by Lacey Pevey http://px.sklar.com/code.html?code_id=258) +--- Chat (orignal work) +- Continues development and project direction. + +### Application Developers ### +* Michael Weber |weber@rising-systems.de| +- Develops/Maintains Trouble Ticket System + +* Vincent Larchet (aka vinz) |vinz@users.sourceforge.net| +- He hops from application to application helping out everywhere +- Keeps phpGW working on NT servers + +* Mark A Peters (aka Skeeter) |mpeters@satx.rr.com| +- Developed/Maintains Headlines application +- Helps with almost all other applications as well + +*Scott Moser (aka smoser) |smoser@brickies.net| +-Developed/Maintains the FTP application + +* Itzchak Rehberg (aka izzy)|izzysoft@qumran.org| +- has been working on replacement for mail() function +- Developed/Maintains POP-3 class +- Built/Maintains the german language files +- He hops from application to application helping out everywhere + +* Stephan Beal (aka wander)|stephan@wanderinghorse.net| +- Initial quick-n-dirty rbs port from the MRBS system +- Minor bug fixes. +- Conned Hakon into doing the Norwegian translations ;) + +### Patch Contributors ### (in alphabetical order) +* Wolfgang Lunz |wlunz@infomatec.de| +* bachroxx |bachroxx@users.sourceforge.net| +* brandonne |brandonne@users.sourceforge.net| +* flimm |flimm@users.sourceforge.net| +* gmartine |gmartine@users.sourceforge.net| +* Omer Uner Guclu |oquclu@superonline.com| +* Marvin Horst |marvinhorst@hotmail.com| +* Brian King |bking@affcu.com| +* Marl |marl@users.sourceforge.net| +* Mike Preishuber |martin.preishuber@eclipt.uni-klu.ac.at| +* Roy Svendsen |roysv@users.sourceforge.net| +* smoser |smoser@users.sourceforge.net| +* preisel |preisl@users.aourceforge.net| +* Raúl Alexis Betancort Santana |rabs@dimension-virtual.com| +- Great working on our first template set. + +### Other Contributors ### +* Hakon Tjaum +- Norwegian translations. + + +Thanks to Crista Schofield and Eric Degner for *TONS* of Beta testing. +All others on the phpgroupware-developers@lists.sourceforge.net mailing list +And finally every one of our users for the encouragement that keeps us happy, which means more development. diff --git a/doc/FAQ.html b/doc/FAQ.html new file mode 100644 index 0000000000..767c79069c --- /dev/null +++ b/doc/FAQ.html @@ -0,0 +1,55 @@ + + + + + phpGroupWare FAQ + + + + +

    phpGroupWare FAQ

    + +

    Dan Kuykendall <dan@kuykendall.org>

    v1.0, 15 July 2000 +


    + phpGroupWare Frequently Asked Questions. +
    +

    1. Building and Installing

    + +

    1.1 Questions and Answers

    + +

    Q: When I try to send file attachments, I get errors about safe mode being +effect.
    +A: I ran into this problem after I installed Aeromail for the first time.
    +Try chown root.root for all files in your /phpGroupWare directory. I don't know +why this is needed. Any ideas ? +

    Q: Why don't you just use the session class from phplib? Why not use cookies +to hold the sessionid?
    +A: I personally don't like using cookies for something like this.
    +However, the session management is currently being abstracted for the applications. +This means that switching to cookies will be possible for those that are interested. +

    Q: When I do a search, it returns the results but they have the wrong date.
    +A: Becuase of the way the tables are set up to handle repeating events, +I need to rewrite the query. I have not had a chance to play around with it +

    Q: When I view the calendar, I get tons of SQL errors.
    +A: Make sure all users on the system belong to a group. That should clear up +any problems. This is something that needs to be fixed. +

    Q: Will phpGroupWare run on PHP4 ?
    +A: Yes. It runs on both PHP3 and PHP4. +

    Q: Will phpGroupWare work with SSL ?
    +A: Sure, why not ? I am running it with mod_ssl and have had no problems. +Since there are no references to http:// or https:// there should not be +any problems with it. +

    Q: Does phpGroupWare work on any other databases ?
    +A: Right now, no. I have been playing around with support for mSQL, but, that +will take some time. Other databases are completly unknown at this point, +support for Oracle, MS-SQL, and others are planned for the future. +

    Q: I am having problems installing on PostgreSQL 6.x.
    +A: phpGroupWare is being developed with version 7.x. I tried installing it on +6.x and ran into a bunch of probelms. Unless you plan on toying around +with it, your better off with 7.x. +

    Q: Will phpGroupWare work with Windows?
    +A: Yes, there several people who are using it.
    +Thanks Vincent Larchet <<vinz@users.sourceforge.net>> for patching anything +we do that breaks phpGroupWare on NT. + + diff --git a/doc/FAQ.sgml b/doc/FAQ.sgml new file mode 100644 index 0000000000..5bd0c91442 --- /dev/null +++ b/doc/FAQ.sgml @@ -0,0 +1,65 @@ + + + +

    + + phpGroupWare FAQ + + + Dan Kuykendall <dan@kuykendall.org> + + + v1.0, 15 July 2000 + + + phpGroupWare Frequently Asked Questions. + + + +Building and Installing +Questions and Answers +

    +Q: When I try to send file attachments, I get errors about safe mode being + effect. +A: I ran into this problem after I installed Aeromail for the first time. + Try chown root.root for all files in your /phpGroupWare directory. I don't know + why this is needed. Any ideas ? +

    +Q: Why don't you just use the session class from phplib? Why not use cookies + to hold the sessionid? +A: I personally don't like using cookies for something like this. + However, the session management is currently being abstracted for the applications. + This means that switching to cookies will be possible for those that are interested. +

    +Q: When I do a search, it returns the results but they have the wrong date. +A: Becuase of the way the tables are set up to handle repeating events, + I need to rewrite the query. I have not had a chance to play around with it +

    +Q: When I view the calendar, I get tons of SQL errors. +A: Make sure all users on the system belong to a group. That should clear up + any problems. This is something that needs to be fixed. +

    +Q: Will phpGroupWare run on PHP4 ? +A: Yes. It runs on both PHP3 and PHP4. +

    +Q: Will phpGroupWare work with SSL ? +A: Sure, why not ? I am running it with mod_ssl and have had no problems. + Since there are no references to http:// or https:// there should not be + any problems with it. +

    +Q: Does phpGroupWare work on any other databases ? +A: Right now, no. I have been playing around with support for mSQL, but, that + will take some time. Other databases are completly unknown at this point, + support for Oracle, MS-SQL, and others are planned for the future. +

    +Q: I am having problems installing on PostgreSQL 6.x. +A: phpGroupWare is being developed with version 7.x. I tried installing it on + 6.x and ran into a bunch of probelms. Unless you plan on toying around + with it, your better off with 7.x. +

    +Q: Will phpGroupWare work with Windows? +A: Yes, there several people who are using it. + Thanks Vincent Larchet <<vinz@users.sourceforge.net>> for patching anything + we do that breaks phpGroupWare on NT. +

    +
    diff --git a/doc/FAQ.txt b/doc/FAQ.txt new file mode 100644 index 0000000000..b515ac84e8 --- /dev/null +++ b/doc/FAQ.txt @@ -0,0 +1,132 @@ + phpGroupWare FAQ + Dan Kuykendall + v1.0, 15 July 2000 + + phpGroupWare Frequently Asked Questions. + ______________________________________________________________________ + + Table of Contents + + + 1. Building and Installing + + 1.1 Questions and Answers + + + ______________________________________________________________________ + + 11.. BBuuiillddiinngg aanndd IInnssttaalllliinngg + + 11..11.. QQuueessttiioonnss aanndd AAnnsswweerrss + + Q: When I try to send file attachments, I get errors about safe mode + being effect. + A: I ran into this problem after I installed Aeromail for the first + time. + Try chown root.root for all files in your /phpGroupWare directory. I + don't know why this is needed. Any ideas ? + + Q: Why don't you just use the session class from phplib? Why not use + cookies to hold the sessionid? + A: I personally don't like using cookies for something like this. + However, the session management is currently being abstracted for the + applications. This means that switching to cookies will be possible + for those that are interested. + + Q: When I do a search, it returns the results but they have the wrong + date. + A: Becuase of the way the tables are set up to handle repeating + events, I need to rewrite the query. I have not had a chance to play + around with it + + Q: When I view the calendar, I get tons of SQL errors. + A: Make sure all users on the system belong to a group. That should + clear up any problems. This is something that needs to be fixed. + + Q: Will phpGroupWare run on PHP4 ? + A: Yes. It runs on both PHP3 and PHP4. + + Q: Will phpGroupWare work with SSL ? + A: Sure, why not ? I am running it with mod_ssl and have had no + problems. Since there are no references to http:// or https:// there + should not be any problems with it. + + Q: Does phpGroupWare work on any other databases ? + A: Right now, no. I have been playing around with support for mSQL, + but, that will take some time. Other databases are completly unknown + at this point, support for Oracle, MS-SQL, and others are planned for + the future. + + Q: I am having problems installing on PostgreSQL 6.x. + A: phpGroupWare is being developed with version 7.x. I tried + installing it on 6.x and ran into a bunch of probelms. Unless you + plan on toying around with it, your better off with 7.x. + + Q: Will phpGroupWare work with Windows? + A: Yes, there several people who are using it. + Thanks Vincent Larchet <> for patching + anything we do that breaks phpGroupWare on NT. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/HOWTO.html b/doc/HOWTO.html new file mode 100644 index 0000000000..5a9d6969a0 --- /dev/null +++ b/doc/HOWTO.html @@ -0,0 +1,159 @@ + + + + + phpGroupWare HOWTO + + + + +

    phpGroupWare HOWTO

    + +

    Joseph Engo <jengo@phpgroupware.org>, + Dan Kuykendall <dan@kuykendall.org>

    v1.0, 7 July 2000 +


    + This document explains how to install and configure phpGroupWare. +
    +

    1. Introduction

    + +

    phpGroupWare is a web based groupware application that includes integrated features such as +email, calendar, todo list, address book, file manager, headline news, and a trouble ticket system. +

    It should run on all systems where PHP is avalible and currently supports MySQL and PostgreSQL. +

    1.1 What is phpGroupWare and why should I use it?

    + +

    phpGroupWare is: +

    phpGroupWare is a web based groupware application that includes integrated features such as +email, calendar, todo list, address book, file manager, headline news, and a trouble ticket system. +

    +

    You should use it if: +

    You would like a powerful groupware system that can be access from anywhere on the Internet. +For companies with a distributed user base, it's an ideal solution. Oh, and did I mention that its FREE? +

    2. Installation

    + +

    2.1 Requirements

    + +

    You will need PHP compiled and installed on your system. You will also need MySQL or PostgreSQL setup. +If you are planning on using the email system, you will need to have an IMAP server installed and IMAP support compiled into PHP. +You can have it installed as an Apache module or command line version, the Apache module is prefered. +We will assume that you are running on a Linux or other Unix system for these steps. +Windows is supported, but there is no documentation for it currently. +

    2.2 Tested Systems

    + +

    On Linux 2.2.x +

      +
    • PHP 3.0.15+ / PHP 4.0.x
    • +
    • Apache 1.3.x
    • +
    • MySQL 3.22.25 or PostgreSQL 7.0.x
    • +
    • Courier-IMAP 0.33+
    • +
    +

    We have reports of it working on Windows NT, but no details at this time. +

    2.3 Tested Systems

    + +

    After you have met the system requirements, unpack the tarball in the html +directory of your webserver. (eg, /home/httpd/html) +

    The first step is to setup the database and create the tables needed. In the +doc directory there is a file called create_tables.(name of your database) +

    Installation with MySQL

    + +

    We will assume that you are using the database named phpgroupware. +

    $ mysql phpgroupware -u username -p < create_tables.mysql +

    Installation with PostgreSQL

    + +

    We will assume that you are using the database named phpgroupware. +

    $ psql -d phpgroupware -U username < create_tables.pgsql +

    2.4 Configure phpGroupWare

    + +

    Change to the inc directory.
    +Edit the file called config.inc.php to point to the location of your include files. +

    +Some people might prefer to install their include files in a directory which is not world viewable. +For this, you will need to move everything except config.inc.php into another directory +and point config.inc.php to that directory. For most installations, the current location +of these file should be fine. +
    + +Edit globalconfig.inc.php to reflect your system settings. You can choose which programs +you would like to have available to your system.
    +For example, if you do not have access to a IMAP server, you can change +$installed["email"] = "Y"; to $installed["email"] = "N";
    +This would make this program unavaiable to all users regardless of their permissions. +

    If you are using the email system you will need to create a temporary directory +where file uploads will be stored. For security reasons, you should chown +nobody.nobody and chmod 700 to that directory. Depending on your system configuration. +Default installs of Apache normally run as the user nobody. You may need your system +administrator to do this for you if you do not have root access. +

    If you do not have access to root, create this file and run it. +

    +  <?php 
    +    if (mkdir("/path/to/temp/directory",0700)) { 
    +      echo "Directory created successfully"; 
    +    } else { 
    +      echo "Error creating directory"; 
    +    }
    +
    + +If you have access to cron, you may want to setup the files in the cron +directory. +

    stalesessions.pl - There are 2 reasons for this file. +

      +
    • Users always forget to logout. This way the session doesn't sit around forever, creating a possible security risk.
    • +
    • The email system requires plain text passwords which are stored in the sessions table.
    • +
    +

    This file is not required, you can simply uncomment the lines indicated in session.class in update_dla(). +This will require an extra query during every transaction which could cause performance +problems. Also, if there are no logins in a few days, they will sit around and +wait for someone to login before they are deleted. If you go this route, you +will need to edit the number of seconds until they are deleted. It defaults to 2 hours +(7200 secs). If you choose to use the cron program, simply edit the settings +for your database and uncomment the line for your database type. +

    stale_uploads.pl - This will delete file attachments for messages that where not +completed. If a users browser crashes, internet connection dies, etc, their +files will sit there forever unless deleted. You could add a few lines to +logout.php that will look in the temp directory for any stale uploads and delete +them. But, once again, it becomes a performance issue. +

    If your config is setup properly you can now login. Point your browser to the +installed location and login with the username demo and the password is 1234
    +At this point it would be a good idea to create a new user and delete the old +one. +

    3. About this document

    + +

    3.1 New versions

    + +

    The newest version of this document can be found on our website +http://www.phpgroupware.org as SGML source, HTML, or TEXT. +

    3.2 Comments

    + +

    Comments on this HOWTO should be directed to the phpGroupWare developers mailing list +phpgroupware-developers@lists.sourceforge.net. +

    To subscribe, go to +http://sourceforge.net/mail/?group_id=7305

    3.3 History

    + +

    This document was started by Joseph Engo and reworked by Dan Kuykendall. +

    3.4 Version History

    + +

    Old Version +

    +

      +
    • Created by Jengo, wasn't in SGML HOWTO format.
    • +
    +

    v1.0 (July 6, 2000) +

    +

      +
    • Built proper SGML version.
    • +
    • Included the FAQ.
    • +
    • Other minor additions.
    • +
    +

    3.5 Copyrights and Trademarks

    + +

    Copyright (c) Dan Kuykendall. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation +

    A copy of the license is available at +GNU Free Documentation License. +

    3.6 Acknowledgements and Thanks

    + +

    Thanks to Joesph Engo for starting phpGroupWare (at the time called webdistro) and the core of this HOWTO. +Thanks to all the developers and users who contribute to making phpGroupWare such a success. + + diff --git a/doc/HOWTO.sgml b/doc/HOWTO.sgml new file mode 100644 index 0000000000..fc3e12845f --- /dev/null +++ b/doc/HOWTO.sgml @@ -0,0 +1,184 @@ + + + +

    + + phpGroupWare HOWTO + + + Joseph Engo <jengo@phpgroupware.org>, + Dan Kuykendall <dan@kuykendall.org> + + + v1.0, 7 July 2000 + + + This document explains how to install and configure phpGroupWare. + + + +Introduction +

    + phpGroupWare is a web based groupware application that includes integrated features such as + email, calendar, todo list, address book, file manager, headline news, and a trouble ticket system. +

    It should run on all systems where PHP is avalible and currently supports MySQL and PostgreSQL. +

    +What is phpGroupWare and why should I use it? +

    + phpGroupWare is:

    + phpGroupWare is a web based groupware application that includes integrated features such as + email, calendar, todo list, address book, file manager, headline news, and a trouble ticket system.

    + + You should use it if:

    + You would like a powerful groupware system that can be access from anywhere on the Internet. + For companies with a distributed user base, it's an ideal solution. Oh, and did I mention that its FREE? +

    +Installation +Requirements +

    + You will need PHP compiled and installed on your system. You will also need MySQL or PostgreSQL setup. + If you are planning on using the email system, you will need to have an IMAP server installed and IMAP support compiled into PHP. + You can have it installed as an Apache module or command line version, the Apache module is prefered. + We will assume that you are running on a Linux or other Unix system for these steps. + Windows is supported, but there is no documentation for it currently. +

    +Tested Systems +

    + On Linux 2.2.x + + PHP 3.0.15+ / PHP 4.0.x + Apache 1.3.x + MySQL 3.22.25 or PostgreSQL 7.0.x + Courier-IMAP 0.33+ + + + We have reports of it working on Windows NT, but no details at this time. +

    +Tested Systems +

    + After you have met the system requirements, unpack the tarball in the html + directory of your webserver. (eg, /home/httpd/html) +

    + The first step is to setup the database and create the tables needed. In the + doc directory there is a file called create_tables.(name of your database) +

    +Installation with MySQL +

    + We will assume that you are using the database named phpgroupware.

    + $ mysql phpgroupware -u username -p < create_tables.mysql +

    +Installation with PostgreSQL +

    + We will assume that you are using the database named phpgroupware.

    + $ psql -d phpgroupware -U username < create_tables.pgsql +

    +Configure phpGroupWare +

    + Change to the inc directory. + Edit the file called config.inc.php to point to the location of your include files. + + Some people might prefer to install their include files in a directory which is not world viewable. + For this, you will need to move everything except config.inc.php into another directory + and point config.inc.php to that directory. For most installations, the current location + of these file should be fine. + + Edit globalconfig.inc.php to reflect your system settings. You can choose which programs + you would like to have available to your system. + For example, if you do not have access to a IMAP server, you can change + $installed["email"] = "Y"; to $installed["email"] = "N"; + This would make this program unavaiable to all users regardless of their permissions. +

    + If you are using the email system you will need to create a temporary directory + where file uploads will be stored. For security reasons, you should chown + nobody.nobody and chmod 700 to that directory. Depending on your system configuration. + Default installs of Apache normally run as the user nobody. You may need your system + administrator to do this for you if you do not have root access. +

    + If you do not have access to root, create this file and run it. + + + If you have access to cron, you may want to setup the files in the cron + directory. +

    + stalesessions.pl - There are 2 reasons for this file. + + Users always forget to logout. This way the session doesn't sit around forever, creating a possible security risk. + The email system requires plain text passwords which are stored in the sessions table. + + + This file is not required, you can simply uncomment the lines indicated in session.class in update_dla(). + This will require an extra query during every transaction which could cause performance + problems. Also, if there are no logins in a few days, they will sit around and + wait for someone to login before they are deleted. If you go this route, you + will need to edit the number of seconds until they are deleted. It defaults to 2 hours + (7200 secs). If you choose to use the cron program, simply edit the settings + for your database and uncomment the line for your database type. +

    + stale_uploads.pl - This will delete file attachments for messages that where not + completed. If a users browser crashes, internet connection dies, etc, their + files will sit there forever unless deleted. You could add a few lines to + logout.php that will look in the temp directory for any stale uploads and delete + them. But, once again, it becomes a performance issue. +

    + If your config is setup properly you can now login. Point your browser to the + installed location and login with the username demo and the password is 1234 + At this point it would be a good idea to create a new user and delete the old + one. +

    +About this document +New versions +

    + The newest version of this document can be found on our website as SGML source, HTML, or TEXT. +

    +Comments +

    + Comments on this HOWTO should be directed to the phpGroupWare developers mailing list + .

    + To subscribe, go to +

    +History +

    + This document was started by Joseph Engo and reworked by Dan Kuykendall. +

    +Version History +

    + Old Version +

    +

    + + Created by Jengo, wasn't in SGML HOWTO format. + +

    + v1.0 (July 6, 2000) +

    +

    + + Built proper SGML version. + Included the FAQ. + Other minor additions. + +

    +Copyrights and Trademarks +

    + Copyright (c) Dan Kuykendall. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation +

    +

    + A copy of the license is available at + . +

    +Acknowledgements and Thanks +

    + Thanks to Joesph Engo for starting phpGroupWare (at the time called webdistro) and the core of this HOWTO. + Thanks to all the developers and users who contribute to making phpGroupWare such a success. +

    +
    diff --git a/doc/HOWTO.txt b/doc/HOWTO.txt new file mode 100644 index 0000000000..f4e3a53a40 --- /dev/null +++ b/doc/HOWTO.txt @@ -0,0 +1,264 @@ + phpGroupWare HOWTO + Joseph Engo , Dan Kuykendall + + v1.0, 7 July 2000 + + This document explains how to install and configure phpGroupWare. + ______________________________________________________________________ + + Table of Contents + + + 1. Introduction + + 1.1 What is phpGroupWare and why should I use it? + + 2. Installation + + 2.1 Requirements + 2.2 Tested Systems + 2.3 Tested Systems + 2.3.1 Installation with MySQL + 2.3.2 Installation with PostgreSQL + 2.4 Configure phpGroupWare + + 3. About this document + + 3.1 New versions + 3.2 Comments + 3.3 History + 3.4 Version History + 3.5 Copyrights and Trademarks + 3.6 Acknowledgements and Thanks + + + ______________________________________________________________________ + + 11.. IInnttrroodduuccttiioonn + + phpGroupWare is a web based groupware application that includes + integrated features such as email, calendar, todo list, address book, + file manager, headline news, and a trouble ticket system. + + It should run on all systems where PHP is avalible and currently + supports MySQL and PostgreSQL. + + 11..11.. WWhhaatt iiss pphhppGGrroouuppWWaarree aanndd wwhhyy sshhoouulldd II uussee iitt?? + + phpGroupWare is: + + phpGroupWare is a web based groupware application that includes + integrated features such as email, calendar, todo list, address book, + file manager, headline news, and a trouble ticket system. + + + You should use it if: + + You would like a powerful groupware system that can be access from + anywhere on the Internet. For companies with a distributed user base, + it's an ideal solution. Oh, and did I mention that its FREE? + + 22.. IInnssttaallllaattiioonn + + 22..11.. RReeqquuiirreemmeennttss + + You will need PHP compiled and installed on your system. You will + also need MySQL or PostgreSQL setup. If you are planning on using the + email system, you will need to have an IMAP server installed and IMAP + support compiled into PHP. You can have it installed as an Apache + module or command line version, the Apache module is prefered. We + will assume that you are running on a Linux or other Unix system for + these steps. Windows is supported, but there is no documentation for + it currently. + + 22..22.. TTeesstteedd SSyysstteemmss + + On Linux 2.2.x + + +o PHP 3.0.15+ / PHP 4.0.x + + +o Apache 1.3.x + + +o MySQL 3.22.25 or PostgreSQL 7.0.x + + +o Courier-IMAP 0.33+ + + We have reports of it working on Windows NT, but no details at this + time. + + 22..33.. TTeesstteedd SSyysstteemmss + + After you have met the system requirements, unpack the tarball in the + html directory of your webserver. (eg, /home/httpd/html) + + The first step is to setup the database and create the tables needed. + In the doc directory there is a file called create_tables.(name of + your database) + + 22..33..11.. IInnssttaallllaattiioonn wwiitthh MMyySSQQLL + + We will assume that you are using the database named phpgroupware. + + $ mysql phpgroupware -u username -p < create_tables.mysql + + 22..33..22.. IInnssttaallllaattiioonn wwiitthh PPoossttggrreeSSQQLL + + We will assume that you are using the database named phpgroupware. + + $ psql -d phpgroupware -U username < create_tables.pgsql + + 22..44.. CCoonnffiigguurree pphhppGGrroouuppWWaarree + + Change to the inc directory. + Edit the file called config.inc.php to point to the location of your + include files. + + Some people might prefer to install their include files in a directory + which is not world viewable. For this, you will need to move every- + thing except config.inc.php into another directory and point con- + fig.inc.php to that directory. For most installations, the current + location of these file should be fine. + + + Edit globalconfig.inc.php to reflect your system settings. You can + choose which programs you would like to have available to your system. + For example, if you do not have access to a IMAP server, you can + change $installed["email"] = "Y"; to $installed["email"] = "N"; + This would make this program unavaiable to all users regardless of + their permissions. + + If you are using the email system you will need to create a temporary + directory where file uploads will be stored. For security reasons, + you should chown nobody.nobody and chmod 700 to that directory. + Depending on your system configuration. Default installs of Apache + normally run as the user nobody. You may need your system + administrator to do this for you if you do not have root access. + + If you do not have access to root, create this file and run it. + + as SGML source, HTML, or TEXT. + + 33..22.. CCoommmmeennttss + + Comments on this HOWTO should be directed to the phpGroupWare + developers mailing list phpgroupware-developers@lists.sourceforge.net + . + + To subscribe, go to http://sourceforge.net/mail/?group_id=7305 + + + + + 33..33.. HHiissttoorryy + + This document was started by Joseph Engo and reworked by Dan + Kuykendall. + + 33..44.. VVeerrssiioonn HHiissttoorryy + + Old Version + + + +o Created by Jengo, wasn't in SGML HOWTO format. + + v1.0 (July 6, 2000) + + + +o Built proper SGML version. + + +o Included the FAQ. + + +o Other minor additions. + + 33..55.. CCooppyyrriigghhttss aanndd TTrraaddeemmaarrkkss + + Copyright (c) Dan Kuykendall. Permission is granted to copy, + distribute and/or modify this document under the terms of the GNU Free + Documentation License, Version 1.1 or any later version published by + the Free Software Foundation + + A copy of the license is available at GNU Free Documentation License + . + + 33..66.. AAcckknnoowwlleeddggeemmeennttss aanndd TThhaannkkss + + Thanks to Joesph Engo for starting phpGroupWare (at the time called + webdistro) and the core of this HOWTO. Thanks to all the developers + and users who contribute to making phpGroupWare such a success. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/INSTALL b/doc/INSTALL new file mode 100755 index 0000000000..c3cc62f90d --- /dev/null +++ b/doc/INSTALL @@ -0,0 +1,7 @@ +[ phpGroupWare ] + +See the HOWTO for installation instructions. + +jengo@phpgroupware.org + + diff --git a/doc/LICENSE b/doc/LICENSE new file mode 100755 index 0000000000..8a53d829a3 --- /dev/null +++ b/doc/LICENSE @@ -0,0 +1,342 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + + diff --git a/doc/README b/doc/README new file mode 100755 index 0000000000..d93c4c0865 --- /dev/null +++ b/doc/README @@ -0,0 +1,63 @@ +** This file is mostly out of date, please see the HOWTO docs ** + +This program was created becuase I needed a more centralize means of conduting +my daily life. I have seen many great programs out there, calendars, todolist, +addressbooks, email, etc... But, there is a very common problem with 95% of +them, they don't like each other. ( The programs, not the people :) If I was +logged into the calendar and wanted to grab a phone number, I would have to +login to another app. Which became a real pain real quick. So, I search high +and low for something that would have all these systems tied in to one. Well, +I didn't find anything I really liked. So, I made my own. ( Isn't that the +driving force of 99% of Open Source apps ? :) + +Before I bore you to death, not all of these programs are written by me. Some, +I wrote my self. Some where downloaded and converted. All apps are released +under the GPL license. I would not use anything but. If you are intrested +in adding/recommending a program to be included in this ditro. Please, send +me the URL. I will not except restrictive licenses. I will only accept GPL +or freeware. If you are intrested in helping out with development, or think +you might be able to help out. Let me know what your plains are. + +You might have noticed there are a few references to programs that can't be +found anywhere in the archive or on the site. Thats becuase there not ready +yet. For example, pop_mail. This is a feature that will be added in the +future. It will give the admin control over who has POP-3 access for virtual +users. Becuase the system does not use nor require the user to have a shell +account on the system, a special POP-3 server is going to be used. It will +verify the user from the accounts table, then allow or disallow access to there +messages. I don't think this feature will be used too often, but, it gives +a nice bit of control for some added flexablity. Currently users that have +access to email will be required to have an account on the server. This will +change in the future. I am looking into other IMAP servers that can verify +logins through the accounts table. This will take some time for me to find the +best solution. + +Some things you should note on how this system works. Think of the navigation +bar as the glue sticking all of these apps together. It is handling the +login portions, session info and account info. If you notice the layout of +the directorys, it can give a good clue to how this system is layied out. + +/phpGroupWare + |- inc [ The common files used by the distro ] + |- addressbook [ File needed by the addressbook only ] + | |- inc [ The include files for the addressbook ] + | \- icons [ Images for the addressbook, unless commonly + | used through out the program ] + |- icons [ Images used throughout the program ] + +I think you can get the idea of it. Another thing that should be noted is the +structure of the database. Yes, it looks pretty odd, but, for the most part +makes a lot of sense. Lets say you didn't need the addressbook. Delete +/phpGroupWare/addressbook and change the settings in /phpGroupWare/config.inc There are +still a few references to it, like in the account table. But, there not used. +This is one of the main reasons I use $dbase->f("con") instead of $dbase->f(0) + +Which brings me to another point, I _try_ to use standared colum names through +out the database. con = control number, owner = the users loginid, +status = that records status. This makes it easier to keep track of what does +what. Refear to CODES in the doc directory. + +BTW: Please, ingnore my very poor spelling and grammer. I am a programmer + not an English teacher. + +Happy hacking :) diff --git a/doc/RELEASE-NOTES b/doc/RELEASE-NOTES new file mode 100755 index 0000000000..148a1fecb7 --- /dev/null +++ b/doc/RELEASE-NOTES @@ -0,0 +1,4 @@ +This release requires you to change your addressbook table. You need to add the field company varchar(255) after the notes field. + +The groups table has changed greatly. This should be the last changed the groups table requires +for quite a while. \ No newline at end of file diff --git a/doc/SECURITY b/doc/SECURITY new file mode 100755 index 0000000000..9f6ccc7a98 --- /dev/null +++ b/doc/SECURITY @@ -0,0 +1,18 @@ +First off, I would not recommend using this in a type of enviroment that +security is a really big concern. I am *NOT* saying that you shouldn't be +concerned about it, but, until the system is thoughly tested. I would not +recommend it. + +Becuase of the current methods that the email system works. It is required +that the users password is in the sessions table. IMAP needs the password +to verify the user. This is one of the main reasons for the stalesessions +program. I do not like keeping passwords in any medium that is not encryped. + +The email system stores its file attachments in a temp directory. For right +now, you need to watch this directory because it can fill up very quickly. +If a user does not finsh composing the message (going else where in the program, internet connection dieing, browser crash, etc) the file will sit there until +it is deleted. There will be a simple cron program to go through and clean +things up. + +Besides this, there is nothing else that I am aware of. Let me know if you +find anything. diff --git a/doc/create_tables.mysql b/doc/create_tables.mysql new file mode 100755 index 0000000000..03e5e0ac21 --- /dev/null +++ b/doc/create_tables.mysql @@ -0,0 +1,255 @@ +# $Id$ + +CREATE TABLE applications ( + app_name varchar(25) NOT NULL, + app_title varchar(50), + app_enabled int, + UNIQUE app_name (app_name) +); + +insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1); +insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1); +insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1); +insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1); +insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1); +insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1); +insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1); +insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1); +insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1); +insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1); +insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1); +insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1); +insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0); +insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0); +insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0); + +CREATE TABLE accounts ( + con int(11) DEFAULT '0' NOT NULL auto_increment, + loginid varchar(25) NOT NULL, + passwd varchar(32) NOT NULL, + firstname varchar(50), + lastname varchar(50), + permissions text, + groups varchar(30), + lastlogin int(11), + lastloginfrom varchar(255), + lastpasswd_change int(11), + status enum('A','L') DEFAULT 'A' NOT NULL, + PRIMARY KEY (con), + UNIQUE loginid (loginid) +); + +create table bookmarks ( + con int(11) DEFAULT '0' NOT NULL auto_increment, + owner varchar(255), + category int NOT NULL, + url varchar(255), + title varchar(255), + des text, + access char(7), + lastupdate int(11), + lastview int(11), + totalviews int(11), + PRIMARY KEY (con) +); + +create table bookmarks_cats ( + con int(11) DEFAULT '0' NOT NULL auto_increment, + owner varchar(255), + parent int(11), + parent_name varchar(255), + type char(4), + name varchar(255), + PRIMARY KEY (con) +); + +create table groups ( + group_id int NOT NULL auto_increment, + group_name varchar(255), + group_apps varchar(255), + primary key(group_id) +); + +insert into groups (group_name) values ('Default'); + +insert into accounts (loginid,passwd,firstname,lastname,permissions,groups, +status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account', +':admin:email:todo:addressbook:calendar:hr:',',1,','A'); + + +CREATE TABLE addressbook ( + con int(11) DEFAULT '0' NOT NULL auto_increment, + owner varchar(25), + access varchar(10), + firstname varchar(255), + lastname varchar(255), + email varchar(255), + hphone varchar(255), + wphone varchar(255), + fax varchar(255), + pager varchar(255), + mphone varchar(255), + ophone varchar(255), + street varchar(255), + city varchar(255), + state varchar(255), + zip varchar(255), + bday varchar(255), + notes text, + company varchar(255), + PRIMARY KEY (con) +); + +CREATE TABLE preferences ( + owner varchar(20), + name varchar(50), + value varchar(50) +); + +CREATE TABLE sessions ( + sessionid varchar(255) NOT NULL, + loginid varchar(20), + passwd varchar(255), + ip varchar(255), + logintime int(11), + dla int(11), + UNIQUE sessionid (sessionid) +); + +CREATE TABLE app_sessions ( + sessionid varchar(255) NOT NULL, + loginid varchar(20), + app varchar(20), + content text +); + + +CREATE TABLE todo ( + con int(11) DEFAULT '0' NOT NULL auto_increment, + owner varchar(25), + access varchar(10), + des text, + pri int(11), + status int(11), + datecreated int(11), + datedue int(11), + PRIMARY KEY (con) +); + +CREATE TABLE webcal_entry ( + cal_id int(11) DEFAULT '0' NOT NULL auto_increment, + cal_group_id int(11), + cal_create_by varchar(25) NOT NULL, + cal_date int(11) DEFAULT '0' NOT NULL, + cal_time int(11), + cal_mod_date int(11), + cal_mod_time int(11), + cal_duration int(11) DEFAULT '0' NOT NULL, + cal_priority int(11) DEFAULT '2', + cal_type varchar(10), + cal_access char(10), + cal_name varchar(80) NOT NULL, + cal_description text, + PRIMARY KEY (cal_id) +); + +CREATE TABLE webcal_entry_repeats ( + cal_id int(11) DEFAULT '0' NOT NULL, + cal_type enum('daily','weekly','monthlyByDay','monthlyByDate','yearly') DEFAULT 'daily' NOT NULL, + cal_end int(11), + cal_frequency int(11) DEFAULT '1', + cal_days char(7) +); + +CREATE TABLE webcal_entry_user ( + cal_id int(11) DEFAULT '0' NOT NULL, + cal_login varchar(25) NOT NULL, + cal_status char(1) DEFAULT 'A', + PRIMARY KEY (cal_id, cal_login) +); + +create table webcal_entry_groups ( + cal_id int, + groups varchar(255) +); + +create table access_log ( + sessionid varchar(30), + loginid varchar(30), + ip varchar(30), + li int, + lo int +); + +create table ticket ( + t_id int unsigned not null auto_increment, + t_category varchar(40) not null, + t_subject varchar(80), + t_detail text, + t_priority smallint, + t_user varchar(10) not null, + t_assignedto varchar(10) not null, + t_timestamp_opened int, + t_timestamp_closed int, + t_department varchar(25), + primary key (t_id) +); + +create table category ( + c_id int unsigned not null auto_increment, + c_department varchar(25) not null, + c_name varchar(40) not null, + primary key (c_id) +); + +insert into preferences values ('demo','maxmatchs','10'); +insert into preferences values ('demo','mainscreen_showbirthdays','True'); +insert into preferences values ('demo','mainscreen_showevents','True'); +insert into preferences values ('demo','timeformat','12'); +insert into preferences values ('demo','dateformat','m/d/Y'); +insert into preferences values ('demo','theme','default'); +insert into preferences values ('demo','tz_offset','0'); + +CREATE TABLE news_site ( + con int(11) DEFAULT '0' NOT NULL auto_increment, + display varchar(255), + base_url varchar(255), + newsfile varchar(255), + lastread int unsigned, + newstype varchar(15), + cachetime int unsigned, + listings int unsigned, + PRIMARY KEY (con) +); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Slashdot','http://slashdot.org','/slashdot.rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Freshmeat','http://freshmeat.net','/backend/fm.rdf',0,'fm',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Linux Today','http://linuxtoday.com','/backend/linuxtoday.xml',0,'lt',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Linux Game Tome','http://happypenguin.org','/html/news.rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Segfault','http://segfault.org','/stories.xml',0,'sf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('KDE News','http://www.kde.org','/news/kdenews.rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Gnome News','http://news.gnome.org','/gnome-news/rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Gimp News','http://www.xach.com','/gimp/news/channel.rdf',0,'rdf-chan',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Mozilla','http://www.mozilla.org','/news.rdf',0,'rdf-chan',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('MozillaZine','http://www.mozillazine.org','/contents.rdf',0,'rdf',60,20); + +CREATE TABLE news_headlines ( + site int(11) NOT NULL, + title varchar(255), + link varchar(255) +); + +CREATE TABLE users_headlines ( + owner varchar(25) NOT NULL, + site int(11) NOT NULL +); + +CREATE TABLE profiles ( + con int(11) DEFAULT '0' NOT NULL auto_increment, + owner varchar(20), + title varchar(255), + phone_number varchar(255), + comments text, + picture_format varchar(255), + picture blob, + PRIMARY KEY (con) +); \ No newline at end of file diff --git a/doc/create_tables.pgsql b/doc/create_tables.pgsql new file mode 100755 index 0000000000..a224077e65 --- /dev/null +++ b/doc/create_tables.pgsql @@ -0,0 +1,244 @@ +BEGIN WORK; + +create table applications ( + app_name varchar(25) NOT NULL, + app_title varchar(50), + app_enabled int, + unique(app_name) +); + +insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1); +insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1); +insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1); +insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1); +insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1); +insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1); +insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1); +insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1); +insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1); +insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1); +insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1); +insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1); +insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0); +insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0); +insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0); + +create table accounts ( + con serial, + loginid varchar(25) NOT NULL, + passwd char(32) NOT NULL, + firstname varchar(50), + lastname varchar(50), + permissions text, + groups varchar(30), + lastlogin int, + lastloginfrom varchar(255), + lastpasswd_change int, + status char(1), + unique(loginid) +); + +create table groups ( + group_id serial, + group_name varchar(50), + group_apps varchar(255) +); + +insert into groups (group_name) values ('Default'); + +insert into accounts (loginid,passwd,firstname,lastname,permissions,groups, +status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account', +':admin:email:todo:addressbook:calendar:hr:',',1,','A'); + +create table addressbook ( + con serial, + owner varchar(25), + access varchar(10), + firstname varchar(255), + lastname varchar(255), + email varchar(255), + hphone varchar(255), + wphone varchar(255), + fax varchar(255), + pager varchar(255), + mphone varchar(255), + ophone varchar(255), + street varchar(255), + city varchar(255), + state varchar(255), + zip varchar(255), + bday varchar(255), + notes TEXT, + company varchar(255) +); + +create table bookmarks ( + con serial, + owner varchar(255), + category int NOT NULL, + url varchar(255), + title varchar(255), + des text, + access char(7), + lastupdate int, + lastview int, + totalviews int +); + +create table bookmarks_cats ( + con serial, + owner varchar(255), + parent int, + parent_name varchar(255), + type char(4), + name varchar(255) +); + +create table sessions ( + sessionid varchar(255), + loginid varchar(20), + passwd varchar(255), + ip varchar(255), + logintime int, + dla int, + unique(sessionid) +); + +CREATE TABLE app_sessions ( + sessionid varchar(255) NOT NULL, + loginid varchar(20), + app varchar(20), + content text +); + +create table todo ( + con serial, + owner varchar(25), + access varchar(10), + des text, + pri int, + status int, + datecreated int, + datedue int +); + +CREATE TABLE webcal_entry ( + cal_id serial, + cal_group_id int NULL, + cal_create_by varchar(25) NOT NULL, + cal_date int NOT NULL, + cal_time int NULL, + cal_mod_date int, + cal_mod_time int, + cal_duration int NOT NULL, + cal_priority int DEFAULT 2, + cal_type varchar(10), + cal_access varchar(10), + cal_name varchar(80) NOT NULL, + cal_description TEXT +); + +CREATE TABLE webcal_entry_user ( + cal_id int NOT NULL, + cal_login varchar(25) NOT NULL, + cal_status char(1) DEFAULT 'A' +); + +create table webcal_entry_repeats ( + cal_id int, + cal_type varchar(20), + cal_end int, + cal_frequency int default 1, + cal_days char(7) +); + +create table webcal_entry_groups ( + cal_id int, + groups varchar(255) +); + +create table preferences ( + owner varchar(20), + name varchar(50), + value varchar(50) +); + +create table access_log ( + sessionid varchar(30), + loginid varchar(30), + ip varchar(30), + li int, + lo int +); + +create table ticket ( + t_id serial, + t_category varchar(40) not null, + t_subject varchar(80), + t_detail text, + t_priority smallint, + t_user varchar(10) not null, + t_assignedto varchar(10) not null, + t_timestamp_opened int, + t_timestamp_closed int, + t_department varchar(25) +); + +create table category ( + c_id serial, + c_department varchar(25) not null, + c_name varchar(40) not null +); + +insert into preferences values ('demo','maxmatchs','10'); +insert into preferences values ('demo','email_sig',''); +insert into preferences values ('demo','mainscreen_showbirthdays','True'); +insert into preferences values ('demo','mainscreen_showevents','True'); +insert into preferences values ('demo','timeformat','12'); +insert into preferences values ('demo','dateformat','m/d/Y'); +insert into preferences values ('demo','theme','default'); +insert into preferences values ('demo','tz_offset','0'); + +CREATE TABLE news_site ( + con serial, + display varchar(255), + base_url varchar(255), + newsfile varchar(255), + lastread int, + newstype varchar(15), + cachetime int, + listings int +); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Slashdot','http://slashdot.org','/slashdot.rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Freshmeat','http://freshmeat.net','/backend/fm.rdf',0,'fm',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Linux Today','http://linuxtoday.com','/backend/linuxtoday.xml',0,'lt',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Linux Game Tome','http://happypenguin.org','/html/news.rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Segfault','http://segfault.org','/stories.xml',0,'sf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('KDE News','http://www.kde.org','/news/kdenews.rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Gnome News','http://news.gnome.org','/gnome-news/rdf',0,'rdf',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Gimp News','http://www.xach.com','/gimp/news/channel.rdf',0,'rdf-chan',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('Mozilla','http://www.mozilla.org','/news.rdf',0,'rdf-chan',60,20); +insert into news_site (display,base_url,newsfile,lastread,newstype,cachetime,listings) values ('MozillaZine','http://www.mozillazine.org','/contents.rdf',0,'rdf',60,20); + +CREATE TABLE news_headlines ( + site int, + title varchar(255), + link varchar(255) +); + +CREATE TABLE users_headlines ( + owner varchar(25) not null, + site int +); + +CREATE TABLE profiles ( + con serial, + owner varchar(20), + title varchar(255), + phone_number varchar(255), + comments text, + picture_format varchar(255), + picture text +); + +COMMIT; diff --git a/doc/developers/.cvswrappers b/doc/developers/.cvswrappers new file mode 100644 index 0000000000..19589ceec5 --- /dev/null +++ b/doc/developers/.cvswrappers @@ -0,0 +1,7 @@ +# just add the following two lines to your $home/.cvswrappers file (if it +# already exists and doesn't have these lines - otherwise just create this +# file with those two lines). This guarantees that *.gif and *.jpg files will +# always be marked as binaries - even if you forgot the -kb on adding them + +*.gif -k 'b' +*.jpg -k 'b' diff --git a/doc/developers/CODES b/doc/developers/CODES new file mode 100755 index 0000000000..c6d281e0e0 --- /dev/null +++ b/doc/developers/CODES @@ -0,0 +1,35 @@ +Let me take a few minutes to explain codes. This is a system that I have been +using for years now to forward generic information to another program. +Recently I have noticed that all of my programs are differant. So, I am +creating a sort of standard for my self. It you need to tell the user that +they have been logged off successfully. Would you send the whole string to +login.php or just send a number ? Even though I call them codes, I use the +variable cd in the program. They are checked through check_code(int code). + +BTW: Some of these do not apply to this program, the are for completly seperate +programs. But, might apply to any developing anyone else does. Feel free to +come up with some of your own. + +code Meaning +----------------------- +0 Successfully logged off +2 Login expired +5 Bad login or password +13 Message has been sent +14 New entry added successfully +15 Entry updated successfully +16 Entry deleted successfully +17 Problem proccessing your request +18 Password changed +19 Session killed +22 Database error +23 Search returned no matchs +25 out of order +26 invalied date +27 Account updated +28 Account created +29 Account deleted +30 Settings updated +31 User group added +32 User group deleted +33 User group updated diff --git a/doc/developers/dos2unix.pl b/doc/developers/dos2unix.pl new file mode 100644 index 0000000000..bc07cc81b8 --- /dev/null +++ b/doc/developers/dos2unix.pl @@ -0,0 +1,137 @@ +#!/usr/bin/perl + +# This program is distributed under the GPL. +# get the license from http://www.fsf.org +# this message must be attached to any redistributions +# smoser@brickies.net + +sub getType; +sub usage; + +if (!@ARGV) { usage(); } + +for($i=(@ARGV-1);$i>=0;$i--) { + if (@ARGV[$i] eq "-D" || @ARGV[$i] eq "--u2d") { + $target="dos"; + splice(@ARGV,$i,1); + next; + } + if (@ARGV[$i] eq "-U" || @ARGV[$i] eq "--d2u") { + + $target="unix"; + splice(@ARGV,$i,1); + next; + } + if (@ARGV[$i] eq "-q") { + $quite=1; + splice(@ARGV,$i,1); + next; + } + if (@ARGV[$i] =~ m/^-/) { + usage(@ARGV[$i]); + } +} + + +foreach $elem (@ARGV) { + if (!($origtype=getType($elem))) { + if (!$quite) { + print STDERR "bad file $elem\n"; + } + next; + } + if (! -s $elem) { + if (!$quite) { print STDERR "file $elem is empty\n"; } + next; + } + $currtarget=$target; + if ($currtarget eq "") { + if ($origtype eq "dos") { + $currtarget="unix"; + } elsif ($origtype eq "unix") { + $currtarget="dos"; + } else { + print "BAD ERROR, filetype was \"$origtype\" trying to change it to \"$currtarget\"\n"; + exit(0); + } + if (!$quite) { print STDERR "changing $elem to $currtarget\n"; } + } + # should be sane and safe at this point + if ($origtype eq $currtarget) { + if (!$quite) { + print STDERR "warning, skipping $elem\n"; + } + next; + } + open(READ,"<$elem") || die "couldn't open $elem for reading\n"; + @contents=; + close(READ); + if ($currtarget eq "dos") { + for($i=0;$i<@contents;$i++) { + @contents[$i]=~s/\x0A$/\x0D\x0A/; + } + } elsif ($currtarget eq "unix") { + for($i=0;$i<@contents;$i++) { + @contents[$i]=~s/\x0D\x0A$/\x0A/; + } + } else { + print "BAD ERROR, confused on $elem, origtype=\"$origtype\" target=\"$currtarget\"\n"; + exit(0); + } + open(WRITE,">$elem") || die "couldn't open $elem for writing\n"; + foreach $elem (@contents) { + print WRITE $elem; + } +} +exit(1); + + + +sub getType { + # hopefully, this function returns 0 on failure, "dos" for a unix file + # "unix" for file that is in unix style + my $filename = shift; + my $type; + if (! -e $filename) { print "$elem bad -e\n";} + if (! -w $filename) { print "$elem bad -w\n";} + if (! -f $filename) { print "$elem bad -f\n";} + if (! -r $filename) { print "$elem bad -r\n";} + + if (!(-w $filename && -e $filename && -f $filename && -r $filename )) { + return 0; + } else { + open(READ,"<$filename"); + $line=; + $type=""; + if ($line=~m/\x0D\x0A$/) { + #print "had \n"; + + $type="dos"; + } elsif ($line=~m/\x0A$/) { + #print "had LF\n"; + $type="unix"; + } elsif (! -s $filename) { + return "unix"; + } else { + # whats going on here + # $type=0; + if (!$quite) { print "warning, can't tell what $elem was. probably binary\n";} + $type=0; + } + close(READ); + return $type; + } +} + +sub usage { + my $invalid = shift; + if ($invalid ne "") { + print "$invalid: invalid argument\n"; + } + print "usage: $0 [--d2u|--u2d|-D|-U] file1 file2 ...\n"; + print "\t--d2u, -U\t change files to UNIX format\n"; + print "\t--u2d, -D\t change files to DOS format\n"; + print "- when no options are given, format will be detected and changed\n"; + print "- avoid using with binary files\n"; + exit(0); +} diff --git a/doc/developers/phpGW_Developers-HOWTO-1.html b/doc/developers/phpGW_Developers-HOWTO-1.html new file mode 100644 index 0000000000..5ad2e2507c --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-1.html @@ -0,0 +1,34 @@ + + + + + phpGroupWare Application Development: Introduction + + + + + +Next +Previous +Contents +
    +

    1. Introduction

    + +

    phpGroupWare is a web based groupware application framework (API), for writing applications. Integrated applications such as +email, calendar, todo list, address book, file manager, headline news, and a trouble ticket system are included. +

    1.1 Overview of application writing +

    + +

    We have attempted to make writing application for phpGroupWare as painless as possible. +We hope any pain and suffering is cause by making your application work, but not dealing with phpGroupWare itself. +

    1.2 What does the phpGroupWare API provide? +

    + +

    The phpGroupWare API handles session management, user/group management, has support for multiple databases, using the PHPLIB database abstraction method, we support templates using the PHPLIB Templates class, a file system interface, and even a network i/o interface.
    +On top of these standard functions, phpgroupWare provides several functions to give you the information you need about the users environment, and to properly plug into phpgroupWare. +


    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-2.html b/doc/developers/phpGW_Developers-HOWTO-2.html new file mode 100644 index 0000000000..7267e24f0e --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-2.html @@ -0,0 +1,74 @@ + + + + + phpGroupWare Application Development: Guidelines + + + + + +Next +Previous +Contents +
    +

    2. Guidelines

    + +

    2.1 Requirements +

    + +

    These guidelines must be followed for any application that wants considered for inclusion into phpGroupWare proper. +

    It must run on PHP3 and PHP4.
    +SQL statements must be compatible with both MySQL and PostgreSQL.
    +It must use our default header.inc.php include.
    +It must use our $phpgw_link($url) for all links (this is for session support).
    +It must respect phpGW group rights and phpGW user permissions.
    +It must use our directory structure, template support and lang (multi-language) support.
    +Where possible it should run on both Unix and NT platforms. +

    For applications that do not meet these requirements, we will store them in a seperate location, indicating their status.
    +If you need help converting your application to templates and our lang support, we will try to connect you with someone to help. +

    2.2 Writing/porting your application +

    + +

    Include files

    + +

    Each PHP page you write will need to include the header.inc.php along with a few variables.
    +This is done by putting this at the top of each PHP page. +


    +
    +  <?php
    +  $phpgw_flags["currentapp"] = "newapp";
    +  include("../header.inc.php");
    +  ?>
    +
    +
    + +Of course change application name to fit.
    +This will include the standard functions, verify the sessionid, rights to the application, and will toss in the navbar. +

    If you have other includes, or functions that need to be inserted/run before the navbar replace +


    +
    +  $phpgw_flags["currentapp"] = "newapp";
    +
    +
    + +with +
    +
    +  $phpgw_flags["currentapp"] = "newapp";
    +  $phpgw_flags["nonavbar"] = True;
    +
    +
    + +Then when you are done you need to display the navbar by adding this line: +
    +
    +     $phpgw->common->navbar();
    +
    +
    +
    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-3.html b/doc/developers/phpGW_Developers-HOWTO-3.html new file mode 100644 index 0000000000..bf07ae0c4a --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-3.html @@ -0,0 +1,62 @@ + + + + + phpGroupWare Application Development: Installing your application + + + + + +Next +Previous +Contents +
    +

    3. Installing your application

    + +

    3.1 Overview +

    + +

    It is fairly simple to add and delete applications to/from phpGroupWare. +

    3.2 Automatic features +

    + +

    To make things easy for developers we go ahead and load the following files. +

      +
    • inc/appname/appname.inc.php - This file should include all your application specific functions.
    • +
    • inc/appname/header.inc.php - This file is loaded just after the system header/navbar, and allows developers to use it for whatever they need to load.
    • +
    • inc/appname/footer.inc.php - This file is loaded just before the system footer, allowing developers to close connections and whetever else they need.
    • +
    +

    3.3 Adding files, directories and icons. +

    + +

    You will need to create the following directories for your code
    +(replace 'newapp' with your application name)
    +

    +  `-- newapp
    +      `-- icons
    +      |   `-- navbar.gif
    +      `-- inc
    +      |   |-- header.inc.php
    +      |   `-- footer.inc.php
    +      |-- lang
    +      |   `-- en
    +      |       `-- newapp.inc.php
    +      `-- template       
    +          `-- default
    +  
    +
    +

    3.4 Making phpGroupWare aware of your application +

    + +

    To make the application aware of your application, add your application setup in the inc/globalconfig.inc.php.
    +Simply add the following line just after '/* ADD NEW APPS HERE */' (replace 'newapp' with your application name) +

    +  $phpgw_info["apps"]["newapp"] = array ("title" => "Title of Application", "enabled" => True);
    +
    +
    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-4.html b/doc/developers/phpGW_Developers-HOWTO-4.html new file mode 100644 index 0000000000..8292be506d --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-4.html @@ -0,0 +1,122 @@ + + + + + phpGroupWare Application Development: Infastructure + + + + + +Next +Previous +Contents +
    +

    4. Infastructure

    + +

    4.1 Overview +

    + +

    phpGroupWare attempts to provide developers with a sound directory structure to work from.
    +The directory layout may seem complex at first, but after some use, you will see that it is designed to accommidate a large number of applications and functions. +

    4.2 Directory tree +

    + +

    +

    +.-- addressbook
    +|-- admin
    +|-- calendar
    +|-- cron
    +|-- doc
    +|-- email
    +|-- filemanager
    +|-- files
    +|   |-- groups
    +|   `-- users
    +|-- headlines
    +|-- inc
    +|   |-- addressbook
    +|   |-- calendar
    +|   |-- core
    +|   |-- email
    +|   |-- headlines
    +|   |-- lang
    +|   |   |-- en
    +|   |   |-- gr
    +|   |   `-- sp
    +|   `-- templates
    +|       |-- default
    +|       |   |-- addressbook
    +|       |   |-- admin
    +|       |   |-- calendar
    +|       |   |-- common
    +|       |   |-- email
    +|       |   |-- filemanager
    +|       |   |-- headlines
    +|       |   |-- preferences
    +|       |   |-- todo
    +|       |   `-- tts
    +|       `-- icons
    +|           |-- email
    +|           |-- calendar
    +|           `-- tts
    +|-- preferences
    +|-- themes
    +|-- todo
    +`-- tts  
    +    `-- newapp
    +        `-- icons
    +        |   `-- navbar.gif
    +        `-- inc
    +        |   |-- header.inc.php
    +        |   `-- footer.inc.php
    +        |-- lang
    +        |   `-- en
    +        |       `-- newapp.inc.php
    +        `-- template       
    +            `-- default
    +  
    +
    +

    4.3 The lang Directory +

    + +

    The lang directory is pretty basic. The lang files are simply named appname.inc.php. +

    +.-- inc
    +    `-- lang
    +        |-- en
    +        |   |-- admin.inc.php
    +        |   |-- common.inc.php
    +        |   |-- login.inc.php
    +        |   |-- todo.inc.php
    +        |   |-- addressbook.inc.php
    +        |   |-- calendar.inc.php
    +        |   |-- filemanager.inc.php
    +        |   `-- preferences.inc.php
    +        |-- de
    +        |   |-- admin.inc.php
    +        |   |-- common.inc.php
    +        |   |-- login.inc.php
    +        |   |-- todo.inc.php
    +        |   |-- addressbook.inc.php
    +        |   |-- calendar.inc.php
    +        |   |-- filemanager.inc.php
    +        |   `-- preferences.inc.php
    +        `-- sp
    +            |-- admin.inc.php
    +            |-- common.inc.php
    +            |-- login.inc.php
    +            |-- todo.inc.php
    +            |-- addressbook.inc.php
    +            |-- calendar.inc.php
    +            |-- filemanager.inc.php
    +            `-- preferences.inc.php
    +  
    +
    +
    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-5.html b/doc/developers/phpGW_Developers-HOWTO-5.html new file mode 100644 index 0000000000..707ce8fa15 --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-5.html @@ -0,0 +1,144 @@ + + + + + phpGroupWare Application Development: The API + + + + + +Next +Previous +Contents +
    +

    5. The API

    + +

    5.1 Introduction +

    + +

    phpGroupWare attempts to provide developers with a useful API to handle common tasks.
    +To do this we have created a multi-dimensional class $phpgw->.
    +This allows for terrific code organization, and help developers easily identify the file that the function is in. +All the files that are patr of this class are in the inc/core directory and are named to match the sub-class.
    +Example: +$phpgw->msg->send() is in the inc/core/phpgw_msg.inc.php file. +

    5.2 Basic functions +

    + +

    $phpgw->link

    + +

    $phpgw->link($url)
    +Add support for session management. ALL links must use this, that includes href's form actions and header location's.
    +If you are just doing a form action back to the same page, you can use it without any paramaters.
    +This function is right at the core of the class because it is used so often, we wanted to save developers a few keystrokes. +Example: +


    +
    +<form name=copy method=post action="<?php echo $phpgw->link();?>">
    +/* If session management is done via passing url paramaters */
    +/* The the result would be */
    +/* <form name=copy method=post action="somepage.php?sessionid=87687693276?kp3=kjh98u80"> */
    +
    +
    +

    5.3 Application Functions +

    + +

    +

    $phpgw->common->appsession

    + +

    $phpgw->common->appsession($data)
    +Store important information session information that your application needs.
    +$phpgw->appsession will return the value of your session data is you leave the paramater enmpty [i.e. $phpgw->appsession("")], otherwise it will store whatever data you send to it.
    +You can also store a comma delimited string and use explode() to turn it back into an array when you recieve the value back.
    +Example: +


    +
    +  $phpgw->common->appsession("/path/to/something");
    +  echo "Dir: " . $phpgw->common->appsession();
    +
    +
    +

    5.4 File functions +

    + +

    $phpgw->vfs->read_file

    + +

    $phpgw->vfs->read_file($file)
    +Returns the data from $file.
    +You must send the complete path to the file.
    +Example: +


    +
    +$data = $phpgw->vfs->read_file("/some/dir/to/file.txt");
    +
    +
    +

    +

    $phpgw->vfs->write_file

    + +

    $phpgw->vfs->write_file($file, $contents)
    +Write data to $file.
    +You must send the complete path to the file.
    +Example: +


    +
    +$data = $phpgw->vfs->write_file("/some/dir/to/file.txt");
    +
    +
    +

    +

    $phpgw->vfs->read_userfile

    + +

    $phpgw->vfs->read_userfile($file)
    +Returns the data from $file, which resides in the users private dir.
    +Example: +


    +
    +$data = $phpgw->vfs->read_userfile("file.txt");
    +
    +
    +

    +

    $phpgw->vfs->write_userfile

    + +

    $phpgw->write_userfile($file, $contents)
    +Writes data to $file, which resides in the users private dir.
    +Example: +


    +
    +$data = $phpgw->vfs->write_userfile("file.txt");
    +
    +
    +

    +

    $phpgw->vfs->list_userfiles

    + +

    $phpgw->vfs->list_userfiles()
    +Returns an array which has the list of files in the users private dir.
    +Example: +


    +
    +$filelist = array();
    +$filelist = $phpgw->vfs->list_userfiles();
    +
    +
    +

    5.5 Email/NNTP Functions +

    + +

    +

    +

    $phpgw->send->msg

    + +

    $phpgw->msg->send($service, $to, $subject, $body, $msgtype, $cc, $bcc)
    +Send a message via email or NNTP and returns any error codes.
    +Example: +


    +
    +$to = "someuser@domain.com";
    +$subject = "Hello buddy";
    +$body = "Give me a call\n Been wondering what your up to.";
    +$errors = $phpgw->msg->send("email", $to, $subject, $body);
    +
    +
    +
    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-6.html b/doc/developers/phpGW_Developers-HOWTO-6.html new file mode 100644 index 0000000000..99f2101ecf --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-6.html @@ -0,0 +1,122 @@ + + + + + phpGroupWare Application Development: Configuration Variables + + + + + +Next +Previous +Contents +
    +

    6. Configuration Variables

    + +

    6.1 Introduction +

    + +

    phpGroupWare attempt to provide developers with as much information about the user, group, server, and application configuration as possible.
    +To do this we provide a multi-dimensional array called '$phpgw_info[]', which includes all the information about your environment.
    +Due to the multi-dimensional array approach. getting these values is easy.
    +Here are some examples: +


    +
    +  <?php
    +  // To do a hello username
    +  echo "Hello " . $phpgw_info["user"]["fullname"];
    +  //If username first name is John and last name is Doe, prints: 'Hello John Doe'
    +  ?>
    +  <?php
    +  // To find out the location of the imap server
    +  echo "IMAP Server is named: " . $phpgw_info["server"]["imap_server"]; 
    +  //If imap is running on localhost, prints: 'IMAP Server is named: localhost'
    +  ?>
    +  
    +
    +
    +

    6.2 User information +

    + +

    $phpgw_info["user"]["userid"] = The user ID.
    +$phpgw_info["user"]["sessionid"] = The session ID
    +$phpgw_info["user"]["theme"] = Selected theme
    +$phpgw_info["user"]["private_dir"] = Users private dir. Use phpgroupware core functions for access to the files.
    +$phpgw_info["user"]["firstname"] = Users first name
    +$phpgw_info["user"]["lastname"] = Users last name
    +$phpgw_info["user"]["fullname"] = Users Full Name
    +$phpgw_info["user"]["groups"] = Groups the user is a member of
    +$phpgw_info["user"]["app_perms"] = If the user has access to the current application
    +$phpgw_info["user"]["lastlogin"] = Last time the user logged in.
    +$phpgw_info["user"]["lastloginfrom"] = Where they logged in from the last time.
    +$phpgw_info["user"]["lastpasswd_change"] = Last time they changed their password.
    +$phpgw_info["user"]["passwd"] = Hashed password.
    +$phpgw_info["user"]["status"] = If the user is enabled.
    +$phpgw_info["user"]["logintime"] = Time they logged into their current session.
    +$phpgw_info["user"]["session_dla"] = Last time they did anything in their current session
    +$phpgw_info["user"]["session_ip"] = Current IP address
    +

    6.3 Group information +

    + +

    $phpgw_info["group"]["group_names"] = List of groups.
    +

    6.4 Server information +

    + +

    $phpgw_info["server"]["server_root"] = Main installation directory
    +$phpgw_info["server"]["include_root"] = Location of the 'inc' directory.
    +$phpgw_info["server"]["temp_dir"] = Directory that can be used for temporarily storing files
    +$phpgw_info["server"]["common_include_dir"] = Location of the core/shared include files.
    +$phpgw_info["server"]["template_dir"] = Active template files directory. This is defaulted by the server, and changeable by the user.
    +$phpgw_info["server"]["dir_separator"] = Allows compatibility with WindowsNT directory format,
    +$phpgw_info["server"]["encrpytkey"] =
    +$phpgw_info["server"]["site_title"] = Site Title will show in the title bar of each webpage.
    +$phpgw_info["server"]["webserver_url"] = URL to phpGroupWare installation.
    +$phpgw_info["server"]["charset"] = Unknown
    +$phpgw_info["server"]["version"] = phpGroupWare version.
    +

    6.5 Database information +

    + +

    It is unlikely you will need these, because $phpgw_info_db will already be loaded as a database for you to use. +$phpgw_info["server"]["db_host"] = Address of the database server. Usually this is set to localhost.
    +$phpgw_info["server"]["db_name"] = Database name.
    +$phpgw_info["server"]["db_user"] = User name.
    +$phpgw_info["server"]["db_pass"] = Password
    +$phpgw_info["server"]["db_type"] = Type of database. Currently MySQL and PostgreSQL are supported.
    +

    6.6 Mail information +

    + +

    It is unlikely you will need these, because most email needs are services thru core phpGroupWare functions. +$phpgw_info["server"]["mail_server"] = Address of the IMAP server. Usually this is set to localhost.
    +$phpgw_info["server"]["mail_server_type"] = IMAP or POP3
    +$phpgw_info["server"]["imap_server_type"] = Cyrus or Uwash
    +$phpgw_info["server"]["imap_port"] = This is usually 143, and should only be changed if there is a good reason.
    +$phpgw_info["server"]["mail_suffix] = This is the domain name, used to add to email address
    +$phpgw_info["server"]["mail_login_type"] = This adds support for VMailMgr. Generally this hsould be set to 'standard'.
    +$phpgw_info["server"]["smtp_server"] = Address of the SMTP server. Usually this is set to localhost.
    +$phpgw_info["server"]["smtp_port"] = This is usually 25, and should only be changed if there is a good reason.
    +

    6.7 NNTP information +

    + +

    $phpgw_info["server"]["nntp_server"] = Address of the NNTP server.
    +$phpgw_info["server"]["nntp_port"] = This is usually XX, and should only be changed if there is a good reason.
    +$phpgw_info["server"]["nntp_sender"] = Unknown
    +$phpgw_info["server"]["nntp_organization"] = Unknown
    +$phpgw_info["server"]["nntp_admin"] = Uknown
    +

    6.8 Application information +

    + +

    Each application has the following information avalible. +$phpgw_info["apps"]["appname"]["title"] = The title of the application.
    +$phpgw_info["apps"]["appname"]["enabled"] = If the application is enabled. True or False.
    +$phpgw_info["server"]["app_include_dir"] = Location of the current application include files.
    +$phpgw_info["server"]["app_template_dir"] = Location of the current application tpl files.
    +$phpgw_info["server"]["app_lang_dir"] = Location of the current lang directory.
    +$phpgw_info["server"]["app_auth"] = If the server and current user have access to current application
    +$phpgw_info["server"]["app_current"] = name of the current application.
    +


    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-7.html b/doc/developers/phpGW_Developers-HOWTO-7.html new file mode 100644 index 0000000000..3b64b0db29 --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-7.html @@ -0,0 +1,63 @@ + + + + + phpGroupWare Application Development: Using Language Support + + + + + +Next +Previous +Contents +
    +

    7. Using Language Support

    + +

    7.1 Overview +

    + +

    phpGroupWare is built using a multi-language support scheme. This means the pages can be translated to other languages +very easily. It is done thru a series of lang files, which can be translated and selected by the user. +

    7.2 How to use lang support +

    + +

    Some instructions on using the lang files.
    +Under inc/lang there needs to be a sub-directory for each langague. Inside the +directory there are a number of files for each application. There is one common file +which contains a list of words that all applications use. ie, add, delete, edit, etc...
    +Words that are specific to a application should be stored with that applications include file. +


    +
    +  function lang_todo($message, $m1 = "", $m2 = "", $m3 = "", $m4 = "")
    +  {
    +    $message = strtolower($message);
    +    switch($message)
    +    {
    +       case "urgency": $s = "Urgency"; break;
    +       case "completed": $s = "completed"; break;
    +       [ snip ]
    +       default: $s = "<b>*</b> " . $message;
    +    }
    +    return $s;
    +  }
    +  
    +
    +
    + +The list of words in the left column should always be written in english. The +second column is used to return those words in that includes language. $m1, $m2, +$m3, and $m4 are used to pass extra data to be place in the middle of a sentence.
    +For example: +
    +You have 29 new messages!
    +
    + +The default should return a bold faced * and the word that wasn't found. This allows users to notice that something is missing in the files and make changes if +necessary. +
    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-8.html b/doc/developers/phpGW_Developers-HOWTO-8.html new file mode 100644 index 0000000000..e334134acf --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-8.html @@ -0,0 +1,31 @@ + + + + + phpGroupWare Application Development: Using Templates + + + + + +Next +Previous +Contents +
    +

    8. Using Templates

    + +

    8.1 Overview +

    + +

    phpGroupWare is built using a templates based design. This means the display pages, stored in tpl files, can be translated to other languages, made to look completely different. +

    8.2 How to use templates +

    + +

    Some instructions on using templates
    +For Further info read the PHPLIBs documentation for their template class. +


    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO-9.html b/doc/developers/phpGW_Developers-HOWTO-9.html new file mode 100644 index 0000000000..287860e7ea --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO-9.html @@ -0,0 +1,50 @@ + + + + + phpGroupWare Application Development: About this document + + + + +Next +Previous +Contents +
    +

    9. About this document

    + +

    9.1 New versions +

    + +

    The newest version of this document can be found on our website +http://www.phpgroupware.org as SGML source, as HTML and as TEXT. +

    9.2 Comments +

    + +

    Comments on this HOWTO should be directed to the phpGroupWare developers mailing list +phpgroupware-developers@lists.sourceforge.net. +

    To subscribe, go to +http://sourceforge.net/mail/?group_id=7305

    9.3 History +

    + +

    This document was written by Dan Kuykendall. +

    9.4 Copyrights and Trademarks +

    + +

    Copyright (c) Dan Kuykendall. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation +

    A copy of the license is available at +GNU Free Documentation License. +

    9.5 Acknowledgements and Thanks +

    + +

    Thanks to Joesph Engo for starting phpGroupWare (at the time called webdistro). +Thanks to all the developers and users who contribute to making phpGroupWare such a success. +


    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO.html b/doc/developers/phpGW_Developers-HOWTO.html new file mode 100644 index 0000000000..330624a2da --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO.html @@ -0,0 +1,104 @@ + + + + + phpGroupWare Application Development + + + + + +Next +Previous +Contents +
    +

    phpGroupWare Application Development

    + +

    Dan Kuykendall <dan@kuykendall.org>

    v0.3, 12 August 2000 +


    + This document explains phpGroupWare's infastructure and API, along what is required to integrate applications into it. +
    +

    +

    1. Introduction

    + + +

    +

    2. Guidelines

    + + +

    +

    3. Installing your application

    + + +

    +

    4. Infastructure

    + + +

    +

    5. The API

    + + +

    +

    6. Configuration Variables

    + + +

    +

    7. Using Language Support

    + + +

    +

    8. Using Templates

    + + +

    +

    9. About this document

    + + +
    +Next +Previous +Contents + + diff --git a/doc/developers/phpGW_Developers-HOWTO.sgml b/doc/developers/phpGW_Developers-HOWTO.sgml new file mode 100644 index 0000000000..f5818c5b84 --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO.sgml @@ -0,0 +1,503 @@ + + + +
    + + phpGroupWare Application Development + + + Dan Kuykendall <dan@kuykendall.org> + + + v0.3, 12 August 2000 + + + This document explains phpGroupWare's infastructure and API, along what is required to integrate applications into it. + + + +Introduction +

    + phpGroupWare is a web based groupware application framework (API), for writing applications. Integrated applications such as + email, calendar, todo list, address book, file manager, headline news, and a trouble ticket system are included. +

    +Overview of application writing +

    + We have attempted to make writing application for phpGroupWare as painless as possible. + We hope any pain and suffering is cause by making your application work, but not dealing with phpGroupWare itself. +

    +What does the phpGroupWare API provide? +

    + The phpGroupWare API handles session management, user/group management, has support for multiple databases, using the PHPLIB database abstraction method, we support templates using the PHPLIB Templates class, a file system interface, and even a network i/o interface. + On top of these standard functions, phpgroupWare provides several functions to give you the information you need about the users environment, and to properly plug into phpgroupWare. +

    +Guidelines +Requirements +

    + These guidelines must be followed for any application that wants considered for inclusion into phpGroupWare proper. +

    +

    + It must run on PHP3 and PHP4. + SQL statements must be compatible with both MySQL and PostgreSQL. + It must use our default header.inc.php include. + It must use our $phpgw_link($url) for all links (this is for session support). + It must respect phpGW group rights and phpGW user permissions. + It must use our directory structure, template support and lang (multi-language) support. + Where possible it should run on both Unix and NT platforms. +

    +

    + For applications that do not meet these requirements, we will store them in a seperate location, indicating their status. + If you need help converting your application to templates and our lang support, we will try to connect you with someone to help. +

    +Writing/porting your application +Include files +

    + Each PHP page you write will need to include the header.inc.php along with a few variables. + This is done by putting this at the top of each PHP page. + + + + Of course change application name to fit. + This will include the standard functions, verify the sessionid, rights to the application, and will toss in the navbar. +

    + If you have other includes, or functions that need to be inserted/run before the navbar replace + + $phpgw_flags["currentapp"] = "newapp"; + +with + + $phpgw_flags["currentapp"] = "newapp"; + $phpgw_flags["nonavbar"] = True; + + Then when you are done you need to display the navbar by adding this line: + + $phpgw->common->navbar(); + +

    + +Installing your application +Overview +

    + It is fairly simple to add and delete applications to/from phpGroupWare. +

    +Automatic features +

    + To make things easy for developers we go ahead and load the following files. + + inc/appname/appname.inc.php - This file should include all your application specific functions. + inc/appname/header.inc.php - This file is loaded just after the system header/navbar, and allows developers to use it for whatever they need to load. + inc/appname/footer.inc.php - This file is loaded just before the system footer, allowing developers to close connections and whetever else they need. + +

    +Adding files, directories and icons. +

    + You will need to create the following directories for your code + (replace 'newapp' with your application name) + + `-- newapp + `-- icons + | `-- navbar.gif + `-- inc + | |-- header.inc.php + | `-- footer.inc.php + |-- lang + | `-- en + | `-- newapp.inc.php + `-- template + `-- default + +

    +Making phpGroupWare aware of your application +

    + To make the application aware of your application, add your application setup in the inc/globalconfig.inc.php. + Simply add the following line just after '/* ADD NEW APPS HERE */' (replace 'newapp' with your application name) + + $phpgw_info["apps"]["newapp"] = array ("title" => "Title of Application", "enabled" => True); + +

    + +Infastructure +Overview +

    + phpGroupWare attempts to provide developers with a sound directory structure to work from. + The directory layout may seem complex at first, but after some use, you will see that it is designed to accommidate a large number of applications and functions. +

    +Directory tree +

    + +.-- addressbook +|-- admin +|-- calendar +|-- cron +|-- doc +|-- email +|-- filemanager +|-- files +| |-- groups +| `-- users +|-- headlines +|-- inc +| |-- addressbook +| |-- calendar +| |-- core +| |-- email +| |-- headlines +| |-- lang +| | |-- en +| | |-- gr +| | `-- sp +| `-- templates +| |-- default +| | |-- addressbook +| | |-- admin +| | |-- calendar +| | |-- common +| | |-- email +| | |-- filemanager +| | |-- headlines +| | |-- preferences +| | |-- todo +| | `-- tts +| `-- icons +| |-- email +| |-- calendar +| `-- tts +|-- preferences +|-- themes +|-- todo +`-- tts + `-- newapp + `-- icons + | `-- navbar.gif + `-- inc + | |-- header.inc.php + | `-- footer.inc.php + |-- lang + | `-- en + | `-- newapp.inc.php + `-- template + `-- default + +

    +The lang Directory +

    + The lang directory is pretty basic. The lang files are simply named appname.inc.php. + +.-- inc + `-- lang + |-- en + | |-- admin.inc.php + | |-- common.inc.php + | |-- login.inc.php + | |-- todo.inc.php + | |-- addressbook.inc.php + | |-- calendar.inc.php + | |-- filemanager.inc.php + | `-- preferences.inc.php + |-- de + | |-- admin.inc.php + | |-- common.inc.php + | |-- login.inc.php + | |-- todo.inc.php + | |-- addressbook.inc.php + | |-- calendar.inc.php + | |-- filemanager.inc.php + | `-- preferences.inc.php + `-- sp + |-- admin.inc.php + |-- common.inc.php + |-- login.inc.php + |-- todo.inc.php + |-- addressbook.inc.php + |-- calendar.inc.php + |-- filemanager.inc.php + `-- preferences.inc.php + +

    +The API +Introduction +

    + phpGroupWare attempts to provide developers with a useful API to handle common tasks. + To do this we have created a multi-dimensional class $phpgw->. + This allows for terrific code organization, and help developers easily identify the file that the function is in. + All the files that are patr of this class are in the inc/core directory and are named to match the sub-class. + Example: + $phpgw->msg->send() is in the inc/core/phpgw_msg.inc.php file. +Basic functions + +$phpgw->link +

    +$phpgw->link($url) +Add support for session management. ALL links must use this, that includes href's form actions and header location's. +If you are just doing a form action back to the same page, you can use it without any paramaters. +This function is right at the core of the class because it is used so often, we wanted to save developers a few keystrokes. +Example: + +

    +/* If session management is done via passing url paramaters */ +/* The the result would be */ +/* */ + +

    +Application Functions +

    +$phpgw->common->appsession +

    +$phpgw->common->appsession($data) +Store important information session information that your application needs. +$phpgw->appsession will return the value of your session data is you leave the paramater enmpty [i.e. $phpgw->appsession("")], otherwise it will store whatever data you send to it. +You can also store a comma delimited string and use explode() to turn it back into an array when you recieve the value back. +Example: + + $phpgw->common->appsession("/path/to/something"); + echo "Dir: " . $phpgw->common->appsession(); + +

    + + +File functions +$phpgw->vfs->read_file +

    +$phpgw->vfs->read_file($file) +Returns the data from $file. +You must send the complete path to the file. +Example: + +$data = $phpgw->vfs->read_file("/some/dir/to/file.txt"); + + +$phpgw->vfs->write_file +

    +$phpgw->vfs->write_file($file, $contents) +Write data to $file. +You must send the complete path to the file. +Example: + +$data = $phpgw->vfs->write_file("/some/dir/to/file.txt"); + + +$phpgw->vfs->read_userfile +

    +$phpgw->vfs->read_userfile($file) +Returns the data from $file, which resides in the users private dir. +Example: + +$data = $phpgw->vfs->read_userfile("file.txt"); + + +$phpgw->vfs->write_userfile +

    +$phpgw->write_userfile($file, $contents) +Writes data to $file, which resides in the users private dir. +Example: + +$data = $phpgw->vfs->write_userfile("file.txt"); + + +$phpgw->vfs->list_userfiles +

    +$phpgw->vfs->list_userfiles() +Returns an array which has the list of files in the users private dir. +Example: + +$filelist = array(); +$filelist = $phpgw->vfs->list_userfiles(); + +

    + +Email/NNTP Functions +

    + +$phpgw->send->msg +

    +$phpgw->msg->send($service, $to, $subject, $body, $msgtype, $cc, $bcc) +Send a message via email or NNTP and returns any error codes. +Example: + +$to = "someuser@domain.com"; +$subject = "Hello buddy"; +$body = "Give me a call\n Been wondering what your up to."; +$errors = $phpgw->msg->send("email", $to, $subject, $body); + +

    + +Configuration Variables +Introduction +

    + phpGroupWare attempt to provide developers with as much information about the user, group, server, and application configuration as possible. + To do this we provide a multi-dimensional array called '$phpgw_info[]', which includes all the information about your environment. + Due to the multi-dimensional array approach. getting these values is easy. + Here are some examples: + + + + +

    +User information +

    + $phpgw_info["user"]["userid"] = The user ID. + $phpgw_info["user"]["sessionid"] = The session ID + $phpgw_info["user"]["theme"] = Selected theme + $phpgw_info["user"]["private_dir"] = Users private dir. Use phpgroupware core functions for access to the files. + $phpgw_info["user"]["firstname"] = Users first name + $phpgw_info["user"]["lastname"] = Users last name + $phpgw_info["user"]["fullname"] = Users Full Name + $phpgw_info["user"]["groups"] = Groups the user is a member of + $phpgw_info["user"]["app_perms"] = If the user has access to the current application + $phpgw_info["user"]["lastlogin"] = Last time the user logged in. + $phpgw_info["user"]["lastloginfrom"] = Where they logged in from the last time. + $phpgw_info["user"]["lastpasswd_change"] = Last time they changed their password. + $phpgw_info["user"]["passwd"] = Hashed password. + $phpgw_info["user"]["status"] = If the user is enabled. + $phpgw_info["user"]["logintime"] = Time they logged into their current session. + $phpgw_info["user"]["session_dla"] = Last time they did anything in their current session + $phpgw_info["user"]["session_ip"] = Current IP address +

    +Group information +

    + $phpgw_info["group"]["group_names"] = List of groups. +

    +Server information +

    + $phpgw_info["server"]["server_root"] = Main installation directory + $phpgw_info["server"]["include_root"] = Location of the 'inc' directory. + $phpgw_info["server"]["temp_dir"] = Directory that can be used for temporarily storing files + $phpgw_info["server"]["common_include_dir"] = Location of the core/shared include files. + $phpgw_info["server"]["template_dir"] = Active template files directory. This is defaulted by the server, and changeable by the user. + $phpgw_info["server"]["dir_separator"] = Allows compatibility with WindowsNT directory format, + $phpgw_info["server"]["encrpytkey"] = + $phpgw_info["server"]["site_title"] = Site Title will show in the title bar of each webpage. + $phpgw_info["server"]["webserver_url"] = URL to phpGroupWare installation. + $phpgw_info["server"]["charset"] = Unknown + $phpgw_info["server"]["version"] = phpGroupWare version. +

    +Database information +

    + It is unlikely you will need these, because $phpgw_info_db will already be loaded as a database for you to use. + $phpgw_info["server"]["db_host"] = Address of the database server. Usually this is set to localhost. + $phpgw_info["server"]["db_name"] = Database name. + $phpgw_info["server"]["db_user"] = User name. + $phpgw_info["server"]["db_pass"] = Password + $phpgw_info["server"]["db_type"] = Type of database. Currently MySQL and PostgreSQL are supported. +

    +Mail information +

    + It is unlikely you will need these, because most email needs are services thru core phpGroupWare functions. + $phpgw_info["server"]["mail_server"] = Address of the IMAP server. Usually this is set to localhost. + $phpgw_info["server"]["mail_server_type"] = IMAP or POP3 + $phpgw_info["server"]["imap_server_type"] = Cyrus or Uwash + $phpgw_info["server"]["imap_port"] = This is usually 143, and should only be changed if there is a good reason. + $phpgw_info["server"]["mail_suffix] = This is the domain name, used to add to email address + $phpgw_info["server"]["mail_login_type"] = This adds support for VMailMgr. Generally this hsould be set to 'standard'. + $phpgw_info["server"]["smtp_server"] = Address of the SMTP server. Usually this is set to localhost. + $phpgw_info["server"]["smtp_port"] = This is usually 25, and should only be changed if there is a good reason. +

    +NNTP information +

    + $phpgw_info["server"]["nntp_server"] = Address of the NNTP server. + $phpgw_info["server"]["nntp_port"] = This is usually XX, and should only be changed if there is a good reason. + $phpgw_info["server"]["nntp_sender"] = Unknown + $phpgw_info["server"]["nntp_organization"] = Unknown + $phpgw_info["server"]["nntp_admin"] = Uknown +

    +Application information +

    + Each application has the following information avalible. + $phpgw_info["apps"]["appname"]["title"] = The title of the application. + $phpgw_info["apps"]["appname"]["enabled"] = If the application is enabled. True or False. + $phpgw_info["server"]["app_include_dir"] = Location of the current application include files. + $phpgw_info["server"]["app_template_dir"] = Location of the current application tpl files. + $phpgw_info["server"]["app_lang_dir"] = Location of the current lang directory. + $phpgw_info["server"]["app_auth"] = If the server and current user have access to current application + $phpgw_info["server"]["app_current"] = name of the current application. +

    +Using Language Support +Overview +

    + phpGroupWare is built using a multi-language support scheme. This means the pages can be translated to other languages + very easily. It is done thru a series of lang files, which can be translated and selected by the user. +

    +How to use lang support +

    + Some instructions on using the lang files. + Under inc/lang there needs to be a sub-directory for each langague. Inside the + directory there are a number of files for each application. There is one common file + which contains a list of words that all applications use. ie, add, delete, edit, etc... + Words that are specific to a application should be stored with that applications include file. + + function lang_todo($message, $m1 = "", $m2 = "", $m3 = "", $m4 = "") + { + $message = strtolower($message); + switch($message) + { + case "urgency": $s = "Urgency"; break; + case "completed": $s = "completed"; break; + [ snip ] + default: $s = "<b>*</b> " . $message; + } + return $s; + } + +The list of words in the left column should always be written in english. The +second column is used to return those words in that includes language. $m1, $m2, +$m3, and $m4 are used to pass extra data to be place in the middle of a sentence. +For example: + +You have 29 new messages! + +The default should return a bold faced * and the word that wasn't found. This allows users to notice that something is missing in the files and make changes if +necessary. +

    +Using Templates +Overview +

    + phpGroupWare is built using a templates based design. This means the display pages, stored in tpl files, can be translated to other languages, made to look completely different. +

    +How to use templates +

    + Some instructions on using templates + For Further info read the PHPLIBs documentation for their template class. +

    +About this document +New versions +

    + The newest version of this document can be found on our website as SGML source, as HTML and as TEXT. +

    +Comments +

    + Comments on this HOWTO should be directed to the phpGroupWare developers mailing list + .

    + To subscribe, go to +History +

    + This document was written by Dan Kuykendall. +

    +Copyrights and Trademarks +

    + Copyright (c) Dan Kuykendall. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation +

    +

    + A copy of the license is available at + . +

    +Acknowledgements and Thanks +

    + Thanks to Joesph Engo for starting phpGroupWare (at the time called webdistro). + Thanks to all the developers and users who contribute to making phpGroupWare such a success. +

    +
    diff --git a/doc/developers/phpGW_Developers-HOWTO.txt b/doc/developers/phpGW_Developers-HOWTO.txt new file mode 100644 index 0000000000..da6965a879 --- /dev/null +++ b/doc/developers/phpGW_Developers-HOWTO.txt @@ -0,0 +1,858 @@ + phpGroupWare Application Development + Dan Kuykendall + v0.3, 12 August 2000 + + This document explains phpGroupWare's infastructure and API, along + what is required to integrate applications into it. + ______________________________________________________________________ + + Table of Contents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1. Introduction + + 1.1 Overview of application writing + 1.2 What does the phpGroupWare API provide? + + 2. Guidelines + + 2.1 Requirements + 2.2 Writing/porting your application + 2.2.1 Include files + + 3. Installing your application + + 3.1 Overview + 3.2 Automatic features + 3.3 Adding files, directories and icons. + 3.4 Making phpGroupWare aware of your application + + 4. Infastructure + + 4.1 Overview + 4.2 Directory tree + 4.3 The lang Directory + + 5. The API + + 5.1 Introduction + 5.2 Basic functions + 5.2.1 $phpgw->link + 5.3 Application Functions + 5.3.1 $phpgw->common->appsession + 5.4 File functions + 5.4.1 $phpgw->vfs->read_file + 5.4.2 $phpgw->vfs->write_file + 5.4.3 $phpgw->vfs->read_userfile + 5.4.4 $phpgw->vfs->write_userfile + 5.4.5 $phpgw->vfs->list_userfiles + 5.5 Email/NNTP Functions + 5.5.1 $phpgw->send->msg + + 6. Configuration Variables + + 6.1 Introduction + 6.2 User information + 6.3 Group information + 6.4 Server information + 6.5 Database information + 6.6 Mail information + 6.7 NNTP information + 6.8 Application information + + 7. Using Language Support + + 7.1 Overview + 7.2 How to use lang support + + 8. Using Templates + + 8.1 Overview + 8.2 How to use templates + + 9. About this document + + 9.1 New versions + 9.2 Comments + 9.3 History + 9.4 Copyrights and Trademarks + 9.5 Acknowledgements and Thanks + + + ______________________________________________________________________ + + 11.. IInnttrroodduuccttiioonn + + phpGroupWare is a web based groupware application framework (API), for + writing applications. Integrated applications such as email, calendar, + todo list, address book, file manager, headline news, and a trouble + ticket system are included. + + 11..11.. OOvveerrvviieeww ooff aapppplliiccaattiioonn wwrriittiinngg + + We have attempted to make writing application for phpGroupWare as + painless as possible. We hope any pain and suffering is cause by + making your application work, but not dealing with phpGroupWare + itself. + + 11..22.. WWhhaatt ddooeess tthhee pphhppGGrroouuppWWaarree AAPPII pprroovviiddee?? + + The phpGroupWare API handles session management, user/group + management, has support for multiple databases, using the PHPLIB + database abstraction method, we support templates using the PHPLIB + Templates class, a file system interface, and even a network i/o + interface. + On top of these standard functions, phpgroupWare provides several + functions to give you the information you need about the users + environment, and to properly plug into phpgroupWare. + + 22.. GGuuiiddeelliinneess + + 22..11.. RReeqquuiirreemmeennttss + + These guidelines must be followed for any application that wants + considered for inclusion into phpGroupWare proper. + + It must run on PHP3 and PHP4. + SQL statements must be compatible with both MySQL and PostgreSQL. + It must use our default header.inc.php include. + It must use our $phpgw_link($url) for all links (this is for session + support). + It must respect phpGW group rights and phpGW user permissions. + It must use our directory structure, template support and lang (multi- + language) support. + Where possible it should run on both Unix and NT platforms. + + For applications that do not meet these requirements, we will store + them in a seperate location, indicating their status. + If you need help converting your application to templates and our lang + support, we will try to connect you with someone to help. + + 22..22.. WWrriittiinngg//ppoorrttiinngg yyoouurr aapppplliiccaattiioonn + + 22..22..11.. IInncclluuddee ffiilleess + + Each PHP page you write will need to include the header.inc.php along + with a few variables. + This is done by putting this at the top of each PHP page. + + + + + + + ______________________________________________________________________ + + ______________________________________________________________________ + + + Of course change application name to fit. + This will include the standard functions, verify the sessionid, + rights to the application, and will toss in the navbar. + + If you have other includes, or functions that need to be inserted/run + before the navbar replace + + ______________________________________________________________________ + $phpgw_flags["currentapp"] = "newapp"; + ______________________________________________________________________ + + + with + + ______________________________________________________________________ + $phpgw_flags["currentapp"] = "newapp"; + $phpgw_flags["nonavbar"] = True; + ______________________________________________________________________ + + + Then when you are done you need to display the navbar by adding this + line: + + ______________________________________________________________________ + $phpgw->common->navbar(); + ______________________________________________________________________ + + + + 33.. IInnssttaalllliinngg yyoouurr aapppplliiccaattiioonn + + 33..11.. OOvveerrvviieeww + + It is fairly simple to add and delete applications to/from + phpGroupWare. + + 33..22.. AAuuttoommaattiicc ffeeaattuurreess + + To make things easy for developers we go ahead and load the following + files. + + +o inc/appname/appname.inc.php - This file should include all your + application specific functions. + + +o inc/appname/header.inc.php - This file is loaded just after the + system header/navbar, and allows developers to use it for whatever + they need to load. + + +o inc/appname/footer.inc.php - This file is loaded just before the + system footer, allowing developers to close connections and + whetever else they need. + + 33..33.. AAddddiinngg ffiilleess,, ddiirreeccttoorriieess aanndd iiccoonnss.. + + You will need to create the following directories for your code + (replace 'newapp' with your application name) + + + `-- newapp + `-- icons + | `-- navbar.gif + `-- inc + | |-- header.inc.php + | `-- footer.inc.php + |-- lang + | `-- en + | `-- newapp.inc.php + `-- template + `-- default + + + + + 33..44.. MMaakkiinngg pphhppGGrroouuppWWaarree aawwaarree ooff yyoouurr aapppplliiccaattiioonn + + To make the application aware of your application, add your + application setup in the inc/globalconfig.inc.php. + Simply add the following line just after '/* ADD NEW APPS HERE */' + (replace 'newapp' with your application name) + + $phpgw_info["apps"]["newapp"] = array ("title" => "Title of Application", "enabled" => True); + + + + 44.. IInnffaassttrruuccttuurree + + 44..11.. OOvveerrvviieeww + + phpGroupWare attempts to provide developers with a sound directory + structure to work from. + The directory layout may seem complex at first, but after some use, + you will see that it is designed to accommidate a large number of + applications and functions. + + 44..22.. DDiirreeccttoorryy ttrreeee + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .-- addressbook + |-- admin + |-- calendar + |-- cron + |-- doc + |-- email + |-- filemanager + |-- files + | |-- groups + | `-- users + |-- headlines + |-- inc + | |-- addressbook + | |-- calendar + | |-- core + | |-- email + | |-- headlines + | |-- lang + | | |-- en + | | |-- gr + | | `-- sp + | `-- templates + | |-- default + | | |-- addressbook + | | |-- admin + | | |-- calendar + | | |-- common + | | |-- email + | | |-- filemanager + | | |-- headlines + | | |-- preferences + | | |-- todo + | | `-- tts + | `-- icons + | |-- email + | |-- calendar + | `-- tts + |-- preferences + |-- themes + |-- todo + `-- tts + `-- newapp + `-- icons + | `-- navbar.gif + `-- inc + | |-- header.inc.php + | `-- footer.inc.php + |-- lang + | `-- en + | `-- newapp.inc.php + `-- template + `-- default + + + + + 44..33.. TThhee llaanngg DDiirreeccttoorryy + + The lang directory is pretty basic. The lang files are simply named + appname.inc.php. + + + + + + + .-- inc + `-- lang + |-- en + | |-- admin.inc.php + | |-- common.inc.php + | |-- login.inc.php + | |-- todo.inc.php + | |-- addressbook.inc.php + | |-- calendar.inc.php + | |-- filemanager.inc.php + | `-- preferences.inc.php + |-- de + | |-- admin.inc.php + | |-- common.inc.php + | |-- login.inc.php + | |-- todo.inc.php + | |-- addressbook.inc.php + | |-- calendar.inc.php + | |-- filemanager.inc.php + | `-- preferences.inc.php + `-- sp + |-- admin.inc.php + |-- common.inc.php + |-- login.inc.php + |-- todo.inc.php + |-- addressbook.inc.php + |-- calendar.inc.php + |-- filemanager.inc.php + `-- preferences.inc.php + + + + + 55.. TThhee AAPPII + + 55..11.. IInnttrroodduuccttiioonn + + phpGroupWare attempts to provide developers with a useful API to + handle common tasks. + To do this we have created a multi-dimensional class $phpgw->. + This allows for terrific code organization, and help developers easily + identify the file that the function is in. All the files that are + patr of this class are in the inc/core directory and are named to + match the sub-class. + Example: $phpgw->msg->send() is in the inc/core/phpgw_msg.inc.php + file. + + 55..22.. BBaassiicc ffuunnccttiioonnss + + 55..22..11.. $$pphhppggww-->>lliinnkk + + $phpgw->link($url) + Add support for session management. ALL links must use this, that + includes href's form actions and header location's. + If you are just doing a form action back to the same page, you can use + it without any paramaters. + This function is right at the core of the class because it is used so + often, we wanted to save developers a few keystrokes. Example: + + ______________________________________________________________________ + + /* If session management is done via passing url paramaters */ + /* The the result would be */ + /* */ + ______________________________________________________________________ + + 55..33.. AApppplliiccaattiioonn FFuunnccttiioonnss + + + 55..33..11.. $$pphhppggww-->>ccoommmmoonn-->>aappppsseessssiioonn + + $phpgw->common->appsession($data) + Store important information session information that your application + needs. + $phpgw->appsession will return the value of your session data is you + leave the paramater enmpty [i.e. $phpgw->appsession("")], otherwise it + will store whatever data you send to it. + You can also store a comma delimited string and use explode() to turn + it back into an array when you recieve the value back. + Example: + + ______________________________________________________________________ + $phpgw->common->appsession("/path/to/something"); + echo "Dir: " . $phpgw->common->appsession(); + ______________________________________________________________________ + + + + 55..44.. FFiillee ffuunnccttiioonnss + + 55..44..11.. $$pphhppggww-->>vvffss-->>rreeaadd__ffiillee + + $phpgw->vfs->read_file($file) + Returns the data from $file. + You must send the complete path to the file. + Example: + + ______________________________________________________________________ + $data = $phpgw->vfs->read_file("/some/dir/to/file.txt"); + ______________________________________________________________________ + + + + + 55..44..22.. $$pphhppggww-->>vvffss-->>wwrriittee__ffiillee + + $phpgw->vfs->write_file($file, $contents) + Write data to $file. + You must send the complete path to the file. + Example: + + ______________________________________________________________________ + $data = $phpgw->vfs->write_file("/some/dir/to/file.txt"); + ______________________________________________________________________ + + + + + 55..44..33.. $$pphhppggww-->>vvffss-->>rreeaadd__uusseerrffiillee + + $phpgw->vfs->read_userfile($file) + Returns the data from $file, which resides in the users private dir. + Example: + + ______________________________________________________________________ + $data = $phpgw->vfs->read_userfile("file.txt"); + ______________________________________________________________________ + + + + + + 55..44..44.. $$pphhppggww-->>vvffss-->>wwrriittee__uusseerrffiillee + + $phpgw->write_userfile($file, $contents) + Writes data to $file, which resides in the users private dir. + Example: + + ______________________________________________________________________ + $data = $phpgw->vfs->write_userfile("file.txt"); + ______________________________________________________________________ + + + + + 55..44..55.. $$pphhppggww-->>vvffss-->>lliisstt__uusseerrffiilleess + + $phpgw->vfs->list_userfiles() + Returns an array which has the list of files in the users private dir. + Example: + + ______________________________________________________________________ + $filelist = array(); + $filelist = $phpgw->vfs->list_userfiles(); + ______________________________________________________________________ + + + + 55..55.. EEmmaaiill//NNNNTTPP FFuunnccttiioonnss + + + + 55..55..11.. $$pphhppggww-->>sseenndd-->>mmssgg + + $phpgw->msg->send($service, $to, $subject, $body, $msgtype, $cc, $bcc) + Send a message via email or NNTP and returns any error codes. + Example: + + ______________________________________________________________________ + $to = "someuser@domain.com"; + $subject = "Hello buddy"; + $body = "Give me a call\n Been wondering what your up to."; + $errors = $phpgw->msg->send("email", $to, $subject, $body); + ______________________________________________________________________ + + + + 66.. CCoonnffiigguurraattiioonn VVaarriiaabblleess + + 66..11.. IInnttrroodduuccttiioonn + + phpGroupWare attempt to provide developers with as much information + about the user, group, server, and application configuration as + possible. + To do this we provide a multi-dimensional array called + '$phpgw_info[]', which includes all the information about your + environment. + Due to the multi-dimensional array approach. getting these values is + easy. + Here are some examples: + + + + + + + + + ______________________________________________________________________ + + + + ______________________________________________________________________ + + + + 66..22.. UUsseerr iinnffoorrmmaattiioonn + + $phpgw_info["user"]["userid"] = The user ID. + $phpgw_info["user"]["sessionid"] = The session ID + $phpgw_info["user"]["theme"] = Selected theme + $phpgw_info["user"]["private_dir"] = Users private dir. Use + phpgroupware core functions for access to the files. + $phpgw_info["user"]["firstname"] = Users first name + $phpgw_info["user"]["lastname"] = Users last name + $phpgw_info["user"]["fullname"] = Users Full Name + $phpgw_info["user"]["groups"] = Groups the user is a member of + $phpgw_info["user"]["app_perms"] = If the user has access to the + current application + $phpgw_info["user"]["lastlogin"] = Last time the user logged in. + $phpgw_info["user"]["lastloginfrom"] = Where they logged in from the + last time. + $phpgw_info["user"]["lastpasswd_change"] = Last time they changed + their password. + $phpgw_info["user"]["passwd"] = Hashed password. + $phpgw_info["user"]["status"] = If the user is enabled. + $phpgw_info["user"]["logintime"] = Time they logged into their current + session. + $phpgw_info["user"]["session_dla"] = Last time they did anything in + their current session + $phpgw_info["user"]["session_ip"] = Current IP address + + 66..33.. GGrroouupp iinnffoorrmmaattiioonn + + $phpgw_info["group"]["group_names"] = List of groups. + + 66..44.. SSeerrvveerr iinnffoorrmmaattiioonn + + $phpgw_info["server"]["server_root"] = Main installation directory + $phpgw_info["server"]["include_root"] = Location of the 'inc' + directory. + $phpgw_info["server"]["temp_dir"] = Directory that can be used for + temporarily storing files + $phpgw_info["server"]["common_include_dir"] = Location of the + core/shared include files. + $phpgw_info["server"]["template_dir"] = Active template files + directory. This is defaulted by the server, and changeable by the + user. + $phpgw_info["server"]["dir_separator"] = Allows compatibility with + WindowsNT directory format, + $phpgw_info["server"]["encrpytkey"] = + $phpgw_info["server"]["site_title"] = Site Title will show in the + title bar of each webpage. + $phpgw_info["server"]["webserver_url"] = URL to phpGroupWare + installation. + $phpgw_info["server"]["charset"] = Unknown + $phpgw_info["server"]["version"] = phpGroupWare version. + + 66..55.. DDaattaabbaassee iinnffoorrmmaattiioonn + + It is unlikely you will need these, because $phpgw_info_db will + already be loaded as a database for you to use. + $phpgw_info["server"]["db_host"] = Address of the database server. + Usually this is set to localhost. + $phpgw_info["server"]["db_name"] = Database name. + $phpgw_info["server"]["db_user"] = User name. + $phpgw_info["server"]["db_pass"] = Password + $phpgw_info["server"]["db_type"] = Type of database. Currently MySQL + and PostgreSQL are supported. + + 66..66.. MMaaiill iinnffoorrmmaattiioonn + + It is unlikely you will need these, because most email needs are + services thru core phpGroupWare functions. + $phpgw_info["server"]["mail_server"] = Address of the IMAP server. + Usually this is set to localhost. + $phpgw_info["server"]["mail_server_type"] = IMAP or POP3 + $phpgw_info["server"]["imap_server_type"] = Cyrus or Uwash + $phpgw_info["server"]["imap_port"] = This is usually 143, and should + only be changed if there is a good reason. + $phpgw_info["server"]["mail_suffix] = This is the domain name, used to + add to email address + $phpgw_info["server"]["mail_login_type"] = This adds support for + VMailMgr. Generally this hsould be set to 'standard'. + $phpgw_info["server"]["smtp_server"] = Address of the SMTP server. + Usually this is set to localhost. + $phpgw_info["server"]["smtp_port"] = This is usually 25, and should + only be changed if there is a good reason. + + 66..77.. NNNNTTPP iinnffoorrmmaattiioonn + + $phpgw_info["server"]["nntp_server"] = Address of the NNTP server. + $phpgw_info["server"]["nntp_port"] = This is usually XX, and should + only be changed if there is a good reason. + $phpgw_info["server"]["nntp_sender"] = Unknown + $phpgw_info["server"]["nntp_organization"] = Unknown + $phpgw_info["server"]["nntp_admin"] = Uknown + + 66..88.. AApppplliiccaattiioonn iinnffoorrmmaattiioonn + + Each application has the following information avalible. + $phpgw_info["apps"]["appname"]["title"] = The title of the + application. + $phpgw_info["apps"]["appname"]["enabled"] = If the application is + enabled. True or False. + $phpgw_info["server"]["app_include_dir"] = Location of the current + application include files. + $phpgw_info["server"]["app_template_dir"] = Location of the current + application tpl files. + $phpgw_info["server"]["app_lang_dir"] = Location of the current lang + directory. + $phpgw_info["server"]["app_auth"] = If the server and current user + have access to current application + $phpgw_info["server"]["app_current"] = name of the current + application. + + 77.. UUssiinngg LLaanngguuaaggee SSuuppppoorrtt + + 77..11.. OOvveerrvviieeww + + phpGroupWare is built using a multi-language support scheme. This + means the pages can be translated to other languages very easily. It + is done thru a series of lang files, which can be translated and + selected by the user. + + 77..22.. HHooww ttoo uussee llaanngg ssuuppppoorrtt + + Some instructions on using the lang files. + Under inc/lang there needs to be a sub-directory for each langague. + Inside the directory there are a number of files for each application. + There is one common file which contains a list of words that all + applications use. ie, add, delete, edit, etc... + Words that are specific to a application should be stored with that + applications include file. + + ______________________________________________________________________ + function lang_todo($message, $m1 = "", $m2 = "", $m3 = "", $m4 = "") + { + $message = strtolower($message); + switch($message) + { + case "urgency": $s = "Urgency"; break; + case "completed": $s = "completed"; break; + [ snip ] + default: $s = "* " . $message; + } + return $s; + } + + ______________________________________________________________________ + + + The list of words in the left column should always be written in + english. The second column is used to return those words in that + includes language. $m1, $m2, $m3, and $m4 are used to pass extra data + to be place in the middle of a sentence. + For example: + + You have 29 new messages! + + + The default should return a bold faced * and the word that wasn't + found. This allows users to notice that something is missing in the + files and make changes if necessary. + + 88.. UUssiinngg TTeemmppllaatteess + + 88..11.. OOvveerrvviieeww + + phpGroupWare is built using a templates based design. This means the + display pages, stored in tpl files, can be translated to other + languages, made to look completely different. + + 88..22.. HHooww ttoo uussee tteemmppllaatteess + + Some instructions on using templates + For Further info read the PHPLIBs documentation for their template + class. + + 99.. AAbboouutt tthhiiss ddooccuummeenntt + + 99..11.. NNeeww vveerrssiioonnss + + The newest version of this document can be found on our website + as SGML source, as HTML and as TEXT. + + + + 99..22.. CCoommmmeennttss + + Comments on this HOWTO should be directed to the phpGroupWare + developers mailing list phpgroupware-developers@lists.sourceforge.net + . + + To subscribe, go to + + 99..33.. HHiissttoorryy + + This document was written by Dan Kuykendall. + + 99..44.. CCooppyyrriigghhttss aanndd TTrraaddeemmaarrkkss + + Copyright (c) Dan Kuykendall. Permission is granted to copy, + distribute and/or modify this document under the terms of the GNU Free + Documentation License, Version 1.1 or any later version published by + the Free Software Foundation + + A copy of the license is available at GNU Free Documentation License + . + + 99..55.. AAcckknnoowwlleeddggeemmeennttss aanndd TThhaannkkss + + Thanks to Joesph Engo for starting phpGroupWare (at the time called + webdistro). Thanks to all the developers and users who contribute to + making phpGroupWare such a success. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/developers/phpgwapi/msg_pop3.txt b/doc/developers/phpgwapi/msg_pop3.txt new file mode 100644 index 0000000000..5167d88ea1 --- /dev/null +++ b/doc/developers/phpgwapi/msg_pop3.txt @@ -0,0 +1,139 @@ + phpgw_msg_pop3.inc.php + Itzchak Rehberg + v1.0, 07 August 2000 + + documentation of the pop3 "msg" class + ______________________________________________________________________ + + Table of Contents + + + 1. Why this pop class? + 2. Function reference + 2.1. function pop_close($stream,$flags="") + 2.2. function pop_delete($stream,$msg_num,$flags="") + 2.3. function pop_fetchbody($stream,$msgnr,$partnr="",$flags="") + 2.4. function pop_fetchstructure($stream,$msg_num,$flags="") + 2.5. function pop_header($stream,$msg_nr,$fromlength="",$tolength="", + $defaulthost="") + 2.6. function pop_mailboxmsginfo($stream) + 2.7. function pop_sort($stream,$criteria,$reverse="",$options="", + $msg_info="") + 3. Additional functionality + + + ______________________________________________________________________ + + + 1. Why this pop class? + + You may ask, why we use another pop class - php's imap_*() functions + would work on pop3, too. Well, that may be true - but there are lots + of folks out there having their php *not* compiled --with-imap, and + some of them feel unable doing such. So it's the easiest thing to have + an own pop3 class built on straight socket calls - and since I already + did the same writing the smtp "send" class... And by the way this pop3 + class will have some advantages over php's imap_*() functions... + + We named this class "msg" instead of "pop3", since we use another + class with the same structure for imap. Additionally to imap_open() + (or pop_open() in this case) we have the "wrapper method" open(), + which allows us just to decide on user configuration wether using + imap or pop and then just to include the appropriate file, using the + same function/method calls for both. + + ______________________________________________________________________ + + + 2. Function reference + + When I built up this pop class, I felt it an important issue to have + it most compatible in syntax to the imap_*() functions, so we could + adapt it easily into phpGroupWare. So if I made some improvements, as + e.g. to the pop_sort() method, I did it in a manner, that one still + can call it the same way as he would call imap_sort() (in this case). + + Due to this fact I have *not* to explain the syntax of each single + method here (for this, please refer to your php manual). I will just + list up differences one has to keep in mind when using them. + + The first difference is, that this is a class. So before you can use + the functions, you have to create an instance of this class, e.g. + + $mypop3 = new msg; + $mypop3->open($mailbox,$username,$password,$flags); // or: + $mypop3->pop_open($mailbox,$username,$password,$flags); + + both methods do the same - see "wrapper" above in section 1. So if you + want to use this pop3 class outside the phpGroupWare environment, you + may just want to strip these wrapper methods off the file and just use + the pop_*() methods themselves. + + Not all imap_*() funcs have their (working) pendant here, since pop3 + does not support all the features imap has (e.g. multiple folders). + Those methods (e.g. pop_expunge()) just return a default value (here + false) and do nothing. They are just kept here in case one of our + wrapper methods tries to call them :) These methods are not listed in + this document, neither are those who are fully described by their imap + pendant. + + + 2.1. function pop_close($stream,$flags="") + + $flags is not used here and won't ever be (makes no sense), but just + kept for compatibility. + + 2.2. function pop_delete($stream,$msg_num,$flags="") + + Does a real delete - not just marks as deleted (as in imap_delete), + since this function is not available to pop3 (in fact the mail is + deleted by calling pop_close() afterwards - but there's no undelete) + + 2.3. function pop_fetchbody($stream,$msgnr,$partnr="",$flags="") + + $partnr and $flags are ignored and just put here for compatibility + purposes to imap_fetchbody + + 2.4. function pop_fetchstructure($stream,$msg_num,$flags="") + + $flags is not used here (yet). + + 2.5. function pop_header($stream,$msg_nr,$fromlength="",$tolength="", + $defaulthost="") + + Not all information you find returned by imap_header is included here, + some fields of the array just contain empty values, since these are + not available in pop. Note further, that just the first two params of + the method are evaluated here. $info[date] contains the date as it + appears in the msg header. The method returns false if message does + not exist. + + 2.6. function pop_mailboxmsginfo($stream) + + Only Nmsgs and Size contain real values. All other fields are empty + and just in here for compatibility (those informations you'ld expect + in there is not retainable from pop3 servers - e.g. Recent or Unread) + + 2.7. function pop_sort($stream,$criteria,$reverse="",$options="") + + $options is not used here. For speed optimizing this method will make + use of an array stored within the class (and temporary "out-sourced" + to a file, since else it would be lost after the page is once built), + holding all the header infos needed to fulfill the sort task. So it + only retrieves new header info when either the page is called for the + very first time that session, the count of messages reported by the + array differs from the count reported by the pop3 server (which in + this case would be the same ;), or the class variable $force_check is + set to true (which is done automatically by pop_delete, e.g.) - thus + not only saving bandwith but gaining additional speed (you will really + feel this with several hundreds of mails in your mailbox :) + + ______________________________________________________________________ + + + 3. Additional functionality + + The msg->err Array is available as described for the smtp "send" + method. + + The $msg->logout() method does remove the temp file. diff --git a/doc/developers/phpgwapi/send.txt b/doc/developers/phpgwapi/send.txt new file mode 100644 index 0000000000..8b5354dee6 --- /dev/null +++ b/doc/developers/phpgwapi/send.txt @@ -0,0 +1,117 @@ + phpgw_send.inc.php + Itzchak Rehberg + v1.0, 07 August 2000 + + documentation of the smtp "send" class + ______________________________________________________________________ + + Table of Contents + + + 1. Why another mail() function? + 2. Function reference + 3. Additional functionality + 3.1. The smail->err Array + 3.2. The smail->to_res Array + 3.3. The function msg() + 4. Comments + 4.1. reply codes according to RFC821 - short explanation + + + ______________________________________________________________________ + + + 1. Why another mail() function? + + Who ever has used php's owm (built-in) mail() function will certainly + agree to its limitations. And if I say "limitations", this is a very + neat way to describe what we really think of it - it's almost + unreliable at all. Imagine sending a mail to multiple recipients: how + will you know if a copy was sent to all of them, and not just one + address failed? Or even only one address did *not* fail? There's + almost no possibility for detailed error checking (if there's limited + possibility for it, I didn't see it). That was the point when we + decided on writing an own mail() function to use with phpGroupWare. + + We call the class "send" instead of "smtp" since we plan to have nntp + sending, too, with the same structure and function naming. + + ______________________________________________________________________ + + + 2. Function reference + + Syntax is almost the same as for the mail() function, so please refer + to php's docu on this. The difference, of course, is that smtp is a + class, so you first have to create an instance of it before you can + actually use it, e.g.: + + $mymailer = new send; + $mymailer->smail($to,$subject,$message,$header); + + ______________________________________________________________________ + + + 3. Additional functionality + + As mentioned above, the smtp class provides additional error checking + facilities. These are realized by two arrays used inside the class: + + 3.1. The smail->err Array + + This array holds the latest information returned by the remote smtp + server. It consists of 3 parts: + smail->err["code"] is a 3 digit code according to RFC821 + smail->err["msg"] is the additional message returned by the server + smail->err["desc"] may hold some more detailed information, if + available + + 3.2. The smail->to_res Array + + This is actually an array of arrays holding information equivalent to + the smail->err array, but for each single recipient. So here you can + check for each recipient, if the server accepted him/her. There's an + additional field smail->to_res["addr"] to identify the recipient: + smail->to_res["addr"] is the concerned recipient's address + smail->to_res["code"] is a 3 digit code according to RFC821 + smail->to_res["msg"] is the additional message returned by the server + smail->to_res["desc"] may hold some more detailed information, if + available + + 3.3. The function msg($service, $to, $subject, $body) + + We use this additional function to build the message header and call + the "smail()" function right from within this. So you may want to + adapt the header information, if you want to use the class outside + the phpGroupWare environment. + + ______________________________________________________________________ + + + 4. Comments + + the server to use is hardcoded into the smtp->smail() func using the + variable $phpgw_info - so if you want to use the function outside of + phpGroupWare, you may want to change this. + + 4.1. reply codes according to RFC821 - short explanation + + The reply code according to RFC821 consists of 3 digits, I'll refer to + those here as xyz. X holds some general information - and by x only + one already can decide wether the code tells something good or bad. Y + tells the service affected, and z may give some non specified detail. + + value | x | y + ------+--------------------------------------+------------------------ + 0 | - | syntax + 1 | accepted, confirmation required | information only + 2 | action completed successfully | connection related + 3 | accepted, send more (detailed) data | - + 4 | not accepted, try again later | - + 5 | refused, don't retry | mail system + + so x=4 notifies of some temporary, x=5 of some permanent problem. + + If the 3-digit-code is followed by a "-", it's a multi-line response + (last line of this response will have a blank following the 3-digit + code). Otherwise the 3-digit-code is just followed by a blank. diff --git a/doc/update_permission_tables_07122000_to_08032000.php b/doc/update_permission_tables_07122000_to_08032000.php new file mode 100644 index 0000000000..5c36d003d1 --- /dev/null +++ b/doc/update_permission_tables_07122000_to_08032000.php @@ -0,0 +1,126 @@ + * + * quick and dirty converter for mysql accounts.permissions field upgrade * + * caused by CVS changes around 31-July-2000 * + * written as a bit of: * + * * + * phpGroupWare * + * 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. * + \**************************************************************************/ + +/* +// tooley: and i quote from irc... + admin' => '1', + email' => '2', + pop_mail'=> '3', + calendar' => '4', + addressbook' => '5', + todo' => '6', + tts' => '7', + bookmarks' => '8', + anonymous' => '9', + filemanager' => '10', + headlines' => '11', + nntp' => '12', + chat' => '13', + ftp' => '14' +*/ + +// CHANGE THIS LINE IF NECESSARY +include("../inc/config.inc.php"); + +// DON'T EDIT BELOW THIS LINE +$host = $phpgw_info["server"]["db_host"]; +$db = $phpgw_info["server"]["db_name"]; +$user = $phpgw_info["server"]["db_user"]; +$pass = $phpgw_info["server"]["db_pass"]; + +$conn = mysql_connect($host,$user,$pass); +$result = mysql_db_query($db,"SELECT con,permissions,firstname,lastname FROM accounts",$conn); + +echo "Updating permissions...

    \n"; +echo mysql_num_rows($result) . " users to process:
    \n"; + +while ($row = mysql_fetch_array($result)) { + $perm = $row[1]; + $tok = strtok($perm,":"); + if(isset($newperm)) unset($newperm); + while($tok) { + switch($tok) { + case "1": + $newperm .= "admin:"; + break; + case "2": + $newperm .= "email:"; + break; + case "3": + $newperm .= "pop_mail:"; + break; + case "4": + $newperm .= "calendar:"; + break; + case "5": + $newperm .= "addressbook:"; + break; + case "6": + $newperm .= "todo:"; + break; + case "7": + $newperm .= "tts:"; + break; + case "8": + $newperm .= "bookmarks:"; + break; + case "9": + $newperm .= "anonymous:"; + break; + case "10": + $newperm .= "filemanager:"; + break; + case "11": + $newperm .= "headlines:"; + break; + case "12": + $newperm .= "nntp:"; + break; + case "13": + $newperm .= "chat:"; + break; + case "14": + $newperm .= "ftp:"; + break; + default: + $newperm .= $tok.":"; + $slip++; + break; + } + $tok = strtok(":"); + } + $thiscon = $row[0]; + echo ("Updating $row[3], $row[2] ($newperm)..."); + if( + mysql_db_query($db,"UPDATE accounts SET permissions='$newperm' WHERE con='$thiscon'",$conn)) { + echo "Success.
    \n"; + $success++; + } else { + echo "Fail: " . mysql_error($conn); + $fail++; + } +} + +echo "Processed $success records successfully"; +if($fail > 0) { + echo ", failed $fail records (see errors above).
    \n"; +} else { + echo ".
    \n"; +} +if($slip > 0) { + echo "
    Warning: $slip permission entries didn't parse as old style permissions. Perhaps you already converted? (No harm done, we just stored their permissions as they had been.)
    \n"; +} diff --git a/header.inc.php.sample b/header.inc.php.sample new file mode 100644 index 0000000000..ae1c45f930 --- /dev/null +++ b/header.inc.php.sample @@ -0,0 +1,30 @@ + * + * -------------------------------------------- * + * 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$ */ + + /**************************************************************************\ + * !!!!!!! EDIT THIS LINE !!!!!!!! * + * This setting allows you to easily move the include directory * + * simply point this to your inc dir and then edit the globalconfig.inc.php * + * to fit your site, and you should be up and running. * + \**************************************************************************/ + + $phpgw_info["server"]["include_root"] = "/path/to/phpGroupWare/inc"; + /* This is the basic include needed on each page for phpGroupWare application compliance */ + $phpgw_flags["htmlcompliant"] = True; + + /**************************************************************************\ + * Do not edit this line * + \**************************************************************************/ + include($phpgw_info["server"]["include_root"] . "/phpgwapi/phpgw.inc.php"); +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000000..0f641e9db5 --- /dev/null +++ b/index.php @@ -0,0 +1,149 @@ + * + * -------------------------------------------- * + * 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$ */ + + if (! $sessionid) { + Header("Location: login.php"); + } + + $phpgw_flags = array("noheader" => True, "nonavbar" => True, "currentapp" => "home"); + include("header.inc.php"); + // Note: I need to add checks to make sure these apps are installed. + + if ($cd=="yes" && $phpgw_info["user"]["preferences"]["default_app"] + && $phpgw_info["user"]["permissions"][$phpgw_info["user"]["preferences"]["default_app"]]) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/" + . $phpgw_info["user"]["preferences"]["default_app"])); + exit; + } + $phpgw->common->header(); + $phpgw->common->navbar(); + + + if ($phpgw_info["user"]["permissions"]["admin"] && $phpgw_info["server"]["checkfornewversion"]) { + $fp = fsockopen("phpgroupware.org",80,&$errono,&$errstr,30); + fputs($fp,"GET /currentversion HTTP/1.0\nHOST: www.phpgroupware.org\n\n"); + if ($fp) { + while ($line = fgets($fp,4096)) { + $lines[] = $line; + } + fclose($fp); + } + + for ($i=0; $i $phpgw_info["server"]["version"]) { + echo "

    There is a new version of phpGroupWare avaiable. http://www.phpgroupware.org"; + } + } + + echo ''; +?> + + +Open notify window'; + + if ($phpgw_info["user"]["permissions"]["email"] + && $phpgw_info["user"]["preferences"]["mainscreen_showmail"]) { + echo "\n"; + + $mbox = $phpgw->msg->login(); + if (! $mbox) { + echo "Mail error: can not open connection to mail server"; + exit; + } + + $mailbox_status = $phpgw->msg->status($mbox,"{" . $phpgw_info["server"]["mail_server"] . ":" . $phpgw_info["server"]["mail_port"] . "}INBOX",SA_UNSEEN); + if ($mailbox_status->unseen == 1) { + echo "\n"; + } + if ($mailbox_status->unseen > 1) { + echo ""; + } + echo "\n"; + } + + if ($phpgw_info["user"]["permissions"]["addressbook"] + && $phpgw_info["user"]["preferences"]["mainscreen_showbirthdays"]) { + echo "\n"; + $phpgw->db->query("select DISTINCT firstname,lastname from addressbook where " + . "bday like '" . $phpgw->preferences->show_date_other("n/d",time()) + . "/%' and (owner='" . $phpgw->session->loginid . "' or access='" + . "public')"); + while ($phpgw->db->next_record()) { + echo "\n"; + } + $tommorow = $phpgw->preferences->show_date_other("n/d", mktime(0,0,0, + $phpgw->preferences->show_date_other("m",time()), + $phpgw->preferences->show_date_other("d",time())+1, + $phpgw->preferences->show_date_other("Y",time())) ); + $phpgw->db->query("select firstname,lastname from addressbook where " + . "bday like '$tommorow/%' and (owner='" + . $phpgw->session->loginid . "' or access='public')"); + while ($phpgw->db->next_record()) { + echo "\n"; + } + echo "\n"; + } + + // Reaccuring events have not been added yet and this needs to be updated + // to handle global public and group events. + + + // This is disbaled until I can convert the calendar over + if ($phpgw_info["user"]["permissions"]["calendar"] + && $phpgw_info["user"]["preferences"]["mainscreen_showevents"]) { + echo "\n"; + include($phpgw_info["server"]["server_root"] . "/calendar/inc/functions.inc.php"); + $repeated_events = read_repeated_events($phpgw->session->loginid); + $phpgw->db->query("select count(*) from webcal_entry,webcal_entry_user" + . " where cal_date='" . $phpgw->preferences->show_date_other("Ymd", time()) + . "' and (webcal_entry_user.cal_login='" . $phpgw->session->loginid + . "' and webcal_entry.cal_id = webcal_entry_user.cal_id) and " + . "(cal_priority='3')"); + $phpgw->db->next_record(); + + if ($phpgw->db->f(0) == 1) { + echo ""; + } + if ($phpgw->db->f(0) > 1) { + echo ""; + } + echo "\n"; + } + + +?> + +
    link("email/") . "\"> " + . lang_common("You have 1 new message!") . "
    link("email/") . "\"> " + . lang_common("You have x new messages!",$mailbox_status->unseen) . "
    " . lang_common("Today is x's birthday!", $phpgw->db->f("firstname") . " " + . $phpgw->db->f("lastname")) . "
    " . lang_common("Tommorow is x's birthday.", $phpgw->db->f("firstname") . " " + . $phpgw->db->f("lastname")) . "
    " . lang_common("You have 1 high priority event on your calendar today.") + . "
    " . lang_common("You have x high priority events on your calendar " + . "today.",$phpgw->db->f(0)) . "
    + + + diff --git a/login.php b/login.php new file mode 100755 index 0000000000..0436bbf243 --- /dev/null +++ b/login.php @@ -0,0 +1,140 @@ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags = array("disable_message_class" => True, "disable_send_class" => True, + "disable_nextmatchs_class" => True, "disable_template_class" => True, + "login" => True, "currentapp" => "", + "noheader" => True + ); + + include("header.inc.php"); + include($phpgw_info["server"]["include_root"] . "/lang/" . "en" . "_login.inc.php"); + include($phpgw_info["server"]["api_dir"] . "/phpgw_template.inc.php"); + + $deny_login = False; + + $tmpl = new Template($phpgw_info["server"]["template_dir"]); + + $tmpl->set_file(array("login" => "login.tpl", + "login2" => "login2.tpl")); + + // When I am updating my server, I don't want people logging in a messing + // things up. + + function deny_login() + { + global $tmpl; + $tmpl->set_var("updating","

    Opps! You caught us in the middle of a system" + . " upgrade.
    Please, check back with us shortly.
    "); + $tmpl->parse("loginout", "login"); + $tmpl->p("loginout"); + exit; + } + + function show_cookie($code,$lastloginid,$new_loginid) + { + if ($code != 5) + return $lastloginid; + } + + function check_logoutcode($code) + { + if ($code == "1") { + return lang_login("You have been successfully logged out"); + } + else if ($code == "2") { + return lang_login("Sorry, your login has expired"); + } + else if ($code == "5") { + return "" . lang_login("Bad login or password") . ""; + } + else { + return " "; + } + } + + /* Program starts here */ + + if ($deny_login) { + deny_login(); + } + + if ($submit) { + if (getenv(REQUEST_METHOD) != "POST") { + Header("Location: " . $phpgw->link("", "cd=5")); + } + + $phpgw->db->query("SELECT * FROM accounts WHERE loginid = '$login' AND " + . "passwd='" . md5($passwd) . "' AND status ='A'"); + + $phpgw->db->next_record(); + + if (! $phpgw->db->f("loginid")) { + Header("Location: " . $phpgw_info["server"]["webserver_url"] . "/login.php?cd=5"); + } else { + // Make sure the server allows us to use cookies + if (! $phpgw_info["server"]["usecookies"]) { + $usecookies = False; + } + $phpgw->session->create($phpgw->db->f("loginid"),$passwd, $usecookies); + + // Create the users private_dir if not exist +/* + $basedir = $phpgw_info["server"]["server_root"] + . $phpgw_info["server"]["dir_separator"] + . "filemanager" + . $phpgw_info["server"]["dir_separator"] + . "users" + . $phpgw_info["server"]["dir_separator"]; + if(!is_dir($basedir . $phpgw->db->f("loginid"))) + mkdir($basedir . $phpgw->db->f("loginid"), 0707); +*/ +// Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] +// . "/", $usecookies)); + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] + . "/", "cd=yes")); + + exit; + } + } else { + if ($last_loginid) { + $phpgw->db->query("select value from preferences where owner='$last_loginid' " + . "and name='lang'"); + $phpgw->db->next_record(); + if (! $phpgw->db->f("value")) { + $users_lang = "en"; +// } else { +// $users_lang = $phpgw->db->f("value"); +// include($phpgw_info["server"]["include_root"] . "/lang/$users_lang/" . $users_lang +// . "_login.inc.php"); + } + } + } + $tmpl->set_var("login_url", $phpgw_info["server"]["webserver_url"] . "/login.php"); + $tmpl->set_var("cd",check_logoutcode($cd)); + $tmpl->set_var("cookie",show_cookie($cd,$last_loginid,$login)); + + $tmpl->set_var("lang_username",lang_login("username")); + $tmpl->set_var("lang_password",lang_login("password")); + $tmpl->set_var("lang_login",lang_login("login")); + + if ($phpgw_info["server"]["usecookies"]) { + $tmpl->set_var("use_cookies","" . lang_login("use cookies") . ""); + } + $tmpl->parse("login2out","login2"); + $tmpl->parse("loginout", "login"); + $tmpl->p("loginout"); +?> diff --git a/logout.php b/logout.php new file mode 100755 index 0000000000..14249f8da6 --- /dev/null +++ b/logout.php @@ -0,0 +1,71 @@ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags["disable_message_class"] = True; + $phpgw_flags["disable_send_class"] = True; + $phpgw_flags["disable_nextmatchs_class"] = True; + $phpgw_flags["disable_template_class"] = True; + $phpgw_flags["currentapp"] = ""; + $phpgw_flags["noheader"] = True; + + include("header.inc.php"); +// include($phpgw_info["server"]["include_root"] . "/lang/en/" . "en" . "_logout.inc.php"); + +/* + if ($installed[cron_apps] != "Y") { + $dh = opendir($phpgw_info["server"]["temp_dir"]); + while ($dir = readdir($dh)) { + if ($dir != "." && $dir != "..") { + if (substr($dir,0,strlen(time())) <= (time() - 3600)) { + echo $phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $dir; + $fh = opendir($phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $dir); + while ($file = readdir($fh)) { + if ($file != "." && $file != "..") { + unlink($phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $dir + . $phpgw_info["server"]["dir_separator"] . $file); + } + } + rmdir($phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $dir); + } + } + } + } +*/ + if ($usercookie) { + Setcookie("sessionid",time() - 3); + Setcookie("kp3",time() - 3); + Setcookie("usercookie",time() - 3); + sleep(1); // Make SURE its expired in the browser. + + } + + + if ($phpgw->session->verify($sessionid)) { + if (file_exists($phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $phpgw->session->id)) { + $dh = opendir($phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $phpgw->session->id); + while ($file = readdir($dh)) { + if ($file != "." && $file != "..") { + unlink($phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $phpgw->session->id + . $phpgw_info["server"]["dir_separator"] . $file); + } + + } + rmdir($phpgw_info["server"]["temp_dir"] . $phpgw_info["server"]["dir_separator"] . $phpgw->session->id); + } + $phpgw->session->destroy($phpgw->session->id); + $phpgw->db->query("delete from app_sessions where sessionid='" . $phpgw->session->id . "'"); + } + + Header("Location: " . $phpgw_info["server"]["webserver_url"] . "/login.php?cd=1"); +?> diff --git a/notify.php b/notify.php new file mode 100644 index 0000000000..8457c2f458 --- /dev/null +++ b/notify.php @@ -0,0 +1,63 @@ + True, "nonavbar" => True, "currentapp" => "notifywindow"); + include("header.inc.php"); +?> +" alink="blue" vlink="blue" link="blue"> + + + + + +msg->login(); + if (! $mbox) { + echo "Mail error: can not open connection to mail server"; + exit; + } + + if (hasmsg == "yes"){ + $mailbox_status = $phpgw->msg->status($mbox,"{" . $phpgw_info["server"]["mail_server"] . ":" . $phpgw_info["server"]["mail_port"] . "}INBOX",SA_UNSEEN); + if ($mailbox_status->unseen == 1) { + echo "link("email/") . "\" target=\"phpGroupWare\"> " + . lang_common("You have 1 new message!") . "\n"; + } + if ($mailbox_status->unseen > 1) { + echo "link("email/") . "\" target=\"phpGroupWare\"> " + . lang_common("You have x new messages!",$mailbox_status->unseen) . ""; + } + } else { +?> + +msg->status($mbox,"{" . $phpgw_info["server"]["mail_server"] . ":" . $phpgw_info["server"]["mail_port"] . "}INBOX",SA_UNSEEN); + if ($mailbox_status->unseen == 1) { + echo "
    ".lang_common("You have 1 new message!").""; + } + if ($mailbox_status->unseen > 1) { + echo "
    ".lang_common("You have x new messages!",$mailbox_status->unseen).""; + } + echo "

    Open phpGroupWare
    "; + } + } +?> \ No newline at end of file diff --git a/phpGroupWare.jpg b/phpGroupWare.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0a19bfac18685e7f3b1df6670dc741cfcda2b832 GIT binary patch literal 8465 zcmchcWl&sQv+oB634wt?2muBO46ec59RdUrY;cz$XmAJ?V1f-!a0~8(dk6%#!8N!9 z2*F(r&vUBYy640FaI0>e-e0<^YyVewuT`sh@884h!wTS;vb>T!01XWQKzn=u4+{Vp zz*B5&9BizoI8ShJai8K5kUb;7$0wj7c}YY@_lkiY@(M!B#4hxjiG`n)7Q!vd%`YM* zDJjYDT3$s?TvVPFE$AA`cr0B9KK0E|b&1Y!XHtqC27fk}u(M8ox5O2d@a zIWQKRm^a^8Z{G4V@79 zk0dSkqp0)4JOJ;XI3bV_AOUEKB?QRIq7gpBkd-9-UvYIgKwvsR>wceUDO+%huHp^L z`T6_th@KiV1;PDRp&RU-VmzPcnW`#J!LMhx4lOOx3l$O<#?Q10SI_0W40g6m z)dcg2kCqSJ=VB`pf3B+>%Gy+3@`MT|4?Pw63cz^u6K&U5m8w zG`ME4BR735Z=D%O$oq>on+Gn7B|7b^|5WlnTwIFpRI9KJ`j5nnv0;hBrlG z5RtsO#PVe>al4paWDBEcYBSrZMmuN(FByM~yU$o6l>FEy89(fXnKngc#CE-sFir=n z)~lSQX@LLFC#aAce?9qXg=5_M5s5bS5F9P`0RDWSv${hwo6IML;U0QMLTV9p&lD$x zD#xBMIn&W?ufL-`zAN@LeA48}*1~;xX)o{qhz(qJY7WPYB*JzrUO0V(kivHEehG#6nZhb+ElU>P*66fbl28eoDHb#?Y(GJ<5^oXzSO4&nGtPw4$_- z>X2r+3S`sl-a+H`$1&X8Z}0zmSN}&Z{<}l%UTJOijwlC!*RD#ss0RAg87d;Uywt78t4~H*A=ahQ2}G5oc=$9?ZBEL4DS5oz$p&3Kh|{SuZ4NsOc+9*gP8%FZpjpVjF?E-h2LhW8u2nk>ZSX z`(o)6Ra)kla|asc8HC{iM3S#CE2D;}DA!n^nO&>3N5qk?{nqcs0{7b7pqX@uc`*YE z1$rr8@`4HNl#EC_$rcdFa@v-u?Al4L7?p7JX%QKPLjO1J<(%SRXtn>sB!^sPgjn!)hgV+$=MH)KvORVZki zGNN9mt?}2eZ2J?HKk5Wia8V0@TJuPP(m*p6;T4?sG{~jUv4Xi{_h9!`49m{;Yv2Xz z>y5%D6iWOhuMJWvSNscwhOfN}Te2qGKtrh^#!N~atP#8Dn$3be+>Mga!`m9O@hgjU;sF00dAyFtkMrcLs+kLe%UxT_D-KXB2m6RRh-~PC&#$ex z?Y#!Mv+uPaBZ@*inRj}QTa2G-4Ytqrjxh*wH;&9RZ$+=&80t;xAF9H+}$~Y z0+!DiJ|pqkBPrFe`ux3Ts`e0DakJcKtN>hA=>u(+n7S3$WOqOXW+or+zU=Q@>&?ZL z8JGR0yqP6S^LTBy5oQ#JT#g6p3%kyvCZt%`D&T%EK5#8-O$erYLlc$65LVT2oi=;d z>^H;fR=qT}tE6G>12$+)a(}Ao1BGrkG%>0=4ntltD(-*FEzi)3D!F!GyZsr5^3N8_ z`_%9!yLCi+kd8=7w9H9l=imXrXB_eXQ1TtT)a}dl#Al0xRj(fxaG6QIaWokdJ{G^$ zq=?!=m9N1Z7*(lup(2w7yJZV9>y?G2v~g0(g_4LKrr3H=rLVB2|R4vw#p z35j{XUq+?jl>+l)PN|#2wk`+k?K#u?DeP^QIqF+Tg;*8n`Ch(BVgZAce%KXtA|E40cnuEVoNeU&yVNJhVp=D2FY`5f{JY0ff#^xa55MC+=J}Zm$+gPP)7G z=b_cKjI*W;uyEXgQ8ts$n;BD!c8t2zKaH1vP&e$RM|ml2Z_aK-k+i;3IN%^nz`2-z z`&7CChL2cn@jaf_@SH`tCIqnsuXx=gR#o&fUd-oM zn9~bD7N>7HVwb!tw9YT(`ed-_G>A@hjLdvbbNC>>s~VkU3mC zawGY%?W-Y%iaq;%^Q=tlbiU}4zq7bopfuUT)dD!t_jsk5S^Xtt>Yk<~^SKQ=hPmX; z)X9(F+g&A{MgzYB53g;Q+|fO(J*P*M`x)A~+9^QC+=9>4#~cqx?qPHT3GA~e*8oaJ zv^7J0ocFDEFpIhPt%JPtF|DEBOu4#R4Gg-TOnm{ZQLZnhjrej2C8q;t*`Q4zrlxIA zoBLfH! z37wAh&gFZ#zeOGamU(VCIf&M@t&0@t;so?6X~K=vx-Vv_wPvti*srC=e^b=3Tkaqc zCm?#aoF{*ih&gl*>7oo&M*qFv_py(Kx9#BMSh2JH{&PXHgk>nQ^eNemW7bu*VIiYG zzM9qj&yPpGmh8TF-Y+eWXlqq;)puca9mvUQ&Dx<}`evI<+ACOa&%FD~@z}SIGZpPC zAyH-QLp|gE5nU;u{;pcbK$+va(S?t3>5-&;=NKArjLOY3x(tGB?Id4Eka!#7;Duid z9a37jCDGg2oiUA*PKJ4XW5oHL?XSkYDJGuoc;~t(*DpKc*vmWR>F(k%r@EGnFL_dV z*=SOYxD?aVRYynaV##C_KBxQQ(EHtmVzAu=#k>vBqDZBz)e}wv&0FBDQeZWQ8A>1wuslxxT zG@7@4*5+QLoHMhlRd80MF+RHmTeo{^gK;_RLIQ4<-5}y+4Dm{9-|(U?+HDZ*X&oO1 zuK2#0bihvYVJxV-DHnfMU=mtO`B{T6m8wg{5ndMPhsxTq0p1jw>TstR$_A`qhWma1 zXYhP;HFeEuU+Pu$(`v#CI$&S@Gwb>UGLu_s)7RHHbSN$E-Q|7CSkI__wRXx|EzNp?M1T zZ3X0~64j8hSv$UNfZ{=;fsBLDe%ngWbhLJs78~myOIL|vz&b7!7LifgH8Z7ZXH+FF zLR%Jm{uG=PbA(Ma)!lg{2mbt+JSl-=rDI8!iq-?5OEpQr407a)xW)CUj2S_!3z9)q zTaQ73`xjZcdF!BRIZqX4$v}8Da-6`c!O&lqzry zWN`Nm%Q*D#?dOtOiUmgpp3hgZ%?@jPt)Z8d{PB^hH;iERRNGR8Yq6}~%*SX36ofxr zpcy3uQ=uRBG%fs^NUGWkFI&l<)=qH1ja!cWM)Lg#|El#n#sk2uceQBQKjQf1FSSx$ z8R~+i$vba?=7YJ-;;4+Fa9z7Fp<(U-TtsCF>Q*p71rgWfE?27V$v6ZOxMi{ORm`NH z?zfU|U(z}eTa4}5cEN^OFFBQq1x9~t-gJD|KA_$m7~2k@0)F;}>`mO3%tUbLW}wWN z1>8ThB)Cn7rAWv%wwa`)uos}{ic>=u#VPf`1Hwcv>6UH_$;~4*ZI4}f1AL-2{eSG4 zdkQmip~iFn4z}}SU6xZC_^Fqi^d3?lMiw_&={Xoor(Q&15!@-nB_RKhGgCkZ2GQRX zhQRS*Vd0PWa>qtVOZc|CG5n~}@x`AY+XgP%S4~lvBVej*Ta^zZW~NcyL7jt@ZUnA| z4*-45nCK7$_+pb4x`((=X+si`-x5Z~01p8fQ9w|>wu=iiA2j_B(2;8L$e z!{3LAA6C-0CoxCn3lE)D{3HL&$LtDM!)KQ~IK=L|F0{}2= zT$afoJ(+X^MKQkw2_8$-+CJ~Io+L_iK9t&J+`i)`{Fy#=_xeGJ+N-MjSHqnlMHeo8 zUS(n(6QqA10Af?|Gt^3a^=i-kyYviiNn#j%hZy}et78*?Y*fV=>};@aQu9r%dV|W$ z!m(Vsp36Y7V{k{|rhLeHUP+?5N*mzco1p5Dvplcl=MW;DRB)`}mu#`me_HNjQ0|v$ z@a)Qv=OZg4ihVYW6@3QBf7~<{Cxb4YtvMq=K6GEj8y zA_>zUBaq8W8dSm5+pxj@VRe2|5PYIF#aPXr294eCGVG>M*Lk*dZXVGLXm`T{X7%$VVn)6mxx81uI`Feo!Q`3>|Fg;@%q+->xRPz8R_2K<=zv(j^ zo{Tey=M3K)oNCRhKGpn19a!)j(%bDjFu5jDmbk{hgXEOZ;V^BBvMN{Zjr{s|<(RL6 zBh?zqJ~QBhZaS;3G;Ju&An_YK8_EEnl+La3bb|HZPushxj4pCK=W~PMD?D+E^zMV` zsn9Og`E_Ov#)>=Qcl1^)+H2Kzr{zAQ%pc9yoyCNiNuXB!ym9!WULF&61WI`#y%Zyt zd*=G16`#onr#k6%Uq}^fDd$nzx2>y5ob7t*-B%k6VX8LXoK%>H&Sa&NyOcck zpBj)pLCW#^t4gjP-_(_Tg7(yn4pu4jJ6E+bKDJJY7m=#ZZ!r_WbM0sp+{ZMa{4uUgSLPKS0+K~ZX8fkAouBE*Twry|rfxt~k7yL4pO-?WJwP>b; zYA^KldcGO)@HHUOCG>Yk5rh9tV`Lh1*Z2Yq!bcvq}EU5loe97RzoV?7a=AN_k)h~z3*@-Rm}6dCR+t> z-)%K6s^6BC{dL~j0)fmGjPjKAr8_oD`NA3vGMQJeT*mnAH2FnhLHG`%RADHtetGR4 z#r;OD&_cl(FvE|F} zn#odiJUY^~C#V^@{+7hNx9^LB=brsEQ`FxZkJ(9|d$ z-i0=tXeRp9KoawF84hBC;imFQgfb=G{g%nEV zN^F;`=oZj#Bvw+f;?J*cl;dS`R2Zd|F2cpaijLXEv#(hGGJkK_QCyE~JsxEk5V%2{ z>qKk4?^Ai+A{&p>tr`>)-A!;rF46#H5$h4vQ2VT2ZDzbBQG@oYEoepM%UbRc*na9u zD(cgs`hp4!)ETSYxX?sK*KdSv?^`|r5jmK?KHv3N=og6ee=*UlY#c9?&J|V{J3z6e zDbRCYUJC4qAonjqXy#Angtlb&d(Hbu4hpO>y?>lyfD1F%wA0c7Rf^y|zy5vfVRuiJP&Jk!`_C%guES;;TYlJ8nrz0Pr>Od;Qz;ni`_lqaO3s&_ zyO}Qh?+XPum3y9wQ#F=I=Q};Q4Bv1Lh^i=sTz_<0o>NLHP$$#pRGKQUNeL@@wNrZ? z)Pw_LeI7j!9>LT7f{SmNHFHMvBZzWfX4O|~Pfx(=IEqUNBJ?WY0;ZmFDkj1Vc>sW% zXZO~+%#tQM7l-3KTwStE7tS?(wee0))P4opc~M0Ec*>}PjUDoaNH}q5{YjSuy8shv z0k`!|@_ttZjA0M58N=0QL?9TYmB)#IVG8(v#O17rrnT*y=QN-#U9gC(NrWF$lEciM zR6;POf@OujSTgT@63Fr1r7hqAbj`~nj9lFmH`(!#Oo%Em9E*}@ z7tOXMVM9uUF}mt8Vh@1j{hS&FyxU5j0MxAeRH1tU+0)8OJ1#nPa(0%+k$Z6CkfA=! zhZslSU|B>(VqPNC1cdFw04gVLU5}-i!s@k>2MyOoG!`X6Wkb`SDF>s{#2mdO$GLD6 z`(jyOp$4_1#$S|q*rhN99U`vGMafDHQO&&2ce)(&X91;l^fi{)cLLvkxc);_NM4RNTb#m1>8JgXvU^MJIHJy?`WevaS_E2^^SwX2-6 z=enmo!WP7c984OS%cs<$ZCq>J@SHz@MQ^fSLPg^01;IGITG)aqf6VVA3*MG~K!fVp%}rREZaT4&4oduh{$?4Noi}Ww`l;%P2w`%@@I5Cz zA3+uLgCiclAOB8Ca^8d64i1;RF9Mc-!vYxh^8FL}CS}%akK*58gSCd1KHzIN_c<)B zW|{y_#KYf`W1GD2?=lcy1dFm+n&KL`Z@Y0gUoaNGOO1@JM!Z;HVJ}>@NIjjEmFvp+ z7jL?r)P)SuH!6B#~I_SZie|0xUsGJzPAsm^VBQK zHHV^|qAAr-2t*Bt>SjiH*}o2&qxh}}sWuk${a8ou?6lJ$w7=gCDaoto)9t|ujgHs{ zh+rn@@;?rP#vJBGysLGmaF98oV!eh`ek?G|>~*~c+VON~6af8NR?@dEDz@2aRyUfV zhZmLIj{1lA`Zncs6=C|(0=3`x5_y>DA*eB|KbYt<1$+m907!Vi)rP}GHWCR(KY1;0 zJOmZkZ6ibr(YvQj)2)Zb09Vzl4DGBex8-kqV zlW5EEZJ#S+)Wk2gEvelbwug@vY9+3~WE3p(-Vw7JaROJ54c+49fs*?q8vo#D-=r`P zKv`hLAk!ng1&%0^aqihL%|fhy+u)-9iIY%_t>*G0;RIZ` * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + + $phpgw_flags["currentapp"] = "preferences"; + include("../header.inc.php"); + if ($phpgw_info["user"]["permissions"]["anonymous"]) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); + exit; + } + +if (! $submit) { + $phpgw->common->header(); + $phpgw->common->navbar(); + + ?> + + session->hidden_var(); ?> + + + + + + + + + + + + + +
    + + + +
    + + + +
    + "> +
    + +
    +
    
    +   
    +
    $error

    "; + exit; + } + + $phpgw->db->query("update accounts set passwd='" . md5($n_passwd) . "', " + . "lastpasswd_change='" . time() . "' where loginid='" + . $phpgw->session->loginid . "'"); + + // Since they are logged in, we need to change the password in sessions + // in case they decied to check there mail. + $phpgw->db->query("update sessions set passwd='" . addslashes($n_passwd) + . "' where loginid='" . $phpgw->session->loginid . "'"); + + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] + . "/preferences/","cd=18")); +} diff --git a/preferences/changeprofile.php b/preferences/changeprofile.php new file mode 100644 index 0000000000..a4c202231a --- /dev/null +++ b/preferences/changeprofile.php @@ -0,0 +1,99 @@ + * + * -------------------------------------------- * + * 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$ */ + + Header("Cache-Control: no-cache"); + Header("Pragma: no-cache"); + //Header("Expires: Sat, Jan 01 2000 01:01:01 GMT"); + + $phpgw_flags["currentapp"] = "preferences"; + include("../header.inc.php"); + if ($phpgw_info["user"]["permissions"]["anonymous"]) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); + exit; + } + + if ($submit) { + if ($picture_size) { + $fh = fopen($picture,"r"); + $picture_raw = fread($fh,$picture_size); + fclose($fh); + + $phone_number = addslashes($phone_number); + $comments = addslashes($comments); + $title = addslashes($title); + + if ($phpgw_info["server"]["db_type"] == "mysql") { + $picture_raw = addslashes($picture_raw); + } else { + $picture_raw = base64_encode($picture_raw); + } + + $phpgw->db->query("delete from profiles where owner='" .$phpgw->session->loginid . "'"); + + $phpgw->db->query("insert into profiles (owner,title,phone_number,comments," + . "picture_format,picture) values ('" . $phpgw->session->loginid . "','" + . "$title','$phone_number','$comments','$picture_type','$picture_raw')"); + } else { + $phone_number = addslashes($phone_number); + $picture_raw = addslashes($picture_raw); + $comments = addslashes($comments); + $title = addslashes($title); + + $phpgw->db->query("update profiles set title='$title',phone_number='$phone_number'," + . "comments='$comments' where owner='" . $phpgw->session->loginid. "'"); + } + echo "
    Your profile has been updated
    "; + } + + $phpgw->db->query("select * from profiles where owner='" . $phpgw->session->loginid . "'"); + $phpgw->db->next_record(); +?> + +
    + session->hidden_var(); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    common->display_fullname($phpgw->session->loginid,$phpgw->session->firstname,$phpgw->session->lastname); ?> 
    Title:"> + +
    Phone number:">
    Comments:
    Picture:
    Note: Pictures will be resized to 100x120.
    +
    + +
    diff --git a/preferences/changetheme.php b/preferences/changetheme.php new file mode 100755 index 0000000000..828e7a170b --- /dev/null +++ b/preferences/changetheme.php @@ -0,0 +1,48 @@ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + + $phpgw_flags["currentapp"] = "preferences"; + include("../header.inc.php"); + $installed_themes = array('default','blue','mojo','heaven'); + + if ($phpgw_info["user"]["permissions"]["anonymous"]) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); + exit; + } + + if (!isset($submit) && !$submit) { + $phpgw->common->header(); + $phpgw->common->navbar(); + + ?> +
    +
    +
    + +link("changetheme.php","submit=true&ntheme=" + . $installed_themes[$i]) . "\">" . $installed_themes[$i] . "\n"; + } else { + $theme = $ntheme; + $phpgw->preferences->update($phpgw->session->loginid,"theme"); + + // This way the theme is changed right away. + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] + . "/preferences/")); + } + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); + diff --git a/preferences/index.php b/preferences/index.php new file mode 100755 index 0000000000..f449a628f9 --- /dev/null +++ b/preferences/index.php @@ -0,0 +1,36 @@ + * + * -------------------------------------------- * + * 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$ */ + + //$phpgw_flags = array("noheader" => True, "nonavbar" => True); + + $phpgw_flags["currentapp"] = "preferences"; + include("../header.inc.php"); + if ($phpgw_info["user"]["permissions"]["anonymous"]) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); + exit; + } + + echo "
    link("changepassword.php") . "\">" + . lang_pref("change your password") . ""; + echo "
    link("changetheme.php") . "\">" + . lang_pref("select different theme") . ""; + echo "
    link("settings.php") . "\">" + . lang_pref("change your settings") . ""; + echo "
    link("changeprofile.php") . "\">" + . lang_pref("change your profile") . ""; + if ($phpgw_info["user"]["permissions"]["nntp"]) + echo "
    link("nntp.php") . "\">" + . lang_pref("monitor newsgroups") . ""; + + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); diff --git a/preferences/lang/br_preferences.inc.php b/preferences/lang/br_preferences.inc.php new file mode 100644 index 0000000000..d8dc58fd7a --- /dev/null +++ b/preferences/lang/br_preferences.inc.php @@ -0,0 +1,86 @@ + diff --git a/preferences/lang/de_preferences.inc.php b/preferences/lang/de_preferences.inc.php new file mode 100755 index 0000000000..751a466f23 --- /dev/null +++ b/preferences/lang/de_preferences.inc.php @@ -0,0 +1,97 @@ +" . $m1 .""; break; + + case "please, select a new theme": + $s = "Wählen Sie bitte ein neues Schema"; break; + + case "note: this feature does *not* change your email password. this will need to be done manually.": + $s = "Anmerkung: Ihr EMail Passwort wird durch diese Funktion *NICHT* angepasst. Dies müssen Sie manuell tun."; break; + + case "monitor newsgroups": + $s = "Newsgroups überwachen"; break; + + + default: $s = "* ". $message; + } + return $s; + } + + diff --git a/preferences/lang/en_preferences.inc.php b/preferences/lang/en_preferences.inc.php new file mode 100755 index 0000000000..b69bbe5645 --- /dev/null +++ b/preferences/lang/en_preferences.inc.php @@ -0,0 +1,97 @@ +" . $m1 . ""; break; + + case "please, select a new theme": + $s = "Please, select a new theme"; break; + + case "note: this feature does *not* change your email password. this will need to be done manually.": + $s = "Note: This feature does *not* change your email password. This will need to be done manually."; break; + + case "monitor newsgroups": + $s = "Monitor Newsgroups"; break; + + + default: $s = "* ". $message; + } + return $s; + } + + diff --git a/preferences/lang/fr_preferences.inc.php b/preferences/lang/fr_preferences.inc.php new file mode 100755 index 0000000000..0fa33358f4 --- /dev/null +++ b/preferences/lang/fr_preferences.inc.php @@ -0,0 +1,88 @@ +" . $m1 . ""; break; + + case "please, select a new theme": + $s = "Choisissez un nouveau theme"; break; + + case "note: this feature does *not* change your email password. this will need to be done manually.": + $s = "Note: Ceci ne change pas le mot de passe de votre email. Ceci doit être fait manuellement."; break; + + + default: $s = "* ". $message; + } + return $s; + } + + diff --git a/preferences/lang/it_preferences.inc.php b/preferences/lang/it_preferences.inc.php new file mode 100755 index 0000000000..40f71072bd --- /dev/null +++ b/preferences/lang/it_preferences.inc.php @@ -0,0 +1,86 @@ + \ No newline at end of file diff --git a/preferences/lang/kr_preferences.inc.php b/preferences/lang/kr_preferences.inc.php new file mode 100755 index 0000000000..0edbafa2b1 --- /dev/null +++ b/preferences/lang/kr_preferences.inc.php @@ -0,0 +1,88 @@ +" . $m1 . " ÀÔ´Ï´Ù."; break; + + case "please, select a new theme": + $s = "»õ·Î¿î Å׸¶¸¦ ¼±ÅÃÇϼ¼¿ä."; break; + + case "note: this feature does *not* change your email password. this will need to be done manually.": + $s = "Âü°í: e-mailÀÇ ¾ÏÈ£´Â º¯°æµÇÁö ¾Ê½À´Ï´Ù. ¼öµ¿À¸·Î º¯°æÇϽʽÿÀ."; break; + + + default: $s = "* ". $message; + } + return $s; + } + + diff --git a/preferences/lang/nl_preferences.inc.php b/preferences/lang/nl_preferences.inc.php new file mode 100755 index 0000000000..6dede55ddf --- /dev/null +++ b/preferences/lang/nl_preferences.inc.php @@ -0,0 +1,88 @@ +" . $m1 . ""; break; + + case "please, select a new theme": + $s = "Selecteer een nieuw thema"; break; + + case "note: this feature does *not* change your email password. this will need to be done manually.": + $s = "Noot: Deze optie veranderd *niet* uw email-wachtwoord. Dit moet handmatig gebeuren."; break; + + + default: $s = "* ". $message; + } + return $s; + } + + diff --git a/preferences/lang/no_preferences.inc.php b/preferences/lang/no_preferences.inc.php new file mode 100755 index 0000000000..e3598d942b --- /dev/null +++ b/preferences/lang/no_preferences.inc.php @@ -0,0 +1,85 @@ +" . $m1 . ""; break; + + case "please, select a new theme": + $s = "Vennligst velg et nytt tema"; break; + + case "note: this feature does *not* change your email password. this will need to be done manually.": + $s = "Noter: Denne funksonen endrer *ikke* ditt epost passord. Dette må gjøres manuellt."; break; + + default: $s = "* $message"; + } + return $s; + } diff --git a/preferences/lang/sp_preferences.inc.php b/preferences/lang/sp_preferences.inc.php new file mode 100755 index 0000000000..56bdd7c9fc --- /dev/null +++ b/preferences/lang/sp_preferences.inc.php @@ -0,0 +1,85 @@ +* ". $message; + } + return $s; + } \ No newline at end of file diff --git a/preferences/nntp.php b/preferences/nntp.php new file mode 100755 index 0000000000..b68c22b66d --- /dev/null +++ b/preferences/nntp.php @@ -0,0 +1,169 @@ + * + * -------------------------------------------- * + * 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$ */ + + if ($submit && $nntplist) { + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + } + + $phpgw_flags["currentapp"] = "preferences"; + include("../header.inc.php"); + $phpgw->include_lang("nntp"); + function get_tg() + { + global $phpgw; + + $phpgw->db->query("SELECT count(con) FROM newsgroups WHERE active='Y'"); + $phpgw->db->next_record(); + return $phpgw->db->f(0); + } + + if(!$submit && !$nntplist) { + + $phpgw->db->query("SELECT con FROM accounts WHERE loginid='".$phpgw_info["user"]["userid"]."'"); + $phpgw->db->next_record(); + $usercon = $phpgw->db->f("con"); + + $urlname = $phpgw_info["server"]["webserver_url"]."/preferences/nntp.php"; + + $t = new Template($phpgw_info["server"]["template_dir"]); + + $t->set_file(array( "nntp_header" => "nntp.tpl", + "nntp_list" => "nntp.tpl", + "nntp_footer" => "nntp.tpl" )); + + $t->set_block("nntp_header","nntp_list","nntp_footer","output"); + + if (! $tg) + { + $tg = get_tg(); + } + + if (! $start) $start = 0; + + $orderby = ""; + if ($order) + { + switch ($order) + { + case 1: + $orderby = " ORDER BY CON $sort"; + break; + case 2: + $orderby = " ORDER BY GROUP $sort"; + break; + case 3: + $orderby = " ORDER BY ACTIVE $sort"; + break; + } + } + + $phpgw->db->query("SELECT con, name FROM newsgroups WHERE active='Y'$orderby LIMIT " + .$phpgw->nextmatchs->sql_limit($start)); + + while($phpgw->db->next_record()) + { + $nntpavailgroups["con"][] = $phpgw->db->f("con"); + $nntpavailgroups["name"][] = $phpgw->db->f("name"); + } + + $first = min($nntpavailgroups["con"]); + + $common_hidden_vars = $phpgw->session->hidden_var() . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n"; + + $t->set_var("nml",$phpgw->nextmatchs->left( $urlname, + $start, + $tg, + "&tg=$tg&sort=$sort&order=$order")); + $t->set_var("nmr",$phpgw->nextmatchs->right($urlname, + $start, + $tg, + "&tg=$tg&sort=$sort&order=$order")); + + $t->set_var("title",lang_nntp("Newsgroups")); + $t->set_var("action_url",$phpgw->link($urlname)); + $t->set_var("common_hidden_vars",$common_hidden_vars); + $t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); + $t->set_var("th_font",$phpgw_info["theme"]["font"]); + $t->set_var("sort_con",$phpgw->nextmatchs->show_sort_order($sort,"1",$order,$urlname," # ","&tg=$tg")); + $t->set_var("sort_group",$phpgw->nextmatchs->show_sort_order($sort,"2",$order,$urlname,"Group","&tg=$tg")); + $t->set_var("sort_active",$phpgw->nextmatchs->show_sort_order($sort,"3",$order,$urlname," Active ","&tg=$tg")); + + $t->parse("out","nntp_header"); + + $phpgw->db->query("select newsgroup from users_newsgroups where owner=$usercon"); + while ($phpgw->db->next_record()) + { + $found[$phpgw->db->f("newsgroup")] = " checked"; + } + + for($i=0;$inextmatchs->alternate_row_color($tr_color); + + $t->set_var("tr_color",$tr_color); + $con = $nntpavailgroups["con"][$i]; + $t->set_var("con",$con); + + if (! $nntpavailgroups["name"][$i]) $nntpavailgroups["name"][$i] = " "; + $t->set_var("group",$nntpavailgroups["name"][$i]); + + $active_var = ""; + + $t->set_var("active",$active_var); + + if ($i+1 <> count($nntpavailgroups["con"])) + $t->parse("output","nntp_list",True); + } + $t->set_var("lang_update",lang_nntp("update")); + $t->set_var("checkmark",$phpgw_info["server"]["webserver_url"]."/email/images/check.gif"); + + $t->pparse("out","nntp_footer"); + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); + } else { + $phpgw->db->lock(array("users_newsgroups","accounts")); + + $orderby = ""; + if ($order) + { + switch ($order) + { + case 1: + $orderby = " ORDER BY CON $sort"; + break; + case 2: + $orderby = " ORDER BY GROUP $sort"; + break; + case 3: + $orderby = " ORDER BY ACTIVE $sort"; + break; + } + } + $phpgw->db->query("DELETE FROM users_newsgroups WHERE newsgroup>=$first AND owner=$usercon$orderby LIMIT " + .$phpgw->nextmatchs->sql_limit(0)); + + for ($i=0;$idb->query("INSERT INTO users_newsgroups VALUES($usercon,".$nntplist[$i].")"); + } + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link($urlname,"start=$start&tg=$tg")); + } +?> diff --git a/preferences/settings.php b/preferences/settings.php new file mode 100755 index 0000000000..4b278a9022 --- /dev/null +++ b/preferences/settings.php @@ -0,0 +1,328 @@ + * + * -------------------------------------------- * + * 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$ */ + + $phpgw_flags = array("noheader" => True, "nonavbar" => True); + + $phpgw_flags["currentapp"] = "preferences"; + include("../header.inc.php"); + if ($phpgw_info["user"]["permissions"]["anonymous"]) { + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); + exit; + } else if (! $submit) { + $phpgw->common->header(); + $phpgw->common->navbar(); + } + + function display_option($text,$check,$option) { + global $phpgw, $phpgw_info; + if ($phpgw_info["user"]["permissions"][$check]) { +?> + + + ? + + + > + + + + + + + + + + + + +
    + session->hidden_var(); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +\n"; +?> + + + + + + +
    : + " size="2"> +
    : + > +
    : + + +
    : + + +
    :" + . "" + . "" + . "\n"; + ?> +
    + + +
    ?>
    + +
    + +
    + +
    + +
    :
    + "> +
    +
    + db->query("delete from preferences where owner='" . $phpgw->session->loginid + . "' AND name != 'theme'"); + + // If they don't have permissions to the headlines, + // we don't need to lock the table. + if ($phpgw_info["user"]["permissions"]["headlines"]) { + $phpgw->db->lock(array("preferences","users_headlines")); + } else { + $phpgw->db->lock("preferences"); + } + + $phpgw->preferences->add($phpgw->session->loginid,"maxmatchs"); + $phpgw->preferences->add($phpgw->session->loginid,"tz_offset"); + $phpgw->preferences->add($phpgw->session->loginid,"dateformat"); + $phpgw->preferences->add($phpgw->session->loginid,"timeformat"); + $phpgw->preferences->add($phpgw->session->loginid,"lang"); + $phpgw->preferences->add($phpgw->session->loginid,"default_sorting"); + $phpgw->preferences->add($phpgw->session->loginid,"default_app"); + + if ($navbar_text) { + $phpgw->preferences->add($phpgw->session->loginid,"navbar_text"); + } + + if ($phpgw_info["user"]["permissions"]["admin"]) { + if ($show_currentusers) { + $phpgw->preferences->add($phpgw->session->loginid,"show_currentusers"); + } + } + + if ($phpgw_info["user"]["permissions"]["email"]) { + if ($mainscreen_showmail) { + $phpgw->preferences->add($phpgw->session->loginid,"mainscreen_showmail"); + } + $phpgw->preferences->add($phpgw->session->loginid,"email_sig"); + } + + if ($phpgw_info["user"]["permissions"]["addressbook"]) { + if ($mainscreen_showbirthdays) { + $phpgw->preferences->add($phpgw->session->loginid,"mainscreen_showbirthdays"); + } + } + + if ($phpgw_info["user"]["permissions"]["calendar"]) { + $phpgw->preferences->add($phpgw->session->loginid,"weekdaystarts"); + $phpgw->preferences->add($phpgw->session->loginid,"workdaystarts"); + $phpgw->preferences->add($phpgw->session->loginid,"workdayends"); + if ($mainscreen_showevents) { + $phpgw->preferences->add($phpgw->session->loginid,"mainscreen_showevents"); + } + } + + if ($phpgw_info["user"]["permissions"]["headlines"]) { + include($phpgw_info["server"]["server_root"] . "/headlines/inc/functions.inc.php"); + headlines_update($phpgw->session->loginid,$headlines); + } + + $phpgw->db->unlock(); + + Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] + . "/preferences/")); + } + include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); + +