From 75c3f0a192ad262e1caaac7aaf6c4c554c671be9 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 8 Apr 2008 09:29:21 +0000 Subject: [PATCH] Updated sudo -Default entry is named 'defaults' not "default" git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10273 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../sudo/admin/sudo/class_divListSudo.inc | 4 ++-- .../sudo/admin/sudo/class_sudoGeneric.inc | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc index d0de10f6f..fc65d03ed 100644 --- a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc +++ b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc @@ -169,8 +169,8 @@ class divListSudo extends MultiSelectWindow $display = $val['cn'][0].$desc; - /* Highlight default entry */ - if(preg_match("/^default$/i",$val['cn'][0])){ + /* Highlight defaults entry */ + if(preg_match("/^defaults$/i",$val['cn'][0])){ $display = "$display"; } diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc index 969598d9b..967d8c4ce 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc @@ -115,7 +115,7 @@ class sudo extends plugin } - if(preg_match("/^default$/i",$this->cn)){ + if(preg_match("/^defaults$/i",$this->cn)){ $this->is_default = TRUE; } @@ -329,7 +329,11 @@ class sudo extends plugin $smarty = get_smarty(); $smarty->assign("is_default",$this->is_default); foreach($this->attributes as $attr){ - $smarty->assign($attr,$this->$attr); + if(is_string($this->$attr)){ + $smarty->assign($attr,htmlentities($this->$attr)); + }else{ + $smarty->assign($attr,$this->$attr); + } $smarty->assign($attr."ACL",$this->getacl($attr)); } @@ -455,7 +459,7 @@ class sudo extends plugin plugin::save_object(); if($this->is_default){ - $this->cn = "default"; + $this->cn = "defaults"; } if(is_object($this->dialog)){ @@ -558,7 +562,7 @@ class sudo extends plugin } /* Check if name is reserved */ - if(!$this->is_default && preg_match("/^default$/i",$this->cn)){ + if(!$this->is_default && preg_match("/^defaults$/i",$this->cn)){ $message[] = msgPool::reserved(_("Name")); } @@ -646,12 +650,12 @@ class sudo extends plugin /*! \brief Force this entry to be handled and saved as 'default' - @param BOOL TRUE -force default FALSE -normal + @param BOOL TRUE -force defaults FALSE -normal */ public function set_default($state) { $this->is_default = TRUE; - $this->cn = "default"; + $this->cn = "defaults"; } -- 2.30.2