From: Christopher Vollick Date: Fri, 11 Dec 2009 15:34:57 +0000 (-0500) Subject: Added UserEmail script. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=280b0b500f5f374094794648942571237ca8c687;p=quix0rs-gnu-social.git Added UserEmail script. Used to query user's emails. Mostly used for administration, to see if a user requesting something is who they say. Also, some people assume that the admin knows this data, and says things like: "If you could do _____ with the account connected to this email". It'd be nice if we could do that without raw SQL. --- diff --git a/scripts/useremail.php b/scripts/useremail.php new file mode 100644 index 0000000000..6676a87c80 --- /dev/null +++ b/scripts/useremail.php @@ -0,0 +1,77 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'i:n:e:'; +$longoptions = array('id=', 'nickname=', 'email='); + +$helptext = <<email)) { + print "No email registered for user '$user->nickname'\n"; + } else { + print "$user->email\n"; + } + exit(0); +} + +if (have_option('e', 'email')) { + $user = new User(); + $user->email = get_option_value('e', 'email'); + $user->find(false); + if (!$user->fetch()) { + print "No users with email $user->email\n"; + exit(0); + } + do { + print "$user->id $user->nickname\n"; + } while ($user->fetch()); +} else { + print "You must provide either an ID, email, or a nickname.\n"; + exit(1); +}