From 67e60642851cfecbb7c87db106750052c575ffa2 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 17 Jan 2008 14:29:47 +0000 Subject: [PATCH] Moved plugins git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8464 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../opengroupware/class_pgsql_opengw.inc | 160 ++++++++++++++++++ .../openxchange/class_oxchangeAccount.inc | 0 .../connectivity/openxchange/oxchange.tpl | 0 .../connectivity/phpgw/class_phpgwAccount.inc | 0 .../personal/connectivity/phpgw/phpgw.tpl | 0 .../class_phpscheduleitAccount.inc | 0 .../phpscheduleit/phpscheduleit.tpl | 0 .../connectivity/pptp/class_pptpAccount.inc | 0 .../pptp}/personal/connectivity/pptp/pptp.tpl | 0 .../pureftpd/class_pureftpdAccount.inc | 0 .../connectivity/pureftpd/pureftpd.tpl | 0 .../connectivity/squid/class_proxyAccount.inc | 0 .../personal/connectivity/squid/proxy.tpl | 0 .../webdav/class_webdavAccount.inc | 0 .../personal/connectivity/webdav/webdav.tpl | 0 15 files changed, 160 insertions(+) create mode 100644 gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_pgsql_opengw.inc rename {gosa-core/plugins => gosa-plugins/openxchange}/personal/connectivity/openxchange/class_oxchangeAccount.inc (100%) rename {gosa-core/plugins => gosa-plugins/openxchange}/personal/connectivity/openxchange/oxchange.tpl (100%) rename {gosa-core/plugins => gosa-plugins/phpgw}/personal/connectivity/phpgw/class_phpgwAccount.inc (100%) rename {gosa-core/plugins => gosa-plugins/phpgw}/personal/connectivity/phpgw/phpgw.tpl (100%) rename {gosa-core/plugins => gosa-plugins/phpscheduleit}/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc (100%) rename {gosa-core/plugins => gosa-plugins/phpscheduleit}/personal/connectivity/phpscheduleit/phpscheduleit.tpl (100%) rename {gosa-core/plugins => gosa-plugins/pptp}/personal/connectivity/pptp/class_pptpAccount.inc (100%) rename {gosa-core/plugins => gosa-plugins/pptp}/personal/connectivity/pptp/pptp.tpl (100%) rename {gosa-core/plugins => gosa-plugins/pureftpd}/personal/connectivity/pureftpd/class_pureftpdAccount.inc (100%) rename {gosa-core/plugins => gosa-plugins/pureftpd}/personal/connectivity/pureftpd/pureftpd.tpl (100%) rename {gosa-core/plugins => gosa-plugins/squid}/personal/connectivity/squid/class_proxyAccount.inc (100%) rename {gosa-core/plugins => gosa-plugins/squid}/personal/connectivity/squid/proxy.tpl (100%) rename {gosa-core/plugins => gosa-plugins/webdav}/personal/connectivity/webdav/class_webdavAccount.inc (100%) rename {gosa-core/plugins => gosa-plugins/webdav}/personal/connectivity/webdav/webdav.tpl (100%) diff --git a/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_pgsql_opengw.inc b/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_pgsql_opengw.inc new file mode 100644 index 000000000..3615bb4c6 --- /dev/null +++ b/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_pgsql_opengw.inc @@ -0,0 +1,160 @@ +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-core/plugins/personal/connectivity/openxchange/class_oxchangeAccount.inc b/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc similarity index 100% rename from gosa-core/plugins/personal/connectivity/openxchange/class_oxchangeAccount.inc rename to gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc diff --git a/gosa-core/plugins/personal/connectivity/openxchange/oxchange.tpl b/gosa-plugins/openxchange/personal/connectivity/openxchange/oxchange.tpl similarity index 100% rename from gosa-core/plugins/personal/connectivity/openxchange/oxchange.tpl rename to gosa-plugins/openxchange/personal/connectivity/openxchange/oxchange.tpl diff --git a/gosa-core/plugins/personal/connectivity/phpgw/class_phpgwAccount.inc b/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc similarity index 100% rename from gosa-core/plugins/personal/connectivity/phpgw/class_phpgwAccount.inc rename to gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc diff --git a/gosa-core/plugins/personal/connectivity/phpgw/phpgw.tpl b/gosa-plugins/phpgw/personal/connectivity/phpgw/phpgw.tpl similarity index 100% rename from gosa-core/plugins/personal/connectivity/phpgw/phpgw.tpl rename to gosa-plugins/phpgw/personal/connectivity/phpgw/phpgw.tpl diff --git a/gosa-core/plugins/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc b/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc similarity index 100% rename from gosa-core/plugins/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc rename to gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/class_phpscheduleitAccount.inc diff --git a/gosa-core/plugins/personal/connectivity/phpscheduleit/phpscheduleit.tpl b/gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/phpscheduleit.tpl similarity index 100% rename from gosa-core/plugins/personal/connectivity/phpscheduleit/phpscheduleit.tpl rename to gosa-plugins/phpscheduleit/personal/connectivity/phpscheduleit/phpscheduleit.tpl diff --git a/gosa-core/plugins/personal/connectivity/pptp/class_pptpAccount.inc b/gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc similarity index 100% rename from gosa-core/plugins/personal/connectivity/pptp/class_pptpAccount.inc rename to gosa-plugins/pptp/personal/connectivity/pptp/class_pptpAccount.inc diff --git a/gosa-core/plugins/personal/connectivity/pptp/pptp.tpl b/gosa-plugins/pptp/personal/connectivity/pptp/pptp.tpl similarity index 100% rename from gosa-core/plugins/personal/connectivity/pptp/pptp.tpl rename to gosa-plugins/pptp/personal/connectivity/pptp/pptp.tpl diff --git a/gosa-core/plugins/personal/connectivity/pureftpd/class_pureftpdAccount.inc b/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc similarity index 100% rename from gosa-core/plugins/personal/connectivity/pureftpd/class_pureftpdAccount.inc rename to gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc diff --git a/gosa-core/plugins/personal/connectivity/pureftpd/pureftpd.tpl b/gosa-plugins/pureftpd/personal/connectivity/pureftpd/pureftpd.tpl similarity index 100% rename from gosa-core/plugins/personal/connectivity/pureftpd/pureftpd.tpl rename to gosa-plugins/pureftpd/personal/connectivity/pureftpd/pureftpd.tpl diff --git a/gosa-core/plugins/personal/connectivity/squid/class_proxyAccount.inc b/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc similarity index 100% rename from gosa-core/plugins/personal/connectivity/squid/class_proxyAccount.inc rename to gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc diff --git a/gosa-core/plugins/personal/connectivity/squid/proxy.tpl b/gosa-plugins/squid/personal/connectivity/squid/proxy.tpl similarity index 100% rename from gosa-core/plugins/personal/connectivity/squid/proxy.tpl rename to gosa-plugins/squid/personal/connectivity/squid/proxy.tpl diff --git a/gosa-core/plugins/personal/connectivity/webdav/class_webdavAccount.inc b/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc similarity index 100% rename from gosa-core/plugins/personal/connectivity/webdav/class_webdavAccount.inc rename to gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc diff --git a/gosa-core/plugins/personal/connectivity/webdav/webdav.tpl b/gosa-plugins/webdav/personal/connectivity/webdav/webdav.tpl similarity index 100% rename from gosa-core/plugins/personal/connectivity/webdav/webdav.tpl rename to gosa-plugins/webdav/personal/connectivity/webdav/webdav.tpl -- 2.30.2