Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x

This commit is contained in:
Brion Vibber 2010-03-08 13:37:45 -08:00
commit 42463e160d
8 changed files with 78 additions and 22 deletions

View File

@ -124,6 +124,8 @@ $config['sphinx']['port'] = 3312;
// Email info, used for all outbound email
// $config['mail']['notifyfrom'] = 'microblog@example.net';
// Domain for generating no-reply and incoming email addresses, if enabled.
// Defaults to site server name.
// $config['mail']['domain'] = 'microblog.example.net';
// See http://pear.php.net/manual/en/package.mail.mail.factory.php for options
// $config['mail']['backend'] = 'smtp';
@ -131,8 +133,6 @@ $config['sphinx']['port'] = 3312;
// 'host' => 'localhost',
// 'port' => 25,
// );
// For incoming email, if enabled. Defaults to site server name.
// $config['mail']['domain'] = 'incoming.example.net';
// exponential decay factor for tags, default 10 days
// raise this if traffic is slow, lower it if it's fast

View File

@ -966,6 +966,9 @@ class Auth_OpenID_GenericConsumer {
// framework will not want to block on this call to
// _checkAuth.
if (!$this->_checkAuth($message, $server_url)) {
var_dump($message);
var_dump($server_url);
var_dump($this);
return new Auth_OpenID_FailureResponse(null,
"Server denied check_authentication");
}

View File

@ -301,6 +301,19 @@ function checkPrereqs()
$pass = false;
}
// Look for known library bugs
$str = "abcdefghijklmnopqrstuvwxyz";
$replaced = preg_replace('/[\p{Cc}\p{Cs}]/u', '*', $str);
if ($str != $replaced) {
printf('<p class="error">PHP is linked to a version of the PCRE library ' .
'that does not support Unicode properties. ' .
'If you are running Red Hat Enterprise Linux / ' .
'CentOS 5.4 or earlier, see <a href="' .
'http://status.net/wiki/Red_Hat_Enterprise_Linux#PCRE_library' .
'">our documentation page</a> on fixing this.</p>');
$pass = false;
}
$reqs = array('gd', 'curl',
'xmlwriter', 'mbstring', 'xml', 'dom', 'simplexml');

View File

@ -88,22 +88,30 @@ class Sharing_XMPP extends XMPPHP_XMPP
/**
* Build an XMPP proxy connection that'll save outgoing messages
* to the 'xmppout' queue to be picked up by xmppdaemon later.
*
* If queueing is disabled, we'll grab a live connection.
*
* @return XMPPHP
*/
function jabber_proxy()
{
$proxy = new Queued_XMPP(common_config('xmpp', 'host') ?
common_config('xmpp', 'host') :
common_config('xmpp', 'server'),
common_config('xmpp', 'port'),
common_config('xmpp', 'user'),
common_config('xmpp', 'password'),
common_config('xmpp', 'resource') . 'daemon',
common_config('xmpp', 'server'),
common_config('xmpp', 'debug') ?
true : false,
common_config('xmpp', 'debug') ?
XMPPHP_Log::LEVEL_VERBOSE : null);
return $proxy;
if (common_config('queue', 'enabled')) {
$proxy = new Queued_XMPP(common_config('xmpp', 'host') ?
common_config('xmpp', 'host') :
common_config('xmpp', 'server'),
common_config('xmpp', 'port'),
common_config('xmpp', 'user'),
common_config('xmpp', 'password'),
common_config('xmpp', 'resource') . 'daemon',
common_config('xmpp', 'server'),
common_config('xmpp', 'debug') ?
true : false,
common_config('xmpp', 'debug') ?
XMPPHP_Log::LEVEL_VERBOSE : null);
return $proxy;
} else {
return jabber_connect();
}
}
/**

View File

@ -49,10 +49,20 @@ class Queued_XMPP extends XMPPHP_XMPP
*/
public function __construct($host, $port, $user, $password, $resource, $server = null, $printlog = false, $loglevel = null)
{
parent::__construct($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
// Normally the fulljid isn't filled out until resource binding time;
// we need to save it here since we're not talking to a real server.
$this->fulljid = "{$this->basejid}/{$this->resource}";
parent::__construct($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
// We use $host to connect, but $server to build JIDs if specified.
// This seems to fix an upstream bug where $host was used to build
// $this->basejid, never seen since it isn't actually used in the base
// classes.
if (!$server) {
$server = $this->host;
}
$this->basejid = $this->user . '@' . $server;
// Normally the fulljid is filled out by the server at resource binding
// time, but we need to do it since we're not talking to a real server.
$this->fulljid = "{$this->basejid}/{$this->resource}";
}
/**

View File

@ -36,6 +36,7 @@ class XmppManager extends IoManager
protected $site = null;
protected $pingid = 0;
protected $lastping = null;
protected $conn = null;
static protected $singletons = array();

View File

@ -428,10 +428,18 @@ class Ostatus_profile extends Memcached_DataObject
* Currently assumes that all items in the feed are new,
* coming from a PuSH hub.
*
* @param DOMDocument $feed
* @param DOMDocument $doc
* @param string $source identifier ("push")
*/
public function processFeed($feed, $source)
public function processFeed(DOMDocument $doc, $source)
{
$feed = $doc->documentElement;
if ($feed->localName != 'feed' || $feed->namespaceURI != Activity::ATOM) {
common_log(LOG_ERR, __METHOD__ . ": not an Atom feed, ignoring");
return;
}
$entries = $feed->getElementsByTagNameNS(Activity::ATOM, 'entry');
if ($entries->length == 0) {
common_log(LOG_ERR, __METHOD__ . ": no entries in feed update, ignoring");
@ -449,6 +457,7 @@ class Ostatus_profile extends Memcached_DataObject
*
* @param DOMElement $entry
* @param DOMElement $feed for context
* @param string $source identifier ("push" or "salmon")
*/
public function processEntry($entry, $feed, $source)
{

View File

@ -39,9 +39,21 @@ class User_openid extends Memcached_DataObject
);
}
/**
* List primary and unique keys in this table.
* Unique keys used for lookup *MUST* be listed to ensure proper caching.
*/
function keys()
{
return array('canonical' => 'K', 'display' => 'U');
return array('canonical' => 'K', 'display' => 'U', 'user_id' => 'U');
}
/**
* No sequence keys in this table.
*/
function sequenceKey()
{
return array(false, false, false);
}
Static function hasOpenID($user_id)