]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
authorBrion Vibber <brion@pobox.com>
Mon, 8 Mar 2010 21:37:45 +0000 (13:37 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 8 Mar 2010 21:37:45 +0000 (13:37 -0800)
config.php.sample
extlib/Auth/OpenID/Consumer.php
install.php
lib/jabber.php
lib/queued_xmpp.php
lib/xmppmanager.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OpenID/User_openid.php

index 9e0b4e2acae57d4dd6d7cbc54191a917116793ce..75f5c7d557fd7e82d06370b81779111701fffe70 100644 (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
index 500890b6568def082e94b3afdc28ac893cd3592c..130fe071304530f89e3dcbd95c421db20cac8070 100644 (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");
             }
index 8c9b6138b8e06563d03112520b774d49714e599a..929277e5e857422a199233bb78141bd49387d59e 100644 (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');
 
index e1bf06ba661bfc8a8e29bdc30637c5f3d8b22032..db4e2e9a706a62f8bf905e4b34167f37416492f3 100644 (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();
+    }
 }
 
 /**
index fdd074db2996e422e934d1efa473d1df514b1526..f6bccfd5ba40ddbac9cc0edcb80b478dbdf34dc6 100644 (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}";
     }
 
     /**
index f376358555ab1aa4f442da174925fa01e6add3e7..cca54db08da4b4a016354ffa1b685564c9900fe8 100644 (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();
     
index fcca1a25219e0746530b186f0ff3062f926d4d9d..abc8100cee792dbbcfda1fbd09d3fdb1c9c65aa1 100644 (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)
     {
index 801b49eccdcd612b24a891cd4ca2392e7dcfc961..5ef05b4c774220af6ed4b416cc22ae2d286dc59f 100644 (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)