From e9a32920f47ce268e3835b12abccc9fb2e1dd8c6 Mon Sep 17 00:00:00 2001
From: "terry%mozilla.org" <>
Date: Thu, 17 Feb 2000 13:15:20 +0000
Subject: Major spankage. Added a new state, UNCONFIRMED. Added new groups,
"editbugs" and "canconfirm". People without these states are now much more
limited in what they can do.
For backwards compatability, by default all users will have the
editbugs and canconfirm bits on them. Installing this changes as is
should only have one major visible effect -- an UNCONFIRMED state
will appear in the query page. But no bugs will become in that state,
until you tweak some of the new voting-related parameters you'll find
when editing products.
---
editusers.cgi | 222 +++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 159 insertions(+), 63 deletions(-)
(limited to 'editusers.cgi')
diff --git a/editusers.cgi b/editusers.cgi
index f4a6c4dfb..03819ec35 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -31,7 +31,16 @@ use strict;
require "CGI.pl";
require "globals.pl";
+# Shut up misguided -w warnings about "used only once". "use vars" just
+# doesn't work for me.
+sub sillyness {
+ my $zz;
+ $zz = $::userid;
+}
+
+my $editall;
+my $opblessgroupset = '9223372036854775807'; # This is all 64 bits.
@@ -69,59 +78,81 @@ sub CheckUser ($)
+sub EmitElement ($$)
+{
+ my ($name, $value) = (@_);
+ $value = value_quote($value);
+ if ($editall) {
+ print qq{
\n};
+ } else {
+ print qq{
$value
\n};
+ }
+}
+
+
#
# Displays the form to edit a user parameters
#
-sub EmitFormElements ($$$$$$)
+sub EmitFormElements ($$$$$$$)
{
- my ($user, $password, $realname, $groupset, $emailnotification,
- $disabledtext) = @_;
+ my ($user, $password, $realname, $groupset, $blessgroupset,
+ $emailnotification, $disabledtext) = @_;
print "
Login name:
\n";
- print "
\n";
+ EmitElement("user", $user);
print "
\n";
print "
Real name:
\n";
- print "
\n";
-
- print "
\n";
- print "
Password:
\n";
- print "
\n";
-
- print "
\n";
- print "
Email notification:
\n";
- print qq{
\n";
+ print "
Password:
\n";
+ print "
\n";
+
+ print "
\n";
+ print "
Email notification:
\n";
+ print qq{
\n";
+ print "
\n";
+ print "
Disable text:
\n";
+ print "
\n";
+ print "
\n";
+ print "
\n";
+ print "
If non-empty, then the account will\n";
+ print "be disabled, and this text should explain why.
\n";
}
- print "\n";
- print "
\n";
- print "
Disable text:
\n";
- print "
\n";
- print "
\n";
- print "
\n";
- print "
If non-empty, then the account will\n";
- print "be disabled, and this text should explain why.
\n";
-
-
- SendSQL("SELECT bit,name,description,bit & $groupset != 0
- FROM groups
- ORDER BY name");
+
+
+ SendSQL("SELECT bit,name,description,bit & $groupset != 0, " .
+ " bit & $blessgroupset " .
+ "FROM groups " .
+ "WHERE bit & $opblessgroupset != 0 " .
+ "ORDER BY name");
while (MoreSQLData()) {
- my ($bit,$name,$description,$checked) = FetchSQLData();
+ my ($bit,$name,$description,$checked,$blchecked) = FetchSQLData();
print "
\n";
+ }
}
}
@@ -165,12 +196,19 @@ confirm_login();
print "Content-type: text/html\n\n";
-unless (UserInGroup("editusers")) {
- PutHeader("Not allowed");
- print "Sorry, you aren't a member of the 'editusers' group.\n";
- print "And so, you aren't allowed to add, modify or delete users.\n";
- PutTrailer();
- exit;
+$editall = UserInGroup("editusers");
+
+if (!$editall) {
+ SendSQL("SELECT blessgroupset FROM profiles WHERE userid = $::userid");
+ $opblessgroupset = FetchOneColumn();
+ if (!$opblessgroupset) {
+ PutHeader("Not allowed");
+ print "Sorry, you aren't a member of the 'editusers' group, and you\n";
+ print "don't have permissions to put people in or out of any group.\n";
+ print "And so, you aren't allowed to add, modify or delete users.\n";
+ PutTrailer();
+ exit;
+ }
}
@@ -198,8 +236,8 @@ List users with login name matching:
@@ -261,14 +299,17 @@ if ($action eq 'list') {
}
print "
";
}
- print "
\n";
- my $span = $candelete ? 3 : 2;
- print qq{
+ if ($editall) {
+ print "