From: hickert Date: Tue, 23 Mar 2010 09:01:35 +0000 (+0000) Subject: Updated terminal Startup Tab X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=be4b4a4e2c29c0e5187258186436d94702838728;p=gosa.git Updated terminal Startup Tab git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17009 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc index 15cd3bdfe..e972a1b1c 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc @@ -238,6 +238,7 @@ class termstartup extends plugin } $smarty->assign("gotoShares",$this->printOutAssignedShares()); + $smarty->assign("gotoSharesCount",count($this->printOutAssignedShares())); $smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares())); /* Create divSelectBox for ldap server selection @@ -256,10 +257,10 @@ class termstartup extends plugin } /* Move ldap servers up and down */ - if(!$this->gotoLdap_inherit){ + if(!$this->gotoLdap_inherit && $this->acl_is_writeable("gotoLdapServer")){ foreach($_POST as $name => $value){ if(preg_match("/sort_ldap_up_/",$name)){ - $id = preg_replace("/^sort_ldap_up_([0-9]*)_(x|y)$/","\\1",$name); + $id = preg_replace("/^sort_ldap_up_([0-9]*)$/","\\1",$name); $from = $id; $to = $id -1; $tmp = $this->array_switch_item($this->gotoLdapServers,$from,$to); @@ -269,7 +270,7 @@ class termstartup extends plugin break; } if(preg_match("/sort_ldap_down_/",$name)){ - $id = preg_replace("/^sort_ldap_down_([0-9]*)_(x|y)$/","\\1",$name); + $id = preg_replace("/^sort_ldap_down_([0-9]*)$/","\\1",$name); $from = $id; $to = $id +1; $tmp = $this->array_switch_item($this->gotoLdapServers,$from,$to); @@ -279,29 +280,47 @@ class termstartup extends plugin break; } if(preg_match("/gotoLdapRemove_/",$name)){ - $id = preg_replace("/^gotoLdapRemove_([0-9]*)_(x|y)$/","\\1",$name); + $id = preg_replace("/^gotoLdapRemove_([0-9]*)$/","\\1",$name); $value = $this->gotoLdapServers[$id]; $this->gotoLdapServers = array_remove_entries(array($value),$this->gotoLdapServers); break; } } } - /* Add Entries + + /* Add Entries */ - foreach($this->gotoLdapServers as $key => $server){ - if(!in_array($server,$this->gotoLdapServerList)){ - $server = $server." (missing)"; + if($this->acl_is_readable("gotoLdapServer")){ + + foreach($this->gotoLdapServers as $key => $server){ + + /* Announce missing entries */ + if(!in_array($server,$this->gotoLdapServerList)){ + $server = $server." (missing)"; + } + + /* Convert old style entry */ + if (!preg_match('%:ldaps?://%', $server)){ + $server= "ldap://".preg_replace('/^([^:]+):/', '\1/', $server); + + /* Beautify new style entries */ + } else { + $server= preg_replace("/^[^:]+:/", "", $server); } $SelectBoxLdapServer->AddEntry( - array(array("string" => $server), + array( + array( + "string" => $server), array("string" => - " ". - " ". - "", - "attach" => "style='text-align:right;width:40px;border-right:0px;'"))); + image('images/lists/sort-up.png',"sort_ldap_up_".$key,'',"top"). + image('images/lists/sort-down.png',"sort_ldap_down_".$key,'',"bottom"). + image('images/lists/trash.png',"gotoLdapRemove_".$key), + "attach" => "style='text-align:right;width:60px;border-right:0px;'"))); + } } + if($this->gotoLdap_inherit){ $smarty->assign("gotoLdapServerACL_inherit", preg_replace("/w/","",$this->getacl("gotoLdapServer")));; }else{