]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/common.php
Merge branch '0.8.x' into testing
[quix0rs-gnu-social.git] / lib / common.php
index 764c5a07702bdf8f87250ec10402cff1eff12a0c..8d79b266611fa168bd698dfd3e80091fc8c58933 100644 (file)
@@ -19,7 +19,7 @@
 
 if (!defined('LACONICA')) { exit(1); }
 
-define('LACONICA_VERSION', '0.9.0dev');
+define('LACONICA_VERSION', '0.8.1pre1');
 
 define('AVATAR_PROFILE_SIZE', 96);
 define('AVATAR_STREAM_SIZE', 48);
@@ -47,6 +47,9 @@ require_once('PEAR.php');
 require_once('DB/DataObject.php');
 require_once('DB/DataObject/Cast.php'); # for dates
 
+if (!function_exists('gettext')) {
+    require_once("php-gettext/gettext.inc");
+}
 require_once(INSTALLDIR.'/lib/language.php');
 
 // This gets included before the config file, so that admin code and plugins
@@ -82,7 +85,7 @@ if (isset($server)) {
 if (isset($path)) {
     $_path = $path;
 } else {
-    $_path = array_key_exists('SCRIPT_NAME', $_SERVER) ?
+    $_path = (array_key_exists('SERVER_NAME', $_SERVER) && array_key_exists('SCRIPT_NAME', $_SERVER)) ?
       _sn_to_path($_SERVER['SCRIPT_NAME']) :
     null;
 }
@@ -94,14 +97,6 @@ $config =
         array('name' => 'Just another Laconica microblog',
               'server' => $_server,
               'theme' => 'default',
-              'design' =>
-              array('backgroundcolor' => '#CEE1E9',
-                    'contentcolor' => '#FFFFFF',
-                    'sidebarcolor' => '#C8D1D5',
-                    'textcolor' => '#000000',
-                    'linkcolor' => '#002E6E',
-                    'backgroundimage' => null,
-                    'disposition' => 1),
               'path' => $_path,
               'logfile' => null,
               'logo' => null,
@@ -117,6 +112,7 @@ $config =
               'broughtbyurl' => null,
               'closed' => false,
               'inviteonly' => false,
+              'openidonly' => false,
               'private' => false,
               'ssl' => 'never',
               'sslserver' => null,
@@ -177,6 +173,8 @@ $config =
               'host' => null, # only set if != server
               'debug' => false, # print extra debug info
               'public' => array()), # JIDs of users who want to receive the public stream
+        'openid' =>
+        array('enabled' => true),
         'invite' =>
         array('enabled' => true),
         'sphinx' =>
@@ -191,11 +189,20 @@ $config =
         array('piddir' => '/var/run',
               'user' => false,
               'group' => false),
+        'emailpost' =>
+        array('enabled' => true),
+        'sms' =>
+        array('enabled' => true),
+        'twitter' =>
+        array('enabled' => true),
         'twitterbridge' =>
         array('enabled' => false),
         'integration' =>
         array('source' => 'Laconica', # source attribute for Twitter
               'taguri' => $_server.',2009'), # base for tag URIs
+       'twitter' =>
+       array('consumer_key'    => null,
+             'consumer_secret' => null),
         'memcached' =>
         array('enabled' => false,
               'server' => 'localhost',
@@ -261,6 +268,14 @@ $config =
         'sessions' =>
         array('handle' => false, // whether to handle sessions ourselves
               'debug' => false), // debugging output for sessions
+        'design' =>
+        array('backgroundcolor' => null, // null -> 'use theme default'
+              'contentcolor' => null,
+              'sidebarcolor' => null,
+              'textcolor' => null,
+              'linkcolor' => null,
+              'backgroundimage' => null,
+              'disposition' => null),
         );
 
 $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
@@ -277,6 +292,10 @@ $config['db'] =
         'quote_identifiers' => false,
         'type' => 'mysql' );
 
+// Backward compatibility
+
+$config['site']['design'] =& $config['design'];
+
 if (function_exists('date_default_timezone_set')) {
     /* Work internally in UTC */
     date_default_timezone_set('UTC');
@@ -357,6 +376,12 @@ if ($_db_name != 'laconica' && !array_key_exists('ini_'.$_db_name, $config['db']
     $config['db']['ini_'.$_db_name] = INSTALLDIR.'/classes/laconica.ini';
 }
 
+// Ignore openidonly if OpenID is disabled
+
+if (!$config['openid']['enabled']) {
+    $config['site']['openidonly'] = false;
+}
+
 // XXX: how many of these could be auto-loaded on use?
 
 require_once 'Validate.php';