csrf for addlistitem and manage_site_files (#1798)
[openemr.git] / interface / usergroup / adminacl.php
blob605750c90b528980bbf9e6d92f9208373e247b32
1 <?php
2 /**
3 * Allows acl(php-gacl) administration. Heavily ajax and
4 * javascript/jquery dependent. All ajax functions are called
5 * from adminacl_ajax.php
7 * @package OpenEMR
8 * @link http://www.open-emr.org
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @author Ranganath Pathak <pathak01@hotmail.com>
11 * @copyright Copyright (c) 2007-2017 Brady Miller <brady.g.miller@gmail.com>
12 * @copyright Copyright (c) 2017 Ranganath Pathak <pathak01@hotmail.com>
13 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
16 require_once("../globals.php");
17 require_once("$srcdir/acl.inc");
19 use OpenEMR\Core\Header;
21 //ensure user has proper access
22 if (!acl_check('admin', 'acl')) {
23 echo "(" . xlt('ACL Administration Not Authorized') . ")";
24 exit;
27 //ensure phpgacl is installed
28 if (!isset($phpgacl_location)) {
29 echo "(" . xlt('PHP-gacl is not installed') . ")";
30 exit;
34 <html>
35 <head>
36 <title><?php echo xlt("Access Control List Administration"); ?></title>
38 <?php Header::setupHeader(); ?>
40 <script type="text/JavaScript">
41 $(document).ready(function(){
42 //using jquery-ui-1-12-1 tooltip instead of bootstrap tooltip
43 var groupTitle = "<?php echo xla('This section allows you to create and remove groups and modify or grant access privileges to existing groups. Check the check box to display section'); ?>";
44 $('#advanced-tooltip').attr( "title", "<?php echo xla('Click to manually configure access control, recommended for advanced users'); ?>" ).tooltip();
45 $('#user-tooltip').attr("title", "<?php echo xla('Click the pencil icon to grant and remove access privileges to the selected user'); ?>" ).tooltip();
46 $('#group-tooltip').attr("title", groupTitle).tooltip();
47 $('#new-group-tooltip').attr("title", "<?php echo xla('Enter values in this section to create a new group also known as Access Request Object (ARO)'); ?>").tooltip();
48 $('#remove-group-tooltip').attr("title", "<?php echo xla('Use this section to delete existing groups or Access Request Objects (AROs)'); ?>").tooltip();
49 //Show membership section by default
50 $("#membership_show").click();
51 membership_show();
52 //Show membership section by default
54 $("body").on("click", ".link_submit", function(){
55 generic_click(this);
56 return false;
57 });
59 $("body").on("click", ".button_submit", function(){
60 generic_click(this);
61 return false;
62 });
64 $("body").on("click", "#membership_show", function(){
65 membership_show();
66 return;
67 });
69 $("body").on("click", "#acl_show", function(){
70 acl_show();
71 return;
72 });
74 $("body").on("click", ".button_acl_add", function(){
75 //if Clear, then reset form
76 if (this.id == "button_acl_add_clear") {
77 $("#acl_error").empty();
78 $("#div_acl_add_form span.alert").empty();
79 return;
81 //if Cancel, then reset/hide form and show create/remove acl links
82 if (this.id == "button_acl_add_cancel") {
83 $("#div_acl_add_form").hide("slow");
84 $("#acl_error").empty();
85 $("#div_acl_add_form span.alert").empty();
86 $("#none_acl_returns").show();
87 $("#none_acl_list").show();
88 return;
90 //Submit selected, so send ajax request
91 title = $("#title_field").val();
92 identifier = $("#id_field").val();
93 return_value = $("#return_field").val();
94 description = $("#desc_field").val();
95 $.ajax({
96 type: "POST",
97 url: "../../library/ajax/adminacl_ajax.php",
98 dataType: "xml",
99 data: {
100 csrf_token_form: "<?php echo attr($_SESSION['csrf_token']); ?>",
101 control: "acl",
102 action: "add",
103 title: title,
104 identifier: identifier,
105 return_value: return_value,
106 description: description
108 success: function(xml){
109 //if successful, then show new group
110 if ($(xml).find("success").text() == "SUCCESS") {
111 $("#button_acl_add_cancel").click();
112 acl_show();
114 //Remove Loading indicator and old errors, then display new errors
115 $("#div_acl_add_form span.loading").hide();
116 $("#acl_error").empty();
117 $("#div_acl_add_form span.alert").empty();
118 $(xml).find("error").each(function(){
119 temparray = $(this).text().split("_");
120 $("#" + temparray[0] + "_error").append(temparray[1]);
122 $("#acl_error").show();
123 $("#div_acl_add_form span.alert").show();
125 beforeSend: function(){
126 //Show Loading indicator
127 $("#div_acl_add_form span.loading").show();
129 error: function(){
130 //Remove Loading indicator and show errors
131 $("#div_acl_add_form span.loading").hide();
132 $("#acl_error").empty();
133 $("#acl_error").append("<span class='alert'><?php echo xla('ERROR, unable to collect data from server'); ?><br></span>");
134 $("#acl_error").show();
137 return false;
140 $("body").on("click", ".button_acl_remove", function(){
141 //if Clear, then reset form
142 if (this.id == "button_acl_remove_clear") {
143 $("#acl_error").empty();
144 $("#div_acl_remove_form span.alert").empty();
145 return;
147 //if Cancel, then reset/hide form and show create/remove acl links
148 if (this.id == "button_acl_remove_cancel") {
149 $("#div_acl_remove_form").hide("slow");
150 $("#acl_error").empty();
151 $("#div_acl_remove_form span.alert").empty();
152 $("#none_acl_returns").show();
153 $("#none_acl_list").show();
154 return;
156 //Ensure confirmed before deleting group
157 confirmDelete = $("input[name=acl_remove_confirm]:checked").val();
158 if (confirmDelete == "no") { //send confirm alert and exit
159 $("#remove_confirm_error").empty();
160 $("#remove_confirm_error").append("<?php echo xla('Select Yes to confirm group deletion'); ?>");
161 return false;
163 //Delete and confirmed, so send ajax request
164 temparray = $("#acl_field").val().split("-");
165 title = temparray[0];
166 return_value = temparray[1];
167 $.ajax({
168 type: "POST",
169 url: "../../library/ajax/adminacl_ajax.php",
170 dataType: "xml",
171 data: {
172 csrf_token_form: "<?php echo attr($_SESSION['csrf_token']); ?>",
173 control: "acl",
174 action: "remove",
175 title: title,
176 return_value: return_value
178 success: function(xml){
179 //if successful, then show new group
180 if ($(xml).find("success").text() == "SUCCESS") {
181 $("#button_acl_remove_cancel").click();
182 acl_show();
184 //Remove Loading indicator and old errors, then display new errors
185 $("#div_acl_remove_form span.loading").hide();
186 $("#acl_error").empty();
187 $("#div_acl_remove_form span.alert").empty();
188 $(xml).find("error").each(function(){
189 temparray = $(this).text().split("_");
190 $("#" + temparray[0] + "_error").append(temparray[1]);
192 $("#acl_error").show();
193 $("#div_acl_remove_form span.alert").show();
195 beforeSend: function(){
196 //Show Loading indicator
197 $("#div_acl_remove_form span.loading").show();
199 error: function(){
200 //Remove Loading indicator and show errors
201 $("#div_acl_remove_form span.loading").hide();
202 $("#acl_error").empty();
203 $("#acl_error").append("<span class='alert'><?php echo xla('ERROR, unable to collect data from server'); ?><br></span>");
204 $("#acl_error").show();
207 return false;
210 function membership_show() {
211 if (!$("#membership_show").prop('checked')) {
212 $("#membership_error").empty();
213 $("#membership").hide("slow");
214 return;
216 //Send ajax request
217 $.ajax({
218 type: "POST",
219 url: "../../library/ajax/adminacl_ajax.php",
220 dataType: "xml",
221 data: {
222 csrf_token_form: "<?php echo attr($_SESSION['csrf_token']); ?>",
223 control: "username",
224 action: "list"
226 success: function(xml){
227 $("#membership_error").empty();
228 $("#membership").empty();
229 $(xml).find("user").each(function(){
230 username = $(this).find("username").text();
231 $("#membership").append("<div id='link_" + username + "'><span class='text'>" + username + "</span><a class='link_submit' href='no_javascript' id='" + username + "_membership_list' title='<?php echo xla('Edit'); ?> " + username + "'>&nbsp;<i class='fa fa-pencil' aria-hidden='true'></i></a></span><a class='link_submit' href='no_javascript' id='" + username + "_membership_hide' style='display: none' title='<?php echo xla('Hide'); ?> " + username + "'>&nbsp;<i class='fa fa-eye-slash' aria-hidden='true'></i></a><span class='alert' style='display: none;'>&nbsp;&nbsp;<?php echo xla('This user is not a member of any group'); ?>!!!</span><span class='loading' style='display: none;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xla('LOADING'); ?>...</span></div><div id='error_" + username + "'></div><div id='" + username + "' style='display: none'><div class='table-responsive'><table class='head'><thead><tr><th class='text-center'><span class='bold'><?php echo xla('Active'); ?></span></th><th class='text-center'><span class='bold'><?php echo xla('Inactive'); ?></span></th></tr><tbody><tr><td align='center'><select name='active[]' multiple></select><br /><p align='center'><input class='button_submit' type='button' title='<?php echo xla('Remove'); ?>' id='" + username + "_membership_remove' value=' >> '></p></td><td align='center'><select name='inactive[]' multiple></select><br /><p align='center'><input class='button_submit' type='button' title='<?php echo xla('Add'); ?>' id='" + username + "_membership_add' value=' << ' ></p></td></tr></tbody></table></div></div>");
232 if ($(this).find("alert").text() == "no membership") {
233 $("#link_" + username + " span.alert").show();
236 //Show the username list and remove loading indicator
237 $("#membership").show("slow");
238 $("#membership_edit span.loading:first").hide();
240 beforeSend: function(){
241 //Show Loading indicator
242 $("#membership_edit span.loading:first").show();
244 error: function(){
245 //Remove Loading indicator and previous error, if any, then show error
246 $("#membership_edit span.loading:first").hide();
247 $("#membership_error").empty();
248 $("#membership_error").append("<span class='alert'><?php echo xla('ERROR, unable to collect data from server'); ?><br><br></span>");
249 $("#membership_error").show();
252 return;
255 function acl_show() {
256 if (!$("#acl_show").prop('checked')) {
257 $("#acl_error").empty();
258 $("#none_acl_returns").hide();
259 $("#none_acl_list").hide();
260 $("#acl").hide("slow");
261 $("#div_acl_add_form").hide("slow");
262 $("#div_acl_remove_form").hide("slow");
263 return;
265 //Send ajax request
266 $.ajax({
267 type: "POST",
268 url: "../../library/ajax/adminacl_ajax.php",
269 dataType: "xml",
270 data: {
271 csrf_token_form: "<?php echo attr($_SESSION['csrf_token']); ?>",
272 control: "acl",
273 action: "list"
275 success: function(xml){
276 $("#acl_error").empty();
277 $("#acl").empty();
278 $(xml).find("acl").each(function(){
279 value_acl = $(this).find("value").text();
280 title = $(this).find("title").text();
281 titleDash = value_acl.replace(" ","-");
282 return_value = $(this).find("returnid").text();
283 return_title = $(this).find("returntitle").text();
284 note = $(this).find("note").text();
285 $("#acl").append("<div id='acl_link_" + titleDash + "_" + return_value + "'><span class='text' title='" + note + "'>" + title + "-" + return_title + "</span><a class='link_submit' href='no_javascript' id='" + titleDash + "_aco_list_" + return_value + "' title='<?php echo xla('Edit'); ?> " + title + "-" + return_title + "'>&nbsp;<i class='fa fa-pencil' aria-hidden='true'></i></a></span><a class='link_submit' href='no_javascript' id='" + titleDash + "_acl_hide_" + return_value + "' style='display: none' title='<?php echo xla('Hide'); ?> " + title + "-" + return_title + "'>&nbsp;<i class='fa fa-eye-slash' aria-hidden='true'></i></a><span class='loading' style='display: none;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xla('LOADING'); ?>...</span></div><div id='acl_error_" + titleDash + "_" + return_value + "'></div><div id='acl_" + titleDash + "_" + return_value + "' style='display: none'><div class='table-responsive'><table class='head'><thead><tr><th class='text-center'><span class='bold'><?php echo xla('Active'); ?></span></th><th class='text-center'><span class='bold'><?php echo xla('Inactive'); ?></span></th></tr></thead><tbody><tr><td align='center'><select name='active[]' size='6' multiple class='form-control'></select><br /><p align='center'><input class='button_submit' type='button' title='<?php echo xla('Remove'); ?>' id='" + titleDash +"_aco_remove_" + return_value + "' value=' >> '></p></td><td align='center'><select name='inactive[]' size='6' multiple class='form-control'></select><br /><p align='center'><input class='button_submit' type='button' title='<?php echo xla('Add'); ?>' id='" + titleDash + "_aco_add_" + return_value + "' value=' << ' ></p></td></tr></tbody></table></div></div>");
287 //Show the acl list and add link. Remove loading indicator.
288 $("#acl").show("slow");
289 $("#acl_edit div span.loading:first").hide();
290 $("#none_acl_returns").show();
291 $("#none_acl_list").show();
293 beforeSend: function(){
294 //Show Loading indicator
295 $("#acl_edit div span.loading:first").show();
297 error:function(){
298 //Remove Loading indicator and previous error, if any, then show error
299 $("#acl_edit div span.loading:first").hide();
300 $("#acl_error").empty();
301 $("#acl_error").append("<span class='alert'><?php echo xla('ERROR, unable to collect data from server'); ?><br><br></span>");
302 $("#acl_error").show();
305 return;
308 function generic_click(cthis) {
309 //set up variables and html page pointers
310 temparray = cthis.id.split("_");
311 identity = temparray[0];
312 identityFormatted = identity.replace("-"," ");
313 control = temparray[1];
314 action = temparray[2];
315 return_value = temparray[3];
316 if (control == "membership") {
317 contentPointer = "#" + identity.replace(/([ .])/g,"\\$1");
318 linkPointer = "#link_" + identity.replace(/([ .])/g,"\\$1");
319 linkPointerPost ="";
320 errorPointer = "#error_" + identity.replace(/([ .])/g,"\\$1");
322 if (control == "acl" || control == "aco") {
323 contentPointer = "#acl_" + identity + "_" + return_value;
324 linkPointer = "#acl_link_" + identity + "_" + return_value;
325 linkPointerPost ="";
326 errorPointer = "#acl_error_" + identity + "_" + return_value;
328 //special cases, show add/remove acl forms
329 if (identity == "none" && control == "acl") { //action == "returns"
330 if (action == "returns") {
331 contentPointer = "#div_acl_add_form";
333 else if (action == "list") {
334 contentPointer = "#div_acl_remove_form";
336 linkPointer = "#acl_edit";
337 linkPointerPost =":first";
338 errorPointer = "#acl_error";
341 //If clicked Hide link
342 if (action == "hide") {
343 //Remove stuff and show Edit link
344 $(contentPointer).hide("slow");
345 $(errorPointer).hide();
346 $(linkPointer + " a.link_submit:last").hide();
347 $(linkPointer + " a.link_submit:first").show();
348 return;
351 //If clicked Add with ACO or membership, then collect selections
352 if (action == "add" && !(control == "acl")) {
353 var selected = [];
354 selected = $(contentPointer + " select:last").val();
357 //If clicked Remove with ACO or membership, then collect selections
358 if (action == "remove" && !(control == "acl")) {
359 var selected = [];
360 selected = $(contentPointer + " select:first").val();
363 //Send ajax request
364 $.ajax({
365 type: "POST",
366 url: "../../library/ajax/adminacl_ajax.php",
367 dataType: "xml",
368 data: {
369 csrf_token_form: "<?php echo attr($_SESSION['csrf_token']); ?>",
370 name: identityFormatted,
371 control: control,
372 action: action,
373 'selection[]': selected,
374 return_value: return_value
376 success: function(xml){
378 //SPECIAL CASES to show the add/remove acl form, then exit
379 if (identity == "none" && control == "acl") {
380 $(contentPointer + " select").empty();
381 if (action == "returns") {
382 $(xml).find("return").each(function(){
383 $(contentPointer + " select").append("<option value='" + $(this).find("returnid").text() + "'>" + $(this).find("returntitle").text() + "</option>");
386 else if (action == "list") {
387 $(xml).find("acl").each(function(){
388 $(contentPointer + " select").append("<option value='" + $(this).find("value").text() + "-" + $(this).find("returnid").text() + "'>" + $(this).find("title").text() + "-" + $(this).find("returntitle").text() + "</option>");
391 $(contentPointer + " option").removeAttr('selected');
392 $(contentPointer).show("slow");
393 $("#none_acl_returns").hide();
394 $("#none_acl_list").hide();
395 $(linkPointer + " span.loading" + linkPointerPost).hide();
396 return;
399 if (control == "membership") {
400 //Remove, then re-populate, then set size of selection boxes
401 $(contentPointer + " select").empty();
402 counterActive = 0;
403 counterInactive = 0;
404 $(xml).find("active").find("group").each(function(){
405 $(contentPointer + " select:first").append("<option value='" + $(this).find("value").text() + "'>" + $(this).find("label").text() + "</option>");
406 counterActive = counterActive + 1;
408 $(xml).find("inactive").find("group").each(function(){
409 $(contentPointer + " select:last").append("<option value='" + $(this).find("value").text() + "'>" + $(this).find("label").text() + "</option>");
410 counterInactive = counterInactive + 1;
412 $(contentPointer + " option").removeAttr('selected');
413 if (counterActive > counterInactive) {
414 size = counterActive;
416 else {
417 size = counterInactive;
419 if (size > 10) {
420 size = 10;
422 if (counterActive > 0) {
423 //ensure remove the no active group alert
424 $(linkPointer + " span.alert").hide();
428 if (control == "acl" || control == "aco") {
429 //Remove, then re-populate, then set size of selection boxes
430 $(contentPointer + " select").empty();
431 counterActive = 0;
432 counterInactive = 0;
433 $(xml).find("active").find("section").each(function(){
434 $(contentPointer + " select:first").append("<optgroup label='" + $(this).find("name").text() + "'>");
435 counterActive = counterActive + 1;
436 $(this).find("aco").each(function(){
437 $(contentPointer + " select:first").append("<option value='" + $(this).find("id").text() + "'>" + $(this).find("title").text() + "</option>");
438 counterActive = counterActive + 1;
440 $(contentPointer + " select:first").append("</optgroup>");
442 $(xml).find("inactive").find("section").each(function(){
443 $(contentPointer + " select:last").append("<optgroup label='" + $(this).find("name").text() + "'>");
444 counterInactive = counterInactive + 1;
445 $(this).find("aco").each(function(){
446 $(contentPointer + " select:last").append("<option value='" + $(this).find("id").text() + "'>" + $(this).find("title").text() + "</option>");
447 counterInactive = counterInactive + 1;
449 $(contentPointer + " select:last").append("</optgroup>");
451 $(contentPointer + " option").removeAttr('selected');
452 if (counterActive > counterInactive) {
453 size = counterActive;
455 else {
456 size = counterInactive;
458 if (size > 15) {
459 size = 15;
463 //display the selection boxes
464 $(contentPointer + " select").attr('size', size);
465 $(contentPointer).show("slow");
467 if (action == "list") {
468 //Remove Edit link and show Hide link
469 $(linkPointer + " a.link_submit:first").hide();
470 $(linkPointer + " a.link_submit:last").show();
473 //Remove Loading indicator
474 $(linkPointer + " span.loading" + linkPointerPost).hide();
476 //Remove old errors, then display any new errors to user
477 $(errorPointer).empty();
478 $(xml).find("error").each(function(){
479 $(errorPointer).append("<span class='alert'>" + $(this).text() + "<br></span>");
480 $(errorPointer).show();
483 beforeSend: function(){
484 //Show Loading indicator
485 $(linkPointer + " span.loading" + linkPointerPost).show();
487 error: function(){
488 //Remove Loading indicator and show errors
489 $(linkPointer + " span.loading" + linkPointerPost).hide();
490 $(errorPointer).empty();
491 $(errorPointer).append("<span class='alert'><?php echo xla('ERROR, unable to collect data from server'); ?><br></span>");
492 $(errorPointer).show();
495 return;
498 </script>
499 <?php
500 if ($GLOBALS['enable_help'] == 1) {
501 $help_icon = '<a class="pull-right oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color:#676666" title="' . xla("Click to view Help") . '"><i class="fa fa-question-circle" aria-hidden="true"></i></a>';
502 } elseif ($GLOBALS['enable_help'] == 2) {
503 $help_icon = '<a class="pull-right oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color:#DCD6D0 !Important" title="' . xla("To enable help - Go to Administration > Globals > Features > Enable Help Modal") . '"><i class="fa fa-question-circle" aria-hidden="true"></i></a>';
504 } elseif ($GLOBALS['enable_help'] == 0) {
505 $help_icon = '';
508 </head>
509 <body class="body_top">
510 <div class="container">
511 <div class="row">
512 <div class="col-xs-12">
513 <div class="page-header clearfix">
514 <h2 class="clearfix"><span id='header_text'><?php echo xlt("Access Control List Administration"); ?></span> &nbsp;&nbsp; <?php echo ($phpgacl_location) ? "<a href='../../gacl/admin/acl_admin.php' onclick='top.restoreSession()'><i id='advanced-tooltip' class='fa fa-external-link fa-2x small' aria-hidden='true'></i> </a>" : ""; ?><?php echo $help_icon; ?></h2>
515 </div>
516 </div>
517 </div>
518 <div class="row">
519 <div class="col-xs-12">
520 <div id='membership_edit'>
521 <span class="bold"><input id='membership_show' type='checkbox'><?php echo xlt('User Memberships'); ?></span> <i id='user-tooltip' class="fa fa-info-circle text-primary" aria-hidden="true"></i>
522 <span class='loading' style='display: none;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xlt('LOADING'); ?>...</span>
523 <div id='membership_error'></div>
524 <div class="section" id='membership' style='display: none;'></div>
525 </div>
526 <div id='acl_edit'>
527 <div style='margin-bottom:5px'>
528 <span class="bold" ><input id='acl_show' type='checkbox'><?php echo xlt('Groups and Access Controls'); ?></span> <i id='group-tooltip' class="fa fa-info-circle text-primary" aria-hidden="true"></i>
529 </div>
530 <a class='link_submit btn btn-default btn-add' href='no_javascript' id='none_acl_returns' style='display: none;' title='<?php echo xla('Add New Group'); ?>'><?php echo xlt('Add New Group'); ?></a>
531 <a class='link_submit btn btn-default btn-cancel' href='no_javascript' id='none_acl_list' style='display: none;' title='<?php echo xla('Remove Group'); ?>'><?php echo xlt('Remove Group'); ?></a>
532 <span class='loading' style='display: none;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xlt('LOADING'); ?>...</span>
533 <div id='acl_error'></div>
534 <div id='div_acl_add_form' class='section' style='display: none;'>
535 <form action="no_javascript" class="clearfix" id="acl_add_form" method="post" name="acl_add_form">
536 <span class='bold'><?php echo xlt('New Group Information'); ?></span> <i id='new-group-tooltip' class="fa fa-info-circle text-primary" aria-hidden="true"></i>
537 <span class='loading' style='display: none;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xlt('LOADING'); ?>...</span>
538 <div class='col-xs-12'>
539 <div class='row'>
540 <div class='col-xs-4'>
541 <label class="control-label" for="title_field"><?php echo xlt('Title'); ?>:</label>
542 <input id="title_field" type="text" class="form-control">
543 </div>
544 <div class='col-xs-6'>
545 <br><span class="alert" id="title_error"></span>
546 </div>
547 </div>
548 <div class='row'>
549 <div class='col-xs-4'>
550 <label class="control-label" for="id_field"><?php echo xlt('Identifier(one word)'); ?>:</label>
551 <input id="id_field" type="text" class="form-control">
552 </div>
553 <div class='col-xs-6'>
554 <br><span class="alert" id="identifier_error"></span>
555 </div>
556 </div>
557 <div class='row'>
558 <div class='col-xs-4'>
559 <label class="control-label" for="return_field"><?php echo xlt('Return Value'); ?>:</label>
560 <select id="return_field" class="form-control">
561 </select>
562 </div>
563 <div class='col-xs-6'>
564 <br><span class="alert" id="return_error"></span>
565 </div>
566 </div>
567 <div class='row'>
568 <div class='col-xs-4'>
569 <label class="control-label" for="desc_field"><?php echo xlt('Description'); ?>:</label>
570 <input id="desc_field" type="text" class="form-control">
571 </div>
572 <div class='col-xs-6'>
573 <br><span class="alert" id="description_error"></span>
574 </div>
575 </div>
576 <div class="row">
577 <div class="col-xs-12" style="padding:15px 18px">
578 <button type="submit" class="button_acl_add btn btn-default" id="button_acl_add_submit" title='<?php echo xla('Add Group'); ?>'><?php echo xlt('Add Group'); ?></button>
579 <button type="reset" class="button_acl_add btn btn-link" id="button_acl_add_clear" title='<?php echo xla('Clear'); ?>'><?php echo xlt('Clear'); ?></button>
580 <button type="reset" class="button_acl_add btn btn-link btn-cancel oe-opt-btn-separate-left" id="button_acl_add_cancel" title='<?php echo xla('Cancel'); ?>'><?php echo xlt('Cancel'); ?></button>
581 </div>
582 </div>
583 </div>
584 </form>
585 </div>
586 <div id='div_acl_remove_form' class='section' style='display: none;'>
587 <form action="no_javascript" class="clearfix" id="acl_remove_form" method="post" name="acl_remove_form">
588 <div style='margin-bottom:5px'>
589 <span class='bold'><?php echo xlt('Remove Group Form'); ?></span> <i id='remove-group-tooltip' class="fa fa-info-circle text-primary" aria-hidden="true"></i>
590 <span class='loading' style='display: none;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xlt('LOADING'); ?>...</span>
591 </div>
592 <div class='col-xs-12'>
593 <div class='row'>
594 <div class='col-xs-4'>
595 <label class="control-label" for="acl_field"><?php echo xlt('Group'); ?>:</label>
596 <select id="acl_field" class='form-control'>
597 </select>
598 </div>
599 <div class='col-xs-6'>
600 <br><span class="alert" id="aclTitle_error"></span>
601 </div>
602 </div>
603 <div class='row'>
604 <div class='col-xs-12'>
605 <br>
606 <span class='text'><?php echo xlt('Do you really want to delete this group'); ?>?</span>
607 </div>
608 </div>
609 <div class='row'>
610 <div class='col-xs-4'>
611 <br>
612 <input type="radio" name="acl_remove_confirm" value="yes"><span class='text'><?php echo xlt('Yes'); ?></span>
613 <input type="radio" name="acl_remove_confirm" value="no" checked><span class='text'><?php echo xlt('No'); ?></span>
614 </div>
615 <div class='col-xs-6'>
616 <br><span class="alert" id="remove_confirm_error"></span>
617 </div>
618 </div>
619 <div class="row">
620 <div class="col-xs-12" style="padding:15px 18px">
621 <button type="submit" class="button_acl_remove btn btn-default" id="button_acl_remove_delete" title='<?php echo xla('Delete Group'); ?>'><?php echo xlt('Delete Group'); ?></button>
622 <button type="reset" class="button_acl_remove btn btn-link btn-cancel oe-opt-btn-separate-left" id="button_acl_remove_cancel" title='<?php echo xla('Cancel'); ?>'><?php echo xlt('Cancel'); ?></button>
623 </div>
624 </div>
625 </div>
626 </form>
627 </div>
628 <div class="section hideaway" id='acl' style='display: none;'></div>
629 </div>
630 </div>
631 </div>
632 </div><!--end of container div-->
633 <br>
634 <?php
635 //home of the help modal ;)
636 //$GLOBALS['enable_help'] = 0; // Please comment out line if you want help modal to function on this page
637 if ($GLOBALS['enable_help'] == 1) {
638 echo "<script>var helpFile = 'adminacl_help.php'</script>";
639 //help_modal.php lives in interface, set path accordingly
640 require "../help_modal.php";
643 </body>
644 </html>