Permalink
Browse files

Merge remote-tracking branch 'upstream/2.0.18'

  • Loading branch information...
2 parents 7743482 + ee1b2eb commit 972f7104a08bd5518825a5510ff455dc83fc3d69 @shadowhand shadowhand committed Feb 14, 2012
@@ -280,7 +280,7 @@ public function Auth($AuthenticationSchemeAlias = 'default') {
public function Connect($Method) {
$this->AddJsFile('entry.js');
$this->View = 'connect';
- $IsPostBack = $this->Form->IsPostBack() && $this->Form->GetFormValue('Connect') == 'Connect';
+ $IsPostBack = $this->Form->IsPostBack() && $this->Form->GetFormValue('Connect', NULL) !== NULL;
if (!$IsPostBack) {
// Here are the initial data array values. that can be set by a plugin.
@@ -506,8 +506,7 @@ public function Connect($Method) {
$User['Name'] = $User['ConnectName'];
$User['Password'] = RandomString(50); // some password is required
$User['HashMethod'] = 'Random';
-
- $UserID = $UserModel->Register($User, array('CheckCaptcha' => FALSE), array('NoConfirmEmail' => TRUE));
+ $UserID = $UserModel->Register($User, array('CheckCaptcha' => FALSE, 'NoConfirmEmail' => TRUE));
$User['UserID'] = $UserID;
$this->Form->SetValidationResults($UserModel->ValidationResults());
@@ -25,14 +25,16 @@ public function AfterImport() {
$Router->SetRoute('member\.php\?u=(\d+)', 'dashboard/profile/$1/x', 'Permanent');
// Make different sizes of avatars
$this->ProcessAvatars();
+ // Prep config for ProfileExtender plugin based on imported fields
+ $this->ProfileExtenderPrep();
}
/**
* Create different sizes of user photos.
*/
public function ProcessAvatars() {
$UploadImage = new Gdn_UploadImage();
- $UserData = $this->SQL->Select('u.*')->From('User u')->Where('u.Photo is not null')->Get();
+ $UserData = $this->SQL->Select('u.Photo')->From('User u')->Where('u.Photo is not null')->Get();
// Make sure the avatars folder exists.
if (!file_exists(PATH_UPLOADS.'/userpics'))
@@ -68,4 +70,20 @@ public function ProcessAvatars() {
} catch (Exception $ex) { }
}
}
+
+ /**
+ * Get profile fields imported and add to ProfileFields list.
+ */
+ public function ProfileExtenderPrep() {
+ $ProfileKeyData = $this->SQL->Select('m.Name')->Distinct()->From('UserMeta m')->Like('m.Name', 'Profile_%')->Get();
+ $ExistingKeys = array_filter((array)explode(',', C('Plugins.ProfileExtender.ProfileFields', '')));
+ foreach ($ProfileKeyData->Result() as $Key) {
+ $Name = str_replace('Profile.', '', $Key->Name);
+ if (!in_array($Name, $ExistingKeys)) {
+ $ExistingKeys[] = $Name;
+ }
+ }
+ if (count($ExistingKeys))
+ SaveToConfig('Plugins.ProfileExtender.ProfileFields', implode(',', $ExistingKeys));
+ }
}
@@ -9,4 +9,6 @@
<ul>
<li><?php echo Anchor(T('Click here to carry on to your dashboard'), 'settings'); ?>.</li>
</ul>
-</div>
+</div>
+<?php
+echo $this->Form->Close();
@@ -17,4 +17,4 @@
</div>
</div>
<?php
-$this->Form->Close();
+echo $this->Form->Close();
View
@@ -1,6 +1,6 @@
<?php
define('APPLICATION', 'Vanilla');
-define('APPLICATION_VERSION', '2.0.18.1');
+define('APPLICATION_VERSION', '2.0.18.2');
/*
Copyright 2008, 2009 Vanilla Forums Inc.
This file is part of Garden.
@@ -1,47 +1,55 @@
-/**************************************************************
-jQuery / Garden CheckColumn Plugin v1
-**************************************************************/
+/*
+ * Garden CheckColumn Plugin (1.1)
+ * by Mark O'Sullivan (mark@vanillaforums.com)
+ * by Tim Gunter (tim@vanillaforums.com)
+ *
+ * Copyright (c) 2008 Vanilla Forums, Inc
+ * Licensed under the GPL (GPL-LICENSE.txt) license.
+ *
+ * NOTE: This script requires jQuery to work.
+ * Download jQuery at www.jquery.com
+ */
-(function($) {
- $.fn.checkColumn = function(opt) {
- opt = $.extend({
- noOptionsYet: 0
- }, opt);
-
- // Remove the cellpadding on anchor cells
- $(this).find('thead td').css('padding', '0px');
+jQuery(document).ready(function($){
+ $.fn.checkColumn = function(opt) {
+ opt = $.extend({
+ noOptionsYet: 0
+ }, opt);
+
+ // Remove the cellpadding on anchor cells
+ $(this).find('thead td').css('padding', '0px');
+
+ // Handle column heading clicks
+ $(this).find('thead td').each(function(i,el) {
+ el = $(el);
+ var columnIndex = el.prop('cellIndex');
+ var text = el.html();
+ el.html('');
+
+ var anchor = $('<a></a>');
+ anchor.click(function(event) {
+ var rows = $(el).parents('table').find('tbody tr');
+ var checkbox = false;
+ rows.each(function(j,row){
+ checkbox = $(row).find('td:eq(' + (columnIndex) + ')').find(":checkbox");
+ if (checkbox) {
+ if (checkbox.prop('checked')) {
+ checkbox.removeAttr('checked');
+ } else {
+ checkbox.prop('checked', 'checked');
+ }
+ }
+ })
+ return false;
+ });
+ anchor.html(text);
+ anchor.prop('href', '#');
+ el.append(anchor);
+ });
- // Handle column heading clicks
- $(this).find('thead td').each(function() {
- var columnIndex = $(this).attr('cellIndex');
- var text = $(this).html();
- var anchor = document.createElement('a');
- anchor.onclick = function(sender) {
- var rows = $(this).parents('table').find('tbody tr');
- var checkbox = false;
- for (i = 0; i < rows.length; i++) {
- checkbox = $(rows[i]).find('td:eq(' + (columnIndex) + ')').find(":checkbox");
- if (checkbox) {
- if ($(checkbox).attr('checked')) {
- checkbox.removeAttr('checked');
- } else {
- checkbox.attr('checked', 'checked');
- }
- }
- }
- return false;
- }
- anchor.innerHTML = text;
- anchor.href = '#';
- $(this).html(anchor);
- });
-
+ // Return the object for chaining
+ return $(this);
+ }
- // Return the object for chaining
- return $(this);
- }
-})(jQuery);
-
-$(function() {
- $('table.CheckColumn').checkColumn();
+ $('table.CheckColumn').checkColumn();
});
@@ -190,7 +190,7 @@ public function TestApplication($ApplicationName, &$Validation) {
throw new Exception(T('The application folder was not properly defined.'));
// Hook directly into the autoloader and force it to load the newly tested application
- Gdn_Autoloader::AttachApplication($ApplicationName);
+ Gdn_Autoloader::AttachApplication($ApplicationFolder);
// Redefine the locale manager's settings $Locale->Set($CurrentLocale, $EnabledApps, $EnabledPlugins, TRUE);
$Locale = Gdn::Locale();
@@ -533,7 +533,15 @@ public function Save($File = '', $Group = '', $RequireSourceFile = TRUE) {
$Result = FALSE;
if (file_put_contents($TmpFile, $FileContents) !== FALSE) {
chmod($TmpFile, 0775);
- $Result = rename($TmpFile, $File);
+ if (!rename($TmpFile, $File)) {
+ // The rename may not work on Windows servers so try a copy.
+ if (copy($TmpFile, $File)) {
+ unlink($TmpFile);
+ $Result = TRUE;
+ }
+ } else {
+ $Result = TRUE;
+ }
}
}
@@ -1189,14 +1189,16 @@ public static function Timespan($timespan) {
* @return mixed
*/
public static function Url($Mixed) {
- if (!is_string($Mixed)) {
+ if (!is_string($Mixed))
return self::To($Mixed, 'Url');
- } elseif (preg_replace('`([^\PP])`u', '', 'Test') == '') {
+
+
+ if (preg_replace('`([^\PP])`u', '', 'Test') == '') {
// No Unicode PCRE support.
$Mixed = trim($Mixed);
$Mixed = strip_tags(html_entity_decode($Mixed, ENT_COMPAT, 'UTF-8'));
$Mixed = strtr($Mixed, self::$_UrlTranslations);
- $Mixed = preg_replace('/([^\w\d_:.])/', ' ', $Mixed); // get rid of punctuation and symbols
+ $Mixed = preg_replace('/([^\w\d_:])/', ' ', $Mixed); // get rid of punctuation and symbols
$Mixed = str_replace(' ', '-', trim($Mixed)); // get rid of spaces
$Mixed = preg_replace('/-+/', '-', $Mixed); // limit to 1 hyphen at a time
$Mixed = urlencode(strtolower($Mixed));
@@ -1208,7 +1210,7 @@ public static function Url($Mixed) {
$Mixed = strtr($Mixed, self::$_UrlTranslations);
$Mixed = preg_replace('`([^\PP.\-_])`u', '', $Mixed); // get rid of punctuation
$Mixed = preg_replace('`([^\PS+])`u', '', $Mixed); // get rid of symbols
- $Mixed = preg_replace('`[\s\-/+]+`u', '-', $Mixed); // replace certain characters with dashes
+ $Mixed = preg_replace('`[\s\-/+.]+`u', '-', $Mixed); // replace certain characters with dashes
$Mixed = rawurlencode(strtolower($Mixed));
return $Mixed;
}
@@ -33,7 +33,7 @@ function UserPhotoDefaultUrl($User) {
.'&amp;size='.C('Garden.Thumbnail.Width', 50);
if (C('Plugins.Gravatar.UseVanillicon', FALSE))
- $Url .= '&amp;default='.urlencode(Asset('http://vanillicon.com/'.md5($User->Name).'.png'));
+ $Url .= '&amp;default='.urlencode(Asset('http://vanillicon.com/'.md5($User->Email).'.png'));
else
$Url .= '&amp;default='.urlencode(Asset(C('Plugins.Gravatar.DefaultAvatar', 'plugins/Gravatar/default.gif'), TRUE));
@@ -12,7 +12,7 @@
$PluginInfo['Tagging'] = array(
'Name' => 'Tagging',
'Description' => 'Allow tagging of discussions.',
- 'Version' => '1.1',
+ 'Version' => '1.1p1',
'SettingsUrl' => '/dashboard/settings/tagging',
'SettingsPermission' => 'Garden.Settings.Manage',
'Author' => "Mark O'Sullivan",
@@ -376,7 +376,7 @@ public function PostController_BeforeFormButtons_Handler($Sender) {
->From('TagDiscussion td')
->Join('Tag t', 'td.TagID = t.TagID')
->Where('td.DiscussionID', GetValue('DiscussionID', $Discussion))
- ->Where('t.Type', '')
+ ->Where("coalesce(t.Type, '')", '')
->Get()->ResultArray();
$Tags = ConsolidateArrayValuesByKey($Tags, 'Name');
@@ -16,9 +16,6 @@ $(function() {
forceRemoteUrl = gdn.definition('ForceRemoteUrl', '') != '',
webroot = gdn.definition('WebRoot'),
pathroot = gdn.definition('UrlFormat').replace('/{Path}', '').replace('{Path}', '');
-
- if (!inIframe)
- return;
if (inIframe) {
if ("postMessage" in parent) {
@@ -135,6 +132,7 @@ $(function() {
$(window).unload(function() { remotePostMessage('unload', '*'); });
}
+ else return; // Ignore the rest if we're not embedded.
var path = gdn.definition('Path', '~');
if (path != '~') {

0 comments on commit 972f710

Please sign in to comment.