diff options
-rw-r--r-- | config.php.sample | 4 | ||||
-rw-r--r-- | extlib/Auth/OpenID/Consumer.php | 3 | ||||
-rw-r--r-- | install.php | 13 | ||||
-rw-r--r-- | lib/jabber.php | 34 | ||||
-rw-r--r-- | lib/queued_xmpp.php | 18 | ||||
-rw-r--r-- | lib/xmppmanager.php | 1 | ||||
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 13 | ||||
-rw-r--r-- | plugins/OpenID/User_openid.php | 14 |
8 files changed, 78 insertions, 22 deletions
diff --git a/config.php.sample b/config.php.sample index 9e0b4e2ac..75f5c7d55 100644 --- a/config.php.sample +++ b/config.php.sample @@ -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 diff --git a/extlib/Auth/OpenID/Consumer.php b/extlib/Auth/OpenID/Consumer.php index 500890b65..130fe0713 100644 --- a/extlib/Auth/OpenID/Consumer.php +++ b/extlib/Auth/OpenID/Consumer.php @@ -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"); } diff --git a/install.php b/install.php index 8c9b6138b..929277e5e 100644 --- a/install.php +++ b/install.php @@ -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'); diff --git a/lib/jabber.php b/lib/jabber.php index e1bf06ba6..db4e2e9a7 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -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(); + } } /** diff --git a/lib/queued_xmpp.php b/lib/queued_xmpp.php index fdd074db2..f6bccfd5b 100644 --- a/lib/queued_xmpp.php +++ b/lib/queued_xmpp.php @@ -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}"; } /** diff --git a/lib/xmppmanager.php b/lib/xmppmanager.php index f37635855..cca54db08 100644 --- a/lib/xmppmanager.php +++ b/lib/xmppmanager.php @@ -36,6 +36,7 @@ class XmppManager extends IoManager protected $site = null; protected $pingid = 0; protected $lastping = null; + protected $conn = null; static protected $singletons = array(); diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index fcca1a252..abc8100ce 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -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) { diff --git a/plugins/OpenID/User_openid.php b/plugins/OpenID/User_openid.php index 801b49ecc..5ef05b4c7 100644 --- a/plugins/OpenID/User_openid.php +++ b/plugins/OpenID/User_openid.php @@ -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) |