]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/filter/validator/class_EmailValidatorFilter.php
Registerable instances now possible, some fixes in filters
[shipsimu.git] / inc / classes / main / filter / validator / class_EmailValidatorFilter.php
index a2f5628efc46c863d3d7f0c990cbd82728245ede..8d9117bd89460dba4bfc13b609b9ecba9f1d8db6 100644 (file)
@@ -135,20 +135,23 @@ class EmailValidatorFilter extends BaseFrameworkSystem implements Filterable {
                // 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?