From 9621904cac010bdf31f1a8128517722172ff8df4 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 12 Nov 2010 13:34:04 -0800 Subject: [PATCH 1/3] Revert "Missing one close-paren in newgroup.php" - incorrect fix for paren bug This reverts commit 3afb031d9270a29db7f1ac4a964bb4b796759827. --- actions/newgroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/newgroup.php b/actions/newgroup.php index 371e508379..2951920362 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -147,7 +147,7 @@ class NewgroupAction extends Action $this->showForm(sprintf(_m('Description is too long (maximum %d character).', 'Description is too long (maximum %d characters).', User_group::maxDescription(), - User_group::maxDescription()))); + User_group::maxDescription())); return; } else if (!is_null($location) && mb_strlen($location) > 255) { $this->showForm(_('Location is too long (maximum 255 characters).')); From e4913f97224bad0affd271e1666ca71e66aaa47e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 2 Nov 2010 14:03:50 -0700 Subject: [PATCH 2/3] fix syntax error introduced in i18n tweaks: newgroup action --- actions/newgroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/newgroup.php b/actions/newgroup.php index 2951920362..05520223c0 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -146,7 +146,7 @@ class NewgroupAction extends Action // TRANS: %d is the maximum number of allowed characters. $this->showForm(sprintf(_m('Description is too long (maximum %d character).', 'Description is too long (maximum %d characters).', - User_group::maxDescription(), + User_group::maxDescription()), User_group::maxDescription())); return; } else if (!is_null($location) && mb_strlen($location) > 255) { From defaa3b332c74741bb6df129cc51df825986a08b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 15 Nov 2010 13:26:42 -0800 Subject: [PATCH 3/3] clear_jabber.php script to clear confirmed jabber/xmpp addresses from one or more accounts --- scripts/clear_jabber.php | 92 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100755 scripts/clear_jabber.php diff --git a/scripts/clear_jabber.php b/scripts/clear_jabber.php new file mode 100755 index 0000000000..5ec53caf0e --- /dev/null +++ b/scripts/clear_jabber.php @@ -0,0 +1,92 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'i::n::y'; +$longoptions = array('id=', 'nickname=', 'yes', 'all', 'dry-run'); + +$helptext = <<whereAdd("jabber != ''"); + $user->find(true); + if ($user->N == 0) { + print "No users with registered Jabber addresses in database.\n"; + exit(1); + } +} else { + print "You must provide either an ID or a nickname.\n"; + print "\n"; + print $helptext; + exit(1); +} + +function clear_jabber($id) +{ + $user = User::staticGet('id', $id); + if ($user && $user->jabber) { + echo "clearing user $id's user.jabber, was: $user->jabber"; + if (have_option('dry-run')) { + echo " (SKIPPING)"; + } else { + $original = clone($user); + $user->jabber = null; + $result = $user->updateKeys($original); + } + echo "\n"; + } else if (!$user) { + echo "Missing user for $id\n"; + } else { + echo "Cleared jabber already for $id\n"; + } +} + +do { + clear_jabber($user->id); +} while ($user->fetch()); + +print "DONE.\n";