From: hickert Date: Thu, 18 May 2006 12:02:59 +0000 (+0000) Subject: Some changes for oxchangeaccount X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4a58f5fe5cf57d3fe6bf8785ef636c0ca3f85d0d;p=gosa.git Some changes for oxchangeaccount git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3429 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/connectivity/class_oxchangeAccount.inc b/plugins/personal/connectivity/class_oxchangeAccount.inc index 40119ac48..6104d2574 100644 --- a/plugins/personal/connectivity/class_oxchangeAccount.inc +++ b/plugins/personal/connectivity/class_oxchangeAccount.inc @@ -601,7 +601,8 @@ class oxchangeAccount extends plugin //plugin::execute(); - /* Show tab dialog headers */ + $display=""; + /* Show tab dialog headers * / $display=""; if ($this->parent != NULL){ if ($this->is_account){ @@ -620,7 +621,7 @@ class oxchangeAccount extends plugin } } } - +*/ /* Show main page */ $smarty= get_smarty(); @@ -653,6 +654,20 @@ class oxchangeAccount extends plugin $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); } @@ -695,8 +710,11 @@ class oxchangeAccount extends plugin /* 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(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){ print_red(_("Couldn't connect to postgresql database!")); return; @@ -793,7 +811,7 @@ class oxchangeAccount extends plugin /* 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"]); + $pgcon = @pg_connect("host=".$this->oxconf["PGHOST"]." user=".$this->oxconf["PGUSER"]." password=".$this->oxconf["PGPASSWD"]." dbname=".$this->oxconf["PGDBNAME"]); if (! $pgcon){ print_red(_("Couldn't connect to postgresql database!")); return; diff --git a/plugins/personal/connectivity/oxchange.tpl b/plugins/personal/connectivity/oxchange.tpl index 75a04af19..653f0e33c 100644 --- a/plugins/personal/connectivity/oxchange.tpl +++ b/plugins/personal/connectivity/oxchange.tpl @@ -1,7 +1,15 @@ -{ if !$pg } -

{t}Open-Xchange Account{/t} - {t}disabled, no Postgresql support detected{/t}

+{if !$pg} +

{t}Open-Xchange Account{/t} - {t}disabled, no Postgresql support detected. Or the specified database can't be reached{/t}

{else} -

{if $tabbed eq 1}{/if}{t}Open-Xchange account{/t}

+ + +

{t}Open-Xchange account{/t}

+ +