Bugs item #2860326, was opened at 2009-09-17 00:15
Message generated for change (Tracker Item Submitted) made by christian_boltz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2860326&group_id=191583
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Database
Group: SVN (please specify revision!)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Christian Boltz (christian_boltz)
Assigned to: Nobody/Anonymous (nobody)
Summary: Domain "ALL" is shown after manually modifying the database
Initial Comment:
SVN r718
Reproducer:
- fresh database (existing database should also work)
- create admin "a@b" with setup.php
- DELETE FROM 'admin' WHERE username = "a@b" directly in MySQL / pgsql
- create admin "a@b" with setup.php again
Results:
- list-domains shows domain "ALL" twice
- a@b is not recognized as superadmin
The reason for the first domain is the query for domain admins in list-domain.php which does not exclude 'ALL'.
The reason for the second problem is the code in setup.php:
$result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$fUsername' AND domain='ALL' AND active='1'");
if ($result['rows'] == 1)
(hint: 2 != 1)
The correct fix is to add an UNIQUE index on (username,domain) in domain_admins to avoid duplicate entries.
(To be fixed after 2.3 release because it is a corner case and adding the index might break if the database was manually modified as described before.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2860326&group_id=191583
|