uimport: check check to ensure the username isn't already taken before import (issue 508)
This commit is contained in:
parent
9afe50d1e5
commit
374683503a
|
@ -74,6 +74,18 @@ function import_account(&$a, $file) {
|
|||
}
|
||||
|
||||
|
||||
// check for username
|
||||
$r = q("SELECT uid FROM user WHERE nickname='%s'", $account['user']['nickname']);
|
||||
if ($r===false) {
|
||||
logger("uimport:check nickname : ERROR : ".last_error(), LOGGER_NORMAL);
|
||||
notice(t('Error! Cannot check nickname'));
|
||||
return;
|
||||
}
|
||||
if (count($r)>0) {
|
||||
notice(sprintf(t("User '%s' already exists on this server!"),$account['user']['nickname']));
|
||||
return;
|
||||
}
|
||||
|
||||
$oldbaseurl = $account['baseurl'];
|
||||
$newbaseurl = $a->get_baseurl();
|
||||
$olduid = $account['user']['uid'];
|
||||
|
|
Loading…
Reference in a new issue