From 280b0b500f5f374094794648942571237ca8c687 Mon Sep 17 00:00:00 2001 From: Christopher Vollick Date: Fri, 11 Dec 2009 10:34:57 -0500 Subject: 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. --- scripts/useremail.php | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 scripts/useremail.php (limited to 'scripts/useremail.php') diff --git a/scripts/useremail.php b/scripts/useremail.php new file mode 100644 index 000000000..6676a87c8 --- /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); +} -- cgit v1.2.3-54-g00ecf