Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

user id 1 cannot be deleted from now on

  • Loading branch information...
commit bfe0883d751331314a6d7d0ff30d6ef2d93cbb27 1 parent 59188cd
Spiros Ioannou authored
Showing with 6 additions and 0 deletions.
  1. +4 −0 init.php
  2. +2 −0  php/edituser.php
View
4 init.php
@@ -691,6 +691,10 @@ function delrack($rackid,$dbh) {
}
function deluser($userid,$dbh) {
+ if ($userid==1) {
+ echo "Cannot remove user with ID=1";
+ return;
+ }
$sql="UPDATE items set userid=1 where userid='$userid'";
$sth=db_exec($dbh,$sql);
View
2  php/edituser.php
@@ -23,6 +23,7 @@
else {
}
*/
+
deluser($delid,$dbh); //reassigns items to administrator
echo "<script>document.location='$scriptname?action=listusers'</script>\n";
echo "<a href='$scriptname?action=listusers'>Go here</a>\n</body></html>";
@@ -180,6 +181,7 @@
<td colspan=2>
<button type="submit"><img src="images/save.png" alt="Save"> <?php te("Save");?></button>
<?php
+ if ($id!=1)
echo "\n<button type='button' onclick='javascript:delconfirm2(\"{$r['id']}\",\"$scriptname?action=$action&amp;delid=$id\",\"All items will be assigned to user [id:1].\");'>".
"<img title='delete' src='images/delete.png' border=0>".t("Delete"). "</button>\n";
?>
Please sign in to comment.
Something went wrong with that request. Please try again.