Audited the permissions names. Permissions names are to be non plural.

This commit is contained in:
Mark Crane
2013-09-21 21:45:35 +00:00
parent 6cb84a39c7
commit 8f8fd3e3e8
93 changed files with 266 additions and 266 deletions
+4 -4
View File
@@ -36,16 +36,16 @@
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
//permission details
$apps[$x]['permissions'][0]['name'] = 'variables_view';
$apps[$x]['permissions'][0]['name'] = 'variable_view';
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
$apps[$x]['permissions'][1]['name'] = 'variables_add';
$apps[$x]['permissions'][1]['name'] = 'variable_add';
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
$apps[$x]['permissions'][2]['name'] = 'variables_edit';
$apps[$x]['permissions'][2]['name'] = 'variable_edit';
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
$apps[$x]['permissions'][3]['name'] = 'variables_delete';
$apps[$x]['permissions'][3]['name'] = 'variable_delete';
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
//schema details
+1 -1
View File
@@ -26,7 +26,7 @@
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('variables_delete')) {
if (permission_exists('variable_delete')) {
//access granted
}
else {
+3 -3
View File
@@ -26,7 +26,7 @@
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('variables_add') || permission_exists('variables_edit')) {
if (permission_exists('variable_add') || permission_exists('variable_edit')) {
//access granted
}
else {
@@ -91,7 +91,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//add or update the database
if ($_POST["persistformvar"] != "true") {
if ($action == "add" && permission_exists('variables_add')) {
if ($action == "add" && permission_exists('variable_add')) {
$var_uuid = uuid();
$sql = "insert into v_vars ";
$sql .= "(";
@@ -132,7 +132,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
return;
} //if ($action == "add")
if ($action == "update" && permission_exists('variables_edit')) {
if ($action == "update" && permission_exists('variable_edit')) {
$sql = "update v_vars set ";
$sql .= "var_name = '$var_name', ";
$sql .= "var_value = '$var_value', ";
+6 -6
View File
@@ -26,7 +26,7 @@
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('variables_view')) {
if (permission_exists('variable_view')) {
//access granted
}
else {
@@ -90,7 +90,7 @@ else {
$tmp_var_header .= th_order_by('var_enabled', $text['label-enabled'], $order_by, $order);
$tmp_var_header .= "<th>".$text['label-description']."</th>\n";
$tmp_var_header .= "<td align='right' width='42'>\n";
if (permission_exists('variables_add')) {
if (permission_exists('variable_add')) {
$tmp_var_header .= " <a href='var_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
$tmp_var_header .= "</td>\n";
@@ -111,7 +111,7 @@ else {
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('variables_add')) {
if (permission_exists('variable_add')) {
echo " <a href='var_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
@@ -142,10 +142,10 @@ else {
$var_description = str_replace(" ", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $var_description);
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$var_description."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('variables_edit')) {
if (permission_exists('variable_edit')) {
echo " <a href='var_edit.php?id=".$row['var_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('variables_delete')) {
if (permission_exists('variable_delete')) {
echo " <a href='var_delete.php?id=".$row['var_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
@@ -164,7 +164,7 @@ else {
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('variables_add')) {
if (permission_exists('variable_add')) {
echo " <a href='var_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
+5 -5
View File
@@ -26,7 +26,7 @@
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('variables_view')) {
if (permission_exists('variable_view')) {
//access granted
}
else {
@@ -45,7 +45,7 @@ else {
$page["title"] = $text['title-variables_advanced'];
//restore the default vars.xml
if ($_GET['a'] == "default" && permission_exists('variables_edit')) {
if ($_GET['a'] == "default" && permission_exists('variable_edit')) {
//read default config file
$fd = fopen($_SESSION['switch']['conf']['dir'].".orig/vars.xml", "r");
$v_content = fread($fd, filesize($_SESSION['switch']['conf']['dir'].".orig/vars.xml"));
@@ -59,7 +59,7 @@ if ($_GET['a'] == "default" && permission_exists('variables_edit')) {
}
//save the vars.xml
if ($_POST['a'] == "save" && permission_exists('variables_edit')) {
if ($_POST['a'] == "save" && permission_exists('variable_edit')) {
$v_content = str_replace("\r","",$_POST['code']);
$fd = fopen($_SESSION['switch']['conf']['dir']."/vars.xml", "w");
fwrite($fd, $v_content);
@@ -107,7 +107,7 @@ if ($_GET['a'] == "default" && permission_exists('variables_edit')) {
<br /><br />
</td>
<td align='right' valign='top'>
<?php if (permission_exists('variables_edit')) { ?>
<?php if (permission_exists('variable_edit')) { ?>
<input type="submit" class='btn' value="<?=$text['button-save']?>" />
<?php } ?>
</td>
@@ -133,7 +133,7 @@ if ($_GET['a'] == "default" && permission_exists('variables_edit')) {
<input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
<input type="hidden" name="a" value="save" />
<?php
if (permission_exists('variables_edit')) {
if (permission_exists('variable_edit')) {
echo "<input type='button' class='btn' value='".$text['button-restore']."' onclick=\"document.location.href='vars.php?a=default&f=vars.xml';\" />";
}
?>