Merge "Fix undefined property notice in ChangesList"
[lhc/web/wiklou.git] / maintenance / createAndPromote.php
index 861b364..c1a2022 100644 (file)
@@ -106,6 +106,12 @@ class CreateAndPromote extends Maintenance {
                        }
                }
 
+               if ( !$exists ) {
+                       # Insert the account into the database
+                       $user->addToDatabase();
+                       $user->saveSettings();
+               }
+
                if ( $password ) {
                        # Try to set the password
                        try {
@@ -119,12 +125,6 @@ class CreateAndPromote extends Maintenance {
                        }
                }
 
-               if ( !$exists ) {
-                       # Insert the account into the database
-                       $user->addToDatabase();
-                       $user->saveSettings();
-               }
-
                # Promote user
                array_map( array( $user, 'addGroup' ), $promotions );