| Attached Files | admin.diff [^] (1,121 bytes) 17-01-07 01:43 [Show Content] [Hide Content]Index: public_html/lists/admin/admin.php
===================================================================
RCS file: /cvsroot/phplist/phplist/public_html/lists/admin/admin.php,v
retrieving revision 1.3.4.2
diff -u -p -r1.3.4.2 admin.php
--- public_html/lists/admin/admin.php 28 Apr 2006 16:04:29 -0000 1.3.4.2
+++ public_html/lists/admin/admin.php 17 Jan 2007 01:37:16 -0000
@@ -31,9 +31,19 @@ if ($noaccess) {
if (!empty($_POST["change"])) {
if (empty($_POST["id"])) {
# new one
- Sql_Query(sprintf('insert into %s (namelc,created) values("%s",now())',
+ $result = Sql_query(sprintf('SELECT count(*) FROM %s WHERE namelc="%s"',
$tables["admin"],strtolower(normalize($_POST["loginname"]))));
- $id = Sql_Insert_Id();
+
+ $totalres = Sql_fetch_Row($result);
+ $total = $totalres[0];
+
+ if (!$total) {
+ Sql_Query(sprintf('insert into %s (namelc,created) values("%s",now())',
+ $tables["admin"],strtolower(normalize($_POST["loginname"]))));
+ $id = Sql_Insert_Id();
+ } else {
+ $id = 0;
+ }
} else {
$id = sprintf('%d',$_POST["id"]);
}
|