]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Include Unconfirmed Addresses Too.
authorChristopher Vollick <psycotica0@gmail.com>
Wed, 13 Jan 2010 15:27:50 +0000 (10:27 -0500)
committerChristopher Vollick <psycotica0@gmail.com>
Wed, 13 Jan 2010 15:27:50 +0000 (10:27 -0500)
Looks like there are other places in the db where email addresses can go.
Found them now!

scripts/useremail.php

index 6676a87c803d5edfccd8bb05a94e27277adf25ce..0a59d36f83fbcad75d1bb0f9ed22042a65c2c6ac 100755 (executable)
@@ -53,7 +53,17 @@ if (have_option('i', 'id')) {
 
 if (!empty($user)) {
     if (empty($user->email)) {
-        print "No email registered for user '$user->nickname'\n";
+        # Check for unconfirmed emails
+        $unconfirmed_email = new Confirm_address();
+        $unconfirmed_email->user_id = $user->id;
+        $unconfirmed_email->address_type = 'email';
+        $unconfirmed_email->find(true);
+
+        if (empty($unconfirmed_email->address)) {
+            print "No email registered for user '$user->nickname'\n";
+        } else {
+            print "Unconfirmed Adress: $unconfirmed_email->address\n";
+        }
     } else {
         print "$user->email\n";
     }
@@ -65,7 +75,18 @@ if (have_option('e', 'email')) {
     $user->email = get_option_value('e', 'email');
     $user->find(false);
     if (!$user->fetch()) {
-        print "No users with email $user->email\n";
+        # Check unconfirmed emails
+        $unconfirmed_email = new Confirm_address();
+        $unconfirmed_email->address = $user->email;
+        $unconfirmed_email->address_type = 'email';
+        $unconfirmed_email->find(true);
+
+        if (empty($unconfirmed_email->user_id)) {
+            print "No users with email $user->email\n";
+        } else {
+            $user=User::staticGet('id', $unconfirmed_email->user_id);
+            print "Unconfirmed Address: $user->id $user->nickname\n";
+        }
         exit(0);
     }
     do {