forked from GNUsocial/gnu-social
Merge remote branch 'origin/1.0.x' into 1.0.x
This commit is contained in:
commit
68d960cceb
@ -177,10 +177,17 @@ class DomainStatusNetworkInstaller extends Installer
|
|||||||
throw new ServerException("Could not create status_network: " . print_r($sn, true));
|
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));
|
$sn->setTags(array('domain='.$this->domain));
|
||||||
|
|
||||||
$this->sn = $sn;
|
$this->sn = $sn;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkSchema()
|
function checkSchema()
|
||||||
|
@ -79,6 +79,10 @@ class EmailregisterAction extends Action
|
|||||||
{
|
{
|
||||||
parent::prepare($argarray);
|
parent::prepare($argarray);
|
||||||
|
|
||||||
|
if (common_config('site', 'closed')) {
|
||||||
|
throw new ClientException(_('Registration not allowed.'), 403);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isPost()) {
|
if ($this->isPost()) {
|
||||||
|
|
||||||
$this->checkSessionToken();
|
$this->checkSessionToken();
|
||||||
@ -86,6 +90,9 @@ class EmailregisterAction extends Action
|
|||||||
$this->email = $this->trimmed('email');
|
$this->email = $this->trimmed('email');
|
||||||
|
|
||||||
if (!empty($this->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->email = common_canonical_email($this->email);
|
||||||
$this->state = self::NEWEMAIL;
|
$this->state = self::NEWEMAIL;
|
||||||
} else {
|
} else {
|
||||||
@ -119,6 +126,9 @@ class EmailregisterAction extends Action
|
|||||||
$this->code = $this->trimmed('code');
|
$this->code = $this->trimmed('code');
|
||||||
|
|
||||||
if (empty($this->code)) {
|
if (empty($this->code)) {
|
||||||
|
if (common_config('site', 'inviteonly')) {
|
||||||
|
throw new ClientException(_('Sorry, only invited people can register.'), 403);
|
||||||
|
}
|
||||||
$this->state = self::NEWREGISTER;
|
$this->state = self::NEWREGISTER;
|
||||||
} else {
|
} else {
|
||||||
$this->invitation = Invitation::staticGet('code', $this->code);
|
$this->invitation = Invitation::staticGet('code', $this->code);
|
||||||
|
@ -125,28 +125,6 @@ class RequireValidatedEmailPlugin extends Plugin
|
|||||||
return true;
|
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
|
* Event handler for registration attempts; rejects the registration
|
||||||
* if email field is missing.
|
* if email field is missing.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* StatusNet - a distributed open-source microblogging tool
|
* StatusNet - a distributed open-source microblogging tool
|
||||||
* Copyright (C) 2008, 2009, StatusNet, Inc.
|
* Copyright (C) 2008-2011 StatusNet, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -20,9 +20,16 @@
|
|||||||
|
|
||||||
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
|
||||||
|
|
||||||
|
$shortoptions = 'x::';
|
||||||
|
$longoptions = array('extensions=');
|
||||||
|
|
||||||
$helptext = <<<END_OF_CHECKSCHEMA_HELP
|
$helptext = <<<END_OF_CHECKSCHEMA_HELP
|
||||||
|
php checkschema.php [options]
|
||||||
Gives plugins a chance to update the database schema.
|
Gives plugins a chance to update the database schema.
|
||||||
|
|
||||||
|
-x --extensions= Comma-separated list of plugins to load before checking
|
||||||
|
|
||||||
|
|
||||||
END_OF_CHECKSCHEMA_HELP;
|
END_OF_CHECKSCHEMA_HELP;
|
||||||
|
|
||||||
require_once INSTALLDIR.'/scripts/commandline.inc';
|
require_once INSTALLDIR.'/scripts/commandline.inc';
|
||||||
@ -41,4 +48,17 @@ foreach (tableDefs() as $table => $def) {
|
|||||||
}
|
}
|
||||||
$schemaUpdater->checkSchema();
|
$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');
|
Event::handle('CheckSchema');
|
||||||
|
Loading…
Reference in New Issue
Block a user