summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/Session.php13
-rw-r--r--lib/common.php5
-rw-r--r--plugins/FBConnect/FBCLoginGroupNav.php20
-rw-r--r--plugins/FBConnect/FBCSettingsNav.php42
-rw-r--r--plugins/FBConnect/FBConnectPlugin.php43
-rwxr-xr-xscripts/allsites.php3
-rw-r--r--scripts/createsim.php1
-rw-r--r--scripts/decache.php1
-rw-r--r--scripts/deleteuser.php1
-rwxr-xr-xscripts/enjitqueuehandler.php1
-rwxr-xr-xscripts/facebookqueuehandler.php1
-rwxr-xr-xscripts/fixup_conversations.php1
-rwxr-xr-xscripts/fixup_hashtags.php1
-rwxr-xr-xscripts/fixup_inboxes.php1
-rwxr-xr-xscripts/fixup_notices_rendered.php1
-rwxr-xr-xscripts/fixup_replies.php1
-rwxr-xr-xscripts/fixup_utf8.php1
-rwxr-xr-xscripts/getpiddir.php1
-rwxr-xr-xscripts/getvaliddaemons.php1
-rwxr-xr-xscripts/inbox_users.php1
-rwxr-xr-xscripts/jabberqueuehandler.php1
-rwxr-xr-xscripts/maildaemon.php1
-rwxr-xr-xscripts/ombqueuehandler.php1
-rw-r--r--scripts/pingqueuehandler.php1
-rwxr-xr-xscripts/publicqueuehandler.php1
-rw-r--r--scripts/reportsnapshot.php1
-rw-r--r--scripts/sessiongc.php1
-rwxr-xr-xscripts/setpassword.php1
-rw-r--r--scripts/showcache.php1
-rwxr-xr-xscripts/smsqueuehandler.php1
-rwxr-xr-xscripts/synctwitterfriends.php2
-rw-r--r--scripts/triminboxes.php1
-rwxr-xr-xscripts/twitterqueuehandler.php1
-rwxr-xr-xscripts/twitterstatusfetcher.php2
-rw-r--r--scripts/uncache_users.php1
-rwxr-xr-xscripts/update_translations.php1
-rwxr-xr-xscripts/xmppconfirmhandler.php2
-rwxr-xr-xscripts/xmppdaemon.php1
38 files changed, 80 insertions, 81 deletions
diff --git a/classes/Session.php b/classes/Session.php
index d641edbbe..79a69a96e 100644
--- a/classes/Session.php
+++ b/classes/Session.php
@@ -85,9 +85,18 @@ class Session extends Memcached_DataObject
return $session->insert();
} else {
- $session->session_data = $session_data;
+ if (strcmp($session->session_data, $session_data) == 0) {
+ self::logdeb("Not writing session '$id'; unchanged");
+ return true;
+ } else {
+ self::logdeb("Session '$id' data changed; updating");
+
+ $orig = clone($session);
+
+ $session->session_data = $session_data;
- return $session->update();
+ return $session->update($orig);
+ }
}
}
diff --git a/lib/common.php b/lib/common.php
index 88d77732f..0b4e03184 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -196,15 +196,14 @@ $config =
array('enabled' => true),
'sms' =>
array('enabled' => true),
- 'twitter' =>
- array('enabled' => true),
'twitterbridge' =>
array('enabled' => false),
'integration' =>
array('source' => 'StatusNet', # source attribute for Twitter
'taguri' => $_server.',2009'), # base for tag URIs
'twitter' =>
- array('consumer_key' => null,
+ array('enabled' => true,
+ 'consumer_key' => null,
'consumer_secret' => null),
'memcached' =>
array('enabled' => false,
diff --git a/plugins/FBConnect/FBCLoginGroupNav.php b/plugins/FBConnect/FBCLoginGroupNav.php
index 6e12c2040..81b2520a4 100644
--- a/plugins/FBConnect/FBCLoginGroupNav.php
+++ b/plugins/FBConnect/FBCLoginGroupNav.php
@@ -78,16 +78,20 @@ class FBCLoginGroupNav extends Widget
// action => array('prompt', 'title')
$menu = array();
- $menu['login'] = array(_('Login'),
- _('Login with a username and password'));
-
- if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
- $menu['register'] = array(_('Register'),
- _('Sign up for a new account'));
+ if (!common_config('site','openidonly')) {
+ $menu['login'] = array(_('Login'),
+ _('Login with a username and password'));
+
+ if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
+ $menu['register'] = array(_('Register'),
+ _('Sign up for a new account'));
+ }
}
- $menu['openidlogin'] = array(_('OpenID'),
- _('Login or register with OpenID'));
+ if (common_config('openid', 'enabled')) {
+ $menu['openidlogin'] = array(_('OpenID'),
+ _('Login or register with OpenID'));
+ }
$menu['FBConnectLogin'] = array(_('Facebook'),
_('Login or register using Facebook'));
diff --git a/plugins/FBConnect/FBCSettingsNav.php b/plugins/FBConnect/FBCSettingsNav.php
index 29724d6bd..ed02371e2 100644
--- a/plugins/FBConnect/FBCSettingsNav.php
+++ b/plugins/FBConnect/FBCSettingsNav.php
@@ -77,32 +77,34 @@ class FBCSettingsNav extends Widget
$this->action->elementStart('dd');
# action => array('prompt', 'title')
- $menu =
- array('imsettings' =>
- array(_('IM'),
- _('Updates by instant messenger (IM)')),
- 'smssettings' =>
- array(_('SMS'),
- _('Updates by SMS')),
- 'twittersettings' =>
- array(_('Twitter'),
- _('Twitter integration options')),
- 'FBConnectSettings' =>
- array(_('Facebook'),
- _('Facebook Connect settings')));
+ $menu = array();
+ if (common_config('xmpp', 'enabled')) {
+ $menu['imsettings'] =
+ array(_('IM'),
+ _('Updates by instant messenger (IM)'));
+ }
+ if (common_config('sms', 'enabled')) {
+ $menu['smssettings'] =
+ array(_('SMS'),
+ _('Updates by SMS'));
+ }
+ if (common_config('twitter', 'enabled')) {
+ $menu['twittersettings'] =
+ array(_('Twitter'),
+ _('Twitter integration options'));
+ }
+ $menu['FBConnectSettings'] =
+ array(_('Facebook'),
+ _('Facebook Connect settings'));
$action_name = $this->action->trimmed('action');
$this->action->elementStart('ul', array('class' => 'nav'));
foreach ($menu as $menuaction => $menudesc) {
- if ($menuaction == 'imsettings' &&
- !common_config('xmpp', 'enabled')) {
- continue;
- }
$this->action->menuItem(common_local_url($menuaction),
- $menudesc[0],
- $menudesc[1],
- $action_name === $menuaction);
+ $menudesc[0],
+ $menudesc[1],
+ $action_name === $menuaction);
}
$this->action->elementEnd('ul');
diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php
index 593b49b4e..ff74aade4 100644
--- a/plugins/FBConnect/FBConnectPlugin.php
+++ b/plugins/FBConnect/FBConnectPlugin.php
@@ -232,6 +232,14 @@ class FBConnectPlugin extends Plugin
{
$user = common_current_user();
+ $connect = 'FBConnectSettings';
+ if (common_config('xmpp', 'enabled')) {
+ $connect = 'imsettings';
+ } else if (common_config('sms', 'enabled')) {
+ $connect = 'smssettings';
+ } else if (common_config('twitter', 'enabled')) {
+ $connect = 'twittersettings';
+ }
if (!empty($user)) {
@@ -266,13 +274,8 @@ class FBConnectPlugin extends Plugin
_('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
$action->menuItem(common_local_url('profilesettings'),
_('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
- if (common_config('xmpp', 'enabled')) {
- $action->menuItem(common_local_url('imsettings'),
- _('Connect'), _('Connect to IM, SMS, Twitter'), false, 'nav_connect');
- } else {
- $action->menuItem(common_local_url('smssettings'),
- _('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
- }
+ $action->menuItem(common_local_url($connect),
+ _('Connect'), _('Connect to services'), false, 'nav_connect');
if (common_config('invite', 'enabled')) {
$action->menuItem(common_local_url('invite'),
_('Invite'),
@@ -300,18 +303,30 @@ class FBConnectPlugin extends Plugin
}
}
else {
- if (!common_config('site', 'closed')) {
- $action->menuItem(common_local_url('register'),
- _('Register'), _('Create an account'), false, 'nav_register');
+ if (!common_config('site', 'openidonly')) {
+ if (!common_config('site', 'closed')) {
+ $action->menuItem(common_local_url('register'),
+ _('Register'), _('Create an account'), false, 'nav_register');
+ }
+ $action->menuItem(common_local_url('login'),
+ _('Login'), _('Login to the site'), false, 'nav_login');
+ } else {
+ $this->menuItem(common_local_url('openidlogin'),
+ _('OpenID'), _('Login with OpenID'), false, 'nav_openid');
}
- $action->menuItem(common_local_url('login'),
- _('Login'), _('Login to the site'), false, 'nav_login');
}
$action->menuItem(common_local_url('doc', array('title' => 'help')),
_('Help'), _('Help me!'), false, 'nav_help');
- $action->menuItem(common_local_url('peoplesearch'),
- _('Search'), _('Search for people or text'), false, 'nav_search');
+ if ($user || !common_config('site', 'private')) {
+ $action->menuItem(common_local_url('peoplesearch'),
+ _('Search'), _('Search for people or text'), false, 'nav_search');
+ }
+
+ // We are replacing the primary nav entirely; give other
+ // plugins a chance to handle it here.
+
+ Event::handle('EndPrimaryNav', array($action));
return false;
}
diff --git a/scripts/allsites.php b/scripts/allsites.php
index ff9d8bc80..cf1419e55 100755
--- a/scripts/allsites.php
+++ b/scripts/allsites.php
@@ -37,5 +37,4 @@ if ($sn->find()) {
while ($sn->fetch()) {
print "$sn->nickname\n";
}
-}
-?>
+} \ No newline at end of file
diff --git a/scripts/createsim.php b/scripts/createsim.php
index 93f904506..71ed3bf72 100644
--- a/scripts/createsim.php
+++ b/scripts/createsim.php
@@ -140,4 +140,3 @@ $tagmax = (have_option('t', 'tags')) ? get_option_value('t', 'tags') : 10000
$userprefix = (have_option('x', 'prefix')) ? get_option_value('x', 'prefix') : 'testuser';
main($usercount, $noticeavg, $subsavg, $tagmax);
-?>
diff --git a/scripts/decache.php b/scripts/decache.php
index 9b820bd83..7cabd78ad 100644
--- a/scripts/decache.php
+++ b/scripts/decache.php
@@ -48,4 +48,3 @@ if (!$object) {
}
$result = $object->decache();
-?>
diff --git a/scripts/deleteuser.php b/scripts/deleteuser.php
index 446f76878..52389123c 100644
--- a/scripts/deleteuser.php
+++ b/scripts/deleteuser.php
@@ -66,4 +66,3 @@ if (!have_option('y', 'yes')) {
print "Deleting...";
$user->delete();
print "DONE.\n";
-?>
diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php
index 5eda062f5..08f733b07 100755
--- a/scripts/enjitqueuehandler.php
+++ b/scripts/enjitqueuehandler.php
@@ -137,4 +137,3 @@ if ($handler->start()) {
}
$handler->finish();
-?>
diff --git a/scripts/facebookqueuehandler.php b/scripts/facebookqueuehandler.php
index dc17cb15a..e13ac4e85 100755
--- a/scripts/facebookqueuehandler.php
+++ b/scripts/facebookqueuehandler.php
@@ -72,4 +72,3 @@ if (have_option('i')) {
$handler = new FacebookQueueHandler($id);
$handler->runOnce();
-?>
diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php
index f79288f7b..8a9f7bb57 100755
--- a/scripts/fixup_conversations.php
+++ b/scripts/fixup_conversations.php
@@ -68,4 +68,3 @@ while ($nid->fetch()) {
print ".\n";
}
-?>
diff --git a/scripts/fixup_hashtags.php b/scripts/fixup_hashtags.php
index bae0947b2..5cfebd8ee 100755
--- a/scripts/fixup_hashtags.php
+++ b/scripts/fixup_hashtags.php
@@ -45,4 +45,3 @@ while ($notice->fetch()) {
common_log_db_error($notice, 'UPDATE', __FILE__);
}
}
-?>
diff --git a/scripts/fixup_inboxes.php b/scripts/fixup_inboxes.php
index 9619f3226..d55a53885 100755
--- a/scripts/fixup_inboxes.php
+++ b/scripts/fixup_inboxes.php
@@ -79,4 +79,3 @@ while ($user->fetch()) {
$cache->delete(common_cache_key('user:notices_with_friends:' . $user->id));
}
}
-?>
diff --git a/scripts/fixup_notices_rendered.php b/scripts/fixup_notices_rendered.php
index 4b928ecd2..359cd6cce 100755
--- a/scripts/fixup_notices_rendered.php
+++ b/scripts/fixup_notices_rendered.php
@@ -49,4 +49,3 @@ while ($notice->fetch()) {
common_log_db_error($notice, 'UPDATE', __FILE__);
}
}
-?>
diff --git a/scripts/fixup_replies.php b/scripts/fixup_replies.php
index 302c23915..7328635d3 100755
--- a/scripts/fixup_replies.php
+++ b/scripts/fixup_replies.php
@@ -39,4 +39,3 @@ while ($notice->fetch()) {
common_log(LOG_INFO, 'Getting replies for notice #' . $notice->id);
common_save_replies($notice);
}
-?>
diff --git a/scripts/fixup_utf8.php b/scripts/fixup_utf8.php
index 24d301dab..5a9fba7c3 100755
--- a/scripts/fixup_utf8.php
+++ b/scripts/fixup_utf8.php
@@ -363,4 +363,3 @@ $fixer = new UTF8FixerUpper(array('max_date' => $max_date,
$fixer->fixup();
-?>
diff --git a/scripts/getpiddir.php b/scripts/getpiddir.php
index 5860655fd..8274c37c0 100755
--- a/scripts/getpiddir.php
+++ b/scripts/getpiddir.php
@@ -28,4 +28,3 @@ ENDOFHELP;
require_once INSTALLDIR.'/scripts/commandline.inc';
echo common_config('daemon', 'piddir');
-?>
diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php
index 7fffac783..8f48e8e6f 100755
--- a/scripts/getvaliddaemons.php
+++ b/scripts/getvaliddaemons.php
@@ -52,4 +52,3 @@ echo "pingqueuehandler.php ";
if (common_config('sms', 'enabled')) {
echo "smsqueuehandler.php ";
}
-?>
diff --git a/scripts/inbox_users.php b/scripts/inbox_users.php
index 718dd856b..32adcea21 100755
--- a/scripts/inbox_users.php
+++ b/scripts/inbox_users.php
@@ -105,4 +105,3 @@ foreach ($ids as $id) {
$cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last'));
}
}
-?>
diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php
index b029ea1f1..8f3a56944 100755
--- a/scripts/jabberqueuehandler.php
+++ b/scripts/jabberqueuehandler.php
@@ -76,4 +76,3 @@ if (have_option('i')) {
$handler = new JabberQueueHandler($id);
$handler->runOnce();
-?>
diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php
index 19c77e077..11911dcbd 100755
--- a/scripts/maildaemon.php
+++ b/scripts/maildaemon.php
@@ -389,4 +389,3 @@ if (common_config('emailpost', 'enabled')) {
$md = new MailerDaemon();
$md->handle_message('php://stdin');
}
-?>
diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php
index a24185da3..8e685f1c8 100755
--- a/scripts/ombqueuehandler.php
+++ b/scripts/ombqueuehandler.php
@@ -85,4 +85,3 @@ if (have_option('i')) {
$handler = new OmbQueueHandler($id);
$handler->runOnce();
-?>
diff --git a/scripts/pingqueuehandler.php b/scripts/pingqueuehandler.php
index 768c06c77..c92337e36 100644
--- a/scripts/pingqueuehandler.php
+++ b/scripts/pingqueuehandler.php
@@ -67,4 +67,3 @@ if (have_option('i')) {
$handler = new PingQueueHandler($id);
$handler->runOnce();
-?>
diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php
index ffb5acdb6..50a11bcba 100755
--- a/scripts/publicqueuehandler.php
+++ b/scripts/publicqueuehandler.php
@@ -74,4 +74,3 @@ if (have_option('i')) {
$handler = new PublicQueueHandler($id);
$handler->runOnce();
-?>
diff --git a/scripts/reportsnapshot.php b/scripts/reportsnapshot.php
index b8f8d2a7c..71f1019ee 100644
--- a/scripts/reportsnapshot.php
+++ b/scripts/reportsnapshot.php
@@ -28,4 +28,3 @@ END_OF_SNAPSHOT_HELP;
require_once INSTALLDIR.'/scripts/commandline.inc';
Snapshot::check();
-?>
diff --git a/scripts/sessiongc.php b/scripts/sessiongc.php
index b5fdcbf34..af55ddf3f 100644
--- a/scripts/sessiongc.php
+++ b/scripts/sessiongc.php
@@ -34,4 +34,3 @@ $maxlifetime = ini_get('session.gc_maxlifetime');
print "Deleting sessions older than $maxlifetime seconds.\n";
Session::gc($maxlifetime);
-?>
diff --git a/scripts/setpassword.php b/scripts/setpassword.php
index f951dccf7..50d49d7db 100755
--- a/scripts/setpassword.php
+++ b/scripts/setpassword.php
@@ -59,4 +59,3 @@ if (!$user->update($original)) {
print "Password for user '$nickname' updated.\n";
exit(0);
}
-?>
diff --git a/scripts/showcache.php b/scripts/showcache.php
index fb0ccb5e0..f17979572 100644
--- a/scripts/showcache.php
+++ b/scripts/showcache.php
@@ -69,4 +69,3 @@ if (empty($obj)) {
var_dump($obj);
print "\n";
}
-?>
diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php
index 9e8de7a11..6583a77da 100755
--- a/scripts/smsqueuehandler.php
+++ b/scripts/smsqueuehandler.php
@@ -71,4 +71,3 @@ if (have_option('i')) {
$handler = new SmsQueueHandler($id);
$handler->runOnce();
-?>
diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php
index f582231e3..b30e700a1 100755
--- a/scripts/synctwitterfriends.php
+++ b/scripts/synctwitterfriends.php
@@ -283,4 +283,4 @@ if (have_option('d') || have_option('debug')) {
$syncer = new SyncTwitterFriendsDaemon($id, 60, 2, $debug);
$syncer->runOnce();
-?>
+
diff --git a/scripts/triminboxes.php b/scripts/triminboxes.php
index 5153d1706..da09817e5 100644
--- a/scripts/triminboxes.php
+++ b/scripts/triminboxes.php
@@ -54,4 +54,3 @@ $cnt = $user->find();
while ($user->fetch()) {
Notice_inbox::gc($user->id);
}
-?>
diff --git a/scripts/twitterqueuehandler.php b/scripts/twitterqueuehandler.php
index 820baeb0a..ce4d824d0 100755
--- a/scripts/twitterqueuehandler.php
+++ b/scripts/twitterqueuehandler.php
@@ -72,4 +72,3 @@ if (have_option('i')) {
$handler = new TwitterQueueHandler($id);
$handler->runOnce();
-?>
diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php
index 726d2e237..3cdf1867a 100755
--- a/scripts/twitterstatusfetcher.php
+++ b/scripts/twitterstatusfetcher.php
@@ -562,4 +562,4 @@ if (have_option('d') || have_option('debug')) {
$fetcher = new TwitterStatusFetcher($id, 60, 2, $debug);
$fetcher->runOnce();
-?>
+
diff --git a/scripts/uncache_users.php b/scripts/uncache_users.php
index ee030f778..5a1d33030 100644
--- a/scripts/uncache_users.php
+++ b/scripts/uncache_users.php
@@ -50,4 +50,3 @@ foreach ($ids as $id) {
$memc->delete(common_cache_key('user:notices_with_friends:'. $user->id));
$memc->delete(common_cache_key('user:notices_with_friends:'. $user->id . ';last'));
}
-?>
diff --git a/scripts/update_translations.php b/scripts/update_translations.php
index f036657c5..f145c1f0b 100755
--- a/scripts/update_translations.php
+++ b/scripts/update_translations.php
@@ -96,4 +96,3 @@ function curl_get_file($url)
return FALSE;
}
-?>
diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php
index 05c5f86ce..c7ed15e49 100755
--- a/scripts/xmppconfirmhandler.php
+++ b/scripts/xmppconfirmhandler.php
@@ -160,4 +160,4 @@ if (have_option('i')) {
$handler = new XmppConfirmHandler($id);
$handler->runOnce();
-?>
+
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php
index eaebd5948..9e621e725 100755
--- a/scripts/xmppdaemon.php
+++ b/scripts/xmppdaemon.php
@@ -412,4 +412,3 @@ $foreground = have_option('f', 'foreground');
$daemon = new XMPPDaemon($id, !$foreground);
$daemon->runOnce();
-?>