Menu

[r7]: / html / field_rights.php  Maximize  Restore  History

Download this file

132 lines (131 with data), 4.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
session_start();
$user_ID=$_SESSION[user_ID];
if (!$user_ID || $user_ID=='0')
{
header('location: index.php');
die('Login failed');
}
require("util.php");
$sql = new MySQL_class;
$sql->Create("generator");
$esql = new MySQL_class;
$esql->Create("generator");
if ($_GET[right]) { $_SESSION[var_right] = $_GET[right]; }
if ($_GET[field]) { $_SESSION[var_field] = $_GET[field]; }
$right=$_SESSION[var_right];
$field=$_SESSION[var_field];
$part_rights=array();
function get_part($part) {
global $sql, $user_ID;
$sql->Query("SELECT user_part.part, user_part.right, count(user_rights.user) AS allowed FROM user_part
LEFT JOIN user_rights ON user_rights.user='$user_ID' AND user_rights.right=user_part.user
WHERE user_part.part=$part GROUP BY user_part.part, user_part.right");
for ($i = 0; $i < $sql->rows; $i++)
{
$sql->Fetch($i);
echo "$sql->data[part]/$sql->data[right]=$sql->data[allowed]<br>";
if ($sql->data[allowed]<>'0') {
$part_rights[$sql->data[part].'/'.$sql->data[right]]=1;
}
}
}
get_part (31);
?>
<html>
<head>
<link href="list.css" type="text/css" rel=stylesheet>
<meta content="text/css" http-equiv="Content-Style-Type">
<title>Screen generator Scherm: Field rights</title>
</head>
<script type="text/javascript" src="handlers.js" language="JavaScript">
alert ("no code");
</script>
<body>
<table id=main><tr><td id=menu><?php
include 'menu.php';
?>
</td><td id=workarea><table class=ruler><tr><td>Field rights</td></tr></table>
<?php
$lastorder=$_SESSION[last_70];
$_SESSION[last_70]='';
if ($_GET[zoekitem70]) { $zoekitem70 =$_GET[zoekitem70]; } else { $zoekitem70=$_POST[zoekitem70];}
if ($zoekitem70!='')
{
$zoekitem70 = quote('%'.$zoekitem70.'%');
$query = ("
FROM `user_field`
WHERE (`field` LIKE $zoekitem70
OR `right` LIKE $zoekitem70
OR `user` LIKE $zoekitem70
) AND `user_field`.`field`='$field' AND `user_field`.`right`='$right'
");
}
else
{
$query = ("
FROM `user_field`
WHERE 1 AND `user_field`.`field`='$field' AND `user_field`.`right`='$right'
");
}
$lastrec=-1;
$sql->QueryItem("SELECT COUNT(*) AS records$query");
$records=$sql->data[records];
if ($zoekitem70<>'') {$fromrec=0;} else {
if ($lastorder=='') {$fromrec=20*$_POST[pagina];} else {
$sql->QueryItem("SELECT COUNT(*) AS fromrec$query AND `user` < $lastorder");
$fromrec=$sql->data[fromrec]-10;
if($fromrec<0) {$fromrec=0; }
$lastrec=$sql->data[fromrec]-$fromrec;
}}
$sql->Query("SELECT user_field.field as F504, user_field.right as F503, user_field.user as F505$query
ORDER BY `user` ASC
LIMIT $fromrec, 20");
if (($part_rights['31/nofilter']==0)) {
echo "<form action=\"\" method=post name=Filter>";
echo "<p class=filter>";
echo "Records: $records ";
$maxpage=(int) (($records+19)/20);
if ($maxpage>1) {
echo "Pagina: ";
echo "<select name=\"pagina\" OnChange=\"Filter.target=''; Filter.action = ''; Filter.submit();\">\n";
for ($i = 0; $i < $maxpage; $i++)
{
$nr=$i+1;
if ($i==$_POST[pagina] && $_POST[Zoek]=='' && $_POST[Reset]=='') {$sel=" selected";} else {$sel="";}
echo "<option value=$i$sel>$nr van $maxpage</option>\n";
}
echo "</select>\n";
}
echo "<input type=text name=\"zoekitem70\" size=25>";
echo "<input type=submit value=\"Zoek\">";
echo "<input type=button value=\"User field toevoegen\" onClick=\"javascript: window.open('adduser_field.php?field=$field&right=$right','','width=300,height=300,location=no,menubar=no,scrollbars=yes,status=no,resizable=yes'); return false;\">";
echo "</p>";
echo "</form>";
}
?>
<table class=list>
<tr>
<th width=0px></th>
<th width=0px></th>
<th width=0px>User</th>
</tr>
<?php
for ($i = 0; $i < $sql->rows; $i++)
{
$sql->Fetch($i);
$field = htmlspecialchars($sql->data['F504']);
$right = htmlspecialchars($sql->data['F503']);
$user = htmlspecialchars($sql->data['F505']);
if ($lastrec==$i) {$color="style=\"background-color: #aaaaff;\"";} else {$color="";}
echo ("
<tr $color onMouseOver=\"ChangeColor(this)\" onMouseOut=\"ChangeColorBack(this)\" onClick=\"window.open('edituser_field.php?field=$field&right=$right','wijzigen','width=300,height=300,location=no,menubar=no,scrollbars=yes,status=no,resizable=yes')\">
<td>$field</td>
<td>$right</td>
<td>$user</td>
</tr>");
}
?>
</table>
</td></tr></table></body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.