diff options
Diffstat (limited to 'webui_templates')
-rw-r--r-- | webui_templates/distro_edit.tmpl | 30 | ||||
-rw-r--r-- | webui_templates/enoaccess.tmpl | 12 | ||||
-rw-r--r-- | webui_templates/ksfile_edit.tmpl | 33 | ||||
-rw-r--r-- | webui_templates/ksfile_view.tmpl | 6 | ||||
-rw-r--r-- | webui_templates/profile_edit.tmpl | 32 | ||||
-rw-r--r-- | webui_templates/repo_edit.tmpl | 38 | ||||
-rw-r--r-- | webui_templates/system_edit.tmpl | 55 |
7 files changed, 183 insertions, 23 deletions
diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl index 4729816..f72ab11 100644 --- a/webui_templates/distro_edit.tmpl +++ b/webui_templates/distro_edit.tmpl @@ -15,6 +15,11 @@ function disablename(value) </script> #end if +#if $editable != True +#set global $owners = $distro.owners +#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl" +#end if + <form method="POST" action="$base_url"> <fieldset id="cform"> @@ -61,6 +66,8 @@ function disablename(value) <p class="context-tip">How do you want to modify this object?</p> </td> </tr> + #else + <input type="hidden" name="editmode" value="new"/> #end if @@ -172,7 +179,27 @@ function disablename(value) </td> </tr> + <tr> + <td> + <label for="owners">Access Allowed For</label> + </td> + <td> #if $distro + #set ownerslist = ','.join($distro.owners) + #end if + <input type="text" size="255" style="width: 400px;" name="owners" id="owners" + #if $distro + value="$ownerslist" + #else + value="$user" + #end if + /> + <p class="context-tip">Applies only if using authz_ownership module, comma-delimited</p> + </td> + </tr> + + + #if $distro and $editable == True <tr> <td> <label for="delete">Delete</label> @@ -180,11 +207,13 @@ function disablename(value) <td> <input type="checkbox" name="delete1" value="delete1">Yes <input type="checkbox" name="delete2" value="delete2">Really + <input type="checkbox" name="recursive" value="recursive">Delete child objects? <p class="context-tip">Check both buttons and click save to delete this object</p> </td> </tr> #end if + #if $editable == True <tr> <td> </td> @@ -193,6 +222,7 @@ function disablename(value) <input type="reset" name="reset" value="Reset"/> </td> </tr> + #end if </table> </fieldset> diff --git a/webui_templates/enoaccess.tmpl b/webui_templates/enoaccess.tmpl new file mode 100644 index 0000000..b3a001e --- /dev/null +++ b/webui_templates/enoaccess.tmpl @@ -0,0 +1,12 @@ +#set $myowners = ", ".join($owners) + +<blockquote> +WARNING: You do not have permission to make changes to this +object. To recieve access, contact your Cobbler server administrator. +</br> + +#if $owners != [] +The access control list for this object is: <B><U>$myowners</U></B>. +#end if +</blockquote> + diff --git a/webui_templates/ksfile_edit.tmpl b/webui_templates/ksfile_edit.tmpl index 5e0c5ae..87c9f41 100644 --- a/webui_templates/ksfile_edit.tmpl +++ b/webui_templates/ksfile_edit.tmpl @@ -1,7 +1,22 @@ #extends cobbler.webui.master -#attr $title = "Cobbler: Edit Kickstart File $ksfile" +##attr $title = "Cobbler: Edit Kickstart File $ksfile" #block body + +#if $editable != True +<blockquote> +NOTE: You do not have permission to make changes to this +kickstart template and can only read it. It is possible that +other Cobbler users has secured permissions on Cobbler +profiles/systems that depend on this template -- changing this +template would ultimately affect those profile/system records which +you do not have access to. Alternatively, you may not have access +to edit *any* kickstart templates. Contact your Cobbler server administrator +if you need to resolve this. +</blockquote> +</br> +#end if + <form method="post" action="$base_url?mode=ksfile_save"> <input type="hidden" name="name" value="$name"/> <fieldset id="cform"> @@ -10,8 +25,20 @@ <pre><textarea rows="40" cols="120" name="ksdata" id="ksdata">$ksdata</textarea></pre> <br/> - <input type="submit" name="submit" value="Save"/> - <input type="reset" name="reset" value="Reset"/> + #if $editable == True + <input type="submit" name="submit" value="Save"/> + <input type="reset" name="reset" value="Reset"/> + #end if + </fieldset> </form> + +#if $editable == True +<br/> +<blockquote> +NOTE: Run a cobbler sync to after making changes here in order +for kickstart files to be regenerated. +</blockquote> +#end if + #end block body diff --git a/webui_templates/ksfile_view.tmpl b/webui_templates/ksfile_view.tmpl deleted file mode 100644 index b6abf67..0000000 --- a/webui_templates/ksfile_view.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -#extends cobbler.webui.master - -#block body -<pre class="config_data">$ksdata</pre> -#end block body - diff --git a/webui_templates/profile_edit.tmpl b/webui_templates/profile_edit.tmpl index f9eca09..0c8f156 100644 --- a/webui_templates/profile_edit.tmpl +++ b/webui_templates/profile_edit.tmpl @@ -13,6 +13,11 @@ function disablename(value) </script> #end if +#if $editable != True +#set global $owners = $profile.owners +#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl" +#end if + <form method="post" action="$base_url?mode=profile_save"> <fieldset id="cform"> @@ -75,6 +80,8 @@ function disablename(value) <p class="context-tip">How do you want to modify this object?</p> </td> </tr> + #else + <input type="hidden" name="editmode" value="new"/> #end if #if $subprofile @@ -308,8 +315,28 @@ function disablename(value) </td> </tr> - + <tr> + <td> + <label for="owners">Access Allowed For</label> + </td> + <td> #if $profile + #set ownerslist = ','.join($profile.owners) + #end if + <input type="text" size="255" style="width: 400px;" name="owners" id="owners" + #if $profile + value="$ownerslist" + #else + value="$user" + #end if + + /> + <p class="context-tip">Applies only if using authz_ownership module, comma-delimited</p> + </td> + </tr> + + + #if $profile and $editable == True <tr> <td> <label for="delete">Delete</label> @@ -317,11 +344,13 @@ function disablename(value) <td> <input type="checkbox" name="delete1" value="delete1">Yes <input type="checkbox" name="delete2" value="delete2">Really + <input type="checkbox" name="recursive" value="recursive">Delete child objects? <p class="context-tip">Check both buttons and click save to delete this object</p> </td> </tr> #end if + #if $editable == True <tr> <td> </td> @@ -330,6 +359,7 @@ function disablename(value) <input type="reset" name="reset" value="Reset"/> </td> </tr> + #end if </fieldset> #end block body diff --git a/webui_templates/repo_edit.tmpl b/webui_templates/repo_edit.tmpl index 445218f..30d516d 100644 --- a/webui_templates/repo_edit.tmpl +++ b/webui_templates/repo_edit.tmpl @@ -13,6 +13,10 @@ function disablename(value) </script> #end if +#if $editable != True +#set global $owners = $repo.owners +#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl" +#end if <form method="post" action="$base_url?mode=repo_save"> <fieldset id="cform"> @@ -58,6 +62,8 @@ function disablename(value) <p class="context-tip">How do you want to modify this object?</p> </td> </tr> + #else + <input type="hidden" name="editmode" value="new"/> #end if <tr> @@ -164,8 +170,27 @@ function disablename(value) </td> </tr> - + <tr> + <td> + <label for="owners">Access Allowed For</label> + </td> + <td> #if $repo + #set ownerslist = ','.join($repo.owners) + #end if + <input type="text" size="255" style="width: 400px;" name="owners" id="owners" + #if $repo + value="$ownerslist" + #else + value="$user" + #end if + /> + <p class="context-tip">Applies only if using authz_ownership module, comma-delimited</p> + </td> + </tr> + + + #if $repo and $editable == True <tr> <td> <label for="delete">Delete</label> @@ -178,6 +203,7 @@ function disablename(value) </tr> #end if + #if $editable == True <tr> <td> </td> @@ -185,6 +211,7 @@ function disablename(value) <input type="submit" name="submit" value="Save"/> <input type="reset" name="reset" value="Reset"/> </tr> + #end if </table> </fieldset> @@ -192,10 +219,11 @@ function disablename(value) <br/> <blockquote> -Note: Newly added repos contain no package content until "cobbler reposync" is run -from the command line, which means that profiles relying on these repositories will -not install. Placing "cobbler reposync" on a crontab to ensure frequent updates -is recommended procedure. +Note: Newly added repos contain no package content until +"cobbler reposync" is run from the command line, which means +that profiles relying on these repositories will not install. +Placing "cobbler reposync" on a crontab to ensure frequent +updates is recommended procedure. </blockquote> <br/> diff --git a/webui_templates/system_edit.tmpl b/webui_templates/system_edit.tmpl index 22bdda4..684c6d1 100644 --- a/webui_templates/system_edit.tmpl +++ b/webui_templates/system_edit.tmpl @@ -14,9 +14,11 @@ function delete_interface(num) { - #for $field in $fields - document.getElementById("${field}-intf" + num).value = ""; - #end for + #if $editable == True + #for $field in $fields + document.getElementById("${field}-intf" + num).value = ""; + #end for + #end if toggleRowVisibility("id" + num); } @@ -65,7 +67,6 @@ function get_random_mac(field) #set $defined_interfaces = [ "intf0" ] #end if - ### ### now generate the onload function. ### @@ -87,6 +88,11 @@ function page_onload() { } </script> +#if $editable != True +#set global $owners = $system.owners +#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl" +#end if + <form method="post" action="$base_url?mode=system_save"> <fieldset id="cform"> @@ -132,6 +138,8 @@ function page_onload() { <p class="context-tip">How do you want to modify this object?</p> </td> </tr> + #else + <input type="hidden" name="editmode" value="new"/> #end if <tr id="id9002"> @@ -208,6 +216,26 @@ function page_onload() { </td> </tr> + <tr> + <td> + <label for="owners">Access Allowed For</label> + </td> + <td> + #if $system + #set ownerslist = ','.join($system.owners) + #end if + <input type="text" size="255" style="width: 400px;" name="owners" id="owners" + #if $system + value="$ownerslist" + #else + value="$user" + #end if + /> + <p class="context-tip">Applies only if using authz_ownership module, comma-delimited</p> + </td> + </tr> + + ## ====================================== start of looping through interfaces @@ -366,11 +394,20 @@ function page_onload() { #if $interface != "intf0" <tr class="listrow" id="child-id${counter}-8"> <td> - <label for="enabled-$interface">Remove</label> + #if $editable == True + <label for="enabled-$interface">Remove</label> + #else + <label for="enabled-$interface">Hide</label> + #end if </td> <td> - <input type="button" name="delete-$interface" value="remove" onclick="delete_interface($counter)"> - <p class="context-tip">Clicking this button removes the interface from the configuration.</p> + #if $editable == True + <input type="button" name="delete-$interface" value="remove" onclick="delete_interface($counter)"> + <p class="context-tip">Clicking this button removes the interface from the configuration.</p> + #else + <input type="button" name="delete-$interface" value="hide" onclick="delete_interface($counter)"> + + #end if </td> </tr> #end if @@ -392,7 +429,7 @@ function page_onload() { </td> </tr> - #if $system + #if $system and $editable == True <tr id="id10001"> <td> <label for="delete">Delete</label> @@ -405,6 +442,7 @@ function page_onload() { </tr> #end if + #if $editable == True <tr id="9008"> <td> </td> @@ -413,6 +451,7 @@ function page_onload() { <input type="reset" name="reset" value="Reset"/> </td> </tr> + #end if </table> |