]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'refs/merge-requests/157' of git://gitorious.org/statusnet/mainline...
authorZach Copley <zach@status.net>
Thu, 7 Jul 2011 22:58:28 +0000 (15:58 -0700)
committerZach Copley <zach@status.net>
Thu, 7 Jul 2011 22:58:28 +0000 (15:58 -0700)
1  2 
actions/hostmeta.php
actions/userxrd.php
config.php.sample
lib/default.php

diff --combined actions/hostmeta.php
index e921b5ad59d4473f17c4608d61d1f6bb88e96c08,98c8a33ac986fde19069aac366d493cf8e90b2c1..4c9e9b8ae5cab2ce558f70975cab2e6b105961aa
@@@ -54,11 -54,15 +54,15 @@@ class HostMetaAction extends Actio
              $url = common_local_url('userxrd');
              $url.= '?uri={uri}';
              $xrd->links[] = array('rel' => Discovery::LRDD_REL,
 -                                  'template' => $url,
 -                                  'title' => array('Resource Descriptor'));
 +                      'template' => $url,
 +                      'title' => array('Resource Descriptor'));
              Event::handle('EndHostMetaLinks', array(&$xrd->links));
          }
  
+         global $config;
+         if($config['site']['cors'] === true){
+             header('Access-Control-Allow-Origin: *');
+         }
          header('Content-type: application/xrd+xml');
          print $xrd->toXML();
      }
diff --combined actions/userxrd.php
index 1d888064d67f094af0625b78110ef17a270c2c6b,e119d694368c128a6b2b6acf2292df10c6f8782a..4ba7f91c7e0943cde39aa3ab1faa4241919ea356
@@@ -30,6 -30,10 +30,10 @@@ class UserxrdAction extends XrdActio
      function prepare($args)
      {
          parent::prepare($args);
+         global $config;
+         if($config['site']['cors'] === true){
+             header('Access-Control-Allow-Origin: *');
+         }
  
          $this->uri = $this->trimmed('uri');
          $this->uri = self::normalize($this->uri);
@@@ -56,7 -60,6 +60,7 @@@
          }
  
          if (!$this->user) {
 +            // TRANS: Client error displayed when user not found for an action.
              $this->clientError(_('No such user.'), 404);
              return false;
          }
diff --combined config.php.sample
index 5378ad973d319ba42f7ae35e1bfaa9ce1a31f9d7,8389c333181c6321e47e4b8c4b4b7a973b1121c6..8ddac67417fd15abc83bf497ba848bbddc6e8b77
@@@ -40,6 -40,8 +40,8 @@@ $config['site']['path'] = 'statusnet'
  // $config['site']['inviteonly'] = true;
  // Make the site invisible to  non-logged-in users
  // $config['site']['private'] = true;
+ // Allow Cross-Origin Resource Sharing
+ // $config['site']['cors'] = true;
  
  // If your web server supports X-Sendfile (Apache with mod_xsendfile,
  // lighttpd, nginx), you can enable X-Sendfile support for better
@@@ -182,29 -184,6 +184,29 @@@ $config['sphinx']['port'] = 3312
  // $config['memcached']['server'] = 'localhost';
  // $config['memcached']['port'] = 11211;
  
 +// People tags
 +// Maximum number of tags a user can create:
 +// $config['peopletag']['maxtags'] = 100;
 +// Maximum number of people can have the same tag by the same user
 +// $config['peopletag']['maxpeople'] = 500;
 +// Types of users one can tag.
 +// Everyone.
 +// $config['peopletag']['allow_tagging']['all'] = true;
 +// Local only.
 +// $config['peopletag']['allow_tagging']['local'] = true;
 +// Subscriptions / Subscribers only (including remote)
 +// $config['peopletag']['allow_tagging']['subs'] = true;
 +// Remote.
 +// $config['peopletag']['allow_tagging']['remote'] = true;
 +// Examples:
 +// The following set of options allows tagging local users and
 +// remote subscribers / subscription.
 +// $config['peopletag']['allow_tagging']['all'] = false;
 +// $config['peopletag']['allow_tagging']['local'] = true;
 +// $config['peopletag']['allow_tagging']['subs'] = true;
 +// Or:
 +// $config['peopletag']['allow_tagging'] = array('local' => true, 'subs' =>true);
 +
  // Disable post-by-email
  // $config['emailpost']['enabled'] = false;
  
diff --combined lib/default.php
index 4a7d6110c5c95c5c648becf63e5655e7cdb6c44a,847610aea999dd81a33c7a8a112e88c36cdab6fa..51d62ed767de2ba735c8e8c83993076ce91d39cc
   */
  
  $default =
 -  array('site' =>
 +    array('site' =>
          array('name' => 'Just another StatusNet microblog',
                'nickname' => 'statusnet',
                'wildcard' => null,
                'server' => $_server,
 -              'theme' => 'default',
 +              'theme' => 'neo',
                'path' => $_path,
                'logfile' => null,
                'logo' => null,
@@@ -52,8 -52,8 +52,8 @@@
                'timezone' => 'UTC',
                'broughtbyurl' => null,
                'closed' => false,
 -              'inviteonly' => false,
 -              'private' => false,
 +              'inviteonly' => true,
 +              'private' => true,
                'ssl' => 'never',
                'sslserver' => null,
                'shorturllength' => 30,
                'textlimit' => 140,
                'indent' => true,
                'use_x_sendfile' => false,
+               'cors' => true,
                'notice' => null, // site wide notice text
                'build' => 1, // build number, for code-dependent cache
 +              'minify' => true, // true to use the minified versions of JS files; false to use orig files. Can aid during development
                ),
          'db' =>
          array('database' => 'YOU HAVE TO SET THIS IN config.php',
@@@ -79,8 -79,7 +80,8 @@@
                '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
                'user' => false,
                'group' => false),
          'emailpost' =>
 -        array('enabled' => true),
 +        array('enabled' => false),
          'sms' =>
 -        array('enabled' => true),
 +        array('enabled' => false),
          'twitterimport' =>
          array('enabled' => false),
          'integration' =>
          array('desclimit' => null),
          'group' =>
          array('maxaliases' => 3,
 +              'desclimit' => null,
 +              'addtag' => false),
 +        'peopletag' =>
 +        array('maxtags' => 100, // maximum number of tags a user can create.
 +              'maxpeople' => 500, // maximum no. of people with the same tag by the same user
 +              'allow_tagging' => array('all' => true), // equivalent to array('local' => true, 'remote' => true)
                'desclimit' => null),
 -        'oohembed' => array('endpoint' => 'http://oohembed.com/oohembed/'),
 +        'oembed' =>
 +        array('endpoint' => 'http://oohembed.com/oohembed/',
 +              'order' => array('built-in', 'well-known', 'service', 'discovery'),
 +        ),
          'search' =>
 -        array('type' => 'fulltext'),
 +        array('type' => 'like'),
          'sessions' =>
          array('handle' => false,   // whether to handle sessions ourselves
                'debug' => false,    // debugging output for sessions
                'gc_limit' => 1000), // max sessions to expire at a time
 -        'design' =>
 -        array('backgroundcolor' => null, // null -> 'use theme default'
 -              'contentcolor' => null,
 -              'sidebarcolor' => null,
 -              'textcolor' => null,
 -              'linkcolor' => null,
 -              'backgroundimage' => null,
 -              'disposition' => null),
 -        'custom_css' =>
 -        array('enabled' => true,
 -              'css' => ''),
          'notice' =>
 -        array('contentlimit' => null),
 +        array('contentlimit' => null,
 +              'defaultscope' => null), // null means 1 if site/private, 0 otherwise
          'message' =>
          array('contentlimit' => null),
          'location' =>
          'logincommand' =>
          array('disabled' => true),
          'plugins' =>
 -        array('default' => array('LilUrl' => array('shortenerName'=>'ur1.ca',
 -                                                   'freeService' => true,
 -                                                   'serviceUrl'=>'http://ur1.ca/'),
 -                                 'PtitUrl' => array('shortenerName' => 'ptiturl.com',
 -                                                    'serviceUrl' => 'http://ptiturl.com/?creer=oui&action=Reduire&url=%1$s'),
 -                                 'SimpleUrl' => array(array('shortenerName' => 'is.gd', 'serviceUrl' => 'http://is.gd/api.php?longurl=%1$s'),
 -                                                      array('shortenerName' => 'snipr.com', 'serviceUrl' => 'http://snipr.com/site/snip?r=simple&link=%1$s'),
 -                                                      array('shortenerName' => 'metamark.net', 'serviceUrl' => 'http://metamark.net/api/rest/simple?long_url=%1$s'),
 -                                                      array('shortenerName' => 'tinyurl.com', 'serviceUrl' => 'http://tinyurl.com/api-create.php?url=%1$s')),
 -                                 'TightUrl' => array('shortenerName' => '2tu.us', 'freeService' => true,'serviceUrl'=>'http://2tu.us/?save=y&url=%1$s'),
 -                                 'Geonames' => null,
 -                                 'Mapstraction' => null,
 -                                 'OStatus' => null,
 -                                 'WikiHashtags' => null,
 -                                 'RSSCloud' => null,
 -                                 'OpenID' => null),
 +        array('default' => array('Geonames' => null,
 +                                 'ClientSideShorten' => null,
 +                                 'StrictTransportSecurity' => null,
 +                                 'Bookmark' => null,
 +                                 'Event' => null,
 +                                 'Poll' => null,
 +                                 'QnA' => null,
 +                                 'SearchSub' => null,
 +                                 'TagSub' => null,
 +                                 'OpenID' => null,
 +                                 'Directory' => null,
 +                                 'ExtendedProfile' => null),
                'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories
                'server' => null,
                'sslserver' => null,
                'path' => null,
                'sslpath' => null,
                ),
 +        'pluginlist' => array(),
          'admin' =>
 -        array('panels' => array('design', 'site', 'user', 'paths', 'access', 'sessions', 'sitenotice', 'license')),
 +        array('panels' => array('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_password' => null,
                'proxy_auth_scheme' => null,
                ),
 -      'router' =>
 -      array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel
 -        );
 +        'router' =>
 +        array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel
 +    );