From aeca8807dbce951beccbc3fb0e5a4ae5600e5e5f Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Mon, 5 Oct 2009 12:55:55 -0400 Subject: [PATCH 01/19] Open tags should have closing tags --- scripts/allsites.php | 3 ++- scripts/createsim.php | 1 + scripts/decache.php | 1 + scripts/deleteuser.php | 1 + scripts/enjitqueuehandler.php | 1 + scripts/facebookqueuehandler.php | 1 + scripts/fixup_conversations.php | 1 + scripts/fixup_hashtags.php | 1 + scripts/fixup_inboxes.php | 1 + scripts/fixup_notices_rendered.php | 1 + scripts/fixup_replies.php | 1 + scripts/fixup_utf8.php | 1 + scripts/getpiddir.php | 1 + scripts/getvaliddaemons.php | 1 + scripts/inbox_users.php | 1 + scripts/jabberqueuehandler.php | 1 + scripts/maildaemon.php | 1 + scripts/ombqueuehandler.php | 1 + scripts/pingqueuehandler.php | 1 + scripts/publicqueuehandler.php | 1 + scripts/reportsnapshot.php | 1 + scripts/sessiongc.php | 1 + scripts/setpassword.php | 1 + scripts/showcache.php | 1 + scripts/smsqueuehandler.php | 1 + scripts/synctwitterfriends.php | 2 +- scripts/triminboxes.php | 1 + scripts/twitterqueuehandler.php | 1 + scripts/twitterstatusfetcher.php | 2 +- scripts/uncache_users.php | 1 + scripts/update_translations.php | 1 + scripts/xmppconfirmhandler.php | 2 +- scripts/xmppdaemon.php | 1 + 33 files changed, 34 insertions(+), 4 deletions(-) diff --git a/scripts/allsites.php b/scripts/allsites.php index cf1419e550..ff9d8bc804 100755 --- a/scripts/allsites.php +++ b/scripts/allsites.php @@ -37,4 +37,5 @@ 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 71ed3bf722..93f904506a 100644 --- a/scripts/createsim.php +++ b/scripts/createsim.php @@ -140,3 +140,4 @@ $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 7cabd78ada..9b820bd832 100644 --- a/scripts/decache.php +++ b/scripts/decache.php @@ -48,3 +48,4 @@ if (!$object) { } $result = $object->decache(); +?> diff --git a/scripts/deleteuser.php b/scripts/deleteuser.php index 52389123c5..446f76878b 100644 --- a/scripts/deleteuser.php +++ b/scripts/deleteuser.php @@ -66,3 +66,4 @@ if (!have_option('y', 'yes')) { print "Deleting..."; $user->delete(); print "DONE.\n"; +?> diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php index 08f733b07c..5eda062f5a 100755 --- a/scripts/enjitqueuehandler.php +++ b/scripts/enjitqueuehandler.php @@ -137,3 +137,4 @@ if ($handler->start()) { } $handler->finish(); +?> diff --git a/scripts/facebookqueuehandler.php b/scripts/facebookqueuehandler.php index e13ac4e850..dc17cb15a0 100755 --- a/scripts/facebookqueuehandler.php +++ b/scripts/facebookqueuehandler.php @@ -72,3 +72,4 @@ if (have_option('i')) { $handler = new FacebookQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php index 8a9f7bb577..f79288f7b3 100755 --- a/scripts/fixup_conversations.php +++ b/scripts/fixup_conversations.php @@ -68,3 +68,4 @@ while ($nid->fetch()) { print ".\n"; } +?> diff --git a/scripts/fixup_hashtags.php b/scripts/fixup_hashtags.php index 5cfebd8ee8..bae0947b2d 100755 --- a/scripts/fixup_hashtags.php +++ b/scripts/fixup_hashtags.php @@ -45,3 +45,4 @@ while ($notice->fetch()) { common_log_db_error($notice, 'UPDATE', __FILE__); } } +?> diff --git a/scripts/fixup_inboxes.php b/scripts/fixup_inboxes.php index d55a538853..9619f3226b 100755 --- a/scripts/fixup_inboxes.php +++ b/scripts/fixup_inboxes.php @@ -79,3 +79,4 @@ 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 359cd6cce4..4b928ecd22 100755 --- a/scripts/fixup_notices_rendered.php +++ b/scripts/fixup_notices_rendered.php @@ -49,3 +49,4 @@ while ($notice->fetch()) { common_log_db_error($notice, 'UPDATE', __FILE__); } } +?> diff --git a/scripts/fixup_replies.php b/scripts/fixup_replies.php index 7328635d3c..302c239151 100755 --- a/scripts/fixup_replies.php +++ b/scripts/fixup_replies.php @@ -39,3 +39,4 @@ 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 5a9fba7c3f..24d301dab8 100755 --- a/scripts/fixup_utf8.php +++ b/scripts/fixup_utf8.php @@ -363,3 +363,4 @@ $fixer = new UTF8FixerUpper(array('max_date' => $max_date, $fixer->fixup(); +?> diff --git a/scripts/getpiddir.php b/scripts/getpiddir.php index 8274c37c0f..5860655fd3 100755 --- a/scripts/getpiddir.php +++ b/scripts/getpiddir.php @@ -28,3 +28,4 @@ ENDOFHELP; require_once INSTALLDIR.'/scripts/commandline.inc'; echo common_config('daemon', 'piddir'); +?> diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php index 8f48e8e6f0..7fffac783b 100755 --- a/scripts/getvaliddaemons.php +++ b/scripts/getvaliddaemons.php @@ -52,3 +52,4 @@ echo "pingqueuehandler.php "; if (common_config('sms', 'enabled')) { echo "smsqueuehandler.php "; } +?> diff --git a/scripts/inbox_users.php b/scripts/inbox_users.php index 32adcea213..718dd856be 100755 --- a/scripts/inbox_users.php +++ b/scripts/inbox_users.php @@ -105,3 +105,4 @@ 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 8f3a56944d..b029ea1f1e 100755 --- a/scripts/jabberqueuehandler.php +++ b/scripts/jabberqueuehandler.php @@ -76,3 +76,4 @@ if (have_option('i')) { $handler = new JabberQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 11911dcbdc..19c77e077a 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -389,3 +389,4 @@ if (common_config('emailpost', 'enabled')) { $md = new MailerDaemon(); $md->handle_message('php://stdin'); } +?> diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php index 8e685f1c8e..a24185da35 100755 --- a/scripts/ombqueuehandler.php +++ b/scripts/ombqueuehandler.php @@ -85,3 +85,4 @@ if (have_option('i')) { $handler = new OmbQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/pingqueuehandler.php b/scripts/pingqueuehandler.php index c92337e36c..768c06c776 100644 --- a/scripts/pingqueuehandler.php +++ b/scripts/pingqueuehandler.php @@ -67,3 +67,4 @@ if (have_option('i')) { $handler = new PingQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index 50a11bcba0..ffb5acdb64 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -74,3 +74,4 @@ if (have_option('i')) { $handler = new PublicQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/reportsnapshot.php b/scripts/reportsnapshot.php index 71f1019ee6..b8f8d2a7cf 100644 --- a/scripts/reportsnapshot.php +++ b/scripts/reportsnapshot.php @@ -28,3 +28,4 @@ END_OF_SNAPSHOT_HELP; require_once INSTALLDIR.'/scripts/commandline.inc'; Snapshot::check(); +?> diff --git a/scripts/sessiongc.php b/scripts/sessiongc.php index af55ddf3f0..b5fdcbf341 100644 --- a/scripts/sessiongc.php +++ b/scripts/sessiongc.php @@ -34,3 +34,4 @@ $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 50d49d7dbf..f951dccf78 100755 --- a/scripts/setpassword.php +++ b/scripts/setpassword.php @@ -59,3 +59,4 @@ if (!$user->update($original)) { print "Password for user '$nickname' updated.\n"; exit(0); } +?> diff --git a/scripts/showcache.php b/scripts/showcache.php index f179795728..fb0ccb5e03 100644 --- a/scripts/showcache.php +++ b/scripts/showcache.php @@ -69,3 +69,4 @@ if (empty($obj)) { var_dump($obj); print "\n"; } +?> diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php index 6583a77da8..9e8de7a117 100755 --- a/scripts/smsqueuehandler.php +++ b/scripts/smsqueuehandler.php @@ -71,3 +71,4 @@ if (have_option('i')) { $handler = new SmsQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php index b30e700a1c..f582231e39 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 da09817e5b..5153d17065 100644 --- a/scripts/triminboxes.php +++ b/scripts/triminboxes.php @@ -54,3 +54,4 @@ $cnt = $user->find(); while ($user->fetch()) { Notice_inbox::gc($user->id); } +?> diff --git a/scripts/twitterqueuehandler.php b/scripts/twitterqueuehandler.php index ce4d824d0d..820baeb0a1 100755 --- a/scripts/twitterqueuehandler.php +++ b/scripts/twitterqueuehandler.php @@ -72,3 +72,4 @@ if (have_option('i')) { $handler = new TwitterQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index 3cdf1867a1..726d2e2375 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 5a1d330307..ee030f778f 100644 --- a/scripts/uncache_users.php +++ b/scripts/uncache_users.php @@ -50,3 +50,4 @@ 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 f145c1f0b6..f036657c54 100755 --- a/scripts/update_translations.php +++ b/scripts/update_translations.php @@ -96,3 +96,4 @@ function curl_get_file($url) return FALSE; } +?> diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index c7ed15e495..05c5f86ce7 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 9e621e725a..eaebd59488 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -412,3 +412,4 @@ $foreground = have_option('f', 'foreground'); $daemon = new XMPPDaemon($id, !$foreground); $daemon->runOnce(); +?> From e63a435868318bd183d8ae36ff0f6a110cdc85db Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 6 Oct 2009 17:16:28 +0200 Subject: [PATCH 02/19] Using 'CSS sprites' for common icons for the identica theme. Default theme will follow after some tests. --- theme/base/images/icons/icons-01.png | Bin 0 -> 3260 bytes theme/identica/css/display.css | 48 +++++++++++++++------------ 2 files changed, 27 insertions(+), 21 deletions(-) create mode 100644 theme/base/images/icons/icons-01.png diff --git a/theme/base/images/icons/icons-01.png b/theme/base/images/icons/icons-01.png new file mode 100644 index 0000000000000000000000000000000000000000..c4e3713302fe9bea6d32d83bb2449a4c5107a6f3 GIT binary patch literal 3260 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 literal 0 HcmV?d00001 diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index 9fc97180d4..aebbb54edf 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -88,7 +88,7 @@ color:#333333; color:#000000; } #form_notice label[for=notice_data-attach] { -background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -328px; } #form_notice #notice_data-attach { opacity:0; @@ -150,16 +150,18 @@ background-color:#9BB43E; #export_data li a { background-repeat:no-repeat; -background-position:0 45%; } #export_data li a.rss { -background-image:url(../../base/images/icons/icon_rss.png); +background-image:url(../../base/images/icons/icons-01.png); +background-position:0 -130px; } #export_data li a.atom { -background-image:url(../../base/images/icons/icon_atom.png); +background-image:url(../../base/images/icons/icons-01.png); +background-position:0 -64px; } #export_data li a.foaf { -background-image:url(../../base/images/icons/icon_foaf.gif); +background-image:url(../../base/images/icons/icons-01.png); +background-position:0 1px; } .entity_edit a, @@ -171,7 +173,6 @@ background-image:url(../../base/images/icons/icon_foaf.gif); .form_group_unblock input.submit, .entity_nudge p, .form_make_admin input.submit { -background-position: 0 40%; background-repeat: no-repeat; background-color:transparent; } @@ -189,43 +190,48 @@ background-color:#87B4C8; } .entity_edit a { -background-image:url(../../base/images/icons/twotone/green/edit.gif); +background-image:url(../../base/images/icons/icons-01.png); +background-position: 0 -718px; } .entity_send-a-message a { -background-image:url(../../base/images/icons/twotone/green/quote.gif); +background-image:url(../../base/images/icons/icons-01.png); +background-position: 0 -785px; } .entity_nudge p, .form_user_nudge input.submit { -background-image:url(../../base/images/icons/twotone/green/mail.gif); +background-image:url(../../base/images/icons/icons-01.png); +background-position: 0 -950px; } .form_user_block input.submit, .form_user_unblock input.submit, .form_group_block input.submit, .form_group_unblock input.submit { -background-image:url(../../base/images/icons/twotone/green/shield.gif); +background-image:url(../../base/images/icons/icons-01.png); +background-position: 0 -918px; } .form_make_admin input.submit { -background-image:url(../../base/images/icons/twotone/green/admin.gif); +background-image:url(../../base/images/icons/icons-01.png); +background-position: 0 -983px; } /* NOTICES */ .notice .attachment { -background:transparent url(../../base/images/icons/twotone/green/clip-02.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -394px; } #attachments .attachment { background:none; } .notice-options .notice_reply { -background:transparent url(../../base/images/icons/twotone/green/reply.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -589px; } .notice-options form.form_favor input.submit { -background:transparent url(../../base/images/icons/twotone/green/favourite.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -457px; } .notice-options form.form_disfavor input.submit { -background:transparent url(../../base/images/icons/twotone/green/disfavourite.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -523px; } .notice-options .notice_delete { -background:transparent url(../../base/images/icons/twotone/green/trash.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -655px; } .notices div.entry-content, @@ -262,7 +268,7 @@ background-color:rgba(200, 200, 200, 0.300); /*END: NOTICES */ #new_group a { -background:transparent url(../../base/images/icons/twotone/green/news.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -1054px; } .pagination .nav_prev a, @@ -271,10 +277,10 @@ background-repeat:no-repeat; border-color:#CEE1E9; } .pagination .nav_prev a { -background-image:url(../../base/images/icons/twotone/green/arrow-left.gif); -background-position:10% 45%; +background-image:url(../../base/images/icons/icons-01.png); +background-position:10% -187px; } .pagination .nav_next a { -background-image:url(../../base/images/icons/twotone/green/arrow-right.gif); -background-position:90% 45%; +background-image:url(../../base/images/icons/icons-01.png); +background-position:105% -252px; } From d37bf29bba03f707a201e194c17ce8f0113c25be Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 6 Oct 2009 15:40:28 +0000 Subject: [PATCH 03/19] Fixed nudge and direct message background image alignment --- theme/identica/css/display.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index aebbb54edf..6339c9314e 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -195,12 +195,12 @@ background-position: 0 -718px; } .entity_send-a-message a { background-image:url(../../base/images/icons/icons-01.png); -background-position: 0 -785px; +background-position: 0 -849px; } .entity_nudge p, .form_user_nudge input.submit { background-image:url(../../base/images/icons/icons-01.png); -background-position: 0 -950px; +background-position: 0 -785px; } .form_user_block input.submit, .form_user_unblock input.submit, From 7fe1facc99c0e5b2ffead9bb6def8438f7d011d4 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 6 Oct 2009 15:40:56 +0000 Subject: [PATCH 04/19] Fixed IE background image alignment for attach, favour and disfavour --- theme/identica/css/ie.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/theme/identica/css/ie.css b/theme/identica/css/ie.css index 97cabc30a5..044c32ff16 100644 --- a/theme/identica/css/ie.css +++ b/theme/identica/css/ie.css @@ -7,8 +7,14 @@ color:#FFFFFF; background-color:#D9DADB; } #form_notice .form_note + label { -background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%; +background:transparent url(../../base/images/icons/icons-01.png) no-repeat 0 -328px; } #form_notice #notice_data-attach { filter: alpha(opacity=0); } +.notice-options form.form_favor input.submit { +background-position:0 -460px; +} +.notice-options form.form_disfavor input.submit { +background-position:0 -526px; +} From 81199d0258115d02e1980ae7e5827b325f55629c Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 6 Oct 2009 15:51:06 +0000 Subject: [PATCH 05/19] Aligning notice attach label from right instead of left --- theme/base/css/display.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 76709113fc..d9dca98156 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -468,16 +468,15 @@ margin-bottom:7px; #form_notice #notice_data-attach { position:absolute; top:25px; +right:10.5%; cursor:pointer; } #form_notice label[for=notice_data-attach] { text-indent:-9999px; -left:86%; width:16px; height:16px; } #form_notice #notice_data-attach { -left:40.6%; padding:0; height:16px; } From f7d86f1cc62248c0de742bd44af5bf30e70add9d Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 6 Oct 2009 16:04:36 +0000 Subject: [PATCH 06/19] Returning false seems to fix IE from reclaiming window focus. I think 'WTF' best describes this behaviour. Further investigation required. --- plugins/Realtime/realtimeupdate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 11e466325e..a75f17d8c5 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -25,6 +25,8 @@ RealtimeUpdate = { 'border-top-color':'#AAAAAA', 'border-top-style':'solid' }); + + return false; }); }, From 87f5c53dd0ff03600275077e7185291b62358ef2 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Wed, 7 Oct 2009 16:18:05 +0800 Subject: [PATCH 07/19] Fixed E_NOTICE - GroupList expects an owner object in the constructor, not an array of search terms --- actions/groupsearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/groupsearch.php b/actions/groupsearch.php index be15efc47c..517f127895 100644 --- a/actions/groupsearch.php +++ b/actions/groupsearch.php @@ -106,7 +106,7 @@ class GroupSearchResults extends GroupList function __construct($user_group, $terms, $action) { - parent::__construct($user_group, $terms, $action); + parent::__construct($user_group, null, $action); $this->terms = array_map('preg_quote', array_map('htmlspecialchars', $terms)); $this->pattern = '/('.implode('|',$terms).')/i'; From 9449a1e39c8470072aa30ccde1ac5d2b55d65bad Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Wed, 7 Oct 2009 16:57:38 +0800 Subject: [PATCH 08/19] Fixed E_NOTICE when the "lite" parameter isn't included in the request --- actions/twitapistatuses.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 41887a68f4..360dff27cb 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -454,7 +454,7 @@ class TwitapistatusesAction extends TwitterapiAction function friends($args, $apidata) { parent::handle($args); - $includeStatuses=! (boolean) $args['lite']; + $includeStatuses= !(array_key_exists('lite', $args) and $args['lite']); return $this->subscriptions($apidata, 'subscribed', 'subscriber', false, $includeStatuses); } @@ -467,7 +467,7 @@ class TwitapistatusesAction extends TwitterapiAction function followers($args, $apidata) { parent::handle($args); - $includeStatuses=! (boolean) $args['lite']; + $includeStatuses= !(array_key_exists('lite', $args) and $args['lite']); return $this->subscriptions($apidata, 'subscriber', 'subscribed', false, $includeStatuses); } From 838c13063a8371b858a249b3bc511b2b77ce1c5f Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Wed, 7 Oct 2009 17:09:00 +0800 Subject: [PATCH 09/19] Fixed E_NOTICE when returnto isn't set --- lib/util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index a069ccf7b3..9b299cb14f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -981,7 +981,7 @@ function common_set_returnto($url) function common_get_returnto() { common_ensure_session(); - return $_SESSION['returnto']; + return (array_key_exists('returnto', $_SESSION)) ? $_SESSION['returnto'] : null; } function common_timestamp() From daaa1d47908eba0d7b579222bd82994cb4fa01fb Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 8 Oct 2009 12:49:30 +0800 Subject: [PATCH 10/19] Don't show search suggestions for private sites --- lib/searchaction.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/searchaction.php b/lib/searchaction.php index 0d9f85a8f1..130b28ff52 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -135,16 +135,21 @@ class SearchAction extends Action } function searchSuggestions($q) { - $qe = urlencode($q); - $message = sprintf(_(<<elementStart('dl', array('id' => 'help_search', 'class' => 'help')); $this->element('dt', null, _('Search help')); $this->elementStart('dd', 'instructions'); From a6d4adc398d9d2d131df97007452c5c54072ddec Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 8 Oct 2009 11:41:39 -0400 Subject: [PATCH 11/19] Revert "Open tags should have closing tags" This reverts commit aeca8807dbce951beccbc3fb0e5a4ae5600e5e5f. We specifically DON'T have closing tags so we don't get errors with whitespace after the closing tag. I realize this is less of an issue with scripts, but we should still not use closing tags. --- scripts/allsites.php | 3 +-- scripts/createsim.php | 1 - scripts/decache.php | 1 - scripts/deleteuser.php | 1 - scripts/enjitqueuehandler.php | 1 - scripts/facebookqueuehandler.php | 1 - scripts/fixup_conversations.php | 1 - scripts/fixup_hashtags.php | 1 - scripts/fixup_inboxes.php | 1 - scripts/fixup_notices_rendered.php | 1 - scripts/fixup_replies.php | 1 - scripts/fixup_utf8.php | 1 - scripts/getpiddir.php | 1 - scripts/getvaliddaemons.php | 1 - scripts/inbox_users.php | 1 - scripts/jabberqueuehandler.php | 1 - scripts/maildaemon.php | 1 - scripts/ombqueuehandler.php | 1 - scripts/pingqueuehandler.php | 1 - scripts/publicqueuehandler.php | 1 - scripts/reportsnapshot.php | 1 - scripts/sessiongc.php | 1 - scripts/setpassword.php | 1 - scripts/showcache.php | 1 - scripts/smsqueuehandler.php | 1 - scripts/synctwitterfriends.php | 2 +- scripts/triminboxes.php | 1 - scripts/twitterqueuehandler.php | 1 - scripts/twitterstatusfetcher.php | 2 +- scripts/uncache_users.php | 1 - scripts/update_translations.php | 1 - scripts/xmppconfirmhandler.php | 2 +- scripts/xmppdaemon.php | 1 - 33 files changed, 4 insertions(+), 34 deletions(-) diff --git a/scripts/allsites.php b/scripts/allsites.php index ff9d8bc804..cf1419e550 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 93f904506a..71ed3bf722 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 9b820bd832..7cabd78ada 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 446f76878b..52389123c5 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 5eda062f5a..08f733b07c 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 dc17cb15a0..e13ac4e850 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 f79288f7b3..8a9f7bb577 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 bae0947b2d..5cfebd8ee8 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 9619f3226b..d55a538853 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 4b928ecd22..359cd6cce4 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 302c239151..7328635d3c 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 24d301dab8..5a9fba7c3f 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 5860655fd3..8274c37c0f 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 7fffac783b..8f48e8e6f0 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 718dd856be..32adcea213 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 b029ea1f1e..8f3a56944d 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 19c77e077a..11911dcbdc 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 a24185da35..8e685f1c8e 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 768c06c776..c92337e36c 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 ffb5acdb64..50a11bcba0 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 b8f8d2a7cf..71f1019ee6 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 b5fdcbf341..af55ddf3f0 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 f951dccf78..50d49d7dbf 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 fb0ccb5e03..f179795728 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 9e8de7a117..6583a77da8 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 f582231e39..b30e700a1c 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 5153d17065..da09817e5b 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 820baeb0a1..ce4d824d0d 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 726d2e2375..3cdf1867a1 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 ee030f778f..5a1d330307 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 f036657c54..f145c1f0b6 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 05c5f86ce7..c7ed15e495 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 eaebd59488..9e621e725a 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(); -?> From 2dc66035ba84368ad2b6fa5147ec23c5b147f18f Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 9 Oct 2009 11:16:04 +0800 Subject: [PATCH 12/19] Fixed twitter defaulting to disabled --- lib/common.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/common.php b/lib/common.php index 88d77732f4..0b4e031845 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, From 11e36b18cc18890a2360e4cba14f5f2895f6eb3b Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 9 Oct 2009 11:25:31 +0800 Subject: [PATCH 13/19] Fixed facebook connect nav to obey sms/twitter disabled --- plugins/FBConnect/FBCSettingsNav.php | 42 +++++++++++++++------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/plugins/FBConnect/FBCSettingsNav.php b/plugins/FBConnect/FBCSettingsNav.php index 29724d6bdf..ed02371e25 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'); From b8f8c41c18ae166a88c4a87f90602ad8e1ed2ede Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 9 Oct 2009 11:31:55 +0800 Subject: [PATCH 14/19] Fixed facebook connect login nav to obey openid settings --- plugins/FBConnect/FBCLoginGroupNav.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/FBConnect/FBCLoginGroupNav.php b/plugins/FBConnect/FBCLoginGroupNav.php index 6e12c20403..81b2520a4c 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','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')); + 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')); From d13b0c385dbf6326ecec1c9a9abf9cac0f6ed4b2 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 9 Oct 2009 11:50:04 +0800 Subject: [PATCH 15/19] Fixed facebook connect primary nav to obey sms/twitter/openid settings --- plugins/FBConnect/FBConnectPlugin.php | 32 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php index 593b49b4ed..702aee3496 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,12 +303,17 @@ 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')), From c597aba342c2d4bd7ee53dc471d6b7deafb62a5e Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Fri, 9 Oct 2009 11:52:03 +0800 Subject: [PATCH 16/19] Fixed facebook connect primary nav to hide search option when site is private and user is not logged in --- plugins/FBConnect/FBConnectPlugin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php index 702aee3496..950718a33c 100644 --- a/plugins/FBConnect/FBConnectPlugin.php +++ b/plugins/FBConnect/FBConnectPlugin.php @@ -318,8 +318,10 @@ class FBConnectPlugin extends Plugin $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'); + } return false; } From 88e7092d2326403ab5cb0c7261b665154491e75c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 9 Oct 2009 10:39:56 -0400 Subject: [PATCH 17/19] don't write session if it's unchanged --- classes/Session.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/classes/Session.php b/classes/Session.php index d641edbbe4..79a69a96ea 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"); - return $session->update(); + $orig = clone($session); + + $session->session_data = $session_data; + + return $session->update($orig); + } } } From e9d7f18f0c2ad05c0203bc347a74c0f69e497566 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 9 Oct 2009 14:06:08 -0400 Subject: [PATCH 18/19] fix FBConnect so it doesn't muffle EndPrimaryNav --- plugins/FBConnect/FBConnectPlugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php index 593b49b4ed..cb19b05461 100644 --- a/plugins/FBConnect/FBConnectPlugin.php +++ b/plugins/FBConnect/FBConnectPlugin.php @@ -313,6 +313,11 @@ class FBConnectPlugin extends Plugin $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; } From 96d32fb8d0752c13cb1a768a3e4c3ad36a4a0188 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 30 Sep 2009 16:35:21 -0400 Subject: [PATCH 19/19] Implemented create group api --- actions/twitapigroups.php | 145 +++++++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/actions/twitapigroups.php b/actions/twitapigroups.php index 493144e77e..a294858835 100644 --- a/actions/twitapigroups.php +++ b/actions/twitapigroups.php @@ -428,7 +428,133 @@ require_once INSTALLDIR.'/lib/twitterapi.php'; function create($args, $apidata) { - die("todo"); + parent::handle($args); + + common_debug("in groups api action"); + if (!common_config('inboxes','enabled')) { + $this->serverError(_('Inboxes must be enabled for groups to work')); + return false; + } + + $this->auth_user = $apidata['user']; + + $nickname = $args['nickname']; + $fullname = $args['full_name']; + $homepage = $args['homepage']; + $description = $args['description']; + $location = $args['location']; + $aliasstring = $args['aliases']; + + if (!Validate::string($nickname, array('min_length' => 1, + 'max_length' => 64, + 'format' => NICKNAME_FMT))) { + $this->clientError(_('Nickname must have only lowercase letters '. + 'and numbers and no spaces.'), $code=403); + return; + } else if ($this->groupNicknameExists($nickname)) { + $this->clientError(_('Nickname already in use. Try another one.'), $code=403); + return; + } else if (!User_group::allowedNickname($nickname)) { + $this->clientError(_('Not a valid nickname.'), $code=403); + return; + } else if (!is_null($homepage) && (strlen($homepage) > 0) && + !Validate::uri($homepage, + array('allowed_schemes' => + array('http', 'https')))) { + $this->clientError(_('Homepage is not a valid URL.'), $code=403); + return; + } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { + $this->clientError(_('Full name is too long (max 255 chars).'), $code=403); + return; + } else if (User_group::descriptionTooLong($description)) { + $this->clientError(sprintf(_('description is too long (max %d chars).'), User_group::maxDescription()), $code=403); + return; + } else if (!is_null($location) && mb_strlen($location) > 255) { + $this->clientError(_('Location is too long (max 255 chars).'), $code=403); + return; + } + + if (!empty($aliasstring)) { + $aliases = array_map('common_canonical_nickname', array_unique(preg_split('/[\s,]+/', $aliasstring))); + } else { + $aliases = array(); + } + + if (count($aliases) > common_config('group', 'maxaliases')) { + $this->clientError(sprintf(_('Too many aliases! Maximum %d.'), + common_config('group', 'maxaliases')), $code=403); + return; + } + + foreach ($aliases as $alias) { + if (!Validate::string($alias, array('min_length' => 1, + 'max_length' => 64, + 'format' => NICKNAME_FMT))) { + $this->clientError(sprintf(_('Invalid alias: "%s"'), $alias), $code=403); + return; + } + if ($this->groupNicknameExists($alias)) { + $this->clientError(sprintf(_('Alias "%s" already in use. Try another one.'), + $alias), $code=403); + return; + } + // XXX assumes alphanum nicknames + if (strcmp($alias, $nickname) == 0) { + $this->clientError(_('Alias can\'t be the same as nickname.'), $code=403); + return; + } + } + + $group = new User_group(); + + $group->query('BEGIN'); + + $group->nickname = $nickname; + $group->fullname = $fullname; + $group->homepage = $homepage; + $group->description = $description; + $group->location = $location; + $group->created = common_sql_now(); + + $result = $group->insert(); + + if (!$result) { + common_log_db_error($group, 'INSERT', __FILE__); + $this->serverError(_('Could not create group.')); + } + + $result = $group->setAliases($aliases); + + if (!$result) { + $this->serverError(_('Could not create aliases.')); + } + + $member = new Group_member(); + + $member->group_id = $group->id; + $member->profile_id = $this->auth_user->id; + $member->is_admin = 1; + $member->created = $group->created; + + $result = $member->insert(); + + if (!$result) { + common_log_db_error($member, 'INSERT', __FILE__); + $this->serverError(_('Could not set group membership.')); + } + + $group->query('COMMIT'); + + switch($apidata['content-type']) { + case 'xml': + $this->show_single_xml_group($group); + break; + case 'json': + $this->show_single_json_group($group); + break; + default: + $this->clientError(_('API method not found!'), $code = 404); + } } function update($args, $apidata) @@ -450,4 +576,21 @@ require_once INSTALLDIR.'/lib/twitterapi.php'; { die("todo"); } + + function groupNicknameExists($nickname) + { + $group = User_group::staticGet('nickname', $nickname); + + if (!empty($group)) { + return true; + } + + $alias = Group_alias::staticGet('alias', $nickname); + + if (!empty($alias)) { + return true; + } + + return false; + } }