// Default is already taken
$alreadyTaken = true;
+ // Initialize instance
+ $userInstance = null;
+
// Get a registry instance
$registry = Registry::getInstance();
// Is the user already there?
- if ($registry->keyExists('userInstance')) {
+ if ($registry->instanceExists('user')) {
// Use the instance for checking for the email
- $userInstance = $registry->getInstance('userInstance');
+ $userInstance = $registry->getInstance('user');
$userInstance->setEmailAddress($email);
} else {
// If this instance is created then the username *does* exist
- $userInstance = User::createUserByEmail($userName);
+ $userInstance = User::createUserByEmail($email);
// Remember this user instance in our registry for later usage
- $registry->addInstance('userInstance', $userInstance);
+ $registry->addInstance('user', $userInstance);
}
// Does the email exist?