fix: Stop service modal form disabling services for read-only admin (#4994)

This commit is contained in:
Neil Lathwood
2016-11-16 04:11:47 +00:00
committed by Tony Murray
parent 7061acf508
commit 1acd938fc1

View File

@@ -10,11 +10,7 @@
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
if (is_admin() === false) {
die('ERROR: You need to be admin');
}
if (is_admin() !== false) {
?>
<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="Delete" aria-hidden="true">
@@ -30,7 +26,9 @@ if (is_admin() === false) {
<div class="modal-footer">
<form role="form" class="remove_token_form">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-danger danger" id="service-removal" data-target="service-removal">Delete</button>
<button type="submit" class="btn btn-danger danger" id="service-removal"
data-target="service-removal">Delete
</button>
<input type="hidden" name="service_id" id="service_id" value="">
<input type="hidden" name="confirm" id="confirm" value="yes">
</form>
@@ -73,3 +71,6 @@ $('#service-removal').click('', function(e) {
});
});
</script>
<?php
}
?>