Skip to content

Commit

Permalink
import realname and email address when claiming credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
tomclegg committed Aug 25, 2010
1 parent eec86e7 commit 9e491c4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions claim-wiki-by-password.php
Expand Up @@ -36,6 +36,17 @@
$db->exec ("update or ignore wikipermission set userid_or_groupname='$q_userid' where userid_or_groupname='$q_old_username'");
$access_claimed = $db->changes();

$db->exec ("INSERT OR IGNORE INTO users (userid, realname, email)
SELECT '$q_userid',
CASE WHEN realname IS NULL AND userid NOT LIKE '%@%' THEN userid
ELSE realname END,
CASE WHEN email IS NULL AND userid LIKE '%@%' THEN userid
ELSE email END
FROM users WHERE userid='$q_old_username'");

header ("Location: claim-wiki-by-password.php?w=$wikis_claimed&g=$groups_claimed&a=$access_claimed");
exit;
}

0 comments on commit 9e491c4

Please sign in to comment.