From 50af9c5c401a7bebd1503df885172cf538a6ba79 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 09:10:21 +0000 Subject: [PATCH 01/15] Open geoname URL in a new window --- js/util.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/util.js b/js/util.js index f6b59ec742..00f94e5c49 100644 --- a/js/util.js +++ b/js/util.js @@ -524,6 +524,11 @@ var SN = { // StatusNet NLN.attr('href', location.url); NLN.text(NLN_text); + NLN.click(function() { + window.open(location.url); + + return false; + }); }); }); } From 9f9dcd2bf5e0343bb23b01fde65e61b83d80b702 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 09:14:14 +0000 Subject: [PATCH 02/15] Using object value instead of inline string --- js/util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/util.js b/js/util.js index 00f94e5c49..048d3f1eb1 100644 --- a/js/util.js +++ b/js/util.js @@ -447,7 +447,7 @@ var SN = { // StatusNet var NLE = $('#notice_data-location_wrap'); var geocodeURL = NLE.attr('title'); - $('label[for=notice_data-geo]').attr('title', NLE.text()); + $('label[for='+SN.C.S.NoticeDataGeo+']').attr('title', NLE.text()); if (navigator.geolocation) { NDG.change(function() { @@ -475,14 +475,14 @@ var SN = { // StatusNet if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true) { NLN.addClass('processing'); - $('label[for=notice_data-geo]').addClass('checked'); + $('label[for='+SN.C.S.NoticeDataGeo+']').addClass('checked'); NDGS.append(' '); $('#'+SN.C.S.NoticeDataGeoSelected+' button.close').click(function(){ $('#'+SN.C.S.NoticeDataGeoSelected).remove(); $('#'+SN.C.S.NoticeDataGeo).attr('checked', false); - $('label[for=notice_data-geo]').removeClass('checked'); + $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); return false; }); @@ -533,7 +533,7 @@ var SN = { // StatusNet }); } else { - $('label[for=notice_data-geo]').removeClass('checked'); + $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); NDGS.hide(); $('#'+SN.C.S.NoticeLat).val(''); $('#'+SN.C.S.NoticeLon).val(''); From d1998adb13e78728ea9479f3efab50e55d53b32c Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 09:29:41 +0000 Subject: [PATCH 03/15] Trim whitespace from label's textContent --- js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/util.js b/js/util.js index 048d3f1eb1..f7c54e469f 100644 --- a/js/util.js +++ b/js/util.js @@ -447,7 +447,7 @@ var SN = { // StatusNet var NLE = $('#notice_data-location_wrap'); var geocodeURL = NLE.attr('title'); - $('label[for='+SN.C.S.NoticeDataGeo+']').attr('title', NLE.text()); + $('label[for='+SN.C.S.NoticeDataGeo+']').attr('title', jQuery.trim($('label[for='+SN.C.S.NoticeDataGeo+']').text())); if (navigator.geolocation) { NDG.change(function() { From fe8927a42caa8f74e13f636ed530ef590668f01c Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 09:52:35 +0000 Subject: [PATCH 04/15] Added errorCallback() to geoCurrentPosition() i.e., if user doesn't grant permission, removes the Geo processing and (if any) existing geo location data from notice form. --- js/util.js | 73 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/js/util.js b/js/util.js index f7c54e469f..c1cc08a714 100644 --- a/js/util.js +++ b/js/util.js @@ -493,44 +493,57 @@ var SN = { // StatusNet return false; }); - navigator.geolocation.getCurrentPosition(function(position) { - $('#'+SN.C.S.NoticeLat).val(position.coords.latitude); - $('#'+SN.C.S.NoticeLon).val(position.coords.longitude); + navigator.geolocation.getCurrentPosition( + function(position) { + $('#'+SN.C.S.NoticeLat).val(position.coords.latitude); + $('#'+SN.C.S.NoticeLon).val(position.coords.longitude); - var data = { - 'lat': position.coords.latitude, - 'lon': position.coords.longitude, - 'token': $('#token').val() - }; + var data = { + 'lat': position.coords.latitude, + 'lon': position.coords.longitude, + 'token': $('#token').val() + }; - $.getJSON(geocodeURL, data, function(location) { - NLN.replaceWith(''); - NLN = $('#'+SN.C.S.NoticeLocationName); + $.getJSON(geocodeURL, data, function(location) { + NLN.replaceWith(''); + NLN = $('#'+SN.C.S.NoticeLocationName); - if (typeof(location.location_ns) != 'undefined') { - $('#'+SN.C.S.NoticeLocationNs).val(location.location_ns); - } + if (typeof(location.location_ns) != 'undefined') { + $('#'+SN.C.S.NoticeLocationNs).val(location.location_ns); + } - if (typeof(location.location_id) != 'undefined') { - $('#'+SN.C.S.NoticeLocationId).val(location.location_id); - } + if (typeof(location.location_id) != 'undefined') { + $('#'+SN.C.S.NoticeLocationId).val(location.location_id); + } - if (typeof(location.name) == 'undefined') { - NLN_text = position.coords.latitude + ';' + position.coords.longitude; - } - else { - NLN_text = location.name; - } + if (typeof(location.name) == 'undefined') { + NLN_text = position.coords.latitude + ';' + position.coords.longitude; + } + else { + NLN_text = location.name; + } - NLN.attr('href', location.url); - NLN.text(NLN_text); - NLN.click(function() { - window.open(location.url); + NLN.attr('href', location.url); + NLN.text(NLN_text); + NLN.click(function() { + window.open(location.url); - return false; + return false; + }); }); - }); - }); + }, + + function(error) { + if (error.PERMISSION_DENIED == 1) { + $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); + NDGS.hide(); + $('#'+SN.C.S.NoticeLat).val(''); + $('#'+SN.C.S.NoticeLon).val(''); + $('#'+SN.C.S.NoticeLocationNs).val(''); + $('#'+SN.C.S.NoticeLocationId).val(''); + } + } + ); } else { $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); From ad323575e6c083417fc4e6fc1e253bc9d564e6b2 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 10:07:32 +0000 Subject: [PATCH 05/15] Refactored geo location removal to removeNoticeDataGeo() --- js/util.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/js/util.js b/js/util.js index c1cc08a714..226fdb102c 100644 --- a/js/util.js +++ b/js/util.js @@ -535,23 +535,13 @@ var SN = { // StatusNet function(error) { if (error.PERMISSION_DENIED == 1) { - $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); - NDGS.hide(); - $('#'+SN.C.S.NoticeLat).val(''); - $('#'+SN.C.S.NoticeLon).val(''); - $('#'+SN.C.S.NoticeLocationNs).val(''); - $('#'+SN.C.S.NoticeLocationId).val(''); + removeNoticeDataGeo(); } } ); } else { - $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); - NDGS.hide(); - $('#'+SN.C.S.NoticeLat).val(''); - $('#'+SN.C.S.NoticeLon).val(''); - $('#'+SN.C.S.NoticeLocationNs).val(''); - $('#'+SN.C.S.NoticeLocationId).val(''); + removeNoticeDataGeo(); } }); @@ -560,6 +550,15 @@ var SN = { // StatusNet NDG.change(); } } + + function removeNoticeDataGeo() { + $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); + $('#'+SN.C.S.NoticeDataGeoSelected).hide(); + $('#'+SN.C.S.NoticeLat).val(''); + $('#'+SN.C.S.NoticeLon).val(''); + $('#'+SN.C.S.NoticeLocationNs).val(''); + $('#'+SN.C.S.NoticeLocationId).val(''); + } }, NewDirectMessage: function() { From 30f58bf15f9b7e8f2a58b998937b5fd1096ee930 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 12:43:56 +0000 Subject: [PATCH 06/15] Updated element id for notice_data-geo --- actions/newnotice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/newnotice.php b/actions/newnotice.php index 8d89e9da07..a4ed87bb62 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -184,7 +184,7 @@ class NewnoticeAction extends Action $options = array('reply_to' => ($replyto == 'false') ? null : $replyto); - if ($user->shareLocation() && $this->arg('notice_data-location_enabled')) { + if ($user->shareLocation() && $this->arg('notice_data-geo')) { $locOptions = Notice::locationOptions($this->trimmed('lat'), $this->trimmed('lon'), From dcd3292f575fe5194267f353961ba20d410d2aed Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 12:44:48 +0000 Subject: [PATCH 07/15] Relocated @title removal --- js/util.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/util.js b/js/util.js index 226fdb102c..0200314224 100644 --- a/js/util.js +++ b/js/util.js @@ -446,13 +446,12 @@ var SN = { // StatusNet if (NDG.length > 0) { var NLE = $('#notice_data-location_wrap'); var geocodeURL = NLE.attr('title'); + NLE.removeAttr('title'); $('label[for='+SN.C.S.NoticeDataGeo+']').attr('title', jQuery.trim($('label[for='+SN.C.S.NoticeDataGeo+']').text())); if (navigator.geolocation) { NDG.change(function() { - NLE.removeAttr('title'); - $.cookie(SN.C.S.NoticeLocationCookieName, $('#'+SN.C.S.NoticeDataGeo).attr('checked')); var NLN = $('#'+SN.C.S.NoticeLocationName); From 9a742dd2a2459b9a114239c2f8fd982290b39072 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 13:28:42 +0000 Subject: [PATCH 08/15] Removed comma --- theme/base/css/display.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 0bb3479ccd..4fe30554e7 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -571,7 +571,7 @@ font-size:1.1em; float:right; font-size:0.8em; } -, + .form_notice #notice_data-geo_selected button.minimize { float:left; } From dcc9497099442865914c4e56adebd88eecf8b433 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 13:30:07 +0000 Subject: [PATCH 09/15] Removed unneeded line-height --- theme/base/css/display.css | 1 - 1 file changed, 1 deletion(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 4fe30554e7..f441a4020d 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -559,7 +559,6 @@ line-height:1.618; float:left; width:80%; display:block; -line-height:1.8; overflow:auto; margin-right:2.5%; } From a0f7896f22b93caedf4cfcb91b14a25c0c1e6a82 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 13:44:32 +0000 Subject: [PATCH 10/15] Ran NoticeLocationAttach() through jslint --- js/util.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/js/util.js b/js/util.js index 0200314224..2d108118a3 100644 --- a/js/util.js +++ b/js/util.js @@ -442,6 +442,15 @@ var SN = { // StatusNet }, NoticeLocationAttach: function() { + function removeNoticeDataGeo() { + $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); + $('#'+SN.C.S.NoticeDataGeoSelected).hide(); + $('#'+SN.C.S.NoticeLat).val(''); + $('#'+SN.C.S.NoticeLon).val(''); + $('#'+SN.C.S.NoticeLocationNs).val(''); + $('#'+SN.C.S.NoticeLocationId).val(''); + } + var NDG = $('#'+SN.C.S.NoticeDataGeo); if (NDG.length > 0) { var NLE = $('#notice_data-location_wrap'); @@ -460,7 +469,7 @@ var SN = { // StatusNet } var S = '
'; - NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); + var NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); if (NDGS.length > 0) { NDGS.replaceWith(S); } @@ -470,7 +479,7 @@ var SN = { // StatusNet NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); NDGS.prepend('Geo'); - NLN = $('#'+SN.C.S.NoticeLocationName); + var NLN = $('#'+SN.C.S.NoticeLocationName); if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true) { NLN.addClass('processing'); @@ -504,6 +513,7 @@ var SN = { // StatusNet }; $.getJSON(geocodeURL, data, function(location) { + NLN = $('#'+SN.C.S.NoticeLocationName); NLN.replaceWith(''); NLN = $('#'+SN.C.S.NoticeLocationName); @@ -542,22 +552,12 @@ var SN = { // StatusNet else { removeNoticeDataGeo(); } - }); + }).change(); var cookieVal = $.cookie(SN.C.S.NoticeLocationCookieName); - NDG.attr('checked', (cookieVal == null || cookieVal == 'true')); - NDG.change(); + NDG.attr('checked', (cookieVal === null || cookieVal == 'true')); } } - - function removeNoticeDataGeo() { - $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked'); - $('#'+SN.C.S.NoticeDataGeoSelected).hide(); - $('#'+SN.C.S.NoticeLat).val(''); - $('#'+SN.C.S.NoticeLon).val(''); - $('#'+SN.C.S.NoticeLocationNs).val(''); - $('#'+SN.C.S.NoticeLocationId).val(''); - } }, NewDirectMessage: function() { From 7a2d72fe28e29c67f2a9e8fdb59c6c5c9b38d5e6 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 4 Jan 2010 12:49:25 -0500 Subject: [PATCH 11/15] Enable memcache automatic compression, starting at 20k and only if compression gain is greater than 20%. Allows storage of larger objects (over 1mb in size uncompressed), such as huge LDAP schemas. Should also improve cache efficiency (allows more stuff to be stored in same memory) and reduce network latency (less data transfer) (redo commit 1e9c03e1993b5d2978ac4c5213a8a64e0150b4a2 which was apparently lost during pluginization) --- plugins/MemcachePlugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/MemcachePlugin.php b/plugins/MemcachePlugin.php index acbec135e4..78e2b24067 100644 --- a/plugins/MemcachePlugin.php +++ b/plugins/MemcachePlugin.php @@ -156,6 +156,11 @@ class MemcachePlugin extends Plugin } $this->_conn->addServer($host, $port); } + //Compress items stored in the cache if they're over 2k in size + //and the compression would save more than 20%. + //Allows the cache to store objects larger than 1MB (if they + //compress to less than 1MB), and improves cache memory efficiency. + $this->_conn->setCompressThreshold(20000, 0.2); } } } From 783a2e249bac2ccd02b6ae3351dfe83630b71cc0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 4 Jan 2010 10:30:19 -0800 Subject: [PATCH 12/15] Fix for auto_increment parameter in auto-created tables via checkschema. Update FeedSub plugin for non-Plugin_DataObject setup and working checkschema updates. --- lib/columndef.php | 1 + lib/schema.php | 4 ++ plugins/FeedSub/FeedSubPlugin.php | 7 +- plugins/FeedSub/feedinfo.php | 108 +++++++++++++++++++++++------- 4 files changed, 90 insertions(+), 30 deletions(-) diff --git a/lib/columndef.php b/lib/columndef.php index 1bae6b33bb..ac2fcd23ea 100644 --- a/lib/columndef.php +++ b/lib/columndef.php @@ -74,6 +74,7 @@ class ColumnDef * @param string $key type of key * @param value $default default value * @param value $extra unused + * @param boolean $auto_increment */ function __construct($name=null, $type=null, $size=null, diff --git a/lib/schema.php b/lib/schema.php index a8ba91b87f..6fe442d56b 100644 --- a/lib/schema.php +++ b/lib/schema.php @@ -523,6 +523,10 @@ class Schema } else { $sql .= ($cd->nullable) ? "null " : "not null "; } + + if (!empty($cd->auto_increment)) { + $sql .= " auto_increment "; + } return $sql; } diff --git a/plugins/FeedSub/FeedSubPlugin.php b/plugins/FeedSub/FeedSubPlugin.php index 857a9794d5..e49e2a648a 100644 --- a/plugins/FeedSub/FeedSubPlugin.php +++ b/plugins/FeedSub/FeedSubPlugin.php @@ -105,12 +105,11 @@ class FeedSubPlugin extends Plugin return true; } - /* - // auto increment seems to be broken function onCheckSchema() { + // warning: the autoincrement doesn't seem to set. + // alter table feedinfo change column id id int(11) not null auto_increment; $schema = Schema::get(); - $schema->ensureDataObject('Feedinfo'); + $schema->ensureTable('feedinfo', Feedinfo::schemaDef()); return true; } - */ } diff --git a/plugins/FeedSub/feedinfo.php b/plugins/FeedSub/feedinfo.php index fff66afe97..b166bd6e12 100644 --- a/plugins/FeedSub/feedinfo.php +++ b/plugins/FeedSub/feedinfo.php @@ -31,7 +31,7 @@ class FeedDBException extends FeedSubException } } -class Feedinfo extends Plugin_DataObject +class Feedinfo extends Memcached_DataObject { public $__table = 'feedinfo'; @@ -56,34 +56,90 @@ class Feedinfo extends Plugin_DataObject return parent::staticGet(__CLASS__, $k, $v); } - function tableDef() + /** + * return table definition for DB_DataObject + * + * DB_DataObject needs to know something about the table to manipulate + * instances. This method provides all the DB_DataObject needs to know. + * + * @return array array of column definitions + */ + + function table() { - class_exists('Schema'); // autoload hack - // warning: the autoincrement doesn't seem to set. - // alter table feedinfo change column id id int(11) not null auto_increment; - return new TableDef($this->__table, - array(new ColumnDef('id', 'integer', - null, false, 'PRI', '0', null, true), - new ColumnDef('profile_id', 'integer', - null, false), - new ColumnDef('feeduri', 'varchar', - 255, false, 'UNI'), - new ColumnDef('homeuri', 'varchar', - 255, false), - new ColumnDef('huburi', 'varchar', - 255, false), - new ColumnDef('verify_token', 'varchar', - 32, true), - new ColumnDef('sub_start', 'datetime', - null, true), - new ColumnDef('sub_end', 'datetime', - null, true), - new ColumnDef('created', 'datetime', - null, false), - new ColumnDef('lastupdate', 'datetime', - null, false))); + return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'profile_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'feeduri' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'homeuri' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'huburi' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'verify_token' => DB_DATAOBJECT_STR, + 'sub_start' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME, + 'sub_end' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME, + 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL, + 'lastupdate' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL); + } + + static function schemaDef() + { + return array(new ColumnDef('id', 'integer', + /*size*/ null, + /*nullable*/ false, + /*key*/ 'PRI', + /*default*/ '0', + /*extra*/ null, + /*auto_increment*/ true), + new ColumnDef('profile_id', 'integer', + null, false), + new ColumnDef('feeduri', 'varchar', + 255, false, 'UNI'), + new ColumnDef('homeuri', 'varchar', + 255, false), + new ColumnDef('huburi', 'varchar', + 255, false), + new ColumnDef('verify_token', 'varchar', + 32, true), + new ColumnDef('sub_start', 'datetime', + null, true), + new ColumnDef('sub_end', 'datetime', + null, true), + new ColumnDef('created', 'datetime', + null, false), + new ColumnDef('lastupdate', 'datetime', + null, false)); } + /** + * return key definitions for DB_DataObject + * + * DB_DataObject needs to know about keys that the table has; this function + * defines them. + * + * @return array key definitions + */ + + function keys() + { + return array('id' => 'P'); //? + } + + /** + * return key definitions for Memcached_DataObject + * + * Our caching system uses the same key definitions, but uses a different + * method to get them. + * + * @return array key definitions + */ + + function keyTypes() + { + return $this->keys(); + } + + /** + * Fetch the StatusNet-side profile for this feed + * @return Profile + */ public function getProfile() { return Profile::staticGet('id', $this->profile_id); From e440b69e1a3c73796535298b3b20d6678431f9b6 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 4 Jan 2010 13:33:52 -0500 Subject: [PATCH 13/15] Allow an authentication plugin with the same provider_name other than the one that actually checked the password to autoregister a user Allows for SSO-type plugins that don't have any information about the user other than their username to do autoregistration --- .../Authentication/AuthenticationPlugin.php | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/plugins/Authentication/AuthenticationPlugin.php b/plugins/Authentication/AuthenticationPlugin.php index a76848b04e..75e8d2b766 100644 --- a/plugins/Authentication/AuthenticationPlugin.php +++ b/plugins/Authentication/AuthenticationPlugin.php @@ -99,6 +99,23 @@ abstract class AuthenticationPlugin extends Plugin } } + /** + * Internal AutoRegister event handler + * @param nickname + * @param provider_name + * @param user - the newly registered user + */ + function onAutoRegister($nickname, $provider_name, &$user) + { + if($provider_name == $this->provider_name && $this->autoregistration){ + $user = $this->autoregister($nickname); + if($user){ + User_username::register($user,$nickname,$this->provider_name); + return false; + } + } + } + function onStartCheckPassword($nickname, $password, &$authenticatedUser){ //map the nickname to a username $user_username = new User_username(); @@ -127,13 +144,10 @@ abstract class AuthenticationPlugin extends Plugin } } }else{ - if($this->autoregistration){ - $authenticated = $this->checkPassword($nickname, $password); - if($authenticated){ - $user = $this->autoregister($nickname); - if($user){ - $authenticatedUser = $user; - User_username::register($authenticatedUser,$nickname,$this->provider_name); + $authenticated = $this->checkPassword($nickname, $password); + if($authenticated){ + if(Event::handle('AutoRegister', array($nickname, $this->provider_name, &$authenticatedUser))){ + if($authenticatedUser){ return false; } } From 11d7365a15bb8c8cb856bf0d545a0b550f3dbe26 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 4 Jan 2010 10:39:11 -0800 Subject: [PATCH 14/15] Don't spew notices when building tag cloud if there is no popularity sum to divide by. --- actions/publictagcloud.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/actions/publictagcloud.php b/actions/publictagcloud.php index e7f6ee36c7..5c70740290 100644 --- a/actions/publictagcloud.php +++ b/actions/publictagcloud.php @@ -136,7 +136,12 @@ class PublictagcloudAction extends Action $this->elementStart('dd'); $this->elementStart('ul', 'tags xoxo tag-cloud'); foreach ($tw as $tag => $weight) { - $this->showTag($tag, $weight, $weight/$sum); + if ($sum) { + $weightedSum = $weight/$sum; + } else { + $weightedSum = 1; + } + $this->showTag($tag, $weight, $weightedSum); } $this->elementEnd('ul'); $this->elementEnd('dd'); From 38912b34c7f9d0a377feeb76572003a36c61ee7e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 4 Jan 2010 10:41:52 -0800 Subject: [PATCH 15/15] Drop the overly-prominent link to checklibs display; it's unnecessary and just confuses people. The ability's still there to aid in debugging, but it won't be tempting people to click on it. --- install.php | 1 - 1 file changed, 1 deletion(-) diff --git a/install.php b/install.php index 1c62bb2b21..435f6d63bf 100644 --- a/install.php +++ b/install.php @@ -454,7 +454,6 @@ function showForm()