From 3c3b82e166bfd12b20bb6d52e9ea6d95cc6453b6 Mon Sep 17 00:00:00 2001 From: Don Gilbert Date: Tue, 16 May 2017 12:39:42 -0400 Subject: [PATCH 1/3] Fix for logout during upgrade --- upgrade.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/upgrade.php b/upgrade.php index 4a0154e6406..924c557013f 100644 --- a/upgrade.php +++ b/upgrade.php @@ -12,7 +12,7 @@ date_default_timezone_set('UTC'); define('MAUTIC_MINIMUM_PHP', '5.6.19'); -define('MAUTIC_MAXIMUM_PHP', '7.0.999'); +define('MAUTIC_MAXIMUM_PHP', '7.1.999'); // Are we running the minimum version? if (version_compare(PHP_VERSION, MAUTIC_MINIMUM_PHP, 'lt')) { @@ -52,6 +52,25 @@ } define('MAUTIC_CACHE_DIR', $cacheDir); +/* + * Updating to 2.8.1: Check to see if we have a mautic_session_name + * and use that to populate the actual session name that will be + * generated after a successful update. + */ +if (isset($_COOKIE['mautic_session_name'])) { + $sessionValue = $_COOKIE[$_COOKIE['mautic_session_name']]; + + include MAUTIC_APP_ROOT.'/config/paths.php'; + $localConfigPath = str_replace('%kernel.root_dir%', MAUTIC_APP_ROOT, $paths['local_config']); + + $newSessionName = md5(md5($localConfigPath).$localParameters['secret_key']); + + setcookie($newSessionName, $sessionValue); + + unset($_COOKIE['mautic_session_name']); + setcookie('mautic_session_name', null, -1); +} + // Fetch the update state out of the request if applicable $state = json_decode(base64_decode(getVar('updateState', 'W10=')), true); From a9d7f22a2d18d4d1c5c04783a4111f6ce39b069d Mon Sep 17 00:00:00 2001 From: Don Gilbert Date: Tue, 16 May 2017 12:41:10 -0400 Subject: [PATCH 2/3] Prep 2.8.1 release (really this time) --- app/AppKernel.php | 2 +- app/version.txt | 2 +- media/css/app.css | 2 +- media/css/libraries.css | 2 +- media/js/app.js | 17 +++++++++-------- media/js/libraries.js | 6 +++--- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/AppKernel.php b/app/AppKernel.php index 7f4eb1133c7..f0eb3e33dff 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -51,7 +51,7 @@ class AppKernel extends Kernel * * @const string */ - const EXTRA_VERSION = '-dev'; + const EXTRA_VERSION = ''; /** * @var array diff --git a/app/version.txt b/app/version.txt index 9e231446465..96d771776bd 100644 --- a/app/version.txt +++ b/app/version.txt @@ -1 +1 @@ -2.8.1-dev \ No newline at end of file +2.8.1 \ No newline at end of file diff --git a/media/css/app.css b/media/css/app.css index 90abb41221d..57bfbf0375e 100644 --- a/media/css/app.css +++ b/media/css/app.css @@ -519,7 +519,7 @@ solid #123456}.campaign-event-buttons{position:absolute;top:-10px;right:-10px}.c #CampaignEventSelector_chosen .list-campaign-decision, #CampaignEventSelector_chosen .list-campaign-leadsource{border-left:none;border-right:none;border-top:none;padding:10px 5px}#CampaignEventSelector_chosen .disabled-result{display:none}.campaign-builder .list-group-item.ui-draggable-dragging{width:206px;padding:10px -15px;border-radius:6px}.campaign-builder .builder-active{height:10000px !important}.campaign-builder .builder-content{height:auto;width:auto;bottom:0;overflow:auto}#CampaignCanvas{height:10000px;width:10000px;position:relative}.campaign-event-list .progress-bar{position:absolute;top:0;left:0;height:3px}.campaign-event-buttons .btn-edit{background:#337ab7}.stat-boxes .pie-legend +15px;border-radius:6px}.campaign-builder .builder-active{height:10000px !important}.campaign-builder .builder-content{height:auto;width:auto;bottom:0;overflow:auto}#CampaignCanvas{height:10000px;width:10000px;position:relative}.campaign-event-list .progress-bar{position:absolute;top:0;height:3px}.campaign-event-buttons .btn-edit{background:#337ab7}.stat-boxes .pie-legend li{display:inline}.col-category-color{width:50px}.input-group-addon label{margin-bottom:0px}.vector-map{height:350px;color:transparent}.jvectormap-container{height:100%;width:100%}.dashboard-widgets .sortable-placeholder{background-color:#fff;border:1px dashed #4e5d9d;flex-grow:0}.dashboard-widgets.cards{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:10px}.dashboard-widgets diff --git a/media/css/libraries.css b/media/css/libraries.css index 11aad5760e4..3d6ee0f5a70 100644 --- a/media/css/libraries.css +++ b/media/css/libraries.css @@ -271,7 +271,7 @@ small{font-size:smaller;color:#777;font-weight:normal}.fr-popup{z-index:9999 !im solid #4e5e9e;z-index:1}div[data-section-focus]{content:'';position:absolute;border:1px solid #fdb933}div[data-section-focus="top"]{left:0px;right:0px;top:0px}div[data-section-focus="right"]{bottom:0px;right:0px;top:0px}div[data-section-focus="bottom"]{bottom:0px;right:0px;left:0px}div[data-section-focus="left"]{bottom:0px;top:0px;left:0px}div[data-section-focus="handle"]{width:25px;height:25px;bottom:10px;left:10px;background:#4e5e9e;color:#fff;text-align:center;border:0;line-height:25px}div[data-section-focus="delete"]{width:25px;height:25px;bottom:36px;left:10px;background:#4e5e9e;color:#fff;text-align:center;border:0;line-height:25px}div[data-slot-toolbar]{position:absolute;top:-24px;left:-1px;right:-1px;height:25px;width:100%;z-index:10;cursor:pointer;cursor:move;background-color:#4e5e9e;border-left:1px solid #4e5e9e;border-right:1px solid #4e5e9e;padding-top:2px}div[data-slot-toolbar] .btn{width:20px;height:20px;padding:0;display:inline-block;margin-bottom:0;font-weight:600;text-align:center;vertical-align:middle;cursor:pointer;border:1px solid transparent;white-space:nowrap;line-height:1.3856;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:11px;line-height:1.456;float:right;margin-right:2px;color:#fff}div[data-slot-toolbar] .btn -.fa{padding-top:4px}div[data-slot],[data-section-wrapper]{position:relative}div[data-slot^="image"]{padding-top:1px;padding-bottom:1px}div[data-slot^="image"] img{z-index:2;position:relative}div[data-slot].ui-sortable-helper{border:1px +.fa{padding-top:4px}div[data-slot],[data-section-wrapper]{position:relative;font-size:initial;line-height:initial}div[data-slot^="image"]{padding-top:1px;padding-bottom:1px}div[data-slot^="image"] img{z-index:2;position:relative}div[data-slot].ui-sortable-helper{border:1px solid #4e5e9e}.slot-placeholder{border:2px dotted #4e5e9e}[data-slot="text"].fr-box{padding:initial}[data-slot="text"].fr-box .fr-toolbar{border-top:2px solid #4e5e9e;position:absolute;left:-15px;bottom:initial !important;min-width:385px}[data-slot="text"].fr-box .fr-toolbar.fr-top{top:-78px !important;bottom:initial !important}[data-slot="text"].fr-box .fr-toolbar.fr-bottom{bottom:-78px !important;top:initial !important}[data-slot="text"].fr-box .fr-wrapper{border-radius:0 0 0px 0px;-moz-border-radius:0 0 0px 0px;-webkit-border-radius:0 0 0px 0px;-webkit-box-shadow:none !important;-moz-box-shadow:none !important;box-shadow:none !important;background:transparent !important}[data-slot="text"].fr-box .fr-wrapper .fr-element{text-align:inherit !important;padding:0 !important;overflow-x:initial !important;color:inherit !important;min-height:inherit !important}.slot-type-handle.btn,.section-type-handle.btn{float:left;width:111px;margin:2px;height:75px;padding-left:5px;padding-right:5px;text-align:center;word-wrap:break-word}.slot-type-handle.ui-draggable-dragging,.section-type-handle.ui-draggable-dragging{color:#5d6c7c;background-color:#f5f5f5;border-color:#d3d3d3;padding:10px diff --git a/media/js/app.js b/media/js/app.js index 3206d33bdf3..65c332f5b0d 100644 --- a/media/js/app.js +++ b/media/js/app.js @@ -41,7 +41,7 @@ Mautic.processPageContent(response);} Mautic.stopIconSpinPostEvent();} MauticVars.routeInProgress='';},error:function(request,textStatus,errorThrown){Mautic.processAjaxError(request,textStatus,errorThrown,true);MauticVars.routeInProgress='';Mautic.stopIconSpinPostEvent();Mautic.stopPageLoadingBar();},complete:function(){if(typeof callback!=='undefined'){if(typeof callback=='function'){callback();}else{window["Mautic"][callback].apply('window',[]);}} Mautic.generatePageTitle(route);delete Mautic.loadContentXhr[target];}});return false;};Mautic.generatePageTitle=function(route){if(-1!==route.indexOf('view')){var currentModule=route.split('/')[3];var titleWithHTML=mQuery('.page-header h3').find('span.span-block');var currentModuleItem='';if(1'+currentModuleItem+'').text();mQuery('title').html(currentModule[0].toUpperCase()+currentModule.slice(1)+' | '+currentModuleItem+' | Mautic');}else{mQuery('title').html(mQuery('.page-header h3').html()+' | Mautic');}};Mautic.processPageContent=function(response){if(response){Mautic.deactivateBackgroup();if(response.errors&&'dev'==mauticEnv){alert(response.errors[0].message);console.log(response.errors);} if(!response.target){response.target='#app-content';} Mautic.onPageUnload(response.target,response);if(response.newContent){if(response.replaceContent&&response.replaceContent=='true'){mQuery(response.target).replaceWith(response.newContent);}else{mQuery(response.target).html(response.newContent);}} if(response.flashes){Mautic.setFlashes(response.flashes);} @@ -172,10 +172,10 @@ element.css('background-color',color).attr('bgcolor',color);mQuery(element).find ("0"+parseInt(rgb[3],10).toString(16)).slice(-2):orig;};Mautic.initSlots=function(slotContainers){if(!slotContainers){slotContainers=Mautic.builderContents.find('[data-slot-container]');} Mautic.builderContents.find('a').on('click',function(e){e.preventDefault();});var bodyOverflow={};Mautic.sortActive=false;Mautic.parentDocument=parent.document;slotContainers.sortable({helper:function(e,ui){bodyOverflow.overflowX=mQuery('body').css('overflow-x');bodyOverflow.overflowY=mQuery('body').css('overflow-y');mQuery('body').css({overflowX:'visible',overflowY:'visible'});return ui;},items:'[data-slot]',handle:'[data-slot-toolbar]',placeholder:'slot-placeholder',connectWith:'[data-slot-container]',start:function(event,ui){Mautic.sortActive=true;ui.placeholder.height(ui.helper.outerHeight());Mautic.builderContents.find('[data-slot-focus]').each(function(){var focusedSlot=mQuery(this).closest('[data-slot]');if(focusedSlot.attr('data-slot')==='image'){focusedSlot.find('img').each(function(){mQuery(this).froalaEditor('popups.hideAll');});Mautic.builderContents.find('.fr-image-resizer.fr-active').removeClass('fr-active');}});Mautic.builderContents.find('[data-slot-focus]').remove();},stop:function(event,ui){if(ui.item.hasClass('slot-type-handle')){mQuery('body',parent.document).css(bodyOverflow);var newSlot=mQuery('
').attr('data-slot',ui.item.attr('data-slot-type')).html(ui.item.find('script').html()) ui.item.replaceWith(newSlot);Mautic.builderContents.trigger('slot:init',newSlot);}else{mQuery('body').css(bodyOverflow);} -Mautic.sortActive=false;}});var iframe=mQuery('#builder-template-content',parent.document).contents();mQuery('#slot-type-container .slot-type-handle',parent.document).draggable({iframeFix:true,connectToSortable:'[data-slot-container]',revert:'invalid',iframeOffset:iframe.offset(),helper:function(e,ui){bodyOverflow.overflowX=mQuery('body',Mautic.parentDocument).css('overflow-x');bodyOverflow.overflowY=mQuery('body',Mautic.parentDocument).css('overflow-y');mQuery('body',Mautic.parentDocument).css({overflowX:'hidden',overflowY:'hidden'});return mQuery(this).clone().css('height',mQuery(this).height()).css('width',mQuery(this).width());},zIndex:8000,cursorAt:{top:15,left:15},start:function(event,ui){mQuery('#builder-template-content',Mautic.parentDocument).css('overflow','hidden');mQuery('#builder-template-content',Mautic.parentDocument).attr('scrolling','no');if(slotContainers.data('sortable'))slotContainers.sortable('option','scroll',false);},stop:function(event,ui){mQuery('body',Mautic.parentDocument).css(bodyOverflow);mQuery('#builder-template-content',Mautic.parentDocument).css('overflow','visible');mQuery('#builder-template-content',Mautic.parentDocument).attr('scrolling','yes');if(slotContainers.data('sortable'))slotContainers.sortable('option','scroll',true);}}).disableSelection();iframe.on('scroll',function(){mQuery('#slot-type-container .slot-type-handle',Mautic.parentDocument).draggable("option","cursorAt",{top:-1*iframe.scrollTop()+15});});slotContainers.find('[data-slot]').each(function(){mQuery(this).trigger('slot:init',this);});};Mautic.getSlotToolbar=function(){Mautic.builderContents.find('[data-slot-toolbar]').remove();var slotToolbar=mQuery('
').attr('data-slot-toolbar',true);var deleteLink=Mautic.getSlotDeleteLink();deleteLink.appendTo(slotToolbar);return slotToolbar;};Mautic.getSlotDeleteLink=function(){if(typeof Mautic.deleteLink=='undefined'){Mautic.deleteLink=mQuery('').attr('data-slot-action','delete').attr('alt','delete').addClass('btn btn-delete btn-default');} -return Mautic.deleteLink;};Mautic.getSlotFocus=function(){Mautic.builderContents.find('[data-slot-focus]').remove();return mQuery('
').attr('data-slot-focus',true);};Mautic.cloneFocusForm=function(decId,removeFroala){if(typeof Mautic.activeDEC!=='undefined'){var element=Mautic.activeDEC.detach();element.hide();Mautic.activeDECParent.append(element);} -var focusForm=parent.mQuery('#emailform_dynamicContent_'+decId);Mautic.activeDECParent=focusForm.parent();focusForm.removeClass('fade');focusForm.find('.tab-pane:first').find('.remove-item').hide();var element=focusForm.detach();element.show();Mautic.activeDEC=element;return element;};Mautic.initEmailDynamicContentSlotEdit=function(clickedSlot){var decId=clickedSlot.attr('data-param-dec-id');var focusForm;if(decId||decId===0){focusForm=Mautic.cloneFocusForm(decId);} -var focusFormHeader=parent.mQuery('#customize-slot-panel').find('.panel-heading h4');var newDynConButton=mQuery('