Code

Added "Select all" tooltip
[gosa.git] / gosa-plugins / sudo / admin / sudo / class_sudoGeneric.inc
index 1b044fa1840bf129425750237aa7de9e84cf6ae1..f29b615551a5424e9993caaf65f330f0d9a9c702 100644 (file)
  */
 class sudo extends plugin
 {
-  /* Group attributes */
-  var $cn= "";
-  var $description= "";
 
-  var $sudoUser   = array("ALL");
-  var $sudoCommand= array();
-  var $sudoHost   = array("ALL");
-  var $sudoRunAs  = array("ALL");
+  protected $cn= "";
+  protected $description= "";
 
-  var $accessTo         = array();
-  var $trustModel       = "";
-  var $show_ws_dialog   = FALSE;
-  var $was_trust_account= FALSE;
+  protected $sudoUser   = array("ALL");
+  protected $sudoCommand= array();
+  protected $sudoHost   = array("ALL");
+  protected $sudoRunAs  = array("ALL");
+  protected $accessTo         = array();
+  protected $trustModel       = "";
 
-  var $objectclasses = array("top","sudoRole");
-  var $attributes    = array("cn","description","sudoUser","sudoCommand","sudoHost","sudoRunAs","accessTo","trustModel");
+  private $is_default = FALSE;
+  private $show_ws_dialog   = FALSE;
+  private $was_trust_account= FALSE;
 
-  var $is_account = TRUE;
-  var $is_default = FALSE;
-  var $dialog;
+  public $objectclasses = array("top","sudoRole");
+  public $attributes    = array("cn","description","sudoUser","sudoCommand","sudoHost","sudoRunAs","accessTo","trustModel");
+
+  public $ignore_account = TRUE;
 
   /*! \brief  Returns to the base department for sudo roles.
               This department is then used to store new roles.
@@ -97,7 +96,7 @@ class sudo extends plugin
       }
 
       /* Is this account a trustAccount? */
-      if ($this->is_account && isset($this->attrs['trustModel'])){
+      if (isset($this->attrs['trustModel'])){
         $this->trustModel= $this->attrs['trustModel'][0];
         $this->was_trust_account= TRUE;
       } else {
@@ -106,7 +105,7 @@ class sudo extends plugin
       }
 
       $this->accessTo = array();
-      if ($this->is_account && isset($this->attrs['accessTo'])){
+      if (isset($this->attrs['accessTo'])){
         for ($i= 0; $i<$this->attrs['accessTo']['count']; $i++){
           $tmp= $this->attrs['accessTo'][$i];
           $this->accessTo[$tmp]= $tmp;
@@ -375,7 +374,7 @@ class sudo extends plugin
      */
     $neg_img= "<img src='images/negate.png' alt='!' class='center'>"; 
     $option = "<input type='image' src='images/negate.png'     name='neg_%ATTR%_%KEY%' class='center'>"; 
-    $option.= "<input type='image' src='images/edittrash.png'  name='del_%ATTR%_%KEY%' class='center'>"; 
+    $option.= "<input type='image' src='images/lists/trash.png'  name='del_%ATTR%_%KEY%' class='center'>"; 
     foreach(array("sudoCommand","sudoHost","sudoRunAs") as $attr){
       if($this->acl_is_readable($attr)){
         foreach($this->$attr as $key => $entry){
@@ -397,7 +396,7 @@ class sudo extends plugin
 
     foreach(array("sudoUser") as $attr){
       $img1 = "<img src='images/select_user.png'   alt='"._("User")."' class='center'>";
-      $img2 = "<img src='images/select_groups.png' alt='"._("Group")."' class='center'>";
+      $img2 = "<img src='plugins/groups/images/groups.png' alt='"._("Group")."' class='center'>";
       if($this->acl_is_readable($attr)){
         foreach($this->$attr as $key => $entry){
           $neg = "";
@@ -528,6 +527,7 @@ class sudo extends plugin
 
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
+
     if($this->is_new){
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
@@ -636,9 +636,9 @@ class sudo extends plugin
     foreach( array("depselect","regex") as $type){
       $smarty->assign("$type", $sysfilter[$type]);
     }
-    $smarty->assign("search_image", get_template_path('images/search.png'));
-    $smarty->assign("launchimage",  get_template_path('images/small_filter.png'));
-    $smarty->assign("tree_image",   get_template_path('images/tree.png'));
+    $smarty->assign("search_image", get_template_path('images/lists/search.png'));
+    $smarty->assign("launchimage",  get_template_path('images/lists/action.png'));
+    $smarty->assign("tree_image",   get_template_path('images/lists/search-subtree.png'));
     $smarty->assign("deplist",      $this->config->idepartments);
     $smarty->assign("alphabet",     generate_alphabet());
     $smarty->assign("hint",         print_sizelimit_warning());
@@ -739,6 +739,12 @@ class sudo extends plugin
   }
 
 
+  public function get_cn()
+  {
+    return($this->cn);
+  }
+
+
   /*! \brief  Used for copy & paste.
               Some entries must be renamed to avaoid duplicate entries.
    */