diff --git a/plugins/DomainStatusNetwork/domainstatusnetworkinstaller.php b/plugins/DomainStatusNetwork/domainstatusnetworkinstaller.php index ea8220056c..c871c2328e 100644 --- a/plugins/DomainStatusNetwork/domainstatusnetworkinstaller.php +++ b/plugins/DomainStatusNetwork/domainstatusnetworkinstaller.php @@ -177,10 +177,17 @@ class DomainStatusNetworkInstaller extends Installer throw new ServerException("Could not create status_network: " . print_r($sn, true)); } + // Re-fetch; stupid auto-increment integer isn't working + + $sn = Status_network::staticGet('nickname', $sn->nickname); + + if (empty($sn)) { + throw new ServerException("Created {$this->nickname} status_network and could not find it again."); + } + $sn->setTags(array('domain='.$this->domain)); $this->sn = $sn; - } function checkSchema() diff --git a/plugins/EmailRegistration/emailregister.php b/plugins/EmailRegistration/emailregister.php index 062b054ad7..a7c8e8a2da 100644 --- a/plugins/EmailRegistration/emailregister.php +++ b/plugins/EmailRegistration/emailregister.php @@ -79,6 +79,10 @@ class EmailregisterAction extends Action { parent::prepare($argarray); + if (common_config('site', 'closed')) { + throw new ClientException(_('Registration not allowed.'), 403); + } + if ($this->isPost()) { $this->checkSessionToken(); @@ -86,6 +90,9 @@ class EmailregisterAction extends Action $this->email = $this->trimmed('email'); if (!empty($this->email)) { + if (common_config('site', 'inviteonly')) { + throw new ClientException(_('Sorry, only invited people can register.'), 403); + } $this->email = common_canonical_email($this->email); $this->state = self::NEWEMAIL; } else { @@ -119,6 +126,9 @@ class EmailregisterAction extends Action $this->code = $this->trimmed('code'); if (empty($this->code)) { + if (common_config('site', 'inviteonly')) { + throw new ClientException(_('Sorry, only invited people can register.'), 403); + } $this->state = self::NEWREGISTER; } else { $this->invitation = Invitation::staticGet('code', $this->code); diff --git a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php index 0d4bc4da16..fdb039afec 100644 --- a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php +++ b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php @@ -125,28 +125,6 @@ class RequireValidatedEmailPlugin extends Plugin return true; } - /** - * Event handler for registration attempts; rejects the registration - * if email field is missing. - * - * @param Action $action Action being executed - * - * @return bool hook result code - */ - function onStartRegistrationTry($action) - { - $email = $action->trimmed('email'); - - if (empty($email)) { - $action->showForm(_m('You must provide an email address to register.')); - return false; - } - - // Default form will run address format validation and reject if bad. - - return true; - } - /** * Event handler for registration attempts; rejects the registration * if email field is missing. diff --git a/scripts/checkschema.php b/scripts/checkschema.php index 73fd74302c..cec5773683 100755 --- a/scripts/checkschema.php +++ b/scripts/checkschema.php @@ -2,7 +2,7 @@ $def) { } $schemaUpdater->checkSchema(); +if (have_option('x', 'extensions')) { + $ext = trim(get_option_value('x', 'extensions')); + $exts = explode(',', $ext); + foreach ($exts as $plugin) { + try { + addPlugin($plugin); + } catch (Exception $e) { + print $e->getMessage()."\n"; + exit(1); + } + } +} + Event::handle('CheckSchema');