From 6576dbdf43a301a50d42c8d4458c0ec9d526b944 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 26 Apr 2011 16:52:04 -0400 Subject: [PATCH] Revert "Add DomainStatusNetwork plugin" This reverts commit 4479e7efc79245f67c718148340a4c0057b74f9e. --- .../scripts/#installbyemail.php# | 117 ------------------ .../scripts/installbyemail.php | 117 ------------------ .../scripts/proposesite.php | 85 ------------- .../scripts/registeremailuser.php | 49 -------- .../scripts/sitefordomain.php | 52 -------- 5 files changed, 420 deletions(-) delete mode 100644 plugins/DomainStatusNetwork/scripts/#installbyemail.php# delete mode 100644 plugins/DomainStatusNetwork/scripts/installbyemail.php delete mode 100644 plugins/DomainStatusNetwork/scripts/proposesite.php delete mode 100644 plugins/DomainStatusNetwork/scripts/registeremailuser.php delete mode 100644 plugins/DomainStatusNetwork/scripts/sitefordomain.php diff --git a/plugins/DomainStatusNetwork/scripts/#installbyemail.php# b/plugins/DomainStatusNetwork/scripts/#installbyemail.php# deleted file mode 100644 index cca726e6a0..0000000000 --- a/plugins/DomainStatusNetwork/scripts/#installbyemail.php# +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env php -. - * - * @category Installation - * @package Installation - * - * @author Brion Vibber - * @author Evan Prodromou - * @license GNU Affero General Public License http://www.gnu.org/licenses/ - * @version 1.0.0 - * @link http://status.net - */ - -if (php_sapi_name() !== 'cli') { - exit(1); -} - -define('INSTALLDIR', dirname(dirname(__FILE__))); -set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib'); - -require_once INSTALLDIR . '/lib/installer.php'; - -class EmailMultihomeInstaller extends Installer -{ - protected $address; - - function __construct($address) - { - $this->address = $address; - } - - /** - * Go for it! - * @return boolean success - */ - function main() - { - if (!$this->checkPrereqs()) { - return false; - } - if ($this->prepare()) { - return $this->handle(); - } else { - $this->showHelp(); - return false; - } - } - - /** - * Get our input parameters... - * @return boolean success - */ - - function prepare() - { - - } - - function handle() - { - return $this->doInstall(); - } - - function showHelp() - { - print "USAGE: installbyemail.php "; - } - - function warning($message, $submessage='') - { - print $this->html2text($message) . "\n"; - if ($submessage != '') { - print " " . $this->html2text($submessage) . "\n"; - } - print "\n"; - } - - function updateStatus($status, $error=false) - { - if ($this->verbose || $error) { - if ($error) { - print "ERROR: "; - } - print $this->html2text($status); - print "\n"; - } - } - - private function html2text($html) - { - // break out any links for text legibility - $breakout = preg_replace('/+]\bhref="(.*)"[^>]*>(.*)<\/a>/', - '\2 <\1>', - $html); - return html_entity_decode(strip_tags($breakout), ENT_QUOTES, 'UTF-8'); - } -} - -$installer = new EmailMultihomeInstaller(); -$ok = $installer->main($argv[1]); -exit($ok ? 0 : 1); diff --git a/plugins/DomainStatusNetwork/scripts/installbyemail.php b/plugins/DomainStatusNetwork/scripts/installbyemail.php deleted file mode 100644 index e352dfc0b7..0000000000 --- a/plugins/DomainStatusNetwork/scripts/installbyemail.php +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env php -. - * - * @category Installation - * @package Installation - * - * @author Brion Vibber - * @author Evan Prodromou - * @license GNU Affero General Public License http://www.gnu.org/licenses/ - * @version 1.0.0 - * @link http://status.net - */ - -if (php_sapi_name() !== 'cli') { - exit(1); -} - -define('INSTALLDIR', dirname(dirname(__FILE__))); -set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib'); - -require_once INSTALLDIR . '/lib/installer.php'; - -class EmailMultihomeInstaller extends Installer -{ - protected $address; - - function __construct($address) - { - $this->address = $address; - } - - /** - * Go for it! - * @return boolean success - */ - function main() - { - if (!$this->checkPrereqs()) { - return false; - } - if ($this->prepare()) { - return $this->handle(); - } else { - $this->showHelp(); - return false; - } - } - - /** - * Get our input parameters... - * @return boolean success - */ - - function prepare() - { - - } - - function handle() - { - return $this->doInstall(); - } - - function showHelp() - { - print "USAGE: installbyemail.php "; - } - - function warning($message, $submessage='') - { - print $this->html2text($message) . "\n"; - if ($submessage != '') { - print " " . $this->html2text($submessage) . "\n"; - } - print "\n"; - } - - function updateStatus($status, $error=false) - { - if ($this->verbose || $error) { - if ($error) { - print "ERROR: "; - } - print $this->html2text($status); - print "\n"; - } - } - - private function html2text($html) - { - // break out any links for text legibility - $breakout = preg_replace('/+]\bhref="(.*)"[^>]*>(.*)<\/a>/', - '\2 <\1>', - $html); - return html_entity_decode(strip_tags($breakout), ENT_QUOTES, 'UTF-8'); - } -} - -$installer = new EmailMultihomeInstaller(); -$ok = $installer->main($argv[1]); -exit($ok ? 0 : 1); diff --git a/plugins/DomainStatusNetwork/scripts/proposesite.php b/plugins/DomainStatusNetwork/scripts/proposesite.php deleted file mode 100644 index 0b0f35b76a..0000000000 --- a/plugins/DomainStatusNetwork/scripts/proposesite.php +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env php -. - */ - -define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); - -$helptext = << -Prints site information for the domain given - -END_OF_SITEFORDOMAIN_HELP; - -require_once INSTALLDIR.'/scripts/commandline.inc'; -require_once INSTALLDIR.'/plugins/EmailRegistration/extlib/effectiveTLDs.inc.php'; -require_once INSTALLDIR.'/plugins/EmailRegistration/extlib/regDomain.inc.php'; - -function nicknameAvailable($nickname) -{ - $sn = Status_network::staticGet('nickname', $nickname); - return !empty($sn); -} - -function nicknameForDomain($domain) -{ - global $tldTree; - - $registered = getRegisteredDomain($domain, $tldTree); - - $parts = explode('.', $registered); - - $base = $parts[0]; - - if (nicknameAvailable($base)) { - return $base; - } - - $domainish = str_replace('.', '-', $registered); - - if (nicknameAvailable($domainish)) { - return $domainish; - } - - $i = 1; - - // We don't need to keep doing this forever - - while ($i < 1024) { - $candidate = $domainish.'-'.$i; - if (nicknameAvailable($candidate)) { - return $candidate; - } - } - - return null; -} - -$raw = $args[0]; - - -$nickname = nicknameForDomain($domain); - -if (empty($nickname)) { - throw ClientException("No candidate found."); -} else { - print $nickname; - print "\n"; -} diff --git a/plugins/DomainStatusNetwork/scripts/registeremailuser.php b/plugins/DomainStatusNetwork/scripts/registeremailuser.php deleted file mode 100644 index a8c942d3dd..0000000000 --- a/plugins/DomainStatusNetwork/scripts/registeremailuser.php +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env php -. - */ - -define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); - -$helptext = << - -Options: --e --email Send a confirmation message to the email address - -register a new user by email address. - -END_OF_REGISTEREMAILUSER_HELP; - -require_once INSTALLDIR.'/scripts/commandline.inc'; - -if (count($args) == 0) { - show_help(); -} - -$email = $args[0]; - -$confirm = EmailRegistrationPlugin::registerEmail($email); - -if (have_option('e', 'email')) { - EmailRegistrationPlugin::sendConfirmEmail($confirm); -} - -$confirmUrl = common_local_url('register', array('code' => $confirm->code)); - -print $confirmUrl."\n"; diff --git a/plugins/DomainStatusNetwork/scripts/sitefordomain.php b/plugins/DomainStatusNetwork/scripts/sitefordomain.php deleted file mode 100644 index 80fa6375e0..0000000000 --- a/plugins/DomainStatusNetwork/scripts/sitefordomain.php +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env php -. - */ - -define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); - -$helptext = << -Prints site information for the domain given - -END_OF_SITEFORDOMAIN_HELP; - -require_once INSTALLDIR.'/scripts/commandline.inc'; - -$raw = $args[0]; - -$parts = explode('@', $raw); - -if (count($parts) == 1) { - $domain = $parts[0]; -} else { - $domain = $parts[1]; -} - -$domain = strtolower(trim($domain)); - -$snt = Status_network_tag::withTag('domain='.$domain); - -while ($snt->fetch()) { - $sn = Status_network::staticGet('site_id', $snt->site_id); - if (!empty($sn)) { - print $sn->nickname."\n"; - } -} -- 2.39.5