]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.9.x' into 1.0.x
authorEvan Prodromou <evan@status.net>
Wed, 12 Jan 2011 23:05:56 +0000 (18:05 -0500)
committerEvan Prodromou <evan@status.net>
Wed, 12 Jan 2011 23:05:56 +0000 (18:05 -0500)
Conflicts:
README

1  2 
EVENTS.txt
README
index.php
lib/default.php

diff --combined EVENTS.txt
index 59b75599656acae8ab202e91e45924e97535aba5,6719ba737a19b4a9a4449270ab8d635e87ee8626..1a329b9c0dc9d1483d0a70c6103257cec7833d9e
@@@ -762,24 -762,6 +762,24 @@@ StartShowContentLicense: Showing the de
  EndShowContentLicense: Showing the default license for content
  - $action: the current action
  
 +GetImTransports: Get IM transports that are available
 +- &$transports: append your transport to this array like so: $transports[transportName]=array('display'=>display)
 +
 +NormalizeImScreenname: Normalize an IM screenname
 +- $transport: transport the screenname is on
 +- &$screenname: screenname to be normalized
 +
 +ValidateImScreenname: Validate an IM screenname
 +- $transport: transport the screenname is on
 +- $screenname: screenname to be validated
 +- $valid: is the screenname valid?
 +
 +SendImConfirmationCode: Send a confirmation code to confirm a user owns an IM screenname
 +- $transport: transport the screenname exists on
 +- $screenname: screenname being confirmed
 +- $code: confirmation code for confirmation URL
 +- $user: user requesting the confirmation
 +
  StartUserRegister: When a new user is being registered
  - &$profile: new profile data (no ID)
  - &$user: new user account (no ID or URI)
@@@ -1063,3 -1045,15 +1063,15 @@@ StartProfileSettingsActions: when we'r
  
  EndProfileSettingsActions: when we're showing account-management action list
  - $action: Action being shown (use for output)
+ StartOpenNoticeListItemElement: Before the opening <li> of a notice list element
+ - $nli: The notice list item being shown
+ EndOpenNoticeListItemElement: After the opening <li> of a notice list element
+ - $nli: The notice list item being shown
+ StartCloseNoticeListItemElement: Before the closing </li> of a notice list element
+ - $nli: The notice list item being shown
+ EndCloseNoticeListItemElement: After the closing </li> of a notice list element
+ - $nli: The notice list item being shown
diff --combined README
index 35a055c77b6a98b89feda2e2389d32b638087833,d972bf5676fdb0cb7c52e4f31f9cc93347aea14e..aa5532a8ecceb0f36a91650cd571193fe9c7c11d
--- 1/README
--- 2/README
+++ b/README
@@@ -873,7 -873,9 +873,7 @@@ sslserver: use an alternate server nam
      parameters correctly so that both the SSL server and the
      "normal" server can access the session cookie and
      preferably other cookies as well.
 -shorturllength: Length of URL at which URLs in a message exceeding 140
 -    characters will be sent to the user's chosen
 -    shortening service.
 +shorturllength: ignored. See 'url' section below.
  dupelimit: minimum time allowed for one person to say the same thing
      twice. Default 60s. Anything lower is considered a user
      or UI error.
@@@ -1542,22 -1544,6 +1542,22 @@@ external: external links in notices. On
      nofollowed on profile, notice, and favorites page. Default is
      'sometimes'.
  
 +url
 +---
 +
 +Everybody loves URL shorteners. These are some options for fine-tuning
 +how and when the server shortens URLs.
 +
 +shortener: URL shortening service to use by default. Users can override
 +           individually. 'ur1.ca' by default.
 +maxlength: If an URL is strictly longer than this limit, it will be
 +           shortened. Note that the URL shortener service may return an
 +           URL longer than this limit. Defaults to 25. Users can
 +           override. If set to 0, all URLs will be shortened.
 +maxnoticelength: If a notice is strictly longer than this limit, all
 +           URLs in the notice will be shortened. Users can override.
 +           -1 means the text limit for notices.
 +
  router
  ------
  
@@@ -1570,6 -1556,21 +1570,21 @@@ cache: whether to cache the router in m
      router cached) or others who see strange behavior. You're unlikely
      to need this unless you're a developer.
  
+ http
+ ----
+ Settings for the HTTP client.
+ ssl_cafile: location of the CA file for SSL. If not set, won't verify
+           SSL peers. Default unset.
+ curl: Use cURL <http://curl.haxx.se/> for doing HTTP calls. You must
+       have the PHP curl extension installed for this to work.
+ proxy_host: Host to use for proxying HTTP requests. If unset, doesn't
+           do any HTTP proxy stuff. Default unset.
+ proxy_port: Port to use to connect to HTTP proxy host. Default null.
+ proxy_user: Username to use for authenticating to the HTTP proxy. Default null.
+ proxy_password: Password to use for authenticating to the HTTP proxy. Default null.
+ proxy_auth_scheme: Scheme to use for authenticating to the HTTP proxy. Default null.
  
  Plugins
  =======
diff --combined index.php
index 5a08aa07825c4d11b87a2e726c81c1db5be8b4ee,6f011e7e5bba37bcf7a0dce17765a75625c9ca6d..f8b200a58a0df35f7ee1bdd0bcea8a3f489e5461
+++ b/index.php
@@@ -41,6 -41,8 +41,6 @@@ define('INSTALLDIR', dirname(__FILE__))
  define('STATUSNET', true);
  define('LACONICA', true); // compatibility
  
 -require_once INSTALLDIR . '/lib/common.php';
 -
  $user = null;
  $action = null;
  
@@@ -70,69 -72,52 +70,69 @@@ function getPath($req
   */
  function handleError($error)
  {
 -    if ($error->getCode() == DB_DATAOBJECT_ERROR_NODATA) {
 -        return;
 -    }
 +    try {
  
 -    $logmsg = "PEAR error: " . $error->getMessage();
 -    if (common_config('site', 'logdebug')) {
 -        $logmsg .= " : ". $error->getDebugInfo();
 -    }
 -    // DB queries often end up with a lot of newlines; merge to a single line
 -    // for easier grepability...
 -    $logmsg = str_replace("\n", " ", $logmsg);
 -    common_log(LOG_ERR, $logmsg);
 -
 -    // @fixme backtrace output should be consistent with exception handling
 -    if (common_config('site', 'logdebug')) {
 -        $bt = $error->getBacktrace();
 -        foreach ($bt as $n => $line) {
 -            common_log(LOG_ERR, formatBacktraceLine($n, $line));
 +        if ($error->getCode() == DB_DATAOBJECT_ERROR_NODATA) {
 +            return;
 +        }
 +
 +        $logmsg = "PEAR error: " . $error->getMessage();
 +        if ($error instanceof PEAR_Exception && common_config('site', 'logdebug')) {
 +            $logmsg .= " : ". $error->toText();
 +        }
 +        // DB queries often end up with a lot of newlines; merge to a single line
 +        // for easier grepability...
 +        $logmsg = str_replace("\n", " ", $logmsg);
 +        common_log(LOG_ERR, $logmsg);
 +
 +        // @fixme backtrace output should be consistent with exception handling
 +        if (common_config('site', 'logdebug')) {
 +            $bt = $error->getTrace();
 +            foreach ($bt as $n => $line) {
 +                common_log(LOG_ERR, formatBacktraceLine($n, $line));
 +            }
 +        }
 +        if ($error instanceof DB_DataObject_Error
 +            || $error instanceof DB_Error
 +            || ($error instanceof PEAR_Exception && $error->getCode() == -24)
 +        ) {
 +            //If we run into a DB error, assume we can't connect to the DB at all
 +            //so set the current user to null, so we don't try to access the DB
 +            //while rendering the error page.
 +            global $_cur;
 +            $_cur = null;
 +
 +            $msg = sprintf(
 +                _(
 +                    'The database for %s isn\'t responding correctly, '.
 +                    'so the site won\'t work properly. '.
 +                    'The site admins probably know about the problem, '.
 +                    'but you can contact them at %s to make sure. '.
 +                    'Otherwise, wait a few minutes and try again.'
 +                ),
 +                common_config('site', 'name'),
 +                common_config('site', 'email')
 +            );
 +        } else {
 +            $msg = _(
 +                'An important error occured, probably related to email setup. '.
 +                'Check logfiles for more info..'
 +            );
          }
 -    }
 -    if ($error instanceof DB_DataObject_Error
 -        || $error instanceof DB_Error
 -    ) {
 -        $msg = sprintf(
 -            _(
 -                'The database for %s isn\'t responding correctly, '.
 -                'so the site won\'t work properly. '.
 -                'The site admins probably know about the problem, '.
 -                'but you can contact them at %s to make sure. '.
 -                'Otherwise, wait a few minutes and try again.'
 -            ),
 -            common_config('site', 'name'),
 -            common_config('site', 'email')
 -        );
 -    } else {
 -        $msg = _(
 -            'An important error occured, probably related to email setup. '.
 -            'Check logfiles for more info..'
 -        );
 -    }
  
 -    $dac = new DBErrorAction($msg, 500);
 -    $dac->showPage();
 +        $dac = new DBErrorAction($msg, 500);
 +        $dac->showPage();
 +
 +    } catch (Exception $e) {
 +        echo _('An error occurred.');
 +    }
      exit(-1);
  }
  
 +set_exception_handler('handleError');
 +
 +require_once INSTALLDIR . '/lib/common.php';
 +
  /**
   * Format a backtrace line for debug output roughly like debug_print_backtrace() does.
   * Exceptions already have this built in, but PEAR error objects just give us the array.
@@@ -219,7 -204,7 +219,7 @@@ function main(
  {
      // fake HTTP redirects using lighttpd's 404 redirects
      if (strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false) {
-         $_lighty_url = $base_url.$_SERVER['REQUEST_URI'];
+         $_lighty_url = $_SERVER['REQUEST_URI'];
          $_lighty_url = @parse_url($_lighty_url);
  
          if ($_lighty_url['path'] != '/index.php' && $_lighty_url['path'] != '/') {
          return;
      }
  
 -    // For database errors
 -
 -    PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
 -
      // Make sure RW database is setup
  
      setupRW();
          return;
      }
  
 +    $site_ssl = common_config('site', 'ssl');
 +
 +    // If the request is HTTP and it should be HTTPS...
 +    if ($site_ssl != 'never' && !StatusNet::isHTTPS() && common_is_sensitive($args['action'])) {
 +        common_redirect(common_local_url($args['action'], $args));
 +        return;
 +    }
 +
      $args = array_merge($args, $_REQUEST);
  
      Event::handle('ArgsInitialize', array(&$args));
diff --combined lib/default.php
index 641528691b84e45a90c0c75a5fcb22786901af72,ce61de5ea5e499c3d793dbf23d813edd7aeea16a..9528d9cf8be30ebd39919a9275145554e9a97474
@@@ -76,8 -76,7 +76,8 @@@ $default 
                'schemacheck' => 'runtime', // 'runtime' or 'script'
                'annotate_queries' => false, // true to add caller comments to queries, eg /* POST Notice::saveNew */
                'log_queries' => false, // true to log all DB queries
 -              'log_slow_queries' => 0), // if set, log queries taking over N seconds
 +              'log_slow_queries' => 0, // if set, log queries taking over N seconds
 +              'mysql_foreign_keys' => false), // if set, enables experimental foreign key support on MySQL
          'syslog' =>
          array('appname' => 'statusnet', # for syslog
                'priority' => 'debug', # XXX: currently ignored
                                   'OStatus' => null,
                                   'WikiHashtags' => null,
                                   'RSSCloud' => null,
 +                                 'ClientSideShorten' => null,
 +                                 'StrictTransportSecurity' => null,
                                   'OpenID' => null),
                'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories
                ),
 +        'pluginlist' => array(),
          'admin' =>
 -        array('panels' => array('design', 'site', 'user', 'paths', 'access', 'sessions', 'sitenotice', 'license')),
 +        array('panels' => array('design', 'site', 'user', 'paths', 'access', 'sessions', 'sitenotice', 'license', 'plugins')),
          'singleuser' =>
          array('enabled' => false,
                'nickname' => null),
                'members' => true,
                'peopletag' => true,
                'external' => 'sometimes'), // Options: 'sometimes', 'never', default = 'sometimes'
 +        'url' =>
 +        array('shortener' => 'ur1.ca',
 +              'maxlength' => 25,
 +              'maxnoticelength' => -1),
          'http' => // HTTP client settings when contacting other sites
          array('ssl_cafile' => false, // To enable SSL cert validation, point to a CA bundle (eg '/usr/lib/ssl/certs/ca-certificates.crt')
                'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
+               'proxy_host' => null,
+               'proxy_port' => null,
+               'proxy_user' => null,
+               'proxy_password' => null,
+               'proxy_auth_scheme' => null,
                ),
        'router' =>
        array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel