From 296f2f2d04ddad2e27b57b36599818cbc2cad264 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Jul 2011 07:38:00 +0000 Subject: [PATCH] fixed Smarty handling for GOsa 2.6 git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20956 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/php_setup.inc | 8 ++++++- .../admin/users/class_userManagement.inc | 4 ++++ gosa-core/plugins/admin/users/template.tpl | 21 ++++++++++++++----- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/gosa-core/include/php_setup.inc b/gosa-core/include/php_setup.inc index e2cb35c78..eaabceec0 100644 --- a/gosa-core/include/php_setup.inc +++ b/gosa-core/include/php_setup.inc @@ -292,7 +292,13 @@ require("smarty/Smarty.class.php"); $smarty = new Smarty; $smarty->template_dir = $BASE_DIR.'/ihtml/'; $smarty->caching= false; -$smarty->php_handling= SMARTY_PHP_REMOVE; + +// To be able to switch between smarty version 2/3 +if(defined('SMARTY_PHP_REMOVE')){ + $smarty->php_handling= SMARTY_PHP_REMOVE; +}else{ + $smarty->php_handling= Smarty::PHP_REMOVE; +} /* Global FPDF define */ define('FPDF_FONTPATH', '/usr/share/php/fpdf/font/'); diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index cf4faef32..a3817e77e 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -483,6 +483,7 @@ class userManagement extends management $smarty->assign("template", array_pop($target)); $smarty->assign("templates", $templates); $smarty->assign("edit_uid", ""); + $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false")); return($smarty->fetch(get_template_path('template.tpl', TRUE))); // -> See 'templateContinue' for further handling! @@ -519,6 +520,7 @@ class userManagement extends management $smarty->assign("template", "none"); $smarty->assign("templates", $templates); $smarty->assign("edit_uid", ""); + $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false")); return($smarty->fetch(get_template_path('template.tpl', TRUE))); // -> See 'templateContinue' for further handling! @@ -572,6 +574,7 @@ class userManagement extends management $smarty->assign("templates",$templates); $smarty->assign("got_uid", $this->got_uid); $smarty->assign("edit_uid",false); + $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false")); return($smarty->fetch(get_template_path('template.tpl', TRUE))); } @@ -620,6 +623,7 @@ class userManagement extends management $smarty->assign("template", $_POST['template']); } $smarty->assign("templates",$templates); + $smarty->assign("allowUidProposalModification", $this->config->get_cfg_value("allowUidProposalModification", "false")); return($smarty->fetch(get_template_path('template.tpl', TRUE))); } diff --git a/gosa-core/plugins/admin/users/template.tpl b/gosa-core/plugins/admin/users/template.tpl index 47ef0d730..ffd356956 100644 --- a/gosa-core/plugins/admin/users/template.tpl +++ b/gosa-core/plugins/admin/users/template.tpl @@ -32,11 +32,22 @@ {t}Login{/t} {if $edit_uid eq "false"} - - {else} - + {if $allowUidProposalModification == "true"} + + + + {else} + + {/if} + {else} + {/if} -- 2.30.2