summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc4ebde)
raw | patch | inline | side by side (parent: bc4ebde)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jan 2008 14:29:47 +0000 (14:29 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jan 2008 14:29:47 +0000 (14:29 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8464 594d385d-05f5-0310-b6e9-bd551577e9d8
29 files changed:
diff --git a/gosa-core/plugins/personal/connectivity/openxchange/class_oxchangeAccount.inc b/gosa-core/plugins/personal/connectivity/openxchange/class_oxchangeAccount.inc
+++ /dev/null
@@ -1,976 +0,0 @@
-<?php
-/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2005 Alejandro Escanero Blanco
-
- 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
-*/
-
-class oxchangeAccount extends plugin
-{
- /* Definitions */
- var $plHeadline= "Open-Xchange";
- var $plDescription= "This does something";
-
- /* GW attributes */
- var $OXAppointmentDays="500";
- var $OXTaskDays="5";
- var $OXTimeZone="GMT";
- var $mailEnabled="OK";
- var $dnModeValue = "";
- var $view_logged = FALSE;
-
- /* attribute list for save action */
- var $attributes= array("OXAppointmentDays", "OXTaskDays", "OXTimeZone","mailEnabled");
- var $objectclasses= array("OXUserObject");
- var $ReadOnly =false;
- var $oxconf = array();
- var $timezones=array(
- "Africa/Abidjan",
- "Africa/Accra",
- "Africa/Addis_Ababa",
- "Africa/Algiers",
- "Africa/Asmera",
- "Africa/Bamako",
- "Africa/Bangui",
- "Africa/Banjul",
- "Africa/Bissau",
- "Africa/Blantyre",
- "Africa/Brazzaville",
- "Africa/Bujumbura",
- "Africa/Cairo",
- "Africa/Casablanca",
- "Africa/Ceuta",
- "Africa/Conakry",
- "Africa/Dakar",
- "Africa/Dar_es_Salaam",
- "Africa/Djibouti",
- "Africa/Douala",
- "Africa/El_Aaiun",
- "Africa/Freetown",
- "Africa/Gaborone",
- "Africa/Harare",
- "Africa/Johannesburg",
- "Africa/Kampala",
- "Africa/Khartoum",
- "Africa/Kigali",
- "Africa/Kinshasa",
- "Africa/Lagos",
- "Africa/Libreville",
- "Africa/Lome",
- "Africa/Luanda",
- "Africa/Lubumbashi",
- "Africa/Lusaka",
- "Africa/Malabo",
- "Africa/Maputo",
- "Africa/Maseru",
- "Africa/Mbabane",
- "Africa/Mogadishu",
- "Africa/Monrovia",
- "Africa/Nairobi",
- "Africa/Ndjamena",
- "Africa/Niamey",
- "Africa/Nouakchott",
- "Africa/Ouagadougou",
- "Africa/Porto-Novo",
- "Africa/Sao_Tome",
- "Africa/Timbuktu",
- "Africa/Tripoli",
- "Africa/Tunis",
- "Africa/Windhoek",
- "America/Adak",
- "America/Anchorage",
- "America/Anguilla",
- "America/Antigua",
- "America/Araguaina",
- "America/Aruba",
- "America/Asuncion",
- "America/Atka",
- "America/Barbados",
- "America/Belem",
- "America/Belize",
- "America/Boa_Vista",
- "America/Bogota",
- "America/Boise",
- "America/Buenos_Aires",
- "America/Cambridge_Bay",
- "America/Cancun",
- "America/Caracas",
- "America/Catamarca",
- "America/Cayenne",
- "America/Cayman",
- "America/Chicago",
- "America/Chihuahua",
- "America/Cordoba",
- "America/Costa_Rica",
- "America/Cuiaba",
- "America/Curacao",
- "America/Danmarkshavn",
- "America/Dawson",
- "America/Dawson_Creek",
- "America/Denver",
- "America/Detroit",
- "America/Dominica",
- "America/Edmonton",
- "America/Eirunepe",
- "America/El_Salvador",
- "America/Ensenada",
- "America/Fortaleza",
- "America/Fort_Wayne",
- "America/Glace_Bay",
- "America/Godthab",
- "America/Goose_Bay",
- "America/Grand_Turk",
- "America/Grenada",
- "America/Guadeloupe",
- "America/Guatemala",
- "America/Guayaquil",
- "America/Guyana",
- "America/Halifax",
- "America/Havana",
- "America/Hermosillo",
- "America/Indiana",
- "America/Indiana/Indianapolis",
- "America/Indiana/Knox",
- "America/Indiana/Marengo",
- "America/Indiana/Vevay",
- "America/Indianapolis",
- "America/Inuvik",
- "America/Iqaluit",
- "America/Jamaica",
- "America/Jujuy",
- "America/Juneau",
- "America/Kentucky",
- "America/Kentucky/Louisville",
- "America/Kentucky/Monticello",
- "America/Knox_IN",
- "America/La_Paz",
- "America/Lima",
- "America/Los_Angeles",
- "America/Louisville",
- "America/Maceio",
- "America/Managua",
- "America/Manaus",
- "America/Martinique",
- "America/Mazatlan",
- "America/Mendoza",
- "America/Menominee",
- "America/Merida",
- "America/Mexico_City",
- "America/Miquelon",
- "America/Monterrey",
- "America/Montevideo",
- "America/Montreal",
- "America/Montserrat",
- "America/Nassau",
- "America/New_York",
- "America/Nipigon",
- "America/Nome",
- "America/Noronha",
- "America/North_Dakota",
- "America/North_Dakota/Center",
- "America/Panama",
- "America/Pangnirtung",
- "America/Paramaribo",
- "America/Phoenix",
- "America/Port-au-Prince",
- "America/Porto_Acre",
- "America/Porto_Velho",
- "America/Port_of_Spain",
- "America/Puerto_Rico",
- "America/Rainy_River",
- "America/Rankin_Inlet",
- "America/Recife",
- "America/Regina",
- "America/Rio_Branco",
- "America/Rosario",
- "America/Santiago",
- "America/Santo_Domingo",
- "America/Sao_Paulo",
- "America/Scoresbysund",
- "America/Shiprock",
- "America/St_Johns",
- "America/St_Kitts",
- "America/St_Lucia",
- "America/St_Thomas",
- "America/St_Vincent",
- "America/Swift_Current",
- "America/Tegucigalpa",
- "America/Thule",
- "America/Thunder_Bay",
- "America/Tijuana",
- "America/Tortola",
- "America/Vancouver",
- "America/Virgin",
- "America/Whitehorse",
- "America/Winnipeg",
- "America/Yakutat",
- "America/Yellowknife",
- "Antarctica/Casey",
- "Antarctica/Davis",
- "Antarctica/DumontDUrville",
- "Antarctica/Mawson",
- "Antarctica/McMurdo",
- "Antarctica/Palmer",
- "Antarctica/South_Pole",
- "Antarctica/Syowa",
- "Antarctica/Vostok",
- "Arctic/Longyearbyen",
- "Asia/Aden",
- "Asia/Almaty",
- "Asia/Amman",
- "Asia/Anadyr",
- "Asia/Aqtau",
- "Asia/Aqtobe",
- "Asia/Ashgabat",
- "Asia/Ashkhabad",
- "Asia/Baghdad",
- "Asia/Bahrain",
- "Asia/Baku",
- "Asia/Bangkok",
- "Asia/Beirut",
- "Asia/Bishkek",
- "Asia/Brunei",
- "Asia/Calcutta",
- "Asia/Choibalsan",
- "Asia/Chongqing",
- "Asia/Chungking",
- "Asia/Colombo",
- "Asia/Dacca",
- "Asia/Damascus",
- "Asia/Dhaka",
- "Asia/Dili",
- "Asia/Dubai",
- "Asia/Dushanbe",
- "Asia/Gaza",
- "Asia/Harbin",
- "Asia/Hong_Kong",
- "Asia/Hovd",
- "Asia/Irkutsk",
- "Asia/Istanbul",
- "Asia/Jakarta",
- "Asia/Jayapura",
- "Asia/Jerusalem",
- "Asia/Kabul",
- "Asia/Kamchatka",
- "Asia/Karachi",
- "Asia/Kashgar",
- "Asia/Katmandu",
- "Asia/Krasnoyarsk",
- "Asia/Kuala_Lumpur",
- "Asia/Kuching",
- "Asia/Kuwait",
- "Asia/Macao",
- "Asia/Macau",
- "Asia/Magadan",
- "Asia/Manila",
- "Asia/Muscat",
- "Asia/Nicosia",
- "Asia/Novosibirsk",
- "Asia/Omsk",
- "Asia/Oral",
- "Asia/Phnom_Penh",
- "Asia/Pontianak",
- "Asia/Pyongyang",
- "Asia/Qatar",
- "Asia/Qyzylorda",
- "Asia/Rangoon",
- "Asia/Riyadh",
- "Asia/Riyadh87",
- "Asia/Riyadh88",
- "Asia/Riyadh89",
- "Asia/Saigon",
- "Asia/Sakhalin",
- "Asia/Samarkand",
- "Asia/Seoul",
- "Asia/Shanghai",
- "Asia/Singapore",
- "Asia/Taipei",
- "Asia/Tashkent",
- "Asia/Tbilisi",
- "Asia/Tehran",
- "Asia/Tel_Aviv",
- "Asia/Thimbu",
- "Asia/Thimphu",
- "Asia/Tokyo",
- "Asia/Ujung_Pandang",
- "Asia/Ulaanbaatar",
- "Asia/Ulan_Bator",
- "Asia/Urumqi",
- "Asia/Vientiane",
- "Asia/Vladivostok",
- "Asia/Yakutsk",
- "Asia/Yekaterinburg",
- "Asia/Yerevan",
- "Atlantic/Azores",
- "Atlantic/Bermuda",
- "Atlantic/Canary",
- "Atlantic/Cape_Verde",
- "Atlantic/Faeroe",
- "Atlantic/Jan_Mayen",
- "Atlantic/Madeira",
- "Atlantic/Reykjavik",
- "Atlantic/South_Georgia",
- "Atlantic/Stanley",
- "Atlantic/St_Helena",
- "Australia/ACT",
- "Australia/Adelaide",
- "Australia/Brisbane",
- "Australia/Broken_Hill",
- "Australia/Canberra",
- "Australia/Darwin",
- "Australia/Hobart",
- "Australia/LHI",
- "Australia/Lindeman",
- "Australia/Lord_Howe",
- "Australia/Melbourne",
- "Australia/North",
- "Australia/NSW",
- "Australia/Perth",
- "Australia/Queensland",
- "Australia/South",
- "Australia/Sydney",
- "Australia/Tasmania",
- "Australia/Victoria",
- "Australia/West",
- "Australia/Yancowinna",
- "Brazil/Acre",
- "Brazil/DeNoronha",
- "Brazil/East",
- "Brazil/West",
- "Canada/Atlantic",
- "Canada/Central",
- "Canada/East-Saskatchewan",
- "Canada/Eastern",
- "Canada/Mountain",
- "Canada/Newfoundland",
- "Canada/Pacific",
- "Canada/Saskatchewan",
- "Canada/Yukon",
- "CET",
- "Chile/Continental",
- "Chile/EasterIsland",
- "CST6CDT",
- "Cuba",
- "EET",
- "Egypt",
- "Eire",
- "EST",
- "EST5EDT",
- "Etc/GMT",
- "Etc/GMT+0",
- "Etc/GMT+1",
- "Etc/GMT+10",
- "Etc/GMT+11",
- "Etc/GMT+12",
- "Etc/GMT+2",
- "Etc/GMT+3",
- "Etc/GMT+4",
- "Etc/GMT+5",
- "Etc/GMT+6",
- "Etc/GMT+7",
- "Etc/GMT+8",
- "Etc/GMT+9",
- "Etc/GMT-0",
- "Etc/GMT-1",
- "Etc/GMT-10",
- "Etc/GMT-11",
- "Etc/GMT-12",
- "Etc/GMT-13",
- "Etc/GMT-14",
- "Etc/GMT-2",
- "Etc/GMT-3",
- "Etc/GMT-4",
- "Etc/GMT-5",
- "Etc/GMT-6",
- "Etc/GMT-7",
- "Etc/GMT-8",
- "Etc/GMT-9",
- "Etc/GMT0",
- "Etc/Greenwich",
- "Etc/UCT",
- "Etc/Universal",
- "Etc/UTC",
- "Etc/Zulu",
- "Europe/Amsterdam",
- "Europe/Andorra",
- "Europe/Athens",
- "Europe/Belfast",
- "Europe/Belgrade",
- "Europe/Berlin",
- "Europe/Bratislava",
- "Europe/Brussels",
- "Europe/Bucharest",
- "Europe/Budapest",
- "Europe/Chisinau",
- "Europe/Copenhagen",
- "Europe/Dublin",
- "Europe/Gibraltar",
- "Europe/Helsinki",
- "Europe/Istanbul",
- "Europe/Kaliningrad",
- "Europe/Kiev",
- "Europe/Lisbon",
- "Europe/Ljubljana",
- "Europe/London",
- "Europe/Luxembourg",
- "Europe/Madrid",
- "Europe/Malta",
- "Europe/Minsk",
- "Europe/Monaco",
- "Europe/Moscow",
- "Europe/Nicosia",
- "Europe/Oslo",
- "Europe/Paris",
- "Europe/Prague",
- "Europe/Riga",
- "Europe/Rome",
- "Europe/Samara",
- "Europe/San_Marino",
- "Europe/Sarajevo",
- "Europe/Simferopol",
- "Europe/Skopje",
- "Europe/Sofia",
- "Europe/Stockholm",
- "Europe/Tallinn",
- "Europe/Tirane",
- "Europe/Tiraspol",
- "Europe/Uzhgorod",
- "Europe/Vaduz",
- "Europe/Vatican",
- "Europe/Vienna",
- "Europe/Vilnius",
- "Europe/Warsaw",
- "Europe/Zagreb",
- "Europe/Zaporozhye",
- "Europe/Zurich",
- "Factory",
- "GB",
- "GB-Eire",
- "GMT",
- "GMT+0",
- "GMT-0",
- "GMT0",
- "Greenwich",
- "Hongkong",
- "HST",
- "Iceland",
- "Indian/Antananarivo",
- "Indian/Chagos",
- "Indian/Christmas",
- "Indian/Cocos",
- "Indian/Comoro",
- "Indian/Kerguelen",
- "Indian/Mahe",
- "Indian/Maldives",
- "Indian/Mauritius",
- "Indian/Mayotte",
- "Indian/Reunion",
- "Iran",
- "Israel",
- "Jamaica",
- "Japan",
- "Kwajalein",
- "Libya",
- "MET",
- "Mexico/BajaNorte",
- "Mexico/BajaSur",
- "Mexico/General",
- "Mideast/Riyadh87",
- "Mideast/Riyadh88",
- "Mideast/Riyadh89",
- "MST",
- "MST7MDT",
- "Navajo",
- "NZ",
- "NZ-CHAT",
- "Pacific/Apia",
- "Pacific/Auckland",
- "Pacific/Chatham",
- "Pacific/Easter",
- "Pacific/Efate",
- "Pacific/Enderbury",
- "Pacific/Fakaofo",
- "Pacific/Fiji",
- "Pacific/Funafuti",
- "Pacific/Galapagos",
- "Pacific/Gambier",
- "Pacific/Guadalcanal",
- "Pacific/Guam",
- "Pacific/Honolulu",
- "Pacific/Johnston",
- "Pacific/Kiritimati",
- "Pacific/Kosrae",
- "Pacific/Kwajalein",
- "Pacific/Majuro",
- "Pacific/Marquesas",
- "Pacific/Midway",
- "Pacific/Nauru",
- "Pacific/Niue",
- "Pacific/Norfolk",
- "Pacific/Noumea",
- "Pacific/Pago_Pago",
- "Pacific/Palau",
- "Pacific/Pitcairn",
- "Pacific/Ponape",
- "Pacific/Port_Moresby",
- "Pacific/Rarotonga",
- "Pacific/Saipan",
- "Pacific/Samoa",
- "Pacific/Tahiti",
- "Pacific/Tarawa",
- "Pacific/Tongatapu",
- "Pacific/Truk",
- "Pacific/Wake",
- "Pacific/Wallis",
- "Pacific/Yap",
- "Poland",
- "Portugal",
- "PRC",
- "PST8PDT",
- "ROC",
- "ROK",
- "Singapore",
- "SystemV/AST4",
- "SystemV/AST4ADT",
- "SystemV/CST6",
- "SystemV/CST6CDT",
- "SystemV/EST5",
- "SystemV/EST5EDT",
- "SystemV/HST10",
- "SystemV/MST7",
- "SystemV/MST7MDT",
- "SystemV/PST8",
- "SystemV/PST8PDT",
- "SystemV/YST9",
- "SystemV/YST9YDT",
- "Turkey",
- "UCT",
- "Universal",
- "US/Alaska",
- "US/Aleutian",
- "US/Arizona",
- "US/Central",
- "US/East-Indiana",
- "US/Eastern",
- "US/Hawaii",
- "US/Indiana-Starke",
- "US/Michigan",
- "US/Mountain",
- "US/Pacific",
- "US/Samoa",
- "UTC",
- "W-SU",
- "WET",
- "Zulu"
- );
-
- var $dnmode= "";
- var $uid ="";
-
- function oxchangeAccount (&$config, $dn= NULL)
- {
- plugin::plugin ($config, $dn);
- for ($i=0;$i<count($this->config->data['TABS']['CONNECTIVITY']);$i++){
- if($this->config->data['TABS']['CONNECTIVITY'][$i]['CLASS']=='oxchangeAccount') {
- $this->oxconf=$this->config->data['TABS']['CONNECTIVITY'][$i];
- break;
- }
- }
-
- /* Setting uid to default */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
-
- $this->dnmode= $this->config->current['DNMODE'];
- if(isset($this->attrs[$this->dnmode][0])){
- $this->dnModeValue = $this->attrs[$this->dnmode][0];
- }
- }
-
- function execute()
- {
- /* Call parent execute */
- //plugin::execute();
-
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- $display="";
-
- /* Show main page */
- $smarty= get_smarty();
-
- if (function_exists("pg_connect")){
- $smarty->assign("pg", true);
- }else{
- $smarty->assign("pg", false);
- }
-
- /* Load attributes */
- foreach($this->attributes as $val){
- $smarty->assign("$val", $this->$val);
- }
- if ($this->is_account){
- $smarty->assign("oxchangeState", "checked");
- $smarty->assign("oxState", "");
- } else {
- $smarty->assign("oxchangeState", "");
- $smarty->assign("oxState", "disabled");
- }
-
- $tmp = $this->plInfo();
- foreach($tmp['plProvidedAcls'] as $key => $desc){
- $smarty->assign($key."ACL",$this->getacl($key,$this->ReadOnly));
- $smarty->assign($key."_W",$this->acl_is_writeable($key));
- }
-
- if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) ){
- $smarty->assign('oxchangeAccountACL', "");
- }else{
- $smarty->assign('oxchangeAccountACL', " disabled ");
- }
-
- $smarty->assign("timezones", $this->timezones);
-
-
- if ($this->parent !== NULL){
- $smarty->assign("tabbed", 1);
- }else{
- $smarty->assign("tabbed", 0);
- }
-
- /* Trying to open a Postgresql Database Server */
- if (function_exists("pg_connect")){
- if(isset($this->oxconf["PGUSER"]) and isset($this->oxconf["PGHOST"]) and isset($this->oxconf["PGDBNAME"]) and isset($this->oxconf["PGPASSWD"])){
- $pgcon = @pg_connect("host=".$this->oxconf["PGHOST"]." user=".$this->oxconf["PGUSER"]." password=".$this->oxconf["PGPASSWD"]." dbname=".$this->oxconf["PGDBNAME"]);
- if (! $pgcon){
- $smarty->assign("pg", false);
- }
- }else{
- $smarty->assign("pg", false);
- }
- }else{
- $smarty->assign("pg", false);
- }
-
- $display.= $smarty->fetch (get_template_path('oxchange.tpl', TRUE, dirname(__FILE__)));
- return ($display);
- }
-
- function remove_from_parent()
- {
- if(!$this->acl_is_removeable()) return;
- $this->attrs[$this->dnmode][0] = $this->dnModeValue;
- $sqldeluser=array(
- "delete from prg_notes where (user_right like '".$this->attrs[$this->dnmode][0]."') and (group_right like 's')",
- "delete from prg_documents_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_documents_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_docufolders_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_docufolders_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_date_rights where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_date_notification where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_dates_members where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_knowledge_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_knowledge_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_knowledge_folder_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_knowledge_folder_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_pin_board_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_pin_board_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_bookmarks_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_bookmarks_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_bookmarks_folder_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_bookmarks_folder_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_tasks_rights where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_tasks_notification where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_tasks_members where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_projects_rights where (user_right like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_projects_notification where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
- "delete from prg_projects_members where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
- "delete from oxfolder_permissions where (entity like '".$this->attrs[$this->dnmode][0]."') AND ((role = 256) OR (role = 1024))",
- "delete from oxfolder_standardfolders where owner like '".$this->attrs[$this->dnmode][0]."'",
- "delete from prg_forum_read where user_right = '".$this->attrs[$this->dnmode][0]."'",
- "delete from prg_forum_mod where user_right = '".$this->attrs[$this->dnmode][0]."'",
- "delete from prg_forum_abo where user_right = '".$this->attrs[$this->dnmode][0]."'",
- "delete from prg_forum_seen where username = '".$this->attrs[$this->dnmode][0]."'",
- "delete from sys_holiday where (userid like '".$this->attrs[$this->dnmode][0]."')",
- "delete from usr_holiday where (userid like '".$this->attrs[$this->dnmode][0]."')");
-
- /* Trying to open a Postgresql Database Server */
- if (function_exists("pg_connect")){
- if(isset($this->oxconf["PGUSER"]) and
- isset($this->oxconf["PGHOST"]) and
- isset($this->oxconf["PGDBNAME"]) and
- isset($this->oxconf["PGPASSWD"])){
- $pgcon = @pg_connect("host=".$this->oxconf["PGHOST"]." user=".$this->oxconf["PGUSER"]." password=".$this->oxconf["PGPASSWD"]." dbname=".$this->oxconf["PGDBNAME"]);
- if (! $pgcon){
- msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "Open-Xchange"), ERROR_DIALOG);
- return;
- }
- }else{
- msg_dialog::display(_("Configuration error"), sprintf(_("%s database configuration is missing!"), "Open-Xchange"), ERROR_DIALOG);
- return;
- }
- }else{
- msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "postgresql"), ERROR_DIALOG);
- return;
- }
-
- plugin::remove_from_parent();
- $ldap= $this->config->get_ldap_link();
-
- if($ldap->dn_exists("ou=addr,".$this->dn)){
- $ldap->rmdir_recursive("ou=addr,".$this->dn);
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/oxchange addressbook account with dn '%s' failed."),$this->dn));
- }
-
- $ldap->cd($this->dn);
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/oxchange addressbook account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- $this->postremove(array("uid" => $this->uid));
-
- /* Finally remove data from postgresql server */
- foreach ($sqldeluser as $sqls){
- @pg_exec($pgcon,$sqls);
- }
- pg_close();
- }
-
- /* Save data to object */
- function save_object()
- {
- /* Do we need to flip is_account state? */
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['oxchange'])){
- if (!$this->is_account && $_POST['oxchange'] == "B") {
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
-
- /* Get objects */
- foreach(array("OXTimeZone","OXTaskDays","OXAppointmentDays") as $name) {
- if($this->acl_is_writeable($name) && isset($_POST[$name])){
- $this->$name = $_POST[$name];
- }
- }
-
- if (isset($_POST["oxchangeStatus"])){
- $this->oxchangeStatus = "disabled";
- } else {
- $this->oxchangeStatus = "enabled";
- }
- }
-
-
- /* Save to LDAP */
- function save()
- {
-
- $needupdate=TRUE;
- $istemplate=FALSE;
-
- /*First at all, we must check if this is new or is updated */
- /*Also check is we have a template, if is a template, is a new user */
- if (isset($this->attrs['objectClass'])){
- foreach ($this->attrs['objectClass'] as $object){
- if($object=="OXUserObject") $needupdate=FALSE;
- if($object=="gosaUserTemplate") $istemplate=TRUE;
- }
- }
-
- $uidarray=array();
- preg_match("/^(\w+(?=\=))=((\w|\s|\.)+(?=\,)),.*/",$this->dn,$uidarray);
- $uid=$uidarray[2];
- if (trim($uid) == "") {
- msg_dialog::display(_("Error"), _("Open-Xchange account name is invalid!"), ERROR_DIALOG);
- return;
- }
-
- if ($istemplate) $needupdate=TRUE;
-
- if($needupdate){
- /* Trying to open a Postgresql Database Server */
- if (function_exists("pg_connect")){
- if(isset($this->oxconf["PGUSER"]) and isset($this->oxconf["PGHOST"]) and isset($this->oxconf["PGDBNAME"]) and isset($this->oxconf["PGPASSWD"])){
- $pgcon = @pg_connect("host=".$this->oxconf["PGHOST"]." user=".$this->oxconf["PGUSER"]." password=".$this->oxconf["PGPASSWD"]." dbname=".$this->oxconf["PGDBNAME"]);
- if (! $pgcon){
- msg::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "Open-Xchange"), ERROR_DIALOG);
- return;
- }
- }else{
- msg_dialog::display(_("Configuration error"), sprintf(_("%s database configuration is missing!"), "Open-Xchange"), ERROR_DIALOG);
- return;
- }
- }else{
- msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "postgresql"), ERROR_DIALOG);
- return;
- }
- }
-
- plugin::save();
-
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/oxchange account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- $this->postcreate(array("uid" => $this->uid));
-
- if($needupdate){
- $ldap->create_missing_trees("ou=addr,".$this->dn);
- show_ldap_error($ldap->get_error(), sprintf(_("Creating of user/oxchange account with dn '%s' failed."),$this->dn));
- /* Finally save data to postgresql server */
- pg_set_client_encoding ("UNICODE");
- $nv = "SELECT nextval ('serial_id')";
- $ot = "insert into oxfolder_tree (fuid, parent, fname, module, type, owner, creator, creating_date, created_from, changing_date, changed_from) VALUES (%d, 1, '%s', '%s', 'private', '%s', '%s', 'now', 'System', 'now', 'System')";
- $op = "INSERT INTO oxfolder_permissions (puid, pid, role, entity, sealed, fp, orp, owp, odp) VALUES (%d, %d, 32768, '%s', 0, 128, 128, 128, 128)";
- $os = "insert into oxfolder_standardfolders (owner,module_calendar,module_contact,module_task) VALUES ('%s',%d,%d,%d)";
- $ugr= "INSERT INTO usr_general_rights SELECT creating_date, created_from, changing_date, changed_from,text('%s'), addr_u, addr_r, addr_d, cont_u, cont_r, cont_d, data_u, data_r, data_d, serie_u, serie_r, serie_d, task_u, task_r, task_d, refer, proj_u, proj_r, proj_d, dfolder_u, dfolder_r, dfolder_d, doc_u, doc_r, doc_d, knowl_u, knowl_r, knowl_d, bfolder_u, bfolder_r, bfolder_d, bookm_u, bookm_r, bookm_d, pin_u, pin_r, pin_d, forum_n, fentrie_n, setup, pin_public, internal, int_groups, kfolder_u, kfolder_r, kfolder_d, webmail FROM sys_gen_rights_template WHERE login LIKE 'default_template'";
-
- $error = FALSE;
- $res=@pg_exec($pgcon,$nv);
-
- if(!$res){
- $error = TRUE;
- }else{
- $calendarid=pg_fetch_row($res);
- pg_freeresult($res);
-
- $q=sprintf($ot,$calendarid[0],'My Appointments','calendar',$uid,$uid);
- @pg_exec($pgcon,$q);
- }
-
- $res=@pg_exec($pgcon,$nv);
-
- if(!$res){
- $error = TRUE;
- }else{
- $nid=pg_fetch_row($res);
- pg_freeresult($res);
-
- $q=sprintf($op,$nid[0],$calendarid[0],$uid);
- @pg_exec($pgcon,$q);
- }
-
- $res=@pg_exec($pgcon,$nv);
- if(!$res){
- $error = TRUE;
- }else{
- $contactsid=pg_fetch_row($res);
- pg_freeresult($res);
-
- $q=sprintf($ot,$contactsid[0],'My Contacts','contact',$uid,$uid);
- @pg_exec($pgcon,$q);
- }
-
- $res=@pg_exec($pgcon,$nv);
- if(!$res){
- $error = TRUE;
- }else{
- $nid=pg_fetch_row($res);
- pg_freeresult($res);
-
- $q=sprintf($op,$nid[0],$contactsid[0],$uid);
- @pg_exec($pgcon,$q);
- }
-
- $res=@pg_exec($pgcon,$nv);
- if(!$res){
- $error = TRUE;
- }else{
- $tasksid=pg_fetch_row($res);
- pg_freeresult($res);
-
- $q=sprintf($ot,$tasksid[0],'My Tasks','task',$uid,$uid);
- @pg_exec($pgcon,$q);
- }
-
- $res=@pg_exec($pgcon,$nv);
- if(!$res){
- $error = TRUE;
- }else{
- $nid=pg_fetch_row($res);
- pg_freeresult($res);
-
- $q=sprintf($op,$nid[0],$tasksid[0],$uid);
- @pg_exec($pgcon,$q);
-
- $q=sprintf($os,$uid,$calendarid[0],$contactsid[0],$tasksid[0]);
- @pg_exec($pgcon,$q);
-
- $q=sprintf($ugr,$uid);
- @pg_exec($pgcon,$q);
- }
-
- @pg_close($pgcon);
-
- if($error){
- msg_dialog::display(_("Error"), _("Cannot save Open-Xchange account!"), ERROR_DIALOG);
- }
- }
- }
-
-
- /* Return plugin informations for acl handling */
- static function plInfo()
- {
- return (array(
- "plShortName" => _("Open-Xchange"),
- "plDescription" => _("Open-Xchange account settings")." : <u>"._("Connectivity addon")."</u>",
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 27, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array(
- "OXAppointmentDays" => _("OXAppointmentDays"),
- "OXTaskDays" => _("OXTaskDays"),
- "OXTimeZone" => _("OXTimeZone"))
- ));
- }
-}
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/connectivity/openxchange/oxchange.tpl b/gosa-core/plugins/personal/connectivity/openxchange/oxchange.tpl
+++ /dev/null
@@ -1,84 +0,0 @@
-{if !$pg}
-<h2>{t}Open-Xchange Account{/t} - {t}disabled, no Postgresql support detected. Or the specified database can't be reached{/t}</h2>
-{else}
-<h2>
-<input type="checkbox" name="oxchange" value="B"
- {$oxchangeState} {$oxchangeAccountACL}
- onCLick="
- {if $OXAppointmentDays_W}
- changeState('OXAppointmentDays');
- {/if}
- {if $OXTaskDays_W}
- changeState('OXTaskDays');
- {/if}
- {if $OXTimeZone_W}
- changeState('OXTimeZone');
- {/if}
- ">
-{t}Open-Xchange account{/t}</h2>
-
-
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
-
- <!-- Headline container -->
- <tr>
- <td style="width:50%; vertical-align:top;">
- <table summary="" style="margin-left:4px;">
- <tr>
- <td colspan=2 style="vertical-align:top;">
- <b>{t}Remember{/t}</b>
- </td>
- </tr>
- <tr>
- <td><LABEL for="OXAppointmentDays">{t}Appointment Days{/t}</LABEL></td>
- <td>
-
-{render acl=$OXAppointmentDaysACL}
-<input name="OXAppointmentDays" id="OXAppointmentDays" size=7 maxlength=7 value="{$OXAppointmentDays}" {$oxState} >
-{/render}
- {t}days{/t}</td>
- </tr>
- <tr>
- <td><LABEL for="OXTaskDays">{t}Task Days{/t}</LABEL></td>
- <td>
-
-{render acl=$OXTaskDaysACL}
-<input name="OXTaskDays" id="OXTaskDays" size=7 maxlength=7 value="{$OXTaskDays}" {$oxState} >
-{/render}
-
- {t}days{/t}
- </td>
- </tr>
- </table>
- </td>
- <td rowspan=2 style="border-left:1px solid #A0A0A0">
-
- </td>
- <td style="vertical-align:top;">
- <table summary="">
- <tr>
- <td colspan=2 style="vertical-align:top;">
- <b>{t}User Information{/t}</b>
- </td>
- </tr>
- <tr>
- <td><LABEL for="OXTimeZone">{t}User Timezone{/t}</LABEL></td>
- <td>
-
-{render acl=$OXTimeZoneACL}
-<select size="1" name="OXTimeZone" id="OXTimeZone" {$oxState} >
- {html_options values=$timezones output=$timezones selected=$OXTimeZone}
- </select>
-{/render}
-
- </td>
- </tr>
- <tr>
- <td></td>
- <td></td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-{/if}
diff --git a/gosa-core/plugins/personal/connectivity/phpgw/class_phpgwAccount.inc b/gosa-core/plugins/personal/connectivity/phpgw/class_phpgwAccount.inc
+++ /dev/null
@@ -1,222 +0,0 @@
-<?php
-class phpgwAccount extends plugin
-{
- /* Definitions */
- var $plHeadline= "PHPGroupware";
- var $plDescription= "This does something";
-
- /* GW attributes */
- var $phpgwAccountExpires= "-1";
- var $phpgwAccountStatus= "A";
- var $phpgwAccountType= "u";
-
- /* attribute list for save action */
- var $attributes= array("phpgwAccountExpires", "phpgwAccountStatus", "phpgwAccountType");
- var $objectclasses= array("phpgwAccount");
- var $ReadOnly = false;
-
- var $uid = "";
- var $view_logged = FALSE;
-
- var $multiple_support = TRUE;
-
- function phpgwAccount (&$config, $dn= NULL)
- {
- plugin::plugin ($config, $dn);
-
- /* Setting uid to default */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
- }
-
- function execute()
- {
- /* Call parent execute */
-// plugin::execute();
-
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- /* Show tab dialog headers */
- $display= "";
-
- /* Show main page */
- $smarty= get_smarty();
-
- /* Load attributes */
- foreach($this->attributes as $val){
- $smarty->assign("$val", $this->$val);
- }
- if ($this->is_account){
- $smarty->assign("phpgwState", "checked");
- } else {
- $smarty->assign("phpgwState", "");
- }
-
- $smarty->assign('phpgwAccountACL', $this->getacl("",$this->ReadOnly));
- $smarty->assign("multiple_support",$this->multiple_support_active);
- $smarty->assign("use_phpgw",in_array("phpgw",$this->multi_boxes));
- $display.= $smarty->fetch (get_template_path('phpgw.tpl', TRUE, dirname(__FILE__)));
- return ($display);
- }
-
- function remove_from_parent()
- {
- if($this->acl_is_removeable()){
- /* Cancel if there's nothing to do here */
- if (!$this->initially_was_account){
- return;
- }
-
- plugin::remove_from_parent();
- $ldap= $this->config->get_ldap_link();
-
- $ldap->cd($this->dn);
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPgw account with dn '%s' failed."),$this->dn));
-
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
- /* Optionally execute a command after we're done */
- $this->handle_post_events('remove',array("uid" => $this->uid));
- }
- }
-
-
- /* Save data to object */
- function save_object()
- {
- /* Do we need to flip is_account state? */
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['phpgw'])){
- if (!$this->is_account && $_POST['phpgw'] == "B"){
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
-
- plugin::save_object();
- if (isset($_POST["phpgwStatus"])){
- $this->phpgwStatus = "disabled";
- } else {
- $this->phpgwStatus = "enabled";
- }
- }
-
-
- /* Save to LDAP */
- function save()
- {
- plugin::save();
-
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PHPgw account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account){
- if ($this->is_modified){
- $this->handle_post_events("modify",array("uid" => $this->uid));
- }
- } else {
- $this->handle_post_events("add",array("uid" => $this->uid));
- }
-
- }
-
-
- /* Return plugin informations for acl handling */
- static function plInfo()
- {
- return (array(
- "plShortName" => _("PHP GW"),
- "plDescription" => _("PHP GW account settings")." : <u>"._("Connectivity addon")."</u>",
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 24, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array()
- ));
- }
-
-
- function multiple_save_object()
- {
- if (isset($_POST['connectivityTab'])){
- plugin::multiple_save_object();
-
- /* Do we need to flip is_account state? */
- if(isset($_POST['use_phpgw'])){
- $this->multi_boxes[] = "phpgw";
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['phpgw'])){
- if (!$this->is_account && $_POST['phpgw'] == "B"){
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
- }
- }
- }
-
- function get_multi_edit_values()
- {
- $ret = plugin::get_multi_edit_values();
- if(in_array("phpgw",$this->multi_boxes)){
- $ret['is_account'] = $this->is_account;
- }
- return($ret);
- }
-
- function set_multi_edit_values($values)
- {
- plugin::set_multi_edit_values($values);
- if(isset($values['is_account'])){
- $this->is_account = $values['is_account'];
- }
- }
-
- function init_multiple_support($attrs,$all)
- {
- plugin::init_multiple_support($attrs,$all);
- if(isset($attrs['objectClass']) && in_array("phpgwAccount",$attrs['objectClass'])){
- $this->is_account = TRUE;
- }
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/connectivity/phpgw/phpgw.tpl b/gosa-core/plugins/personal/connectivity/phpgw/phpgw.tpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<h2>
-{render acl=$phpgwAccountACL checkbox=$multiple_support checked=$use_phpgw}
- <input type="checkbox" name="phpgw" value="B" {$phpgwState} class="center">
-{/render}
- {t}PHPGroupware account{/t}
-
-</h2>
diff --git a/gosa-core/plugins/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc b/gosa-core/plugins/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc
+++ /dev/null
@@ -1,175 +0,0 @@
-<?php
-
-/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2005 Guillaume Delecourt
- Copuright (C) 2005 Benoit Mortier
-
- 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
-*/
-
-
-class phpscheduleitAccount extends plugin
-{
- /* Definitions */
- var $plHeadline= "PHPscheduleit";
- var $plDescription= "This does something";
-
- /* attribute list for save action */
- var $attributes= array();
- var $objectclasses= array("phpscheduleitAccount");
- var $ReadOnly =false;
- var $view_logged = FALSE;
-
- function phpscheduleitAccount (&$config, $dn= NULL)
- {
- plugin::plugin ($config, $dn);
- }
-
- function execute()
- {
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- /* Show tab dialog headers */
- $display= "";
-
- /* Show main page */
- $smarty= get_smarty();
-
- if ($this->is_account){
- $smarty->assign("phpscheduleitState", "checked");
- } else {
- $smarty->assign("phpscheduleitState", "");
- $smarty->assign("wstate", "disabled");
- }
-
- if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) {
- $smarty->assign('gosaphpscheduleitACL', "");
- }else{
- $smarty->assign('gosaphpscheduleitACL', " disabled ");
- }
-
- $display.= $smarty->fetch (get_template_path('phpscheduleit.tpl', TRUE, dirname(__FILE__)));
- return ($display);
- }
-
- function remove_from_parent()
- {
- /* Cancel if there's nothing to do here */
- if ($this->acl_is_removeable()){
-
- plugin::remove_from_parent();
- $ldap= $this->config->get_ldap_link();
-
- $ldap->cd($this->dn);
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
- $this->cleanup();
- $ldap->modify ($this->attrs);
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPscheduleit account with dn '%s' failed."),$this->dn));
-
- if($this->is_account){
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
- /* Optionally execute a command after we're done */
- $this->handle_post_events('remove',array("uid" => $this->uid));
- }
- }
-
-
- /* Save data to object */
- function save_object()
- {
- /* Do we need to flip is_account state? */
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['phpscheduleit'])){
- if (!$this->is_account && $_POST['phpscheduleit'] == "B"){
- if($this->acl_is_createable()) {
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
-
- plugin::save_object();
- if (isset($_POST["phpscheduleitStatus"])){
- $this->pptpStatus = "disabled";
- } else {
- $this->pptpStatus = "enabled";
- }
- }
-
-
- /* Save to LDAP */
- function save()
- {
- plugin::save();
-
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PHPscheduleit account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account){
- if ($this->is_modified){
- $this->handle_post_events("modify",array("uid" => $this->uid));
- }
- } else {
- $this->handle_post_events("add",array("uid" => $this->uid));
- }
-
- }
-
-
- /* Return plugin informations for acl handling
- #FIXME This is only an enable/disable checkbox for this account, there is possibly a better solution available later */
- static function plInfo()
- {
- return (array(
- "plShortName" => _("PHP Schedule it"),
- "plDescription" => _("PHP Schedule it settings")." : <u>"._("Connectivity addon")."</u>",
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 29, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
-
- "plOptions" => array(),
-
- "plProvidedAcls" => array()
- ));
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/connectivity/phpscheduleit/phpscheduleit.tpl b/gosa-core/plugins/personal/connectivity/phpscheduleit/phpscheduleit.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<h2>
- <input type="checkbox" name="phpscheduleit" value="B" {$phpscheduleitState} {$gosaphpscheduleitACL}>
- {t}PHPscheduleit account{/t}
-</h2>
diff --git a/gosa-core/plugins/personal/connectivity/pptp/class_pptpAccount.inc b/gosa-core/plugins/personal/connectivity/pptp/class_pptpAccount.inc
+++ /dev/null
@@ -1,188 +0,0 @@
-<?php
-
-/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2005 Guillaume Delecourt
- Copyright (C) 2005 Benoit Mortier
-
- 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
- */
-
-class pptpAccount extends plugin
-{
- /* Definitions */
- var $plHeadline= "PPTP";
- var $plDescription= "This does something";
-
- /* attribute list for save action */
- var $attributes= array();
- var $objectclasses= array("pptpServerAccount");
-
- var $ReadOnly = false;
- var $view_logged = FALSE;
- var $uid ="";
-
- function pptpAccount (&$config, $dn= NULL)
- {
- plugin::plugin ($config, $dn);
-
- /* Setting uid to default */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
- }
-
- function execute()
- {
- /* Call parent execute */
- // plugin::execute();
-
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- /* Show tab dialog headers */
- $display= "";
-
- /* Show main page */
- $smarty= get_smarty();
-
- if ($this->is_account){
- $smarty->assign("pptpState", "checked");
- } else {
- $smarty->assign("pptpState", "");
- $smarty->assign("wstate", "disabled");
- }
-
- if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) {
- $smarty->assign('gosapptpACL', "");
- }else{
- $smarty->assign('gosapptpACL', " disabled ");
- }
-
- $display.= $smarty->fetch (get_template_path('pptp.tpl', TRUE, dirname(__FILE__)));
- return ($display);
- }
-
- function remove_from_parent()
- {
- if($this->acl_is_removeable()){
- /* Cancel if there's nothing to do here */
- if (!$this->initially_was_account){
- return;
- }
-
- plugin::remove_from_parent();
- $ldap= $this->config->get_ldap_link();
-
- $ldap->cd($this->dn);
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PPTP account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- $this->handle_post_events('remove',array("uid" => $this->uid));
- }
- }
-
-
- /* Save data to object */
- function save_object()
- {
- /* Do we need to flip is_account state? */
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['pptp'])){
- if (!$this->is_account && $_POST['pptp'] == "B"){
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
-
- plugin::save_object();
- if (isset($_POST["pptpStatus"])){
- $this->pptpStatus = "disabled";
- } else {
- $this->pptpStatus = "enabled";
- }
- }
-
-
- /* Save to LDAP */
- function save()
- {
- if($this->acl_is_createable()){
- plugin::save();
-
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PPTP account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account){
- if ($this->is_modified){
- $this->handle_post_events("modify",array("uid" => $this->uid));
- }
- } else {
- $this->handle_post_events("add",array("uid" => $this->uid));
- }
- }
- }
-
-
- /* Return plugin informations for acl handling */
- static function plInfo()
- {
- return (array(
- "plShortName" => _("PPTP"),
- "plDescription" => _("PPTP account")." : <u>"._("Connectivity addon")."</u>",
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 28, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array()
- ));
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/connectivity/pptp/pptp.tpl b/gosa-core/plugins/personal/connectivity/pptp/pptp.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<h2>
- <input type="checkbox" name="pptp" value="B" {$pptpState} {$gosapptpACL}>
- {t}PPTP account{/t}
-</h2>
diff --git a/gosa-core/plugins/personal/connectivity/pureftpd/class_pureftpdAccount.inc b/gosa-core/plugins/personal/connectivity/pureftpd/class_pureftpdAccount.inc
+++ /dev/null
@@ -1,323 +0,0 @@
-<?php
-
-class pureftpdAccount extends plugin
-{
- /* Definitions */
- var $plHeadline= "FTP";
- var $plDescription= "This does something";
-
- /* FTP attributes */
- var $FTPQuotaFiles = 0;
- var $FTPQuotaMBytes = 0;
- var $FTPUploadRatio = 0;
- var $FTPDownloadRatio = 0;
- var $FTPUploadBandwidth = 0;
- var $FTPDownloadBandwidth = 0;
- var $FTPStatus = "enabled";
- var $FTPuid = "";
- var $FTPgid = "";
-
- var $uid = "";
-
- /* attribute list for save action */
- var $attributes= array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio",
- "FTPUploadBandwidth","FTPDownloadBandwidth","FTPStatus","FTPuid","FTPgid");
- var $objectclasses= array("PureFTPdUser");
- var $ReadOnly;
- var $view_logged = FALSE;
-
- var $multiple_support=TRUE;
-
- function pureftpdAccount (&$config, $dn= NULL, $parent= NULL)
- {
- plugin::plugin ($config, $dn, $parent);
-
- /* Setting uid to default */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
- }
-
- function execute()
- {
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- /* Show tab dialog headers */
- $display= "";
-
- /* Show main page */
- $smarty= get_smarty();
-
- /* Load attributes */
- foreach($this->attributes as $val){
- $smarty->assign("$val", $this->$val);
- }
-
-
- $tmp = $this->plInfo();
- $changeState = "";
- if($this->multiple_support_active){
-
- /* We do not need the attribute grey out in multiple edit */
- foreach($tmp['plProvidedAcls'] as $key => $desc){
- $smarty->assign($key."ACL", $this->getacl($key,$this->ReadOnly));
- }
- if ($this->is_account){
- $smarty->assign("pureftpdState", "checked");
- }else{
- $smarty->assign("pureftpdState", "");
- }
- $smarty->assign("fstate", "");
- $smarty->assign("changeState","");
-
- }else{
- foreach($tmp['plProvidedAcls'] as $key => $desc){
- $smarty->assign($key."ACL", $this->getacl($key,$this->ReadOnly));
- $smarty->assign($key."_W", $this->acl_is_writeable($key,$this->ReadOnly));
-
- if($this->acl_is_writeable($key)){
- $changeState.= " changeState('".$key."'); \n";
- }
- }
- $smarty->assign("changeState",$changeState);
-
-
- $smarty->assign("fstate", "");
- if ($this->is_account){
- $smarty->assign("pureftpdState", "checked");
- $smarty->assign("fstate", "");
- } else {
- $smarty->assign("pureftpdState", "");
- if(session::get('js')==1){
- if($this->acl!="#none#")
- $smarty->assign("fstate", "disabled");
- }else{
- $smarty->assign("fstate", "");
- }
- }
- }
-
- foreach($this->attributes as $attr){
- if(in_array($attr,$this->multi_boxes)){
- $smarty->assign("use_".$attr,TRUE);
- }else{
- $smarty->assign("use_".$attr,FALSE);
- }
- }
- $smarty->assign("use_pureftpd",in_array("pureftpd",$this->multi_boxes));
- $smarty->assign("multiple_support",$this->multiple_support_active);
- $smarty->assign("FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
- $smarty->assign('pureftpdACL', $this->getacl("",$this->ReadOnly));
- $display.= $smarty->fetch (get_template_path('pureftpd.tpl', TRUE, dirname(__FILE__)));
- return ($display);
- }
-
- function remove_from_parent()
- {
- /* Cancel if there's nothing to do here */
- if ((!$this->initially_was_account) || (!$this->acl_is_removeable())){
- return;
- }
-
- plugin::remove_from_parent();
- $ldap= $this->config->get_ldap_link();
-
- $ldap->cd($this->dn);
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/pureftpd account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- $this->handle_post_events('remove',array("uid" => $this->uid));
- }
-
-
- /* Save data to object */
- function save_object()
- {
- /* Do we need to flip is_account state? */
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['pureftpd'])){
- if (!$this->is_account && $_POST['pureftpd'] == "B"){
- $this->is_account= TRUE;
- }
- } else {
- $this->is_account= FALSE;
- }
-
- plugin::save_object();
-
- $old= $this->FTPStatus;
- if (isset($_POST["FTPStatus"])){
- $this->FTPStatus = "disabled";
- } else {
- $this->FTPStatus = "enabled";
- }
- $this->is_modified= ($old != $this->FTPStatus)?TRUE:$this->is_modified;
-
- /* Ensure that these vars are numeric. Values starting with 0 like '0123' cause ldap errors */
- foreach(array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio","FTPUploadBandwidth","FTPDownloadBandwidth") as $testVar){
- $this->$testVar = (int) ($this->$testVar);
- }
-
-
- }
- }
-
-
- /* Check values */
- function check()
- {
- /* Call common method to give check the hook */
- $message= plugin::check();
-
- /* Check for positive integer values */
- if ($this->is_account){
-
- if($this->acl_is_writeable("FTPUploadBandwidth") && !tests::is_id($this->FTPUploadBandwidth)){
- $message[]= _("Value specified as 'Upload bandwidth' is not valid.");
- }
- if($this->acl_is_writeable("FTPDownloadBandwidth") && !tests::is_id($this->FTPDownloadBandwidth)){
- $message[]= _("Value specified as 'Download bandwidth' is not valid.");
- }
-
- if($this->acl_is_writeable("FTPQuotaFiles") && !tests::is_id($this->FTPQuotaFiles)){
- $message[]= _("Value specified as 'Quota files' is not valid.");
- }
- if($this->acl_is_writeable("FTPQuotaMBytes") && !tests::is_id($this->FTPQuotaMBytes)){
- $message[]= _("Value specified as 'Quota size' is not valid.");
- }
- if($this->acl_is_writeable("FTPUploadRatio") && !tests::is_id($this->FTPUploadRatio)){
- $message[]= _("Value specified as 'Upload ratio' is not valid.");
- }
- if($this->acl_is_writeable("FTPDownloadRatio") && !tests::is_id($this->FTPDownloadRatio)){
- $message[]= _("Value specified as 'Download ratio' is not valid.");
- }
- }
-
- return $message;
- }
-
-
- /* Save to LDAP */
- function save()
- {
- plugin::save();
-
- $tmp = $this->plInfo();
- foreach($tmp['plProvidedAcls'] as $key => $desc){
- if(!$this->acl_is_writeable($key)){
- unset($this->attrs[$key]);
- }
- }
-
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/pureftpd account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account){
- if ($this->is_modified){
- $this->handle_post_events("modify",array("uid" => $this->uid));
- }
- } else {
- $this->handle_post_events("add",array("uid" => $this->uid));
- }
-
- }
-
-
- /* Return plugin informations for acl handling
- #FIME There possibly some attributes that can be combined to one acl. */
- static function plInfo()
- {
- return (array(
- "plShortName" => _("Ftp"),
- "plDescription" => _("Pure ftp account")." : <u>"._("Connectivity addon")."</u>",
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 22, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array(
- "FTPQuotaFiles" => _("Quota files"),
- "FTPUploadRatio" => _("Upload ratio"),
- "FTPQuotaMBytes" => _("Quota MBytes"),
- "FTPDownloadRatio" => _("Download ratio"),
- "FTPUploadBandwidth" => _("Upload bandwith"),
- "FTPDownloadBandwidth" => _("Download bandwith"),
- "FTPStatus" => _("Status"))
- ));
- }
-
- function multiple_save_object()
- {
- if (isset($_POST['connectivityTab'])){
- plugin::multiple_save_object();
- if(isset($_POST['use_pureftpd'])){
- $this->multi_boxes[] = "pureftpd";
- }
- $this->save_object();
- }
- }
-
- function get_multi_init_values()
- {
- $ret = plugin::get_multi_init_values();
- $ret['is_account'] = $this->is_account;
- return($ret);
- }
-
- function init_multiple_support($attrs,$attr)
- {
- plugin::init_multiple_support($attrs,$attr);
-
- if(isset($attrs['is_account'])){
- $this->is_account = $attrs['is_account'];
- }
- }
-
- function get_multi_edit_values()
- {
- $ret = plugin::get_multi_edit_values();
- if(in_array("pureftpd",$this->multi_boxes)){
- $ret['is_account'] = $this->is_account;
- }
- return($ret);
- }
-
- function set_multi_edit_values($values)
- {
- plugin::set_multi_edit_values($values);
- if(isset($values['is_account'])){
- $this->is_account = $values['is_account'];
- }
- }
-
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/connectivity/pureftpd/pureftpd.tpl b/gosa-core/plugins/personal/connectivity/pureftpd/pureftpd.tpl
+++ /dev/null
@@ -1,114 +0,0 @@
-<h2>
- {render acl=$pureftpdACL checkbox=$multiple_support checked=$use_pureftpd}
- <input type="checkbox" name="pureftpd" value="B" {$pureftpdState}
- onclick="{$changeState}" class="center">
- {/render}
- {t}FTP account{/t}
-</h2>
-
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
-
- <!-- Headline container -->
- <tr>
- <td style="width:50%; vertical-align:top;">
- <table summary="" style="margin-left:4px;">
- <tr>
- <td colspan=2 style="vertical-align:top;">
- <b>{t}Bandwidth{/t}</b>
- </td>
- </tr>
- <tr>
- <td>{t}Upload bandwidth{/t}</td>
- <td>
-{render acl=$FTPUploadBandwidthACL checkbox=$multiple_support checked=$use_FTPUploadBandwidth}
-<input name="FTPUploadBandwidth" id="FTPUploadBandwidth" size=7 maxlength=7 value="{$FTPUploadBandwidth}" {$fstate} >
-{/render}
- {t}kb/s{/t}</td>
- </tr>
- <tr>
- <td>{t}Download bandwidth{/t}</td>
- <td>
-{render acl=$FTPDownloadBandwidthACL checkbox=$multiple_support checked=$use_FTPDownloadBandwidth}
-<input name="FTPDownloadBandwidth" id="FTPDownloadBandwidth" size=7 maxlength=7 value="{$FTPDownloadBandwidth}" {$fstate} >
-{/render}
- {t}kb/s{/t}</td>
- </tr>
- </table>
- </td>
- <td rowspan=2 style="border-left:1px solid #A0A0A0">
-
- </td>
- <td>
- <table summary="">
- <tr>
- <td colspan=2 style="vertical-align:top;">
- <b>{t}Quota{/t}</b>
- </td>
- </tr>
- <tr>
- <td>{t}Files{/t}</td>
- <td>
-{render acl=$FTPQuotaFilesACL checkbox=$multiple_support checked=$use_FTPQuotaFiles}
-<input name="FTPQuotaFiles" id="FTPQuotaFiles" size=7 maxlength=10 value="{$FTPQuotaFiles}" {$fstate} >
-{/render}
- </td>
- </tr>
- <tr>
- <td>{t}Size{/t}</td>
- <td>
-{render acl=$FTPQuotaMBytesACL checkbox=$multiple_support checked=$use_FTPQuotaMBytes}
-<input name="FTPQuotaMBytes" id="FTPQuotaMBytes" size=7 maxlength=10 value="{$FTPQuotaMBytes}" {$fstate} >
-{/render}
- {t}MB{/t}
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table summary="" style="margin-left:4px;">
- <tr>
- <td colspan=2 style="vertical-align:top;">
- <b>{t}Ratio{/t}</b>
- </td>
- </tr>
- <tr>
- <td>{t}Uploaded / downloaded files{/t}</td>
- <td>
-
-{render acl=$FTPUploadRatioACL checkbox=$multiple_support checked=$use_FTPUploadRatio}
-<input name="FTPUploadRatio" id="FTPUploadRatio" size=5 maxlength=20 value="{$FTPUploadRatio}" {$fstate} >
-{/render}
- /
-{render acl=$FTPDownloadRatioACL checkbox=$multiple_support checked=$use_FTPDownloadRatio}
-<input name="FTPDownloadRatio" id="FTPDownloadRatio" size=5 maxlength=20 value="{$FTPDownloadRatio}" {$fstate} >
-{/render}
- </td>
- </tr>
- </table>
- </td>
- <td>
- <table summary="">
- <tr>
- <td colspan=2 style="vertical-align:top;">
- <b>{t}Miscellaneous{/t}</b>
- </td>
- <tr>
- <td>
-{render acl=$FTPStatusACL checkbox=$multiple_support checked=$use_FTPStatus}
-<input type=checkbox name="FTPStatus" id="FTPStatus" value="disabled" {$FTPStatus} title="{t}Check to disable FTP Access{/t}" {$fstate} class="center">
-{/render}
-{t}Temporary disable FTP access{/t}</td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-
-<!-- Place cursor -->
-<script language="JavaScript" type="text/javascript">
- <!-- // First input field on page
- focus_field('FTPUploadBandwidth');
- -->
-</script>
diff --git a/gosa-core/plugins/personal/connectivity/squid/class_proxyAccount.inc b/gosa-core/plugins/personal/connectivity/squid/class_proxyAccount.inc
+++ /dev/null
@@ -1,427 +0,0 @@
-<?php
-class proxyAccount extends plugin
-{
- /* Definitions */
- var $plHeadline = "Proxy";
- var $plDescription= "This does something";
-
- /* Proxy attributes */
- var $gosaProxyAcctFlags = "[N ]";
- var $gosaProxyID = "";
- var $gosaProxyWorkingStart= 420;
- var $gosaProxyWorkingStop = 1020;
- var $gosaProxyQuota = "5g";
- var $gosaProxyQuotaPeriod = "m";
-
- /* attribute list for save action */
- var $attributes = array("gosaProxyID", "gosaProxyAcctFlags", "gosaProxyWorkingStart",
- "gosaProxyWorkingStop", "gosaProxyQuota", "gosaProxyQuotaPeriod");
-
- var $objectclasses = array("gosaProxyAccount");
- var $ReadOnly = false;
- var $uid = "";
- var $view_logged = FALSE;
- var $multiple_support = TRUE;
-
- /*! \brief Initialize proxy acoount
- @param $config GOsa configuration object
- @param $dn Object dn
- */
- public function proxyAccount (&$config, $dn= NULL)
- {
- plugin::plugin ($config, $dn);
-
- /* Setting uid to default */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
- }
-
-
- /*! \brief Create html output for this class
- */
- public function execute()
- {
- /* Call parent execute */
- plugin::execute();
-
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- $display= "";
- $smarty= get_smarty();
-
- /* Assign radio boxes */
- foreach (array("F", "T", "B", "N") as $val){
- if (preg_match("/".$val."/",$this->gosaProxyAcctFlags)){
- $smarty->assign("filter$val", "checked");
- $smarty->assign($val."state", "");
- } else {
- $smarty->assign("filter$val", "");
- if(session::get('js')==1){
- $smarty->assign($val."state", "disabled");
- }else{
- $smarty->assign($val."state", "");
- }
- }
- }
-
- /* Assign ACLs */
- $tmp = $this->plInfo();
- foreach($tmp['plProvidedAcls'] as $acl => $desc){
- $smarty->assign($acl."ACL",$this->getacl($acl,$this->ReadOnly));
- $smarty->assign($acl."_W",$this->acl_is_writeable($acl,$this->ReadOnly));
- }
-
- /* Assign working time */
- $smarty->assign("starthour" ,($this->gosaProxyWorkingStart / 60));
- $smarty->assign("startminute", ($this->gosaProxyWorkingStart % 60));
- $smarty->assign("stophour", ($this->gosaProxyWorkingStop / 60));
- $smarty->assign("stopminute", ($this->gosaProxyWorkingStop % 60));
- $hours= array();
- for($i=0; $i<24; $i++){
- $hours[]= sprintf("%02d",$i);
- }
- $smarty->assign("hours", $hours);
- $smarty->assign("minutes", array("00","15","30","45"));
-
- /* Assign quota values */
- $smarty->assign("quota_unit", array("k" => _("KB"), "m" => _("MB"), "g" => _("GB")));
- $smarty->assign("quota_time", array("h" => _("hour"), "d" => _("day"), "w" => _("week"), "m" => _("month")));
- $smarty->assign("gosaProxyQuotaPeriod", $this->gosaProxyQuotaPeriod);
- $smarty->assign("quota_size", preg_replace("/[a-z]$/i", "", $this->gosaProxyQuota));
- $smarty->assign("quota_u", preg_replace("/^[0-9]+/", "", $this->gosaProxyQuota));
- if ($this->is_account){
- $smarty->assign("proxyState", "checked");
- } else {
- $smarty->assign("proxyState", "");
- }
-
-
- /* Handle input grey out and javascript enabled/disable of input fields
- */
- if($this->multiple_support_active){
-
- /* In Multiple edit, everything is enabled */
- $changeB = "";
- $smarty->assign("pstate", "");
- $smarty->assign("ProxyWorkingStateChange","");
- }else{
-
- /* Depeding on the account status, we disable or
- * enable all input fields
- */
- if (!$this->is_account){
- $smarty->assign("pstate", "disabled");
- } else {
- $smarty->assign("pstate", "");
- }
-
- /* Create JS activation string for everal input fields */
- $ProxyWorkingStateChange ="\n";
- if($this->acl_is_writeable("gosaProxyFlagT")){
- $ProxyWorkingStateChange.= "changeState('startHour'); \n";
- $ProxyWorkingStateChange.= "changeState('startMinute'); \n";
- $ProxyWorkingStateChange.= "changeState('stopHour'); \n";
- $ProxyWorkingStateChange.= "changeState('stopMinute'); \n";
- }
- $smarty->assign("ProxyWorkingStateChange",$ProxyWorkingStateChange);
- $changeB = "";
- if($this->acl_is_writeable("gosaProxyFlagB")){
- $changeB =
- "changeSubselectState('filterB', 'quota_size');
- changeSubselectState('filterB', 'quota_unit');
- changeSubselectState('filterB', 'gosaProxyQuotaPeriod');";
- }
- }
-
- /* Assign filter settings */
- $smarty->assign("changeB",$changeB);
- foreach(array("T","B","F") as $attr){
- if(in_array("filter".$attr,$this->multi_boxes)){
- $smarty->assign("use_filter".$attr,TRUE);
- }else{
- $smarty->assign("use_filter".$attr,FALSE);
- }
- }
- $smarty->assign("proxyAccountACL",$this->getacl("",$this->ReadOnly));
- $smarty->assign("use_proxy",in_array("proxy",$this->multi_boxes));
- $smarty->assign("multiple_support",$this->multiple_support_active);
- $display.= $smarty->fetch(get_template_path('proxy.tpl', TRUE, dirname(__FILE__)));
- return($display);
- }
-
-
- /*! \brief Removes proxy account from current object
- */
- public function remove_from_parent()
- {
- if($this->acl_is_removeable() && $this->initially_was_account){
- plugin::remove_from_parent();
- $ldap= $this->config->get_ldap_link();
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/proxy account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- $this->handle_post_events("remove",array("uid" => $this->uid));
- }
- }
-
-
- /*! \brief Check given input
- @return array Returns an array of error messages
- */
- public function check()
- {
- /* Call common method to give check the hook */
- $message= plugin::check();
-
- /* We've got only one value to check for positive integer or emtpy field */
- if ($this->is_account){
- if($this->acl_is_writeable("gosaProxyQuota")){
- if (isset($_POST["quota_size"])){
- if ($_POST["quota_size"] == "gosaProxyQuota"){
- $message[]= _("Numerical value for Quota Setting is empty.");
- }elseif ($_POST["quota_size"] <= 0){
- $message[]= _("Numerical value for Quota Setting is not valid.");
- }
- }
- }
- }
- return $message;
- }
-
- /*! \brief Save POST data to object
- */
- public function save_object()
- {
- /* Do we need to flip is_account state? */
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['proxy'])){
- if (!$this->is_account && $_POST['proxy'] == "B"){
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
-
- /* Save flag value */
- if ($this->is_account || $this->multiple_support_active){
-
- $flags= "";
- $acl= "";
- foreach(array("F", "T", "B") as $key){
- if($this->acl_is_writeable("gosaProxyFlag".$key)){
-
- /* Add acl */
- if (isset($_POST["filter$key"])){
- $flags.= $key;
- }
- }else{
-
- /* Keep all flags that can't be written*/
- if(preg_match("/".$key."/",$this->gosaProxyAcctFlags)){
- $flags .=$key;
- }
- }
- }
- if ("[$flags]" != $this->gosaProxyAcctFlags){
- $this->is_modified= TRUE;
- }
- $this->gosaProxyAcctFlags= "[$flags]";
-
- /* Save time values */
- if ($this->acl_is_writeable("gosaProxyFlagT")){
- if(isset($_POST['startMinute'])){
- $old= $this->gosaProxyWorkingStart;
- $this->gosaProxyWorkingStart= $_POST["startHour"] * 60 + $_POST["startMinute"];
- $this->is_modified= ($old != $this->gosaProxyWorkingStart)?TRUE:$this->is_modified;
- }
-
- if (isset($_POST['stopMinute'])){
- $old= $this->gosaProxyWorkingStop;
- $this->gosaProxyWorkingStop = $_POST["stopHour"] * 60 + $_POST["stopMinute"];
- $this->is_modified= ($old != $this->gosaProxyWorkingStop)?TRUE:$this->is_modified;
- }
- }
-
- /* Save quota values */
- if ($this->acl_is_writeable("gosaProxyFlagB")){
- if(isset($_POST["quota_size"]) && isset($_POST["quota_unit"])){
- $this->gosaProxyQuota= $_POST["quota_size"].$_POST["quota_unit"];
- }
- }
-
- /*Save quota period */
- if($this->acl_is_writeable("gosaProxyFlagB")){
- if(isset($_POST["gosaProxyQuotaPeriod"])){
- $this->gosaProxyQuotaPeriod = $_POST["gosaProxyQuotaPeriod"];
- }
- }
- }
- }
-
-
- /*! \brief Save settings to ldap
- */
- public function save()
- {
- plugin::save();
-
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/proxy account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account){
- if ($this->is_modified){
- $this->handle_post_events("modify",array("uid" => $this->uid));
- }
- } else {
- $this->handle_post_events("add",array("uid" => $this->uid));
- }
-
- }
-
-
- /*! \brief Static Function returning an ACL information array.
- @return Array Returns an ACL array
- */
- static function plInfo()
- {
- return (array(
- "plShortName" => _("Proxy"),
- "plDescription" => _("Proxy account")." : <u>"._("Connectivity addon")."</u>",
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 21, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array(
- "gosaProxyFlagF" => _("Filter unwanted content"),
- "gosaProxyFlagT" => _("Limit proxy access"),
- "gosaProxyFlagB" => _("Restrict proxy usage by quota"))
- ));
- }
-
-
- /*! \brief Save html POSTs in multiple edit.
- */
- public function multiple_save_object()
- {
- if (isset($_POST['connectivityTab'])){
- plugin::multiple_save_object();
- if(isset($_POST['use_proxy'])){
- $this->multi_boxes[] = "proxy";
- }
- foreach(array("T","B","F") as $attr){
- if(isset($_POST["use_filter".$attr])){
- $this->multi_boxes[] = "filter".$attr;
- }
- }
- $this->save_object();
- }
- }
-
-
- /*! \brief Returns all modified values. \
- All selected an modified values will be returned \
- in an array.
- @return array Returns an array containing all attribute modifications
- */
- public function get_multi_edit_values()
- {
- $ret = plugin::get_multi_edit_values();
- if(in_array("proxy",$this->multi_boxes)){
- $ret['is_account'] = $this->is_account;
- }
-
- if(in_array("filterT",$this->multi_boxes)){
- $ret['gosaProxyWorkingStart'] = $this->gosaProxyWorkingStart;
- $ret['gosaProxyWorkingStop'] = $this->gosaProxyWorkingStop;
- }
- if(in_array("filterB",$this->multi_boxes)){
- $ret['gosaProxyQuota'] = $this->gosaProxyQuota;
- $ret['gosaProxyQuotaPeriod'] = $this->gosaProxyQuotaPeriod;
- }
-
- foreach(array("B","T","F") as $attr){
- $name = "filter".$attr;
- if(in_array($name,$this->multi_boxes)){
- $ret[$name] = preg_match("/".$attr."/",$this->gosaProxyAcctFlags);
- }
- }
-
- return($ret);
- }
-
-
- /*! \brief Sets modified attributes in mutliple edit. \
- All collected values from "get_multi_edit_values()" \
- will be applied to this plugin.
- @param array An array containing modified attributes returned by get_multi_edit_values();
- */
- public function set_multi_edit_values($values)
- {
- plugin::set_multi_edit_values($values);
- if(isset($values['is_account'])){
- $this->is_account = $values['is_account'];
- }
- foreach(array("B","T","F") as $attr){
- $name = "filter".$attr;
- if(isset($values[$name])){
- if($values[$name] && !preg_match("/".$attr."/",$this->gosaProxyAcctFlags)){
- $this->gosaProxyAcctFlags = preg_replace("/\]/",$attr."]",$this->gosaProxyAcctFlags);
- }elseif(!$values[$name] && preg_match("/".$attr."/",$this->gosaProxyAcctFlags)){
- $this->gosaProxyAcctFlags = preg_replace("/".$attr."/","",$this->gosaProxyAcctFlags);
- }
- }
- }
- }
-
-
- /*! \brief Initialize multiple edit ui for this plugin. \
- This function sets plugin defaults in multiple edit.
- @param array Attributes used in all object
- @param array All used attributes.
- */
- public function init_multiple_support($attrs,$all)
- {
- plugin::init_multiple_support($attrs,$all);
- if(isset($attrs['objectClass']) && in_array("gosaProxyAccount",$attrs['objectClass'])){
- $this->is_account = TRUE;
- }
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/connectivity/squid/proxy.tpl b/gosa-core/plugins/personal/connectivity/squid/proxy.tpl
+++ /dev/null
@@ -1,130 +0,0 @@
-<h2>
-
-{if $multiple_support}
-
- <input type="checkbox" name="use_proxy" value="1" onClick="changeState('proxy')" class="center"
- {if $use_proxy} checked {/if}>
- <input type="checkbox" id="proxy" name="proxy" value="B" {$proxyState} class="center"
- {if !$use_proxy} disabled {/if}>
-
-{else}
-
- {render acl=$proxyAccountACL}
- <input type="checkbox" id="proxy" name="proxy" value="B" {$proxyState}
- class="center"
- onClick="
-
- {if $gosaProxyFlagF_W}
- changeState('filterF');
- {/if}
-
- {if $gosaProxyFlagT_W}
- changeState('filterT');
- changeTripleSelectState('proxy', 'filterT', 'startHour');
- changeTripleSelectState('proxy', 'filterT', 'startMinute');
- changeTripleSelectState('proxy', 'filterT', 'stopMinute');
- changeTripleSelectState('proxy', 'filterT', 'stopHour');
- {/if}
- {if $gosaProxyFlagB_W}
- changeState('filterB');
- changeTripleSelectState('proxy', 'filterB', 'quota_unit');
- changeTripleSelectState('proxy', 'filterB', 'quota_size');
- changeTripleSelectState('proxy', 'filterB', 'gosaProxyQuotaPeriod');
- {/if}
- ">
- {/render}
-{/if}
- {t}Proxy account{/t}</h2>
-
-<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
- <tr>
- <td>
- <table summary="" border=0 width="100%" cellpadding=0>
- <tr><td colspan=2>
-
-{render acl=$gosaProxyFlagFACL checkbox=$multiple_support checked=$use_filterF}
- <input type="checkbox" name="filterF" id="filterF" value="F" {$filterF} {$pstate} class="center">
-{/render}
- {t}Filter unwanted content (i.e. pornographic or violence related){/t}
- </td></tr>
- <tr>
- <td width="50%">
-
-{render acl=$gosaProxyFlagTACL checkbox=$multiple_support checked=$use_filterT}
- <input type="checkbox" name="filterT" id="filterT" value="T" {$filterT} {$pstate} onClick="javascript:
- {$ProxyWorkingStateChange}" class="center">
-{/render}
-
- <LABEL for="startHour">{t}Limit proxy access to working time{/t}</LABEL>
- <br>
- <table summary="" style="margin-left:20px;">
- <tr>
- <td>
-
-{render acl=$gosaProxyFlagTACL}
- <select size="1" id="startHour" name="startHour" {if $Tstate!=""} disabled {/if} >
- {html_options values=$hours output=$hours selected=$starthour}
- </select>
-{/render}
- :
-{render acl=$gosaProxyFlagTACL}
- <select size="1" id="startMinute" name="startMinute" {if $Tstate!=""} disabled {/if} >
- {html_options values=$minutes output=$minutes selected=$startminute}
- </select>
-{/render}
- -
-{render acl=$gosaProxyFlagTACL}
- <select size="1" id="stopHour" name="stopHour" {if $Tstate!=""} disabled {/if} >
- {html_options values=$hours output=$hours selected=$stophour}
- </select>
-{/render}
- :
-{render acl=$gosaProxyFlagTACL}
- <select size="1" id="stopMinute" name="stopMinute" {if $Tstate!=""} disabled {/if}>
- {html_options values=$minutes output=$minutes selected=$stopminute}
- </select>
-{/render}
- </td>
- </tr>
- </table>
- </td>
- <td rowspan=2 style="border-left:1px solid #A0A0A0">
-
- </td>
- <td>
-{render acl=$gosaProxyFlagBACL checkbox=$multiple_support checked=$use_filterB}
- <input type="checkbox" id="filterB" name="filterB" value="B" {$filterB} {if $pstate=="disabled"} disabled {/if} onClick="{$changeB}"
- class="center"
- >
-{/render}
- <LABEL for="quota_size">{t}Restrict proxy usage by quota{/t}</LABEL>
- <br>
- <table summary="" style="margin-left:20px;">
- <tr>
- <td>
-{render acl=$gosaProxyFlagBACL}
- <input name="quota_size" id="quota_size" size=7 maxlength=10 value="{$quota_size}" {if $Bstate!=""} disabled {/if} >
-{/render}
-
-{render acl=$gosaProxyFlagBACL}
- <select size="1" name="quota_unit" id="quota_unit" {if $Bstate!=""} disabled {/if} >
- {html_options options=$quota_unit selected=$quota_u}
- </select>
-{/render}
-
- <LABEL for="gosaProxyQuotaPeriod">{t}per{/t}</LABEL>
-{render acl=$gosaProxyFlagBACL}
- <select size="1" name="gosaProxyQuotaPeriod" id="gosaProxyQuotaPeriod" {if $Bstate!=""} disabled {/if} >
- {html_options options=$quota_time selected=$gosaProxyQuotaPeriod}
- </select>
-{/render}
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-
diff --git a/gosa-core/plugins/personal/connectivity/webdav/class_webdavAccount.inc b/gosa-core/plugins/personal/connectivity/webdav/class_webdavAccount.inc
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-
-class webdavAccount extends plugin
-{
- /* Definitions */
- var $plHeadline= "WebDAV";
- var $plDescription= "This does something";
-
- /* attribute list for save action */
- var $attributes= array();
- var $objectclasses= array("gosaWebdavAccount");
- var $ReadOnly = false;
- var $view_logged = FALSE;
- var $uid ="";
-
- var $multiple_support =TRUE;
-
- function webdavAccount (&$config, $dn= NULL)
- {
- plugin::plugin ($config, $dn);
-
- /* Setting uid to default */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
- }
-
- function execute()
- {
- /* Call parent execute */
-// plugin::execute();
-
- /* Log view */
- if($this->is_account && !$this->view_logged){
- $this->view_logged = TRUE;
- new log("view","users/".get_class($this),$this->dn);
- }
-
- /* Show tab dialog headers */
- $display= "";
-
- /* Show main page */
- $smarty= get_smarty();
-
- if ($this->is_account){
- $smarty->assign("webdavState", "checked");
- } else {
- $smarty->assign("webdavState", "");
- $smarty->assign("wstate", "disabled");
- }
-
- if ($this->parent !== NULL){
- $smarty->assign("tabbed", 1);
- }
-
- $smarty->assign('webdavAccountACL', $this->getacl("",$this->ReadOnly));
- $smarty->assign("use_webdav",in_array("webdav",$this->multi_boxes));
- $smarty->assign("multiple_support",$this->multiple_support_active);
- $display.= $smarty->fetch (get_template_path('webdav.tpl', TRUE, dirname(__FILE__)));
- return ($display);
- }
-
- function remove_from_parent()
- {
- if($this->acl_is_createable() || $this->is_account){
- /* Cancel if there's nothing to do here */
- if (!$this->initially_was_account){
- return;
- }
-
- plugin::remove_from_parent();
- $ldap= $this->config->get_ldap_link();
-
- $ldap->cd($this->dn);
- @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
- $this->attributes, "Save");
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/webDAV account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- $this->handle_post_events('remove',array("uid" => $this->uid));
- }
- }
-
-
- /* Save data to object */
- function save_object()
- {
- /* Do we need to flip is_account state? */
- if (isset($_POST['connectivityTab'])){
- if (isset($_POST['webdav'])){
- if (!$this->is_account && $_POST['webdav'] == "B"){
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
-
- plugin::save_object();
- if (isset($_POST["WEBDAVStatus"])){
- $this->WEBDAVStatus = "disabled";
- } else {
- $this->WEBDAVStatus = "enabled";
- }
- }
-
-
- /* Save to LDAP */
- function save()
- {
- if($this->acl_is_createable()){
- plugin::save();
-
- /* Write back to ldap */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- /* Log last action */
- if($this->initially_was_account){
- new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }else{
- new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- }
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/webDAV account with dn '%s' failed."),$this->dn));
-
- /* Optionally execute a command after we're done */
- if ($this->initially_was_account == $this->is_account){
- if ($this->is_modified){
- $this->handle_post_events("modify",array("uid" => $this->uid));
- }
- } else {
- $this->handle_post_events("add",array("uid" => $this->uid));
- }
- }
- }
-
- /* Return plugin informations for acl handling
- #FIXME This is only an enable/disable checkbox for this account, there is possibly a better solution available later */
- static function plInfo()
- {
- return (array(
- "plShortName" => _("WebDAV"),
- "plDescription" => _("WebDAV account")." : <u>"._("Connectivity addon")."</u>",
- "plSelfModify" => TRUE,
- "plDepends" => array("user"),
- "plPriority" => 23, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users"),
- "plOptions" => array(),
-
- "plProvidedAcls" => array()
- ));
- }
-
- function multiple_save_object()
- {
- if (isset($_POST['connectivityTab'])){
- plugin::multiple_save_object();
-
- if(isset($_POST['use_webdav'])){
- $this->multi_boxes[] = "webdav";
- if (isset($_POST['webdav'])){
- if (!$this->is_account && $_POST['webdav'] == "B"){
- if($this->acl_is_createable()){
- $this->is_account= TRUE;
- }
- }
- } else {
- if($this->acl_is_removeable()){
- $this->is_account= FALSE;
- }
- }
- }
- }
- }
-
- function get_multi_edit_values()
- {
- $ret = plugin::get_multi_edit_values();
- if(in_array("webdav",$this->multi_boxes)){
- $ret['is_account'] = $this->is_account;
- }
- return($ret);
- }
-
- function set_multi_edit_values($values)
- {
- plugin::set_multi_edit_values($values);
- if(isset($values['is_account'])){
- $this->is_account = $values['is_account'];
- }
- }
-
- function init_multiple_support($attrs,$all)
- {
- plugin::init_multiple_support($attrs,$all);
- if(isset($attrs['objectClass']) && in_array("gosaWebdavAccount",$attrs['objectClass'])){
- $this->is_account = TRUE;
- }
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-core/plugins/personal/connectivity/webdav/webdav.tpl b/gosa-core/plugins/personal/connectivity/webdav/webdav.tpl
+++ /dev/null
@@ -1,6 +0,0 @@
-<h2>
-{render acl=$webdavAccountACL checkbox=$multiple_support checked=$use_webdav}
- <input type="checkbox" name="webdav" value="B" {$webdavState} class="center">
-{/render}
- {t}WebDAV account{/t}
-</h2>
diff --git a/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_pgsql_opengw.inc b/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_pgsql_opengw.inc
--- /dev/null
@@ -0,0 +1,160 @@
+<?php
+
+class pgre_sql{
+
+ var $handle;
+ var $query_log;
+ var $user;
+ var $server;
+ var $db;
+ var $pwd;
+ var $is_connected = false;
+
+ function pgre_sql($user,$pwd,$server,$db)
+ {
+ $this->user = $user;
+ $this->pwd = $pwd;
+ $this->server = $server;
+ $this->db = $db;
+
+ if($this->_connect()){
+ $this->is_connected = true;
+ }else{
+ $this->is_connected = false;
+ }
+ }
+
+ function _connect()
+ {
+ error_reporting(E_ALL | E_STRICT);
+ if(is_callable("pg_connect")){
+ if(!empty($this->pwd)){
+ $this->handle = @pg_connect("dbname=".$this->db." host=".$this->server." user=".$this->user);
+ }else{
+ $this->handle = @pg_connect("dbname=".$this->db." host=".$this->server." user=".$this->user." password=".$this->pwd);
+ }
+ if(!$this->handle){
+ $this->handle = false;
+ }
+ }else{
+ $this->handle = false;
+ }
+ return($this->handle);
+ }
+
+ function Query($a_query)
+ {
+ if(is_array($a_query)){
+ foreach($a_query as $nr => $query){
+ return($this->_query($query));
+ }
+ }else{
+ return($this->_query($a_query));
+ }
+ }
+
+ function _query($query)
+ {
+ return(pg_query($this->handle,$query));
+ }
+
+ function FetchAllRows($res)
+ {
+ return(pg_fetch_all($res)) ;
+ }
+
+ function gen_id()
+ {
+ $tmp = $this->_query("select nextval('key_generator');");
+ $tmp = ($this->FetchAllRows($tmp));
+ return($tmp[0]['nextval']);
+ }
+
+
+ function GetTemplateUser(){
+ $data = array();
+ $qry = "SELECT description,name,company_id FROM company WHERE is_template_user=1;";
+ $res = $this->_query($qry);
+ $tmp = $this->FetchAllRows($res);
+ foreach($tmp as $attr){
+ $data[$attr['name']] = $attr;
+ }
+ return $data;
+ }
+ function GetLocationTeam(){
+ $data = array();
+ $qry = "SELECT description,name,company_id FROM team WHERE is_location_team=1;";
+ $res = $this->_query($qry);
+ $tmp = $this->FetchAllRows($res);
+ if(is_array($tmp)){
+ foreach($tmp as $attr){
+ $data[$attr['description']] = $attr;
+ }
+ }
+ return $data;
+ }
+ function GetTeams(){
+ $data = array();
+ $qry = "SELECT description,name,company_id FROM team
+ WHERE (is_team=1) AND company_id
+ NOT IN (SELECT company_id FROM company WHERE is_location_team=1);";
+ $res = $this->_query($qry);
+ $tmp = $this->FetchAllRows($res);
+ foreach($tmp as $attr){
+ $data[$attr['description']] = $attr;
+ }
+ return $data;
+ }
+}
+
+
+function gen_syntax($array,$tablename,$act,$ist)
+{
+ if($act == "EDIT"){
+ $str = "UPDATE ".$tablename." SET ";
+ $company_id = $ist[0]['company_id'];
+
+ foreach($array as $name => $value){
+ if((empty($value))&&(!preg_match("/^is_/i",$name))) continue;
+
+ if((empty($value))&&(preg_match("/^is_/i",$name))){
+ $value= 0;
+ }
+
+ if(!is_numeric($value)){
+ $str.= " ".$name."='".$value."', ";
+ }else{
+ $str.= " ".$name."=".$value.", ";
+ }
+ }
+ $str = preg_replace("/, $/","",$str);
+ $str .= " WHERE company_id=".$company_id.";\n";
+ return $str;
+ }
+ if($act == "ADD"){
+ $str = "INSERT into ".$tablename." (";
+ $attrs = "";
+ $values = "";
+ foreach($array as $name => $attribute){
+ if((empty($attribute))&&(!preg_match("/^is_/i",$name))) continue;
+
+ if((empty($attribute))&&(preg_match("/^is_/i",$name))){
+ $attribute= 0;
+ }
+
+ if(is_numeric($attribute)){
+ $attrs .= $name.", ";
+ $values .= $attribute.", ";
+ }else{
+ $attrs .= $name.", ";
+ $values .= "'".$attribute."', ";
+ }
+ }
+ $attrs = preg_replace("/, $/","",$attrs);
+ $values= preg_replace("/, $/","",$values);
+ $str .= $attrs." ) \nVALUES\n (".$values.");\n";
+ return $str;
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc b/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc
--- /dev/null
@@ -0,0 +1,976 @@
+<?php
+/*
+ This code is part of GOsa (https://gosa.gonicus.de)
+ Copyright (C) 2005 Alejandro Escanero Blanco
+
+ 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
+*/
+
+class oxchangeAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline= "Open-Xchange";
+ var $plDescription= "This does something";
+
+ /* GW attributes */
+ var $OXAppointmentDays="500";
+ var $OXTaskDays="5";
+ var $OXTimeZone="GMT";
+ var $mailEnabled="OK";
+ var $dnModeValue = "";
+ var $view_logged = FALSE;
+
+ /* attribute list for save action */
+ var $attributes= array("OXAppointmentDays", "OXTaskDays", "OXTimeZone","mailEnabled");
+ var $objectclasses= array("OXUserObject");
+ var $ReadOnly =false;
+ var $oxconf = array();
+ var $timezones=array(
+ "Africa/Abidjan",
+ "Africa/Accra",
+ "Africa/Addis_Ababa",
+ "Africa/Algiers",
+ "Africa/Asmera",
+ "Africa/Bamako",
+ "Africa/Bangui",
+ "Africa/Banjul",
+ "Africa/Bissau",
+ "Africa/Blantyre",
+ "Africa/Brazzaville",
+ "Africa/Bujumbura",
+ "Africa/Cairo",
+ "Africa/Casablanca",
+ "Africa/Ceuta",
+ "Africa/Conakry",
+ "Africa/Dakar",
+ "Africa/Dar_es_Salaam",
+ "Africa/Djibouti",
+ "Africa/Douala",
+ "Africa/El_Aaiun",
+ "Africa/Freetown",
+ "Africa/Gaborone",
+ "Africa/Harare",
+ "Africa/Johannesburg",
+ "Africa/Kampala",
+ "Africa/Khartoum",
+ "Africa/Kigali",
+ "Africa/Kinshasa",
+ "Africa/Lagos",
+ "Africa/Libreville",
+ "Africa/Lome",
+ "Africa/Luanda",
+ "Africa/Lubumbashi",
+ "Africa/Lusaka",
+ "Africa/Malabo",
+ "Africa/Maputo",
+ "Africa/Maseru",
+ "Africa/Mbabane",
+ "Africa/Mogadishu",
+ "Africa/Monrovia",
+ "Africa/Nairobi",
+ "Africa/Ndjamena",
+ "Africa/Niamey",
+ "Africa/Nouakchott",
+ "Africa/Ouagadougou",
+ "Africa/Porto-Novo",
+ "Africa/Sao_Tome",
+ "Africa/Timbuktu",
+ "Africa/Tripoli",
+ "Africa/Tunis",
+ "Africa/Windhoek",
+ "America/Adak",
+ "America/Anchorage",
+ "America/Anguilla",
+ "America/Antigua",
+ "America/Araguaina",
+ "America/Aruba",
+ "America/Asuncion",
+ "America/Atka",
+ "America/Barbados",
+ "America/Belem",
+ "America/Belize",
+ "America/Boa_Vista",
+ "America/Bogota",
+ "America/Boise",
+ "America/Buenos_Aires",
+ "America/Cambridge_Bay",
+ "America/Cancun",
+ "America/Caracas",
+ "America/Catamarca",
+ "America/Cayenne",
+ "America/Cayman",
+ "America/Chicago",
+ "America/Chihuahua",
+ "America/Cordoba",
+ "America/Costa_Rica",
+ "America/Cuiaba",
+ "America/Curacao",
+ "America/Danmarkshavn",
+ "America/Dawson",
+ "America/Dawson_Creek",
+ "America/Denver",
+ "America/Detroit",
+ "America/Dominica",
+ "America/Edmonton",
+ "America/Eirunepe",
+ "America/El_Salvador",
+ "America/Ensenada",
+ "America/Fortaleza",
+ "America/Fort_Wayne",
+ "America/Glace_Bay",
+ "America/Godthab",
+ "America/Goose_Bay",
+ "America/Grand_Turk",
+ "America/Grenada",
+ "America/Guadeloupe",
+ "America/Guatemala",
+ "America/Guayaquil",
+ "America/Guyana",
+ "America/Halifax",
+ "America/Havana",
+ "America/Hermosillo",
+ "America/Indiana",
+ "America/Indiana/Indianapolis",
+ "America/Indiana/Knox",
+ "America/Indiana/Marengo",
+ "America/Indiana/Vevay",
+ "America/Indianapolis",
+ "America/Inuvik",
+ "America/Iqaluit",
+ "America/Jamaica",
+ "America/Jujuy",
+ "America/Juneau",
+ "America/Kentucky",
+ "America/Kentucky/Louisville",
+ "America/Kentucky/Monticello",
+ "America/Knox_IN",
+ "America/La_Paz",
+ "America/Lima",
+ "America/Los_Angeles",
+ "America/Louisville",
+ "America/Maceio",
+ "America/Managua",
+ "America/Manaus",
+ "America/Martinique",
+ "America/Mazatlan",
+ "America/Mendoza",
+ "America/Menominee",
+ "America/Merida",
+ "America/Mexico_City",
+ "America/Miquelon",
+ "America/Monterrey",
+ "America/Montevideo",
+ "America/Montreal",
+ "America/Montserrat",
+ "America/Nassau",
+ "America/New_York",
+ "America/Nipigon",
+ "America/Nome",
+ "America/Noronha",
+ "America/North_Dakota",
+ "America/North_Dakota/Center",
+ "America/Panama",
+ "America/Pangnirtung",
+ "America/Paramaribo",
+ "America/Phoenix",
+ "America/Port-au-Prince",
+ "America/Porto_Acre",
+ "America/Porto_Velho",
+ "America/Port_of_Spain",
+ "America/Puerto_Rico",
+ "America/Rainy_River",
+ "America/Rankin_Inlet",
+ "America/Recife",
+ "America/Regina",
+ "America/Rio_Branco",
+ "America/Rosario",
+ "America/Santiago",
+ "America/Santo_Domingo",
+ "America/Sao_Paulo",
+ "America/Scoresbysund",
+ "America/Shiprock",
+ "America/St_Johns",
+ "America/St_Kitts",
+ "America/St_Lucia",
+ "America/St_Thomas",
+ "America/St_Vincent",
+ "America/Swift_Current",
+ "America/Tegucigalpa",
+ "America/Thule",
+ "America/Thunder_Bay",
+ "America/Tijuana",
+ "America/Tortola",
+ "America/Vancouver",
+ "America/Virgin",
+ "America/Whitehorse",
+ "America/Winnipeg",
+ "America/Yakutat",
+ "America/Yellowknife",
+ "Antarctica/Casey",
+ "Antarctica/Davis",
+ "Antarctica/DumontDUrville",
+ "Antarctica/Mawson",
+ "Antarctica/McMurdo",
+ "Antarctica/Palmer",
+ "Antarctica/South_Pole",
+ "Antarctica/Syowa",
+ "Antarctica/Vostok",
+ "Arctic/Longyearbyen",
+ "Asia/Aden",
+ "Asia/Almaty",
+ "Asia/Amman",
+ "Asia/Anadyr",
+ "Asia/Aqtau",
+ "Asia/Aqtobe",
+ "Asia/Ashgabat",
+ "Asia/Ashkhabad",
+ "Asia/Baghdad",
+ "Asia/Bahrain",
+ "Asia/Baku",
+ "Asia/Bangkok",
+ "Asia/Beirut",
+ "Asia/Bishkek",
+ "Asia/Brunei",
+ "Asia/Calcutta",
+ "Asia/Choibalsan",
+ "Asia/Chongqing",
+ "Asia/Chungking",
+ "Asia/Colombo",
+ "Asia/Dacca",
+ "Asia/Damascus",
+ "Asia/Dhaka",
+ "Asia/Dili",
+ "Asia/Dubai",
+ "Asia/Dushanbe",
+ "Asia/Gaza",
+ "Asia/Harbin",
+ "Asia/Hong_Kong",
+ "Asia/Hovd",
+ "Asia/Irkutsk",
+ "Asia/Istanbul",
+ "Asia/Jakarta",
+ "Asia/Jayapura",
+ "Asia/Jerusalem",
+ "Asia/Kabul",
+ "Asia/Kamchatka",
+ "Asia/Karachi",
+ "Asia/Kashgar",
+ "Asia/Katmandu",
+ "Asia/Krasnoyarsk",
+ "Asia/Kuala_Lumpur",
+ "Asia/Kuching",
+ "Asia/Kuwait",
+ "Asia/Macao",
+ "Asia/Macau",
+ "Asia/Magadan",
+ "Asia/Manila",
+ "Asia/Muscat",
+ "Asia/Nicosia",
+ "Asia/Novosibirsk",
+ "Asia/Omsk",
+ "Asia/Oral",
+ "Asia/Phnom_Penh",
+ "Asia/Pontianak",
+ "Asia/Pyongyang",
+ "Asia/Qatar",
+ "Asia/Qyzylorda",
+ "Asia/Rangoon",
+ "Asia/Riyadh",
+ "Asia/Riyadh87",
+ "Asia/Riyadh88",
+ "Asia/Riyadh89",
+ "Asia/Saigon",
+ "Asia/Sakhalin",
+ "Asia/Samarkand",
+ "Asia/Seoul",
+ "Asia/Shanghai",
+ "Asia/Singapore",
+ "Asia/Taipei",
+ "Asia/Tashkent",
+ "Asia/Tbilisi",
+ "Asia/Tehran",
+ "Asia/Tel_Aviv",
+ "Asia/Thimbu",
+ "Asia/Thimphu",
+ "Asia/Tokyo",
+ "Asia/Ujung_Pandang",
+ "Asia/Ulaanbaatar",
+ "Asia/Ulan_Bator",
+ "Asia/Urumqi",
+ "Asia/Vientiane",
+ "Asia/Vladivostok",
+ "Asia/Yakutsk",
+ "Asia/Yekaterinburg",
+ "Asia/Yerevan",
+ "Atlantic/Azores",
+ "Atlantic/Bermuda",
+ "Atlantic/Canary",
+ "Atlantic/Cape_Verde",
+ "Atlantic/Faeroe",
+ "Atlantic/Jan_Mayen",
+ "Atlantic/Madeira",
+ "Atlantic/Reykjavik",
+ "Atlantic/South_Georgia",
+ "Atlantic/Stanley",
+ "Atlantic/St_Helena",
+ "Australia/ACT",
+ "Australia/Adelaide",
+ "Australia/Brisbane",
+ "Australia/Broken_Hill",
+ "Australia/Canberra",
+ "Australia/Darwin",
+ "Australia/Hobart",
+ "Australia/LHI",
+ "Australia/Lindeman",
+ "Australia/Lord_Howe",
+ "Australia/Melbourne",
+ "Australia/North",
+ "Australia/NSW",
+ "Australia/Perth",
+ "Australia/Queensland",
+ "Australia/South",
+ "Australia/Sydney",
+ "Australia/Tasmania",
+ "Australia/Victoria",
+ "Australia/West",
+ "Australia/Yancowinna",
+ "Brazil/Acre",
+ "Brazil/DeNoronha",
+ "Brazil/East",
+ "Brazil/West",
+ "Canada/Atlantic",
+ "Canada/Central",
+ "Canada/East-Saskatchewan",
+ "Canada/Eastern",
+ "Canada/Mountain",
+ "Canada/Newfoundland",
+ "Canada/Pacific",
+ "Canada/Saskatchewan",
+ "Canada/Yukon",
+ "CET",
+ "Chile/Continental",
+ "Chile/EasterIsland",
+ "CST6CDT",
+ "Cuba",
+ "EET",
+ "Egypt",
+ "Eire",
+ "EST",
+ "EST5EDT",
+ "Etc/GMT",
+ "Etc/GMT+0",
+ "Etc/GMT+1",
+ "Etc/GMT+10",
+ "Etc/GMT+11",
+ "Etc/GMT+12",
+ "Etc/GMT+2",
+ "Etc/GMT+3",
+ "Etc/GMT+4",
+ "Etc/GMT+5",
+ "Etc/GMT+6",
+ "Etc/GMT+7",
+ "Etc/GMT+8",
+ "Etc/GMT+9",
+ "Etc/GMT-0",
+ "Etc/GMT-1",
+ "Etc/GMT-10",
+ "Etc/GMT-11",
+ "Etc/GMT-12",
+ "Etc/GMT-13",
+ "Etc/GMT-14",
+ "Etc/GMT-2",
+ "Etc/GMT-3",
+ "Etc/GMT-4",
+ "Etc/GMT-5",
+ "Etc/GMT-6",
+ "Etc/GMT-7",
+ "Etc/GMT-8",
+ "Etc/GMT-9",
+ "Etc/GMT0",
+ "Etc/Greenwich",
+ "Etc/UCT",
+ "Etc/Universal",
+ "Etc/UTC",
+ "Etc/Zulu",
+ "Europe/Amsterdam",
+ "Europe/Andorra",
+ "Europe/Athens",
+ "Europe/Belfast",
+ "Europe/Belgrade",
+ "Europe/Berlin",
+ "Europe/Bratislava",
+ "Europe/Brussels",
+ "Europe/Bucharest",
+ "Europe/Budapest",
+ "Europe/Chisinau",
+ "Europe/Copenhagen",
+ "Europe/Dublin",
+ "Europe/Gibraltar",
+ "Europe/Helsinki",
+ "Europe/Istanbul",
+ "Europe/Kaliningrad",
+ "Europe/Kiev",
+ "Europe/Lisbon",
+ "Europe/Ljubljana",
+ "Europe/London",
+ "Europe/Luxembourg",
+ "Europe/Madrid",
+ "Europe/Malta",
+ "Europe/Minsk",
+ "Europe/Monaco",
+ "Europe/Moscow",
+ "Europe/Nicosia",
+ "Europe/Oslo",
+ "Europe/Paris",
+ "Europe/Prague",
+ "Europe/Riga",
+ "Europe/Rome",
+ "Europe/Samara",
+ "Europe/San_Marino",
+ "Europe/Sarajevo",
+ "Europe/Simferopol",
+ "Europe/Skopje",
+ "Europe/Sofia",
+ "Europe/Stockholm",
+ "Europe/Tallinn",
+ "Europe/Tirane",
+ "Europe/Tiraspol",
+ "Europe/Uzhgorod",
+ "Europe/Vaduz",
+ "Europe/Vatican",
+ "Europe/Vienna",
+ "Europe/Vilnius",
+ "Europe/Warsaw",
+ "Europe/Zagreb",
+ "Europe/Zaporozhye",
+ "Europe/Zurich",
+ "Factory",
+ "GB",
+ "GB-Eire",
+ "GMT",
+ "GMT+0",
+ "GMT-0",
+ "GMT0",
+ "Greenwich",
+ "Hongkong",
+ "HST",
+ "Iceland",
+ "Indian/Antananarivo",
+ "Indian/Chagos",
+ "Indian/Christmas",
+ "Indian/Cocos",
+ "Indian/Comoro",
+ "Indian/Kerguelen",
+ "Indian/Mahe",
+ "Indian/Maldives",
+ "Indian/Mauritius",
+ "Indian/Mayotte",
+ "Indian/Reunion",
+ "Iran",
+ "Israel",
+ "Jamaica",
+ "Japan",
+ "Kwajalein",
+ "Libya",
+ "MET",
+ "Mexico/BajaNorte",
+ "Mexico/BajaSur",
+ "Mexico/General",
+ "Mideast/Riyadh87",
+ "Mideast/Riyadh88",
+ "Mideast/Riyadh89",
+ "MST",
+ "MST7MDT",
+ "Navajo",
+ "NZ",
+ "NZ-CHAT",
+ "Pacific/Apia",
+ "Pacific/Auckland",
+ "Pacific/Chatham",
+ "Pacific/Easter",
+ "Pacific/Efate",
+ "Pacific/Enderbury",
+ "Pacific/Fakaofo",
+ "Pacific/Fiji",
+ "Pacific/Funafuti",
+ "Pacific/Galapagos",
+ "Pacific/Gambier",
+ "Pacific/Guadalcanal",
+ "Pacific/Guam",
+ "Pacific/Honolulu",
+ "Pacific/Johnston",
+ "Pacific/Kiritimati",
+ "Pacific/Kosrae",
+ "Pacific/Kwajalein",
+ "Pacific/Majuro",
+ "Pacific/Marquesas",
+ "Pacific/Midway",
+ "Pacific/Nauru",
+ "Pacific/Niue",
+ "Pacific/Norfolk",
+ "Pacific/Noumea",
+ "Pacific/Pago_Pago",
+ "Pacific/Palau",
+ "Pacific/Pitcairn",
+ "Pacific/Ponape",
+ "Pacific/Port_Moresby",
+ "Pacific/Rarotonga",
+ "Pacific/Saipan",
+ "Pacific/Samoa",
+ "Pacific/Tahiti",
+ "Pacific/Tarawa",
+ "Pacific/Tongatapu",
+ "Pacific/Truk",
+ "Pacific/Wake",
+ "Pacific/Wallis",
+ "Pacific/Yap",
+ "Poland",
+ "Portugal",
+ "PRC",
+ "PST8PDT",
+ "ROC",
+ "ROK",
+ "Singapore",
+ "SystemV/AST4",
+ "SystemV/AST4ADT",
+ "SystemV/CST6",
+ "SystemV/CST6CDT",
+ "SystemV/EST5",
+ "SystemV/EST5EDT",
+ "SystemV/HST10",
+ "SystemV/MST7",
+ "SystemV/MST7MDT",
+ "SystemV/PST8",
+ "SystemV/PST8PDT",
+ "SystemV/YST9",
+ "SystemV/YST9YDT",
+ "Turkey",
+ "UCT",
+ "Universal",
+ "US/Alaska",
+ "US/Aleutian",
+ "US/Arizona",
+ "US/Central",
+ "US/East-Indiana",
+ "US/Eastern",
+ "US/Hawaii",
+ "US/Indiana-Starke",
+ "US/Michigan",
+ "US/Mountain",
+ "US/Pacific",
+ "US/Samoa",
+ "UTC",
+ "W-SU",
+ "WET",
+ "Zulu"
+ );
+
+ var $dnmode= "";
+ var $uid ="";
+
+ function oxchangeAccount (&$config, $dn= NULL)
+ {
+ plugin::plugin ($config, $dn);
+ for ($i=0;$i<count($this->config->data['TABS']['CONNECTIVITY']);$i++){
+ if($this->config->data['TABS']['CONNECTIVITY'][$i]['CLASS']=='oxchangeAccount') {
+ $this->oxconf=$this->config->data['TABS']['CONNECTIVITY'][$i];
+ break;
+ }
+ }
+
+ /* Setting uid to default */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+
+ $this->dnmode= $this->config->current['DNMODE'];
+ if(isset($this->attrs[$this->dnmode][0])){
+ $this->dnModeValue = $this->attrs[$this->dnmode][0];
+ }
+ }
+
+ function execute()
+ {
+ /* Call parent execute */
+ //plugin::execute();
+
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ $display="";
+
+ /* Show main page */
+ $smarty= get_smarty();
+
+ if (function_exists("pg_connect")){
+ $smarty->assign("pg", true);
+ }else{
+ $smarty->assign("pg", false);
+ }
+
+ /* Load attributes */
+ foreach($this->attributes as $val){
+ $smarty->assign("$val", $this->$val);
+ }
+ if ($this->is_account){
+ $smarty->assign("oxchangeState", "checked");
+ $smarty->assign("oxState", "");
+ } else {
+ $smarty->assign("oxchangeState", "");
+ $smarty->assign("oxState", "disabled");
+ }
+
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $key => $desc){
+ $smarty->assign($key."ACL",$this->getacl($key,$this->ReadOnly));
+ $smarty->assign($key."_W",$this->acl_is_writeable($key));
+ }
+
+ if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) ){
+ $smarty->assign('oxchangeAccountACL', "");
+ }else{
+ $smarty->assign('oxchangeAccountACL', " disabled ");
+ }
+
+ $smarty->assign("timezones", $this->timezones);
+
+
+ if ($this->parent !== NULL){
+ $smarty->assign("tabbed", 1);
+ }else{
+ $smarty->assign("tabbed", 0);
+ }
+
+ /* Trying to open a Postgresql Database Server */
+ if (function_exists("pg_connect")){
+ if(isset($this->oxconf["PGUSER"]) and isset($this->oxconf["PGHOST"]) and isset($this->oxconf["PGDBNAME"]) and isset($this->oxconf["PGPASSWD"])){
+ $pgcon = @pg_connect("host=".$this->oxconf["PGHOST"]." user=".$this->oxconf["PGUSER"]." password=".$this->oxconf["PGPASSWD"]." dbname=".$this->oxconf["PGDBNAME"]);
+ if (! $pgcon){
+ $smarty->assign("pg", false);
+ }
+ }else{
+ $smarty->assign("pg", false);
+ }
+ }else{
+ $smarty->assign("pg", false);
+ }
+
+ $display.= $smarty->fetch (get_template_path('oxchange.tpl', TRUE, dirname(__FILE__)));
+ return ($display);
+ }
+
+ function remove_from_parent()
+ {
+ if(!$this->acl_is_removeable()) return;
+ $this->attrs[$this->dnmode][0] = $this->dnModeValue;
+ $sqldeluser=array(
+ "delete from prg_notes where (user_right like '".$this->attrs[$this->dnmode][0]."') and (group_right like 's')",
+ "delete from prg_documents_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_documents_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_docufolders_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_docufolders_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_date_rights where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_date_notification where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_dates_members where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_knowledge_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_knowledge_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_knowledge_folder_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_knowledge_folder_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_pin_board_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_pin_board_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_bookmarks_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_bookmarks_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_bookmarks_folder_read where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_bookmarks_folder_mod where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_tasks_rights where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_tasks_notification where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_tasks_members where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_projects_rights where (user_right like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_projects_notification where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from prg_projects_members where (member_uid like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from oxfolder_permissions where (entity like '".$this->attrs[$this->dnmode][0]."') AND ((role = 256) OR (role = 1024))",
+ "delete from oxfolder_standardfolders where owner like '".$this->attrs[$this->dnmode][0]."'",
+ "delete from prg_forum_read where user_right = '".$this->attrs[$this->dnmode][0]."'",
+ "delete from prg_forum_mod where user_right = '".$this->attrs[$this->dnmode][0]."'",
+ "delete from prg_forum_abo where user_right = '".$this->attrs[$this->dnmode][0]."'",
+ "delete from prg_forum_seen where username = '".$this->attrs[$this->dnmode][0]."'",
+ "delete from sys_holiday where (userid like '".$this->attrs[$this->dnmode][0]."')",
+ "delete from usr_holiday where (userid like '".$this->attrs[$this->dnmode][0]."')");
+
+ /* Trying to open a Postgresql Database Server */
+ if (function_exists("pg_connect")){
+ if(isset($this->oxconf["PGUSER"]) and
+ isset($this->oxconf["PGHOST"]) and
+ isset($this->oxconf["PGDBNAME"]) and
+ isset($this->oxconf["PGPASSWD"])){
+ $pgcon = @pg_connect("host=".$this->oxconf["PGHOST"]." user=".$this->oxconf["PGUSER"]." password=".$this->oxconf["PGPASSWD"]." dbname=".$this->oxconf["PGDBNAME"]);
+ if (! $pgcon){
+ msg_dialog::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "Open-Xchange"), ERROR_DIALOG);
+ return;
+ }
+ }else{
+ msg_dialog::display(_("Configuration error"), sprintf(_("%s database configuration is missing!"), "Open-Xchange"), ERROR_DIALOG);
+ return;
+ }
+ }else{
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "postgresql"), ERROR_DIALOG);
+ return;
+ }
+
+ plugin::remove_from_parent();
+ $ldap= $this->config->get_ldap_link();
+
+ if($ldap->dn_exists("ou=addr,".$this->dn)){
+ $ldap->rmdir_recursive("ou=addr,".$this->dn);
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/oxchange addressbook account with dn '%s' failed."),$this->dn));
+ }
+
+ $ldap->cd($this->dn);
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/oxchange addressbook account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ $this->postremove(array("uid" => $this->uid));
+
+ /* Finally remove data from postgresql server */
+ foreach ($sqldeluser as $sqls){
+ @pg_exec($pgcon,$sqls);
+ }
+ pg_close();
+ }
+
+ /* Save data to object */
+ function save_object()
+ {
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['oxchange'])){
+ if (!$this->is_account && $_POST['oxchange'] == "B") {
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+
+ /* Get objects */
+ foreach(array("OXTimeZone","OXTaskDays","OXAppointmentDays") as $name) {
+ if($this->acl_is_writeable($name) && isset($_POST[$name])){
+ $this->$name = $_POST[$name];
+ }
+ }
+
+ if (isset($_POST["oxchangeStatus"])){
+ $this->oxchangeStatus = "disabled";
+ } else {
+ $this->oxchangeStatus = "enabled";
+ }
+ }
+
+
+ /* Save to LDAP */
+ function save()
+ {
+
+ $needupdate=TRUE;
+ $istemplate=FALSE;
+
+ /*First at all, we must check if this is new or is updated */
+ /*Also check is we have a template, if is a template, is a new user */
+ if (isset($this->attrs['objectClass'])){
+ foreach ($this->attrs['objectClass'] as $object){
+ if($object=="OXUserObject") $needupdate=FALSE;
+ if($object=="gosaUserTemplate") $istemplate=TRUE;
+ }
+ }
+
+ $uidarray=array();
+ preg_match("/^(\w+(?=\=))=((\w|\s|\.)+(?=\,)),.*/",$this->dn,$uidarray);
+ $uid=$uidarray[2];
+ if (trim($uid) == "") {
+ msg_dialog::display(_("Error"), _("Open-Xchange account name is invalid!"), ERROR_DIALOG);
+ return;
+ }
+
+ if ($istemplate) $needupdate=TRUE;
+
+ if($needupdate){
+ /* Trying to open a Postgresql Database Server */
+ if (function_exists("pg_connect")){
+ if(isset($this->oxconf["PGUSER"]) and isset($this->oxconf["PGHOST"]) and isset($this->oxconf["PGDBNAME"]) and isset($this->oxconf["PGPASSWD"])){
+ $pgcon = @pg_connect("host=".$this->oxconf["PGHOST"]." user=".$this->oxconf["PGUSER"]." password=".$this->oxconf["PGPASSWD"]." dbname=".$this->oxconf["PGDBNAME"]);
+ if (! $pgcon){
+ msg::display(_("Error"), sprintf(_("Cannot connect to %s database!"), "Open-Xchange"), ERROR_DIALOG);
+ return;
+ }
+ }else{
+ msg_dialog::display(_("Configuration error"), sprintf(_("%s database configuration is missing!"), "Open-Xchange"), ERROR_DIALOG);
+ return;
+ }
+ }else{
+ msg_dialog::display(_("Configuration error"), sprintf(_("Missing %s PHP extension!"), "postgresql"), ERROR_DIALOG);
+ return;
+ }
+ }
+
+ plugin::save();
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/oxchange account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ $this->postcreate(array("uid" => $this->uid));
+
+ if($needupdate){
+ $ldap->create_missing_trees("ou=addr,".$this->dn);
+ show_ldap_error($ldap->get_error(), sprintf(_("Creating of user/oxchange account with dn '%s' failed."),$this->dn));
+ /* Finally save data to postgresql server */
+ pg_set_client_encoding ("UNICODE");
+ $nv = "SELECT nextval ('serial_id')";
+ $ot = "insert into oxfolder_tree (fuid, parent, fname, module, type, owner, creator, creating_date, created_from, changing_date, changed_from) VALUES (%d, 1, '%s', '%s', 'private', '%s', '%s', 'now', 'System', 'now', 'System')";
+ $op = "INSERT INTO oxfolder_permissions (puid, pid, role, entity, sealed, fp, orp, owp, odp) VALUES (%d, %d, 32768, '%s', 0, 128, 128, 128, 128)";
+ $os = "insert into oxfolder_standardfolders (owner,module_calendar,module_contact,module_task) VALUES ('%s',%d,%d,%d)";
+ $ugr= "INSERT INTO usr_general_rights SELECT creating_date, created_from, changing_date, changed_from,text('%s'), addr_u, addr_r, addr_d, cont_u, cont_r, cont_d, data_u, data_r, data_d, serie_u, serie_r, serie_d, task_u, task_r, task_d, refer, proj_u, proj_r, proj_d, dfolder_u, dfolder_r, dfolder_d, doc_u, doc_r, doc_d, knowl_u, knowl_r, knowl_d, bfolder_u, bfolder_r, bfolder_d, bookm_u, bookm_r, bookm_d, pin_u, pin_r, pin_d, forum_n, fentrie_n, setup, pin_public, internal, int_groups, kfolder_u, kfolder_r, kfolder_d, webmail FROM sys_gen_rights_template WHERE login LIKE 'default_template'";
+
+ $error = FALSE;
+ $res=@pg_exec($pgcon,$nv);
+
+ if(!$res){
+ $error = TRUE;
+ }else{
+ $calendarid=pg_fetch_row($res);
+ pg_freeresult($res);
+
+ $q=sprintf($ot,$calendarid[0],'My Appointments','calendar',$uid,$uid);
+ @pg_exec($pgcon,$q);
+ }
+
+ $res=@pg_exec($pgcon,$nv);
+
+ if(!$res){
+ $error = TRUE;
+ }else{
+ $nid=pg_fetch_row($res);
+ pg_freeresult($res);
+
+ $q=sprintf($op,$nid[0],$calendarid[0],$uid);
+ @pg_exec($pgcon,$q);
+ }
+
+ $res=@pg_exec($pgcon,$nv);
+ if(!$res){
+ $error = TRUE;
+ }else{
+ $contactsid=pg_fetch_row($res);
+ pg_freeresult($res);
+
+ $q=sprintf($ot,$contactsid[0],'My Contacts','contact',$uid,$uid);
+ @pg_exec($pgcon,$q);
+ }
+
+ $res=@pg_exec($pgcon,$nv);
+ if(!$res){
+ $error = TRUE;
+ }else{
+ $nid=pg_fetch_row($res);
+ pg_freeresult($res);
+
+ $q=sprintf($op,$nid[0],$contactsid[0],$uid);
+ @pg_exec($pgcon,$q);
+ }
+
+ $res=@pg_exec($pgcon,$nv);
+ if(!$res){
+ $error = TRUE;
+ }else{
+ $tasksid=pg_fetch_row($res);
+ pg_freeresult($res);
+
+ $q=sprintf($ot,$tasksid[0],'My Tasks','task',$uid,$uid);
+ @pg_exec($pgcon,$q);
+ }
+
+ $res=@pg_exec($pgcon,$nv);
+ if(!$res){
+ $error = TRUE;
+ }else{
+ $nid=pg_fetch_row($res);
+ pg_freeresult($res);
+
+ $q=sprintf($op,$nid[0],$tasksid[0],$uid);
+ @pg_exec($pgcon,$q);
+
+ $q=sprintf($os,$uid,$calendarid[0],$contactsid[0],$tasksid[0]);
+ @pg_exec($pgcon,$q);
+
+ $q=sprintf($ugr,$uid);
+ @pg_exec($pgcon,$q);
+ }
+
+ @pg_close($pgcon);
+
+ if($error){
+ msg_dialog::display(_("Error"), _("Cannot save Open-Xchange account!"), ERROR_DIALOG);
+ }
+ }
+ }
+
+
+ /* Return plugin informations for acl handling */
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Open-Xchange"),
+ "plDescription" => _("Open-Xchange account settings")." : <u>"._("Connectivity addon")."</u>",
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 27, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array(
+ "OXAppointmentDays" => _("OXAppointmentDays"),
+ "OXTaskDays" => _("OXTaskDays"),
+ "OXTimeZone" => _("OXTimeZone"))
+ ));
+ }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/openxchange/personal/connectivity/openxchange/oxchange.tpl b/gosa-plugins/openxchange/personal/connectivity/openxchange/oxchange.tpl
--- /dev/null
@@ -0,0 +1,84 @@
+{if !$pg}
+<h2>{t}Open-Xchange Account{/t} - {t}disabled, no Postgresql support detected. Or the specified database can't be reached{/t}</h2>
+{else}
+<h2>
+<input type="checkbox" name="oxchange" value="B"
+ {$oxchangeState} {$oxchangeAccountACL}
+ onCLick="
+ {if $OXAppointmentDays_W}
+ changeState('OXAppointmentDays');
+ {/if}
+ {if $OXTaskDays_W}
+ changeState('OXTaskDays');
+ {/if}
+ {if $OXTimeZone_W}
+ changeState('OXTimeZone');
+ {/if}
+ ">
+{t}Open-Xchange account{/t}</h2>
+
+
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
+
+ <!-- Headline container -->
+ <tr>
+ <td style="width:50%; vertical-align:top;">
+ <table summary="" style="margin-left:4px;">
+ <tr>
+ <td colspan=2 style="vertical-align:top;">
+ <b>{t}Remember{/t}</b>
+ </td>
+ </tr>
+ <tr>
+ <td><LABEL for="OXAppointmentDays">{t}Appointment Days{/t}</LABEL></td>
+ <td>
+
+{render acl=$OXAppointmentDaysACL}
+<input name="OXAppointmentDays" id="OXAppointmentDays" size=7 maxlength=7 value="{$OXAppointmentDays}" {$oxState} >
+{/render}
+ {t}days{/t}</td>
+ </tr>
+ <tr>
+ <td><LABEL for="OXTaskDays">{t}Task Days{/t}</LABEL></td>
+ <td>
+
+{render acl=$OXTaskDaysACL}
+<input name="OXTaskDays" id="OXTaskDays" size=7 maxlength=7 value="{$OXTaskDays}" {$oxState} >
+{/render}
+
+ {t}days{/t}
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td rowspan=2 style="border-left:1px solid #A0A0A0">
+
+ </td>
+ <td style="vertical-align:top;">
+ <table summary="">
+ <tr>
+ <td colspan=2 style="vertical-align:top;">
+ <b>{t}User Information{/t}</b>
+ </td>
+ </tr>
+ <tr>
+ <td><LABEL for="OXTimeZone">{t}User Timezone{/t}</LABEL></td>
+ <td>
+
+{render acl=$OXTimeZoneACL}
+<select size="1" name="OXTimeZone" id="OXTimeZone" {$oxState} >
+ {html_options values=$timezones output=$timezones selected=$OXTimeZone}
+ </select>
+{/render}
+
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+{/if}
diff --git a/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc b/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc
--- /dev/null
@@ -0,0 +1,222 @@
+<?php
+class phpgwAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline= "PHPGroupware";
+ var $plDescription= "This does something";
+
+ /* GW attributes */
+ var $phpgwAccountExpires= "-1";
+ var $phpgwAccountStatus= "A";
+ var $phpgwAccountType= "u";
+
+ /* attribute list for save action */
+ var $attributes= array("phpgwAccountExpires", "phpgwAccountStatus", "phpgwAccountType");
+ var $objectclasses= array("phpgwAccount");
+ var $ReadOnly = false;
+
+ var $uid = "";
+ var $view_logged = FALSE;
+
+ var $multiple_support = TRUE;
+
+ function phpgwAccount (&$config, $dn= NULL)
+ {
+ plugin::plugin ($config, $dn);
+
+ /* Setting uid to default */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+ }
+
+ function execute()
+ {
+ /* Call parent execute */
+// plugin::execute();
+
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ /* Show tab dialog headers */
+ $display= "";
+
+ /* Show main page */
+ $smarty= get_smarty();
+
+ /* Load attributes */
+ foreach($this->attributes as $val){
+ $smarty->assign("$val", $this->$val);
+ }
+ if ($this->is_account){
+ $smarty->assign("phpgwState", "checked");
+ } else {
+ $smarty->assign("phpgwState", "");
+ }
+
+ $smarty->assign('phpgwAccountACL', $this->getacl("",$this->ReadOnly));
+ $smarty->assign("multiple_support",$this->multiple_support_active);
+ $smarty->assign("use_phpgw",in_array("phpgw",$this->multi_boxes));
+ $display.= $smarty->fetch (get_template_path('phpgw.tpl', TRUE, dirname(__FILE__)));
+ return ($display);
+ }
+
+ function remove_from_parent()
+ {
+ if($this->acl_is_removeable()){
+ /* Cancel if there's nothing to do here */
+ if (!$this->initially_was_account){
+ return;
+ }
+
+ plugin::remove_from_parent();
+ $ldap= $this->config->get_ldap_link();
+
+ $ldap->cd($this->dn);
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPgw account with dn '%s' failed."),$this->dn));
+
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events('remove',array("uid" => $this->uid));
+ }
+ }
+
+
+ /* Save data to object */
+ function save_object()
+ {
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['phpgw'])){
+ if (!$this->is_account && $_POST['phpgw'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+
+ plugin::save_object();
+ if (isset($_POST["phpgwStatus"])){
+ $this->phpgwStatus = "disabled";
+ } else {
+ $this->phpgwStatus = "enabled";
+ }
+ }
+
+
+ /* Save to LDAP */
+ function save()
+ {
+ plugin::save();
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PHPgw account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("modify",array("uid" => $this->uid));
+ }
+ } else {
+ $this->handle_post_events("add",array("uid" => $this->uid));
+ }
+
+ }
+
+
+ /* Return plugin informations for acl handling */
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("PHP GW"),
+ "plDescription" => _("PHP GW account settings")." : <u>"._("Connectivity addon")."</u>",
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 24, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array()
+ ));
+ }
+
+
+ function multiple_save_object()
+ {
+ if (isset($_POST['connectivityTab'])){
+ plugin::multiple_save_object();
+
+ /* Do we need to flip is_account state? */
+ if(isset($_POST['use_phpgw'])){
+ $this->multi_boxes[] = "phpgw";
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['phpgw'])){
+ if (!$this->is_account && $_POST['phpgw'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ function get_multi_edit_values()
+ {
+ $ret = plugin::get_multi_edit_values();
+ if(in_array("phpgw",$this->multi_boxes)){
+ $ret['is_account'] = $this->is_account;
+ }
+ return($ret);
+ }
+
+ function set_multi_edit_values($values)
+ {
+ plugin::set_multi_edit_values($values);
+ if(isset($values['is_account'])){
+ $this->is_account = $values['is_account'];
+ }
+ }
+
+ function init_multiple_support($attrs,$all)
+ {
+ plugin::init_multiple_support($attrs,$all);
+ if(isset($attrs['objectClass']) && in_array("phpgwAccount",$attrs['objectClass'])){
+ $this->is_account = TRUE;
+ }
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/phpgw/personal/connectivity/phpgw/phpgw.tpl b/gosa-plugins/phpgw/personal/connectivity/phpgw/phpgw.tpl
--- /dev/null
@@ -0,0 +1,7 @@
+<h2>
+{render acl=$phpgwAccountACL checkbox=$multiple_support checked=$use_phpgw}
+ <input type="checkbox" name="phpgw" value="B" {$phpgwState} class="center">
+{/render}
+ {t}PHPGroupware account{/t}
+
+</h2>
diff --git a/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc b/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc
--- /dev/null
@@ -0,0 +1,175 @@
+<?php
+
+/*
+ This code is part of GOsa (https://gosa.gonicus.de)
+ Copyright (C) 2005 Guillaume Delecourt
+ Copuright (C) 2005 Benoit Mortier
+
+ 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
+*/
+
+
+class phpscheduleitAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline= "PHPscheduleit";
+ var $plDescription= "This does something";
+
+ /* attribute list for save action */
+ var $attributes= array();
+ var $objectclasses= array("phpscheduleitAccount");
+ var $ReadOnly =false;
+ var $view_logged = FALSE;
+
+ function phpscheduleitAccount (&$config, $dn= NULL)
+ {
+ plugin::plugin ($config, $dn);
+ }
+
+ function execute()
+ {
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ /* Show tab dialog headers */
+ $display= "";
+
+ /* Show main page */
+ $smarty= get_smarty();
+
+ if ($this->is_account){
+ $smarty->assign("phpscheduleitState", "checked");
+ } else {
+ $smarty->assign("phpscheduleitState", "");
+ $smarty->assign("wstate", "disabled");
+ }
+
+ if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) {
+ $smarty->assign('gosaphpscheduleitACL', "");
+ }else{
+ $smarty->assign('gosaphpscheduleitACL', " disabled ");
+ }
+
+ $display.= $smarty->fetch (get_template_path('phpscheduleit.tpl', TRUE, dirname(__FILE__)));
+ return ($display);
+ }
+
+ function remove_from_parent()
+ {
+ /* Cancel if there's nothing to do here */
+ if ($this->acl_is_removeable()){
+
+ plugin::remove_from_parent();
+ $ldap= $this->config->get_ldap_link();
+
+ $ldap->cd($this->dn);
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPscheduleit account with dn '%s' failed."),$this->dn));
+
+ if($this->is_account){
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events('remove',array("uid" => $this->uid));
+ }
+ }
+
+
+ /* Save data to object */
+ function save_object()
+ {
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['phpscheduleit'])){
+ if (!$this->is_account && $_POST['phpscheduleit'] == "B"){
+ if($this->acl_is_createable()) {
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+
+ plugin::save_object();
+ if (isset($_POST["phpscheduleitStatus"])){
+ $this->pptpStatus = "disabled";
+ } else {
+ $this->pptpStatus = "enabled";
+ }
+ }
+
+
+ /* Save to LDAP */
+ function save()
+ {
+ plugin::save();
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PHPscheduleit account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("modify",array("uid" => $this->uid));
+ }
+ } else {
+ $this->handle_post_events("add",array("uid" => $this->uid));
+ }
+
+ }
+
+
+ /* Return plugin informations for acl handling
+ #FIXME This is only an enable/disable checkbox for this account, there is possibly a better solution available later */
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("PHP Schedule it"),
+ "plDescription" => _("PHP Schedule it settings")." : <u>"._("Connectivity addon")."</u>",
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 29, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array()
+ ));
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/phpscheduleit.tpl b/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/phpscheduleit.tpl
--- /dev/null
@@ -0,0 +1,4 @@
+<h2>
+ <input type="checkbox" name="phpscheduleit" value="B" {$phpscheduleitState} {$gosaphpscheduleitACL}>
+ {t}PHPscheduleit account{/t}
+</h2>
diff --git a/gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc b/gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc
--- /dev/null
@@ -0,0 +1,188 @@
+<?php
+
+/*
+ This code is part of GOsa (https://gosa.gonicus.de)
+ Copyright (C) 2005 Guillaume Delecourt
+ Copyright (C) 2005 Benoit Mortier
+
+ 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
+ */
+
+class pptpAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline= "PPTP";
+ var $plDescription= "This does something";
+
+ /* attribute list for save action */
+ var $attributes= array();
+ var $objectclasses= array("pptpServerAccount");
+
+ var $ReadOnly = false;
+ var $view_logged = FALSE;
+ var $uid ="";
+
+ function pptpAccount (&$config, $dn= NULL)
+ {
+ plugin::plugin ($config, $dn);
+
+ /* Setting uid to default */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+ }
+
+ function execute()
+ {
+ /* Call parent execute */
+ // plugin::execute();
+
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ /* Show tab dialog headers */
+ $display= "";
+
+ /* Show main page */
+ $smarty= get_smarty();
+
+ if ($this->is_account){
+ $smarty->assign("pptpState", "checked");
+ } else {
+ $smarty->assign("pptpState", "");
+ $smarty->assign("wstate", "disabled");
+ }
+
+ if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) {
+ $smarty->assign('gosapptpACL', "");
+ }else{
+ $smarty->assign('gosapptpACL', " disabled ");
+ }
+
+ $display.= $smarty->fetch (get_template_path('pptp.tpl', TRUE, dirname(__FILE__)));
+ return ($display);
+ }
+
+ function remove_from_parent()
+ {
+ if($this->acl_is_removeable()){
+ /* Cancel if there's nothing to do here */
+ if (!$this->initially_was_account){
+ return;
+ }
+
+ plugin::remove_from_parent();
+ $ldap= $this->config->get_ldap_link();
+
+ $ldap->cd($this->dn);
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PPTP account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events('remove',array("uid" => $this->uid));
+ }
+ }
+
+
+ /* Save data to object */
+ function save_object()
+ {
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['pptp'])){
+ if (!$this->is_account && $_POST['pptp'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+
+ plugin::save_object();
+ if (isset($_POST["pptpStatus"])){
+ $this->pptpStatus = "disabled";
+ } else {
+ $this->pptpStatus = "enabled";
+ }
+ }
+
+
+ /* Save to LDAP */
+ function save()
+ {
+ if($this->acl_is_createable()){
+ plugin::save();
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/PPTP account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("modify",array("uid" => $this->uid));
+ }
+ } else {
+ $this->handle_post_events("add",array("uid" => $this->uid));
+ }
+ }
+ }
+
+
+ /* Return plugin informations for acl handling */
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("PPTP"),
+ "plDescription" => _("PPTP account")." : <u>"._("Connectivity addon")."</u>",
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 28, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array()
+ ));
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/pptp/personal/connectivity/pptp/pptp.tpl b/gosa-plugins/pptp/personal/connectivity/pptp/pptp.tpl
--- /dev/null
@@ -0,0 +1,4 @@
+<h2>
+ <input type="checkbox" name="pptp" value="B" {$pptpState} {$gosapptpACL}>
+ {t}PPTP account{/t}
+</h2>
diff --git a/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc b/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc
--- /dev/null
@@ -0,0 +1,323 @@
+<?php
+
+class pureftpdAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline= "FTP";
+ var $plDescription= "This does something";
+
+ /* FTP attributes */
+ var $FTPQuotaFiles = 0;
+ var $FTPQuotaMBytes = 0;
+ var $FTPUploadRatio = 0;
+ var $FTPDownloadRatio = 0;
+ var $FTPUploadBandwidth = 0;
+ var $FTPDownloadBandwidth = 0;
+ var $FTPStatus = "enabled";
+ var $FTPuid = "";
+ var $FTPgid = "";
+
+ var $uid = "";
+
+ /* attribute list for save action */
+ var $attributes= array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio",
+ "FTPUploadBandwidth","FTPDownloadBandwidth","FTPStatus","FTPuid","FTPgid");
+ var $objectclasses= array("PureFTPdUser");
+ var $ReadOnly;
+ var $view_logged = FALSE;
+
+ var $multiple_support=TRUE;
+
+ function pureftpdAccount (&$config, $dn= NULL, $parent= NULL)
+ {
+ plugin::plugin ($config, $dn, $parent);
+
+ /* Setting uid to default */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+ }
+
+ function execute()
+ {
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ /* Show tab dialog headers */
+ $display= "";
+
+ /* Show main page */
+ $smarty= get_smarty();
+
+ /* Load attributes */
+ foreach($this->attributes as $val){
+ $smarty->assign("$val", $this->$val);
+ }
+
+
+ $tmp = $this->plInfo();
+ $changeState = "";
+ if($this->multiple_support_active){
+
+ /* We do not need the attribute grey out in multiple edit */
+ foreach($tmp['plProvidedAcls'] as $key => $desc){
+ $smarty->assign($key."ACL", $this->getacl($key,$this->ReadOnly));
+ }
+ if ($this->is_account){
+ $smarty->assign("pureftpdState", "checked");
+ }else{
+ $smarty->assign("pureftpdState", "");
+ }
+ $smarty->assign("fstate", "");
+ $smarty->assign("changeState","");
+
+ }else{
+ foreach($tmp['plProvidedAcls'] as $key => $desc){
+ $smarty->assign($key."ACL", $this->getacl($key,$this->ReadOnly));
+ $smarty->assign($key."_W", $this->acl_is_writeable($key,$this->ReadOnly));
+
+ if($this->acl_is_writeable($key)){
+ $changeState.= " changeState('".$key."'); \n";
+ }
+ }
+ $smarty->assign("changeState",$changeState);
+
+
+ $smarty->assign("fstate", "");
+ if ($this->is_account){
+ $smarty->assign("pureftpdState", "checked");
+ $smarty->assign("fstate", "");
+ } else {
+ $smarty->assign("pureftpdState", "");
+ if(session::get('js')==1){
+ if($this->acl!="#none#")
+ $smarty->assign("fstate", "disabled");
+ }else{
+ $smarty->assign("fstate", "");
+ }
+ }
+ }
+
+ foreach($this->attributes as $attr){
+ if(in_array($attr,$this->multi_boxes)){
+ $smarty->assign("use_".$attr,TRUE);
+ }else{
+ $smarty->assign("use_".$attr,FALSE);
+ }
+ }
+ $smarty->assign("use_pureftpd",in_array("pureftpd",$this->multi_boxes));
+ $smarty->assign("multiple_support",$this->multiple_support_active);
+ $smarty->assign("FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
+ $smarty->assign('pureftpdACL', $this->getacl("",$this->ReadOnly));
+ $display.= $smarty->fetch (get_template_path('pureftpd.tpl', TRUE, dirname(__FILE__)));
+ return ($display);
+ }
+
+ function remove_from_parent()
+ {
+ /* Cancel if there's nothing to do here */
+ if ((!$this->initially_was_account) || (!$this->acl_is_removeable())){
+ return;
+ }
+
+ plugin::remove_from_parent();
+ $ldap= $this->config->get_ldap_link();
+
+ $ldap->cd($this->dn);
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/pureftpd account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events('remove',array("uid" => $this->uid));
+ }
+
+
+ /* Save data to object */
+ function save_object()
+ {
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['pureftpd'])){
+ if (!$this->is_account && $_POST['pureftpd'] == "B"){
+ $this->is_account= TRUE;
+ }
+ } else {
+ $this->is_account= FALSE;
+ }
+
+ plugin::save_object();
+
+ $old= $this->FTPStatus;
+ if (isset($_POST["FTPStatus"])){
+ $this->FTPStatus = "disabled";
+ } else {
+ $this->FTPStatus = "enabled";
+ }
+ $this->is_modified= ($old != $this->FTPStatus)?TRUE:$this->is_modified;
+
+ /* Ensure that these vars are numeric. Values starting with 0 like '0123' cause ldap errors */
+ foreach(array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio","FTPUploadBandwidth","FTPDownloadBandwidth") as $testVar){
+ $this->$testVar = (int) ($this->$testVar);
+ }
+
+
+ }
+ }
+
+
+ /* Check values */
+ function check()
+ {
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
+ /* Check for positive integer values */
+ if ($this->is_account){
+
+ if($this->acl_is_writeable("FTPUploadBandwidth") && !tests::is_id($this->FTPUploadBandwidth)){
+ $message[]= _("Value specified as 'Upload bandwidth' is not valid.");
+ }
+ if($this->acl_is_writeable("FTPDownloadBandwidth") && !tests::is_id($this->FTPDownloadBandwidth)){
+ $message[]= _("Value specified as 'Download bandwidth' is not valid.");
+ }
+
+ if($this->acl_is_writeable("FTPQuotaFiles") && !tests::is_id($this->FTPQuotaFiles)){
+ $message[]= _("Value specified as 'Quota files' is not valid.");
+ }
+ if($this->acl_is_writeable("FTPQuotaMBytes") && !tests::is_id($this->FTPQuotaMBytes)){
+ $message[]= _("Value specified as 'Quota size' is not valid.");
+ }
+ if($this->acl_is_writeable("FTPUploadRatio") && !tests::is_id($this->FTPUploadRatio)){
+ $message[]= _("Value specified as 'Upload ratio' is not valid.");
+ }
+ if($this->acl_is_writeable("FTPDownloadRatio") && !tests::is_id($this->FTPDownloadRatio)){
+ $message[]= _("Value specified as 'Download ratio' is not valid.");
+ }
+ }
+
+ return $message;
+ }
+
+
+ /* Save to LDAP */
+ function save()
+ {
+ plugin::save();
+
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $key => $desc){
+ if(!$this->acl_is_writeable($key)){
+ unset($this->attrs[$key]);
+ }
+ }
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/pureftpd account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("modify",array("uid" => $this->uid));
+ }
+ } else {
+ $this->handle_post_events("add",array("uid" => $this->uid));
+ }
+
+ }
+
+
+ /* Return plugin informations for acl handling
+ #FIME There possibly some attributes that can be combined to one acl. */
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Ftp"),
+ "plDescription" => _("Pure ftp account")." : <u>"._("Connectivity addon")."</u>",
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 22, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array(
+ "FTPQuotaFiles" => _("Quota files"),
+ "FTPUploadRatio" => _("Upload ratio"),
+ "FTPQuotaMBytes" => _("Quota MBytes"),
+ "FTPDownloadRatio" => _("Download ratio"),
+ "FTPUploadBandwidth" => _("Upload bandwith"),
+ "FTPDownloadBandwidth" => _("Download bandwith"),
+ "FTPStatus" => _("Status"))
+ ));
+ }
+
+ function multiple_save_object()
+ {
+ if (isset($_POST['connectivityTab'])){
+ plugin::multiple_save_object();
+ if(isset($_POST['use_pureftpd'])){
+ $this->multi_boxes[] = "pureftpd";
+ }
+ $this->save_object();
+ }
+ }
+
+ function get_multi_init_values()
+ {
+ $ret = plugin::get_multi_init_values();
+ $ret['is_account'] = $this->is_account;
+ return($ret);
+ }
+
+ function init_multiple_support($attrs,$attr)
+ {
+ plugin::init_multiple_support($attrs,$attr);
+
+ if(isset($attrs['is_account'])){
+ $this->is_account = $attrs['is_account'];
+ }
+ }
+
+ function get_multi_edit_values()
+ {
+ $ret = plugin::get_multi_edit_values();
+ if(in_array("pureftpd",$this->multi_boxes)){
+ $ret['is_account'] = $this->is_account;
+ }
+ return($ret);
+ }
+
+ function set_multi_edit_values($values)
+ {
+ plugin::set_multi_edit_values($values);
+ if(isset($values['is_account'])){
+ $this->is_account = $values['is_account'];
+ }
+ }
+
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/pureftpd/personal/connectivity/pureftpd/pureftpd.tpl b/gosa-plugins/pureftpd/personal/connectivity/pureftpd/pureftpd.tpl
--- /dev/null
@@ -0,0 +1,114 @@
+<h2>
+ {render acl=$pureftpdACL checkbox=$multiple_support checked=$use_pureftpd}
+ <input type="checkbox" name="pureftpd" value="B" {$pureftpdState}
+ onclick="{$changeState}" class="center">
+ {/render}
+ {t}FTP account{/t}
+</h2>
+
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
+
+ <!-- Headline container -->
+ <tr>
+ <td style="width:50%; vertical-align:top;">
+ <table summary="" style="margin-left:4px;">
+ <tr>
+ <td colspan=2 style="vertical-align:top;">
+ <b>{t}Bandwidth{/t}</b>
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Upload bandwidth{/t}</td>
+ <td>
+{render acl=$FTPUploadBandwidthACL checkbox=$multiple_support checked=$use_FTPUploadBandwidth}
+<input name="FTPUploadBandwidth" id="FTPUploadBandwidth" size=7 maxlength=7 value="{$FTPUploadBandwidth}" {$fstate} >
+{/render}
+ {t}kb/s{/t}</td>
+ </tr>
+ <tr>
+ <td>{t}Download bandwidth{/t}</td>
+ <td>
+{render acl=$FTPDownloadBandwidthACL checkbox=$multiple_support checked=$use_FTPDownloadBandwidth}
+<input name="FTPDownloadBandwidth" id="FTPDownloadBandwidth" size=7 maxlength=7 value="{$FTPDownloadBandwidth}" {$fstate} >
+{/render}
+ {t}kb/s{/t}</td>
+ </tr>
+ </table>
+ </td>
+ <td rowspan=2 style="border-left:1px solid #A0A0A0">
+
+ </td>
+ <td>
+ <table summary="">
+ <tr>
+ <td colspan=2 style="vertical-align:top;">
+ <b>{t}Quota{/t}</b>
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Files{/t}</td>
+ <td>
+{render acl=$FTPQuotaFilesACL checkbox=$multiple_support checked=$use_FTPQuotaFiles}
+<input name="FTPQuotaFiles" id="FTPQuotaFiles" size=7 maxlength=10 value="{$FTPQuotaFiles}" {$fstate} >
+{/render}
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Size{/t}</td>
+ <td>
+{render acl=$FTPQuotaMBytesACL checkbox=$multiple_support checked=$use_FTPQuotaMBytes}
+<input name="FTPQuotaMBytes" id="FTPQuotaMBytes" size=7 maxlength=10 value="{$FTPQuotaMBytes}" {$fstate} >
+{/render}
+ {t}MB{/t}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table summary="" style="margin-left:4px;">
+ <tr>
+ <td colspan=2 style="vertical-align:top;">
+ <b>{t}Ratio{/t}</b>
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Uploaded / downloaded files{/t}</td>
+ <td>
+
+{render acl=$FTPUploadRatioACL checkbox=$multiple_support checked=$use_FTPUploadRatio}
+<input name="FTPUploadRatio" id="FTPUploadRatio" size=5 maxlength=20 value="{$FTPUploadRatio}" {$fstate} >
+{/render}
+ /
+{render acl=$FTPDownloadRatioACL checkbox=$multiple_support checked=$use_FTPDownloadRatio}
+<input name="FTPDownloadRatio" id="FTPDownloadRatio" size=5 maxlength=20 value="{$FTPDownloadRatio}" {$fstate} >
+{/render}
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td>
+ <table summary="">
+ <tr>
+ <td colspan=2 style="vertical-align:top;">
+ <b>{t}Miscellaneous{/t}</b>
+ </td>
+ <tr>
+ <td>
+{render acl=$FTPStatusACL checkbox=$multiple_support checked=$use_FTPStatus}
+<input type=checkbox name="FTPStatus" id="FTPStatus" value="disabled" {$FTPStatus} title="{t}Check to disable FTP Access{/t}" {$fstate} class="center">
+{/render}
+{t}Temporary disable FTP access{/t}</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<!-- Place cursor -->
+<script language="JavaScript" type="text/javascript">
+ <!-- // First input field on page
+ focus_field('FTPUploadBandwidth');
+ -->
+</script>
diff --git a/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc b/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc
--- /dev/null
@@ -0,0 +1,427 @@
+<?php
+class proxyAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline = "Proxy";
+ var $plDescription= "This does something";
+
+ /* Proxy attributes */
+ var $gosaProxyAcctFlags = "[N ]";
+ var $gosaProxyID = "";
+ var $gosaProxyWorkingStart= 420;
+ var $gosaProxyWorkingStop = 1020;
+ var $gosaProxyQuota = "5g";
+ var $gosaProxyQuotaPeriod = "m";
+
+ /* attribute list for save action */
+ var $attributes = array("gosaProxyID", "gosaProxyAcctFlags", "gosaProxyWorkingStart",
+ "gosaProxyWorkingStop", "gosaProxyQuota", "gosaProxyQuotaPeriod");
+
+ var $objectclasses = array("gosaProxyAccount");
+ var $ReadOnly = false;
+ var $uid = "";
+ var $view_logged = FALSE;
+ var $multiple_support = TRUE;
+
+ /*! \brief Initialize proxy acoount
+ @param $config GOsa configuration object
+ @param $dn Object dn
+ */
+ public function proxyAccount (&$config, $dn= NULL)
+ {
+ plugin::plugin ($config, $dn);
+
+ /* Setting uid to default */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+ }
+
+
+ /*! \brief Create html output for this class
+ */
+ public function execute()
+ {
+ /* Call parent execute */
+ plugin::execute();
+
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ $display= "";
+ $smarty= get_smarty();
+
+ /* Assign radio boxes */
+ foreach (array("F", "T", "B", "N") as $val){
+ if (preg_match("/".$val."/",$this->gosaProxyAcctFlags)){
+ $smarty->assign("filter$val", "checked");
+ $smarty->assign($val."state", "");
+ } else {
+ $smarty->assign("filter$val", "");
+ if(session::get('js')==1){
+ $smarty->assign($val."state", "disabled");
+ }else{
+ $smarty->assign($val."state", "");
+ }
+ }
+ }
+
+ /* Assign ACLs */
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $acl => $desc){
+ $smarty->assign($acl."ACL",$this->getacl($acl,$this->ReadOnly));
+ $smarty->assign($acl."_W",$this->acl_is_writeable($acl,$this->ReadOnly));
+ }
+
+ /* Assign working time */
+ $smarty->assign("starthour" ,($this->gosaProxyWorkingStart / 60));
+ $smarty->assign("startminute", ($this->gosaProxyWorkingStart % 60));
+ $smarty->assign("stophour", ($this->gosaProxyWorkingStop / 60));
+ $smarty->assign("stopminute", ($this->gosaProxyWorkingStop % 60));
+ $hours= array();
+ for($i=0; $i<24; $i++){
+ $hours[]= sprintf("%02d",$i);
+ }
+ $smarty->assign("hours", $hours);
+ $smarty->assign("minutes", array("00","15","30","45"));
+
+ /* Assign quota values */
+ $smarty->assign("quota_unit", array("k" => _("KB"), "m" => _("MB"), "g" => _("GB")));
+ $smarty->assign("quota_time", array("h" => _("hour"), "d" => _("day"), "w" => _("week"), "m" => _("month")));
+ $smarty->assign("gosaProxyQuotaPeriod", $this->gosaProxyQuotaPeriod);
+ $smarty->assign("quota_size", preg_replace("/[a-z]$/i", "", $this->gosaProxyQuota));
+ $smarty->assign("quota_u", preg_replace("/^[0-9]+/", "", $this->gosaProxyQuota));
+ if ($this->is_account){
+ $smarty->assign("proxyState", "checked");
+ } else {
+ $smarty->assign("proxyState", "");
+ }
+
+
+ /* Handle input grey out and javascript enabled/disable of input fields
+ */
+ if($this->multiple_support_active){
+
+ /* In Multiple edit, everything is enabled */
+ $changeB = "";
+ $smarty->assign("pstate", "");
+ $smarty->assign("ProxyWorkingStateChange","");
+ }else{
+
+ /* Depeding on the account status, we disable or
+ * enable all input fields
+ */
+ if (!$this->is_account){
+ $smarty->assign("pstate", "disabled");
+ } else {
+ $smarty->assign("pstate", "");
+ }
+
+ /* Create JS activation string for everal input fields */
+ $ProxyWorkingStateChange ="\n";
+ if($this->acl_is_writeable("gosaProxyFlagT")){
+ $ProxyWorkingStateChange.= "changeState('startHour'); \n";
+ $ProxyWorkingStateChange.= "changeState('startMinute'); \n";
+ $ProxyWorkingStateChange.= "changeState('stopHour'); \n";
+ $ProxyWorkingStateChange.= "changeState('stopMinute'); \n";
+ }
+ $smarty->assign("ProxyWorkingStateChange",$ProxyWorkingStateChange);
+ $changeB = "";
+ if($this->acl_is_writeable("gosaProxyFlagB")){
+ $changeB =
+ "changeSubselectState('filterB', 'quota_size');
+ changeSubselectState('filterB', 'quota_unit');
+ changeSubselectState('filterB', 'gosaProxyQuotaPeriod');";
+ }
+ }
+
+ /* Assign filter settings */
+ $smarty->assign("changeB",$changeB);
+ foreach(array("T","B","F") as $attr){
+ if(in_array("filter".$attr,$this->multi_boxes)){
+ $smarty->assign("use_filter".$attr,TRUE);
+ }else{
+ $smarty->assign("use_filter".$attr,FALSE);
+ }
+ }
+ $smarty->assign("proxyAccountACL",$this->getacl("",$this->ReadOnly));
+ $smarty->assign("use_proxy",in_array("proxy",$this->multi_boxes));
+ $smarty->assign("multiple_support",$this->multiple_support_active);
+ $display.= $smarty->fetch(get_template_path('proxy.tpl', TRUE, dirname(__FILE__)));
+ return($display);
+ }
+
+
+ /*! \brief Removes proxy account from current object
+ */
+ public function remove_from_parent()
+ {
+ if($this->acl_is_removeable() && $this->initially_was_account){
+ plugin::remove_from_parent();
+ $ldap= $this->config->get_ldap_link();
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/proxy account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events("remove",array("uid" => $this->uid));
+ }
+ }
+
+
+ /*! \brief Check given input
+ @return array Returns an array of error messages
+ */
+ public function check()
+ {
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
+ /* We've got only one value to check for positive integer or emtpy field */
+ if ($this->is_account){
+ if($this->acl_is_writeable("gosaProxyQuota")){
+ if (isset($_POST["quota_size"])){
+ if ($_POST["quota_size"] == "gosaProxyQuota"){
+ $message[]= _("Numerical value for Quota Setting is empty.");
+ }elseif ($_POST["quota_size"] <= 0){
+ $message[]= _("Numerical value for Quota Setting is not valid.");
+ }
+ }
+ }
+ }
+ return $message;
+ }
+
+ /*! \brief Save POST data to object
+ */
+ public function save_object()
+ {
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['proxy'])){
+ if (!$this->is_account && $_POST['proxy'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+
+ /* Save flag value */
+ if ($this->is_account || $this->multiple_support_active){
+
+ $flags= "";
+ $acl= "";
+ foreach(array("F", "T", "B") as $key){
+ if($this->acl_is_writeable("gosaProxyFlag".$key)){
+
+ /* Add acl */
+ if (isset($_POST["filter$key"])){
+ $flags.= $key;
+ }
+ }else{
+
+ /* Keep all flags that can't be written*/
+ if(preg_match("/".$key."/",$this->gosaProxyAcctFlags)){
+ $flags .=$key;
+ }
+ }
+ }
+ if ("[$flags]" != $this->gosaProxyAcctFlags){
+ $this->is_modified= TRUE;
+ }
+ $this->gosaProxyAcctFlags= "[$flags]";
+
+ /* Save time values */
+ if ($this->acl_is_writeable("gosaProxyFlagT")){
+ if(isset($_POST['startMinute'])){
+ $old= $this->gosaProxyWorkingStart;
+ $this->gosaProxyWorkingStart= $_POST["startHour"] * 60 + $_POST["startMinute"];
+ $this->is_modified= ($old != $this->gosaProxyWorkingStart)?TRUE:$this->is_modified;
+ }
+
+ if (isset($_POST['stopMinute'])){
+ $old= $this->gosaProxyWorkingStop;
+ $this->gosaProxyWorkingStop = $_POST["stopHour"] * 60 + $_POST["stopMinute"];
+ $this->is_modified= ($old != $this->gosaProxyWorkingStop)?TRUE:$this->is_modified;
+ }
+ }
+
+ /* Save quota values */
+ if ($this->acl_is_writeable("gosaProxyFlagB")){
+ if(isset($_POST["quota_size"]) && isset($_POST["quota_unit"])){
+ $this->gosaProxyQuota= $_POST["quota_size"].$_POST["quota_unit"];
+ }
+ }
+
+ /*Save quota period */
+ if($this->acl_is_writeable("gosaProxyFlagB")){
+ if(isset($_POST["gosaProxyQuotaPeriod"])){
+ $this->gosaProxyQuotaPeriod = $_POST["gosaProxyQuotaPeriod"];
+ }
+ }
+ }
+ }
+
+
+ /*! \brief Save settings to ldap
+ */
+ public function save()
+ {
+ plugin::save();
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/proxy account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("modify",array("uid" => $this->uid));
+ }
+ } else {
+ $this->handle_post_events("add",array("uid" => $this->uid));
+ }
+
+ }
+
+
+ /*! \brief Static Function returning an ACL information array.
+ @return Array Returns an ACL array
+ */
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Proxy"),
+ "plDescription" => _("Proxy account")." : <u>"._("Connectivity addon")."</u>",
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 21, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array(
+ "gosaProxyFlagF" => _("Filter unwanted content"),
+ "gosaProxyFlagT" => _("Limit proxy access"),
+ "gosaProxyFlagB" => _("Restrict proxy usage by quota"))
+ ));
+ }
+
+
+ /*! \brief Save html POSTs in multiple edit.
+ */
+ public function multiple_save_object()
+ {
+ if (isset($_POST['connectivityTab'])){
+ plugin::multiple_save_object();
+ if(isset($_POST['use_proxy'])){
+ $this->multi_boxes[] = "proxy";
+ }
+ foreach(array("T","B","F") as $attr){
+ if(isset($_POST["use_filter".$attr])){
+ $this->multi_boxes[] = "filter".$attr;
+ }
+ }
+ $this->save_object();
+ }
+ }
+
+
+ /*! \brief Returns all modified values. \
+ All selected an modified values will be returned \
+ in an array.
+ @return array Returns an array containing all attribute modifications
+ */
+ public function get_multi_edit_values()
+ {
+ $ret = plugin::get_multi_edit_values();
+ if(in_array("proxy",$this->multi_boxes)){
+ $ret['is_account'] = $this->is_account;
+ }
+
+ if(in_array("filterT",$this->multi_boxes)){
+ $ret['gosaProxyWorkingStart'] = $this->gosaProxyWorkingStart;
+ $ret['gosaProxyWorkingStop'] = $this->gosaProxyWorkingStop;
+ }
+ if(in_array("filterB",$this->multi_boxes)){
+ $ret['gosaProxyQuota'] = $this->gosaProxyQuota;
+ $ret['gosaProxyQuotaPeriod'] = $this->gosaProxyQuotaPeriod;
+ }
+
+ foreach(array("B","T","F") as $attr){
+ $name = "filter".$attr;
+ if(in_array($name,$this->multi_boxes)){
+ $ret[$name] = preg_match("/".$attr."/",$this->gosaProxyAcctFlags);
+ }
+ }
+
+ return($ret);
+ }
+
+
+ /*! \brief Sets modified attributes in mutliple edit. \
+ All collected values from "get_multi_edit_values()" \
+ will be applied to this plugin.
+ @param array An array containing modified attributes returned by get_multi_edit_values();
+ */
+ public function set_multi_edit_values($values)
+ {
+ plugin::set_multi_edit_values($values);
+ if(isset($values['is_account'])){
+ $this->is_account = $values['is_account'];
+ }
+ foreach(array("B","T","F") as $attr){
+ $name = "filter".$attr;
+ if(isset($values[$name])){
+ if($values[$name] && !preg_match("/".$attr."/",$this->gosaProxyAcctFlags)){
+ $this->gosaProxyAcctFlags = preg_replace("/\]/",$attr."]",$this->gosaProxyAcctFlags);
+ }elseif(!$values[$name] && preg_match("/".$attr."/",$this->gosaProxyAcctFlags)){
+ $this->gosaProxyAcctFlags = preg_replace("/".$attr."/","",$this->gosaProxyAcctFlags);
+ }
+ }
+ }
+ }
+
+
+ /*! \brief Initialize multiple edit ui for this plugin. \
+ This function sets plugin defaults in multiple edit.
+ @param array Attributes used in all object
+ @param array All used attributes.
+ */
+ public function init_multiple_support($attrs,$all)
+ {
+ plugin::init_multiple_support($attrs,$all);
+ if(isset($attrs['objectClass']) && in_array("gosaProxyAccount",$attrs['objectClass'])){
+ $this->is_account = TRUE;
+ }
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/squid/personal/connectivity/squid/proxy.tpl b/gosa-plugins/squid/personal/connectivity/squid/proxy.tpl
--- /dev/null
@@ -0,0 +1,130 @@
+<h2>
+
+{if $multiple_support}
+
+ <input type="checkbox" name="use_proxy" value="1" onClick="changeState('proxy')" class="center"
+ {if $use_proxy} checked {/if}>
+ <input type="checkbox" id="proxy" name="proxy" value="B" {$proxyState} class="center"
+ {if !$use_proxy} disabled {/if}>
+
+{else}
+
+ {render acl=$proxyAccountACL}
+ <input type="checkbox" id="proxy" name="proxy" value="B" {$proxyState}
+ class="center"
+ onClick="
+
+ {if $gosaProxyFlagF_W}
+ changeState('filterF');
+ {/if}
+
+ {if $gosaProxyFlagT_W}
+ changeState('filterT');
+ changeTripleSelectState('proxy', 'filterT', 'startHour');
+ changeTripleSelectState('proxy', 'filterT', 'startMinute');
+ changeTripleSelectState('proxy', 'filterT', 'stopMinute');
+ changeTripleSelectState('proxy', 'filterT', 'stopHour');
+ {/if}
+ {if $gosaProxyFlagB_W}
+ changeState('filterB');
+ changeTripleSelectState('proxy', 'filterB', 'quota_unit');
+ changeTripleSelectState('proxy', 'filterB', 'quota_size');
+ changeTripleSelectState('proxy', 'filterB', 'gosaProxyQuotaPeriod');
+ {/if}
+ ">
+ {/render}
+{/if}
+ {t}Proxy account{/t}</h2>
+
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=0 border=0>
+ <tr>
+ <td>
+ <table summary="" border=0 width="100%" cellpadding=0>
+ <tr><td colspan=2>
+
+{render acl=$gosaProxyFlagFACL checkbox=$multiple_support checked=$use_filterF}
+ <input type="checkbox" name="filterF" id="filterF" value="F" {$filterF} {$pstate} class="center">
+{/render}
+ {t}Filter unwanted content (i.e. pornographic or violence related){/t}
+ </td></tr>
+ <tr>
+ <td width="50%">
+
+{render acl=$gosaProxyFlagTACL checkbox=$multiple_support checked=$use_filterT}
+ <input type="checkbox" name="filterT" id="filterT" value="T" {$filterT} {$pstate} onClick="javascript:
+ {$ProxyWorkingStateChange}" class="center">
+{/render}
+
+ <LABEL for="startHour">{t}Limit proxy access to working time{/t}</LABEL>
+ <br>
+ <table summary="" style="margin-left:20px;">
+ <tr>
+ <td>
+
+{render acl=$gosaProxyFlagTACL}
+ <select size="1" id="startHour" name="startHour" {if $Tstate!=""} disabled {/if} >
+ {html_options values=$hours output=$hours selected=$starthour}
+ </select>
+{/render}
+ :
+{render acl=$gosaProxyFlagTACL}
+ <select size="1" id="startMinute" name="startMinute" {if $Tstate!=""} disabled {/if} >
+ {html_options values=$minutes output=$minutes selected=$startminute}
+ </select>
+{/render}
+ -
+{render acl=$gosaProxyFlagTACL}
+ <select size="1" id="stopHour" name="stopHour" {if $Tstate!=""} disabled {/if} >
+ {html_options values=$hours output=$hours selected=$stophour}
+ </select>
+{/render}
+ :
+{render acl=$gosaProxyFlagTACL}
+ <select size="1" id="stopMinute" name="stopMinute" {if $Tstate!=""} disabled {/if}>
+ {html_options values=$minutes output=$minutes selected=$stopminute}
+ </select>
+{/render}
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td rowspan=2 style="border-left:1px solid #A0A0A0">
+
+ </td>
+ <td>
+{render acl=$gosaProxyFlagBACL checkbox=$multiple_support checked=$use_filterB}
+ <input type="checkbox" id="filterB" name="filterB" value="B" {$filterB} {if $pstate=="disabled"} disabled {/if} onClick="{$changeB}"
+ class="center"
+ >
+{/render}
+ <LABEL for="quota_size">{t}Restrict proxy usage by quota{/t}</LABEL>
+ <br>
+ <table summary="" style="margin-left:20px;">
+ <tr>
+ <td>
+{render acl=$gosaProxyFlagBACL}
+ <input name="quota_size" id="quota_size" size=7 maxlength=10 value="{$quota_size}" {if $Bstate!=""} disabled {/if} >
+{/render}
+
+{render acl=$gosaProxyFlagBACL}
+ <select size="1" name="quota_unit" id="quota_unit" {if $Bstate!=""} disabled {/if} >
+ {html_options options=$quota_unit selected=$quota_u}
+ </select>
+{/render}
+
+ <LABEL for="gosaProxyQuotaPeriod">{t}per{/t}</LABEL>
+{render acl=$gosaProxyFlagBACL}
+ <select size="1" name="gosaProxyQuotaPeriod" id="gosaProxyQuotaPeriod" {if $Bstate!=""} disabled {/if} >
+ {html_options options=$quota_time selected=$gosaProxyQuotaPeriod}
+ </select>
+{/render}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
diff --git a/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc b/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc
--- /dev/null
@@ -0,0 +1,217 @@
+<?php
+
+class webdavAccount extends plugin
+{
+ /* Definitions */
+ var $plHeadline= "WebDAV";
+ var $plDescription= "This does something";
+
+ /* attribute list for save action */
+ var $attributes= array();
+ var $objectclasses= array("gosaWebdavAccount");
+ var $ReadOnly = false;
+ var $view_logged = FALSE;
+ var $uid ="";
+
+ var $multiple_support =TRUE;
+
+ function webdavAccount (&$config, $dn= NULL)
+ {
+ plugin::plugin ($config, $dn);
+
+ /* Setting uid to default */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+ }
+
+ function execute()
+ {
+ /* Call parent execute */
+// plugin::execute();
+
+ /* Log view */
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","users/".get_class($this),$this->dn);
+ }
+
+ /* Show tab dialog headers */
+ $display= "";
+
+ /* Show main page */
+ $smarty= get_smarty();
+
+ if ($this->is_account){
+ $smarty->assign("webdavState", "checked");
+ } else {
+ $smarty->assign("webdavState", "");
+ $smarty->assign("wstate", "disabled");
+ }
+
+ if ($this->parent !== NULL){
+ $smarty->assign("tabbed", 1);
+ }
+
+ $smarty->assign('webdavAccountACL', $this->getacl("",$this->ReadOnly));
+ $smarty->assign("use_webdav",in_array("webdav",$this->multi_boxes));
+ $smarty->assign("multiple_support",$this->multiple_support_active);
+ $display.= $smarty->fetch (get_template_path('webdav.tpl', TRUE, dirname(__FILE__)));
+ return ($display);
+ }
+
+ function remove_from_parent()
+ {
+ if($this->acl_is_createable() || $this->is_account){
+ /* Cancel if there's nothing to do here */
+ if (!$this->initially_was_account){
+ return;
+ }
+
+ plugin::remove_from_parent();
+ $ldap= $this->config->get_ldap_link();
+
+ $ldap->cd($this->dn);
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/webDAV account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ $this->handle_post_events('remove',array("uid" => $this->uid));
+ }
+ }
+
+
+ /* Save data to object */
+ function save_object()
+ {
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['connectivityTab'])){
+ if (isset($_POST['webdav'])){
+ if (!$this->is_account && $_POST['webdav'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+
+ plugin::save_object();
+ if (isset($_POST["WEBDAVStatus"])){
+ $this->WEBDAVStatus = "disabled";
+ } else {
+ $this->WEBDAVStatus = "enabled";
+ }
+ }
+
+
+ /* Save to LDAP */
+ function save()
+ {
+ if($this->acl_is_createable()){
+ plugin::save();
+
+ /* Write back to ldap */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ /* Log last action */
+ if($this->initially_was_account){
+ new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/webDAV account with dn '%s' failed."),$this->dn));
+
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("modify",array("uid" => $this->uid));
+ }
+ } else {
+ $this->handle_post_events("add",array("uid" => $this->uid));
+ }
+ }
+ }
+
+ /* Return plugin informations for acl handling
+ #FIXME This is only an enable/disable checkbox for this account, there is possibly a better solution available later */
+ static function plInfo()
+ {
+ return (array(
+ "plShortName" => _("WebDAV"),
+ "plDescription" => _("WebDAV account")." : <u>"._("Connectivity addon")."</u>",
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 23, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array()
+ ));
+ }
+
+ function multiple_save_object()
+ {
+ if (isset($_POST['connectivityTab'])){
+ plugin::multiple_save_object();
+
+ if(isset($_POST['use_webdav'])){
+ $this->multi_boxes[] = "webdav";
+ if (isset($_POST['webdav'])){
+ if (!$this->is_account && $_POST['webdav'] == "B"){
+ if($this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
+ }
+ } else {
+ if($this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }
+ }
+ }
+ }
+ }
+
+ function get_multi_edit_values()
+ {
+ $ret = plugin::get_multi_edit_values();
+ if(in_array("webdav",$this->multi_boxes)){
+ $ret['is_account'] = $this->is_account;
+ }
+ return($ret);
+ }
+
+ function set_multi_edit_values($values)
+ {
+ plugin::set_multi_edit_values($values);
+ if(isset($values['is_account'])){
+ $this->is_account = $values['is_account'];
+ }
+ }
+
+ function init_multiple_support($attrs,$all)
+ {
+ plugin::init_multiple_support($attrs,$all);
+ if(isset($attrs['objectClass']) && in_array("gosaWebdavAccount",$attrs['objectClass'])){
+ $this->is_account = TRUE;
+ }
+ }
+}
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/gosa-plugins/webdav/personal/connectivity/webdav/webdav.tpl b/gosa-plugins/webdav/personal/connectivity/webdav/webdav.tpl
--- /dev/null
@@ -0,0 +1,6 @@
+<h2>
+{render acl=$webdavAccountACL checkbox=$multiple_support checked=$use_webdav}
+ <input type="checkbox" name="webdav" value="B" {$webdavState} class="center">
+{/render}
+ {t}WebDAV account{/t}
+</h2>