From: hickert Date: Fri, 19 Mar 2010 14:53:40 +0000 (+0000) Subject: Made apache template w3c conform X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b9d9912ec7bc2f934a6666858468a6bd97b8c46f;p=gosa.git Made apache template w3c conform git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16958 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheEditVhost.inc b/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheEditVhost.inc index 1726c72c7..d00bc8de1 100644 --- a/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheEditVhost.inc +++ b/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheEditVhost.inc @@ -200,7 +200,7 @@ class servapacheVhostEdit extends plugin $once = false; $id = preg_replace("/^SAup_/","",$name); $id = preg_replace("/_.*$/","",$id); - $id = base64_decode($id); + $id = postDecode($id); $this->apacheServerAlias = $this->ArrayUp(($id+1),$this->apacheServerAlias); } @@ -211,7 +211,7 @@ class servapacheVhostEdit extends plugin $id = preg_replace("/^SAdown_/","",$name); $id = preg_replace("/_.*$/","",$id); - $id = base64_decode($id); + $id = postDecode($id); $this->apacheServerAlias = $this->ArrayDown(($id+1),$this->apacheServerAlias); } @@ -222,7 +222,7 @@ class servapacheVhostEdit extends plugin $once = false; $id = preg_replace("/^SAdel_/","",$name); $id = preg_replace("/_.*$/","",$id); - $id = base64_decode($id); + $id = postDecode($id); unset($this->apacheServerAlias[$id]); $tmp =array(); foreach($this->apacheServerAlias as $entry){ @@ -237,7 +237,7 @@ class servapacheVhostEdit extends plugin $once = false; $id = preg_replace("/^SCup_/","",$name); $id = preg_replace("/_.*$/","",$id); - $id = base64_decode($id); + $id = postDecode($id); $this->apacheScriptAlias = $this->ArrayUp(($id+1),$this->apacheScriptAlias); } @@ -247,7 +247,7 @@ class servapacheVhostEdit extends plugin $once = false; $id = preg_replace("/^SCdown_/","",$name); $id = preg_replace("/_.*$/","",$id); - $id = base64_decode($id); + $id = postDecode($id); $this->apacheScriptAlias = $this->ArrayDown(($id+1),$this->apacheScriptAlias); } @@ -257,7 +257,7 @@ class servapacheVhostEdit extends plugin $once = false; $id = preg_replace("/^SCdel_/","",$name); $id = preg_replace("/_.*$/","",$id); - $id = base64_decode($id); + $id = postDecode($id); unset($this->apacheScriptAlias[$id]); $tmp =array(); foreach($this->apacheScriptAlias as $entry){ @@ -295,14 +295,15 @@ class servapacheVhostEdit extends plugin $div->setHeight(120); $recs = $this->apacheServerAlias; - $oneup = " "; - $onedown = " "; - $onedel = ""; + $oneup = image('images/lists/sort-up.png','SAup_%s',_("Up"), "top"); + $onedown = image('images/lists/sort-down.png','SAdown_%s',_("Down"), "bottom"); + $onedel = image('images/lists/trash.png','SAdel_%s',_("Delete")); + foreach($recs as $key => $rec){ $div ->AddEntry(array( array("string"=>$rec), - array("string"=>str_replace("%s",base64_encode($key),$oneup.$onedown.$onedel), - "attach"=>"style='width:70px;border-right:0px;'") + array("string"=>str_replace("%s",postEncode($key),$oneup.$onedown.$onedel), + "attach"=>"style='width:50px;border-right:0px;'") )); } $smarty->assign("apacheServerAlias", $div->DrawList()); @@ -314,15 +315,15 @@ class servapacheVhostEdit extends plugin $div->setHeight(120); $recs = $this->apacheScriptAlias; - $oneup = " "; - $onedown = " "; - $onedel = ""; - + $oneup = image('images/lists/sort-up.png','SCup_%s',_("Up"), "top"); + $onedown = image('images/lists/sort-down.png','SCdown_%s',_("Down"), "bottom"); + $onedel = image('images/lists/trash.png','SCdel_%s',_("Delete")); + foreach($recs as $key => $rec){ $div ->AddEntry(array( array("string"=>$rec), - array("string"=>str_replace("%s",base64_encode($key),$oneup.$onedown.$onedel), - "attach"=>"style='width:70px;border-right:0px;'") + array("string"=>str_replace("%s",postEncode($key),$oneup.$onedown.$onedel), + "attach"=>"style='width:50px;border-right:0px;'") )); } $smarty->assign("apacheScriptAlias", $div->DrawList()); @@ -443,6 +444,13 @@ class servapacheVhostEdit extends plugin return($ret); } + function acl_is_writeable($attribute,$skip_write = FALSE) + { + if($this->read_only) return(FALSE); + $ui= get_userinfo(); + return preg_match('/w/', $ui->get_permissions($this->acl_base, + $this->acl_category."servapache", $attribute, $skip_write)); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheVhost.inc b/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheVhost.inc index 1a26d45f8..fd400896a 100644 --- a/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheVhost.inc +++ b/gosa-plugins/apache2/admin/systems/services/apache2/class_servApacheVhost.inc @@ -104,6 +104,7 @@ class servapache extends goService */ if(isset($_POST['AddVhost']) && $this->acl_is_writeable("VirtualHosts")){ $this->dialog = new servapacheVhostEdit($this->config,$this->dn); + $this->dialog->set_acl_category('server'); } /* Check for edit vhost request @@ -118,6 +119,7 @@ class servapache extends goService $tmp = preg_replace("/^editVhost_/","",$name); $tmp = base64_decode(preg_replace("/_.*$/","",$tmp)); $this->dialog= new servapacheVhostEdit($this->config,$this->dn,$this->Vhosts[$tmp]); + $this->dialog->set_acl_category('server'); } /* check posts for delete vhost @@ -145,16 +147,19 @@ class servapache extends goService /* Create Listbox with existing Vhosts */ $VhostList = new divSelectBox("apacheConfigs"); - $VhostList -> SetHeight(254); + $VhostList -> SetHeight(140); /* Add entries to divlist */ - $editImg = " - "; + $editImg = + image('images/lists/edit.png','editVhost_%s'). + image('images/lists/trash.png','delVhost_%s'); + foreach($this->Vhosts as $vhost => $values ){ $VhostList->AddEntry(array( array("string" => $vhost), - array("string" => str_replace("%s",base64_encode($vhost),$editImg)) + array("string" => str_replace("%s",postEncode($vhost),$editImg), + "attach" => "style='width:40px;'") )); } diff --git a/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhost.tpl b/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhost.tpl index 0537d9d2f..285803f98 100644 --- a/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhost.tpl +++ b/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhost.tpl @@ -2,30 +2,24 @@
- {$VhostList} - {render acl=$VirtualHostACL} - - + {/render}
+ - +
-
-
- - -   - - +
+ +
diff --git a/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhostEdit.tpl b/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhostEdit.tpl index 4c01a6342..3178b89bb 100644 --- a/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhostEdit.tpl +++ b/gosa-plugins/apache2/admin/systems/services/apache2/servApacheVhostEdit.tpl @@ -1,7 +1,4 @@

{t}Generic{/t}

- - - - - -
@@ -23,97 +20,66 @@
-
- - - - - -
- -

{t}Server Alias{/t}

- - - - - - - -
- {$apacheServerAlias} -
- - - - - - - - - -
- -

{t}URL Alias{/t}

-
-

{t}Directory Path{/t}

-
- - - - - - -
-
-
-

-
- + + -
+ +

{t}Server Alias{/t}

+ + {$apacheServerAlias} + + + + + + + + + +
+ +

{t}URL Alias{/t}

+
+

{t}Directory Path{/t}

+
+ + + + + + +
+ +

{t}Script Alias{/t}

- - - - - - - -
- {$apacheScriptAlias} -
- - - - - - - - - -
- -

{t}Alias Directory{/t}

-
-

{t}Script Directory{/t}

-
- - - - - - -
-
-
+ {$apacheScriptAlias} + + + + + + + + + + +
+

{t}Alias Directory{/t}

+
+

{t}Script Directory{/t}

+
+ + + + + + +