From 8021f7add19b98dc9f5176bb9ff2c16d1428ee35 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 7 Apr 2008 06:57:18 +0000 Subject: [PATCH] Updated sudo classes. -Added comments renamed option class git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10217 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../sudo/admin/sudo/class_divListSudo.inc | 2 +- .../sudo/admin/sudo/class_sudoGeneric.inc | 37 +++++++++++++++++-- .../sudo/admin/sudo/class_sudoManagement.inc | 21 +++++++++-- ...s_sudoOptions.inc => class_sudoOption.inc} | 0 4 files changed, 53 insertions(+), 7 deletions(-) rename gosa-plugins/sudo/admin/sudo/{class_sudoOptions.inc => class_sudoOption.inc} (100%) diff --git a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc index 1148b991a..d13d554e0 100644 --- a/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc +++ b/gosa-plugins/sudo/admin/sudo/class_divListSudo.inc @@ -140,7 +140,7 @@ class divListSudo extends MultiSelectWindow if(preg_match("/d/",$acl)){ $actions.= ""; + src='images/edittrash.png' alt='".msgPool::delButton()."' name='sudo_del_%KEY%' title='"._("Delete this entry")."'>"; } $title = "title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'"; diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc index 0ee163d98..9bb9e9c84 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc @@ -20,6 +20,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/*! \brief Sudo generic class. Allow setting User/Host/Command/Runas + for a sudo role object. + */ class sudo extends plugin { /* Group attributes */ @@ -36,6 +40,11 @@ class sudo extends plugin var $is_account = TRUE; + /*! \brief Returns to the base department for sudo roles. + This department is then used to store new roles. + @param Object GOsa configuration object. + @return String sudo store department + */ public static function get_sudoers_ou($config) { /*** @@ -59,6 +68,11 @@ class sudo extends plugin return($base); } + /*! \brief Initializes this sudo class, with all required attributes. + @param Object $config GOsa configuration object. + @param String $db "new" or the sudo role dn. + @return . + */ function sudo(&$config, $dn= NULL) { plugin::plugin ($config, $dn); @@ -114,6 +128,9 @@ class sudo extends plugin //STRINGS } + /*! \brief Creates the sudo generic ui. + @return String The generated HTML content for this plugin. + */ function execute() { /* Call parent execute */ @@ -219,6 +236,9 @@ class sudo extends plugin return($smarty->fetch(get_template_path('generic.tpl', TRUE))); } + + /*! \brief Remove this sudo role from the ldap server + */ function remove_from_parent() { plugin::remove_from_parent(); @@ -231,13 +251,17 @@ class sudo extends plugin $this->handle_post_events("remove"); } - /* Save data to object */ + + /*! \brief Save all relevant HTML posts. + */ function save_object() { plugin::save_object(); } - /* Save to LDAP */ + + /*! \brief Save changes into the ldap database. + */ function save() { plugin::save(); @@ -261,13 +285,20 @@ class sudo extends plugin } } + + /*! \brief Check the given input. + @return Array All error messages in an array(); + */ function check() { $message = plugin::check(); return ($message); } - /* Return plugin informations for acl handling */ + + /*! \brief Add ACL object + @return Returns the ACL object. + */ static function plInfo() { return (array( diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc index fdd354938..7be36c35f 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc @@ -48,6 +48,8 @@ class sudoManagement extends plugin } + /*! \brief Generate && Display HTML content + */ public function execute() { /* Call parent execute */ @@ -309,7 +311,10 @@ class sudoManagement extends plugin return($this->DivListSudo->Draw()); } - + + /*! \brief Return all selected elements from HTML list + @return Array List of all selected list elements + */ private function list_get_selected_items() { $ids = array(); @@ -323,6 +328,8 @@ class sudoManagement extends plugin } + /*! \brief Reload the list of sudo roles. + */ private function reload($CreatePosixsList=false) { $this->list = array(); @@ -351,12 +358,16 @@ class sudoManagement extends plugin } - /* Save data to object */ + /*! \brief Save HTML post data to object + */ public function save_object() { $this->DivListSudo->save_object(); } + + /*! \brief Remove this account + */ public function remove_from_parent() { /* Optionally execute a command after we're done */ @@ -364,13 +375,17 @@ class sudoManagement extends plugin } - /* Save to LDAP */ + /*! \brief Save to LDAP + */ public function save() { /* Optionally execute a command after we're done */ $this->postcreate(); } + + /*! \brief Remove lock from entry + */ public function remove_lock() { if (isset($this->sudotabs->dn)){ diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoOptions.inc b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc similarity index 100% rename from gosa-plugins/sudo/admin/sudo/class_sudoOptions.inc rename to gosa-plugins/sudo/admin/sudo/class_sudoOption.inc -- 2.30.2