]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
authorZach Copley <zach@status.net>
Sat, 17 Sep 2011 20:06:12 +0000 (13:06 -0700)
committerZach Copley <zach@status.net>
Sat, 17 Sep 2011 20:06:12 +0000 (13:06 -0700)
* 'testing' of gitorious.org:statusnet/mainline:
  disable routes that aren't available in single-user mode
  upgrade to beta4
  Better error handling when the email subsystem isn't working. The installer was dying trying to send a confirmation email to the initial user.
  Store a list of all paths the router knows about (backward compatibility with Net_URL_Mapper)
  Upgrade 0.9.x bookmarks to 1.0.x
  add hooks for upgrades

EVENTS.txt
README
lib/action.php
lib/framework.php
lib/mail.php
lib/publicgroupnav.php
lib/urlmapper.php
plugins/Bookmark/BookmarkPlugin.php
scripts/upgrade.php

index 0a9759c246c45e71a1c126dca22be98b3c11224e..922b79a865ea24d0bb85ce7347f2717a68525883 100644 (file)
@@ -1418,3 +1418,7 @@ StartShowInvitationSuccess: Right before showing invitations success msg
 EndShowInvitationSuccess: After showing invitations success msg
 - $action: invitation action
 
+StartUpgrade: when starting a site upgrade
+
+EndUpgrade: when ending a site upgrade; good place to do your own upgrades
+
diff --git a/README b/README
index bdbf2fff90a5124bd02e11378ed2e4a0c7b435aa..bfb94cb9e3ece6fa60fd8f75b6b5616e26c3d1c5 100644 (file)
--- a/README
+++ b/README
@@ -2,8 +2,8 @@
 README
 ------
 
-StatusNet 1.0.0beta3
-27 August 2011
+StatusNet 1.0.0beta4
+16 September 2011
 
 This is the README file for StatusNet, the Open Source social
 networking platform. It includes installation instructions,
index 38685f928a39732e62b96e0c9b4acf1b830d0e5b..9612a82b716342efc3c69050ada5f563baa0fe55 100644 (file)
@@ -324,8 +324,12 @@ class Action extends HTMLOutputter // lawsuit
                     $this->script('xbImportNode.js');
                     $this->script('geometa.js');
                 }
-                $this->inlineScript('var _peopletagAC = "' .
-                    common_local_url('peopletagautocomplete') . '";');
+                // This route isn't available in single-user mode.
+                // Not sure why, but it causes errors here.
+                if (!common_config('singleuser', 'enabled')) {
+                    $this->inlineScript('var _peopletagAC = "' .
+                                        common_local_url('peopletagautocomplete') . '";');
+                }
                 $this->showScriptMessages();
                 // Anti-framing code to avoid clickjacking attacks in older browsers.
                 // This will show a blank page if the page is being framed, which is
index 5b8f84eea7034bf7fb6033b6d4359cc8974598b2..5c7ca6c476acf481d2a109d9b29806d82d08c641 100644 (file)
@@ -20,7 +20,7 @@
 if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 define('STATUSNET_BASE_VERSION', '1.0.0');
-define('STATUSNET_LIFECYCLE', 'beta3'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
+define('STATUSNET_LIFECYCLE', 'beta4'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
 define('STATUSNET_VERSION', STATUSNET_BASE_VERSION . STATUSNET_LIFECYCLE);
 
 define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility
index 3f8a08f3caa751844134579b46868bf3a5c7f29e..c93464a58682f33ac1a64255b4c49885c44518f5 100644 (file)
@@ -71,18 +71,25 @@ function mail_backend()
  */
 function mail_send($recipients, $headers, $body)
 {
-    // XXX: use Mail_Queue... maybe
-    $backend = mail_backend();
-    if (!isset($headers['Content-Type'])) {
-        $headers['Content-Type'] = 'text/plain; charset=UTF-8';
-    }
-    assert($backend); // throws an error if it's bad
-    $sent = $backend->send($recipients, $headers, $body);
-    if (PEAR::isError($sent)) {
-        common_log(LOG_ERR, 'Email error: ' . $sent->getMessage());
+    try {
+        // XXX: use Mail_Queue... maybe
+        $backend = mail_backend();
+
+        if (!isset($headers['Content-Type'])) {
+           $headers['Content-Type'] = 'text/plain; charset=UTF-8';
+        }
+
+        assert($backend); // throws an error if it's bad
+        $sent = $backend->send($recipients, $headers, $body);
+        return true;
+    } catch (PEAR_Exception $e) {
+        common_log(
+            LOG_ERR,
+            "Unable to send email - '{$e->getMessage()}'. "
+            . 'Is your mail subsystem set up correctly?'
+        );
         return false;
     }
-    return true;
 }
 
 /**
index 77243fda7acb5059239f91a9198aaa9ce929f452..2b9c418440e90faffd65a5f2f02ab1068ce69542 100644 (file)
@@ -62,10 +62,12 @@ class PublicGroupNav extends Menu
         $this->action->elementStart('ul', array('class' => 'nav'));
 
         if (Event::handle('StartPublicGroupNav', array($this))) {
-            // TRANS: Menu item in search group navigation panel.
-            $this->out->menuItem(common_local_url('public'), _m('MENU','Public'),
-                // TRANS: Menu item title in search group navigation panel.
-                _('Public timeline'), $this->actionName == 'public', 'nav_timeline_public');
+            if (!common_config('singleuser', 'enabled')) {
+                // TRANS: Menu item in search group navigation panel.
+                $this->out->menuItem(common_local_url('public'), _m('MENU','Public'),
+                                     // TRANS: Menu item title in search group navigation panel.
+                                     _('Public timeline'), $this->actionName == 'public', 'nav_timeline_public');
+            }
 
             // TRANS: Menu item in search group navigation panel.
             $this->out->menuItem(common_local_url('groups'), _m('MENU','Groups'),
@@ -84,10 +86,12 @@ class PublicGroupNav extends Menu
                     _('Featured users'), $this->actionName == 'featured', 'nav_featured');
             }
 
-            // TRANS: Menu item in search group navigation panel.
-            $this->out->menuItem(common_local_url('favorited'), _m('MENU','Popular'),
-                // TRANS: Menu item title in search group navigation panel.
-                _('Popular notices'), $this->actionName == 'favorited', 'nav_timeline_favorited');
+            if (!common_config('singleuser', 'enabled')) {
+                // TRANS: Menu item in search group navigation panel.
+                $this->out->menuItem(common_local_url('favorited'), _m('MENU','Popular'),
+                                     // TRANS: Menu item title in search group navigation panel.
+                                     _('Popular notices'), $this->actionName == 'favorited', 'nav_timeline_favorited');
+            }
 
             Event::handle('EndPublicGroupNav', array($this));
         }
index fcaa66a55315b46fd5606ae74b0f107ee77c0794..d17493e21d5a8cfd645cecbf57da84eea3304b94 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2011, StatusNet, Inc.
  *
  * URL mapper
- * 
+ *
  * PHP version 5
  *
  * This program is free software: you can redistribute it and/or modify
@@ -40,7 +40,7 @@ if (!defined('STATUSNET')) {
  * Converts a path into a set of parameters, and vice versa
  *
  * We used to use Net_URL_Mapper, so there's a wrapper class at Router, q.v.
- * 
+ *
  * NUM's vagaries are the main reason we have weirdnesses here.
  *
  * @category  URL
@@ -58,6 +58,7 @@ class URLMapper
     protected $statics = array();
     protected $variables = array();
     protected $reverse = array();
+    protected $allpaths = array();
 
     function connect($path, $args, $paramPatterns=array())
     {
@@ -65,6 +66,8 @@ class URLMapper
             throw new Exception(sprintf("Can't connect %s; path has no action.", $path));
         }
 
+        $allpaths[] = $path;
+
         $action = $args[self::ACTION];
 
         $paramNames = $this->getParamNames($path);
@@ -119,7 +122,7 @@ class URLMapper
                 return $results;
             }
         }
-        
+
         throw new Exception(sprintf('No match for path "%s"', $path));
     }
 
@@ -173,7 +176,7 @@ class URLMapper
                 $path = vsprintf($format, $toFormat);
             }
 
-            if (!empty($qstring)) { 
+            if (!empty($qstring)) {
                 $formatted = http_build_query($qstring);
                 $path .= '?' . $formatted;
             }
@@ -223,6 +226,11 @@ class URLMapper
 
         return $format;
     }
+
+    public function getPaths()
+    {
+        return $this->allpaths;
+    }
 }
 
 class PatternReplacer
index 77b8a8483cfc6f244bdd3d041c6f61a0ff650139..ff68917bcca36a683f5651f47eed337b3461e13c 100644 (file)
@@ -551,4 +551,25 @@ class BookmarkPlugin extends MicroAppPlugin
         // TRANS: Application title.
         return _m('TITLE','Bookmark');
     }
+
+    function onEndUpgrade()
+    {
+        // Version 0.9.x of the plugin didn't stamp notices
+        // with verb and object-type (for obvious reasons). Update
+        // those notices here.
+
+        $notice = new Notice();
+        
+        $notice->whereAdd('exists (select uri from bookmark where bookmark.uri = notice.uri)');
+        $notice->whereAdd('((object_type is null) or (object_type = "' .ActivityObject::NOTE.'"))');
+
+        $notice->find();
+
+        while ($notice->fetch()) {
+            $original = clone($notice);
+            $notice->verb        = ActivityVerb::POST;
+            $notice->object_type = ActivityObject::BOOKMARK;
+            $notice->update($original);
+        }
+    }
 }
index 4c793ac15e43c34163dc81ede7db46bd3c608cd9..1bf444267cd54b7db7c5766c4792161c6ec1cacb 100644 (file)
@@ -33,23 +33,27 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 function main()
 {
-    updateSchemaCore();
-    updateSchemaPlugins();
+    if (Event::handle('StartUpgrade')) {
+        updateSchemaCore();
+        updateSchemaPlugins();
 
-    // These replace old "fixup_*" scripts
+        // These replace old "fixup_*" scripts
 
-    fixupNoticeRendered();
-    fixupNoticeConversation();
-    initConversation();
-    initInbox();
-    fixupGroupURI();
+        fixupNoticeRendered();
+        fixupNoticeConversation();
+        initConversation();
+        initInbox();
+        fixupGroupURI();
 
-    initLocalGroup();
-    initNoticeReshare();
+        initLocalGroup();
+        initNoticeReshare();
     
-    initFaveURI();
-    initSubscriptionURI();
-    initGroupMemberURI();
+        initFaveURI();
+        initSubscriptionURI();
+        initGroupMemberURI();
+
+        Event::handle('EndUpgrade');
+    }
 }
 
 function tableDefs()