From a076e097290d3b2913bfefc9674d1bf3f7d26066 Mon Sep 17 00:00:00 2001 From: Leonix Date: Thu, 4 Aug 2022 17:44:33 +0300 Subject: [PATCH] installer: v.2.6.2 (developer preview) --- wa-apps/installer/css/app.installer.css | 2 +- wa-apps/installer/lib/config/app.php | 4 +- .../lib/config/installerConfig.class.php | 24 ++- .../webasyst.backend_header.handler.php | 103 +++++++--- .../templates/actions/assets/Assets.html | 2 + .../templates/actions/assets/Assets.row.html | 14 +- .../layouts-legacy/BackendStoreSidebar.html | 13 +- .../layouts/BackendStoreSidebar.html | 8 + wa-content/css/wa/wa-2.0.css | 2 +- wa-content/js/jquery-wa/wa.js | 2 +- wa-system/config/waAppConfig.class.php | 49 +++-- .../database/waDbCacheIterator.class.php | 31 ++- wa-system/database/waDbQuery.class.php | 23 ++- .../database/waDbResultIterator.class.php | 5 +- wa-system/database/waDbResultSelect.class.php | 3 +- wa-system/design/templates-legacy/Design.html | 4 +- wa-system/exception/waDbException.class.php | 4 +- .../exception/waRightsException.class.php | 2 +- wa-system/file/waNet.class.php | 2 +- wa-system/image/waImageGd.class.php | 13 +- wa-system/image/waImageImagick.class.php | 50 +++-- wa-system/locale/waLocale.class.php | 29 ++- wa-system/plugin/waPlugin.class.php | 30 +-- wa-system/request/waRequest.class.php | 9 +- wa-system/util/waHtmlControl.class.php | 4 +- .../smarty-plugins/prefilter.translate.php | 3 - wa-system/waSystem.class.php | 2 +- .../waWebasystIDAccessTokenManager.class.php | 11 ++ wa-system/waid/waWebasystIDApi.class.php | 11 +- .../waid/waWebasystIDClientManager.class.php | 6 +- .../backend/webasystBackend.actions.php | 2 +- .../webasystBackendCheatSheet.actions.php | 16 ++ .../backend/webasystBackendHeader.action.php | 7 +- .../webasystDashboardActivity.action.php | 18 +- .../actions/login/webasystLogin.action.php | 4 + .../webasystProfileSave.controller.php | 30 +-- .../general/webasystSettings.action.php | 2 +- wa-system/webasyst/lib/config/app.php | 4 +- wa-system/webasyst/lib/config/db.php | 1 + wa-system/webasyst/lib/models/waLog.model.php | 4 + .../locale/ru_RU/LC_MESSAGES/webasyst.mo | Bin 237430 -> 237618 bytes .../locale/ru_RU/LC_MESSAGES/webasyst.po | 9 +- .../templates/actions/login/LoginFirst.html | 178 +++++++++--------- 43 files changed, 458 insertions(+), 282 deletions(-) diff --git a/wa-apps/installer/css/app.installer.css b/wa-apps/installer/css/app.installer.css index b21b0d4f5..8deaa9c97 100644 --- a/wa-apps/installer/css/app.installer.css +++ b/wa-apps/installer/css/app.installer.css @@ -1 +1 @@ -#i-themes-color li .i-check-icon{display:none}#i-themes-color li .i-close-icon{display:none}#i-themes-color li.selected:hover .i-check-icon{display:none}#i-themes-color li.selected:hover .i-close-icon{display:block}#i-themes-color li.selected .i-check-icon{display:block}#i-themes-color li.selected .i-close-icon{display:none}#i-themes-color .i-style-color{width:34px;height:34px;border-radius:50%;border:5px solid var(--white);box-shadow:inset 0 0 0 1px var(--light-gray);transition:.3s;transition-property:border-color,background-color}#i-themes-color .i-style-color:hover{border-color:var(--light-gray)}#i-themes-color .i-style-color_black{background-color:var(--black)}#i-themes-color .i-style-color_gray{background-color:var(--gray)}#i-themes-color .i-style-color_white{background-color:var(--white)}#i-themes-color .i-style-color_green{background-color:var(--green)}#i-themes-color .i-style-color_yellow{background-color:var(--yellow)}#i-themes-color .i-style-color_orange{background-color:var(--orange)}#i-themes-color .i-style-color_brown{background-color:var(--brown)}#i-themes-color .i-style-color_red{background-color:var(--red)}#i-themes-color .i-style-color_purple{background-color:var(--purple)}#i-themes-color .i-style-color_blue{background-color:var(--blue)}#i-themes-color .i-style-color_aquamarine{background-color:#00d3c0}#i-themes-color .i-style-color_any{background:url("../img/icons/gradient-sprite.png") no-repeat -7px -7px;background-size:48px auto}#i-themes-color .i-style-color-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.i-selected-icon{display:none}.selected .i-selected-icon{display:block}.i-assets-col-icon{width:48px}.i-assets-col-icon img{max-width:100%}.i-assets-color-blue{color:var(--blue)}@media (max-width:760px){.i-assets-list thead{display:none}.i-assets-list tr{display:grid;grid-template-columns:1fr max-content;border-top:1px solid var(--border-color-soft)}.i-assets-list td{border-bottom:none}.i-assets-list td:nth-child(1){display:none}.i-assets-list td:nth-child(3){text-align:right}.i-assets-list td:nth-child(4){grid-column:1/-1;text-align:center}}.i-assets-disabled-title{display:none}.i-assets-disabled .i-assets-col{color:var(--text-color-hint)}.i-assets-disabled .i-assets-disabled-title{display:block}.js-installer-assets-spinner{display:none}.js-installer-assets-spinner.-active{display:inline-block}.i-reviews{position:relative}.i-reviews h1{margin:1.5rem;font-size:2.286rem}.i-reviews .i-reviews-filter{display:flex;margin:1.8rem;justify-content:flex-start}.i-reviews .i-reviews-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(252px,1fr));grid-gap:20px;position:relative;margin:1.8rem 0}.i-reviews .i-reviews-list.rated{display:block}.i-reviews .i-reviews-list .i-product-review-block{box-sizing:border-box;display:flex;flex-direction:column;position:relative;background-color:var(--background-color-blank);border-radius:5px;padding:1rem;box-shadow:0 3px 7px 0 rgba(0,0,0,0.13),0 0 3px 0 rgba(40,40,80,0.1);transition:box-shadow linear var(--timing-fast)}[data-theme="dark"] .i-reviews .i-reviews-list .i-product-review-block{box-shadow:0 .5rem 2rem -1rem var(--dialog-shadow-color)}.i-reviews .i-reviews-list .i-product-review-block.rated{flex-direction:row;justify-content:flex-start;box-shadow:none}.i-reviews .i-reviews-list .i-product-review-block.rated:hover{box-shadow:none !important}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-icon{min-width:195px;align-self:flex-start;align-items:flex-start;height:auto;margin:0 1rem 0 0}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc{align-items:flex-start;justify-content:flex-start;width:100%}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-review-support{border:0 none;padding:0;margin-bottom:1rem;width:auto;flex-direction:row;height:1.2rem;justify-content:flex-start}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-review-support span{margin-left:.5rem}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-rates-list{margin:0}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info{margin:1.5rem 0 0 0;display:flex;align-items:center;width:100%;font-size:1rem}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .i{margin-right:.5rem}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .user{margin-right:.5rem;font-weight:600;color:#555}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .review_date{margin-right:1.5rem;color:#aaa}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .review_change{margin:0}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .review_rating{margin-left:auto}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-review{display:block;margin:.5rem 0 0 1.25rem;color:#777;white-space:pre;line-height:1.3rem}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse{box-shadow:none;border:1px solid rgba(0,0,0,0.07);border-radius:5px;align-items:center}[data-theme="dark"] .i-reviews .i-reviews-list .i-product-review-block.loader-pulse{border-color:rgba(255,255,255,0.07)}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-product-review-title{width:80%;height:20px;margin-bottom:1rem}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-rates-list{margin-bottom:3rem;display:flex;width:60%;height:20px;justify-content:space-around}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-rates-list > span{color:rgba(0,0,0,0.05)}[data-theme="dark"] .i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-rates-list > span{filter:invert(1)}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-product-review-support{width:100%;height:20px}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse > span{background:rgba(0,0,0,0.05);border-radius:5px}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse:hover{box-shadow:none !important}.i-reviews .i-reviews-list .i-product-review-icon{flex-shrink:0;display:flex;justify-content:center;align-items:center;height:140px;margin-bottom:.72rem}.i-reviews .i-reviews-list .i-product-review-icon img{max-width:268px;height:auto;max-height:120px}.i-reviews .i-reviews-list .i-product-review-icon img.border{border:1px solid rgba(0,0,0,0.1);border-radius:5px}.i-reviews .i-reviews-list .i-product-review-icon img.size-limit{max-width:96px}.i-reviews .i-reviews-list .i-product-review-desc{display:flex;flex-direction:column;align-items:center;height:100%}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-title{font-weight:bold;font-size:1rem;text-align:center;margin-bottom:1.286rem}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list{position:relative;margin-bottom:.5rem}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list::after{content:'';width:160px;height:30px;background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,var(--background-color-blank) 25px,rgba(255,255,255,0) 80px);background-size:600px;animation:shine-lines 5s infinite linear;position:absolute;top:0;left:0}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list:hover::after{animation:none;z-index:-1}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list > span{color:var(--light-gray)}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list > span.is-active{color:var(--yellow)}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list svg{width:1.5rem;height:1.5rem}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-support{display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;color:var(--gray);font-size:.875rem;border-top:1px solid var(--border-color-soft);padding:1rem 1rem 0;margin-top:1rem}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-support:hover span{color:var(--red)}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-support span{color:var(--text-color-link)}.i-reviews .i-reviews-list .i-product-review-desc .i-product-reviewer-info,.i-reviews .i-reviews-list .i-product-review-desc .i-product-review{display:none}.i-reviews .i-loading-wrapper{position:absolute;top:200px;left:calc(50% - 50px);opacity:.5;width:100px;height:100px;background:url("../img/icons/spinner.gif") no-repeat;background-size:100px 100px !important;cursor:default}.i-reviews .i-loading-wrapper.pulsed{display:grid;grid-template-columns:repeat(auto-fit,minmax(252px,1fr));grid-gap:20px;position:relative;top:0;left:0;opacity:1;width:100%;height:100%;background:none}.i-reviews .hidden{display:none !important}.i-reviews .border-no-color{border-color:transparent !important}.i-reviews .overlay{position:absolute !important;top:0 !important;right:0 !important;bottom:0 !important;left:0 !important;z-index:5;background:#fff !important}.loader-pulse{animation:loader-keyframes-pulse var(--timing--slowest) ease-in-out var(--timing-default) infinite}@-moz-keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@-webkit-keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@-o-keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@-moz-keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@-webkit-keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@-o-keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@media (max-width:760px){.installer-update__table thead{display:none}.installer-update__table tr{display:flex;flex-wrap:wrap;border-top:1px solid var(--border-color-soft)}.installer-update__table tr.installer-update__table-tr{border-top-width:3px}.installer-update__table td{display:block;border-bottom:none}.installer-update__table td:empty{display:none}.installer-update__table td:nth-child(3),.installer-update__table td:nth-child(4){width:100%}.installer-update__table td:nth-child(4){display:flex;justify-content:center}.installer-update__table td.installer-update__table-hidden{display:none}.installer-update__table td.i-update-name{align-self:center}}.installer-update__table td p{margin:inherit}.update-result-apps-list{list-style:none;padding:0}/*# sourceMappingURL=app.installer.css.map */ \ No newline at end of file +#i-themes-color li .i-check-icon{display:none}#i-themes-color li .i-close-icon{display:none}#i-themes-color li.selected:hover .i-check-icon{display:none}#i-themes-color li.selected:hover .i-close-icon{display:block}#i-themes-color li.selected .i-check-icon{display:block}#i-themes-color li.selected .i-close-icon{display:none}#i-themes-color .i-style-color{width:34px;height:34px;border-radius:50%;border:5px solid var(--white);box-shadow:inset 0 0 0 1px var(--light-gray);transition:.3s;transition-property:border-color,background-color}#i-themes-color .i-style-color:hover{border-color:var(--light-gray)}#i-themes-color .i-style-color_black{background-color:var(--black)}#i-themes-color .i-style-color_gray{background-color:var(--gray)}#i-themes-color .i-style-color_white{background-color:var(--white)}#i-themes-color .i-style-color_green{background-color:var(--green)}#i-themes-color .i-style-color_yellow{background-color:var(--yellow)}#i-themes-color .i-style-color_orange{background-color:var(--orange)}#i-themes-color .i-style-color_brown{background-color:var(--brown)}#i-themes-color .i-style-color_red{background-color:var(--red)}#i-themes-color .i-style-color_purple{background-color:var(--purple)}#i-themes-color .i-style-color_blue{background-color:var(--blue)}#i-themes-color .i-style-color_aquamarine{background-color:#00d3c0}#i-themes-color .i-style-color_any{background:url("../img/icons/gradient-sprite.png") no-repeat -7px -7px;background-size:48px auto}#i-themes-color .i-style-color-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.i-selected-icon{display:none}.selected .i-selected-icon{display:block}.i-assets-col-icon{width:48px}.i-assets-col-icon img{max-width:100%}.i-assets-color-blue{color:var(--blue)}@media (max-width:760px){.i-assets-list thead{display:none}.i-assets-list tr{display:grid;grid-template-columns:1fr max-content;border-top:1px solid var(--border-color-soft)}.i-assets-list td{border-bottom:none}.i-assets-list td:nth-child(1){display:none}.i-assets-list td:nth-child(3){text-align:right}.i-assets-list td:nth-child(4){grid-column:1/-1;text-align:center}}.i-assets-disabled-title{display:none}.i-assets-disabled .i-assets-col{color:var(--text-color-hint)}.i-assets-disabled .i-assets-disabled-title{display:block}.js-installer-assets-spinner{display:none}.js-installer-assets-spinner.-active{display:inline-block}.i-reviews{position:relative}.i-reviews h1{margin:1.5rem;font-size:2.286rem}.i-reviews .i-reviews-filter{display:flex;margin:1.8rem;justify-content:flex-start}.i-reviews .i-reviews-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(252px,1fr));grid-gap:20px;position:relative;margin:1.8rem 0}.i-reviews .i-reviews-list.rated{display:block}.i-reviews .i-reviews-list .i-product-review-block{box-sizing:border-box;display:flex;flex-direction:column;position:relative;background-color:var(--background-color-blank);border-radius:5px;padding:1rem;box-shadow:0 3px 7px 0 rgba(0,0,0,0.13),0 0 3px 0 rgba(40,40,80,0.1);transition:box-shadow linear var(--timing-fast)}[data-theme="dark"] .i-reviews .i-reviews-list .i-product-review-block{box-shadow:0 .5rem 2rem -1rem var(--dialog-shadow-color)}.i-reviews .i-reviews-list .i-product-review-block.rated{flex-direction:row;justify-content:flex-start;box-shadow:none}.i-reviews .i-reviews-list .i-product-review-block.rated:hover{box-shadow:none !important}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-icon{min-width:195px;align-self:flex-start;align-items:flex-start;height:auto;margin:0 1rem 0 0}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc{align-items:flex-start;justify-content:flex-start;width:100%}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-review-support{border:0 none;padding:0;margin-bottom:1rem;width:auto;flex-direction:row;height:1.2rem;justify-content:flex-start}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-review-support span{margin-left:.5rem}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-rates-list{margin:0}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info{margin:1.5rem 0 0 0;display:flex;align-items:center;width:100%;font-size:1rem}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .i{margin-right:.5rem}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .user{margin-right:.5rem;font-weight:600;color:#555}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .review_date{margin-right:1.5rem;color:#aaa}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .review_change{margin:0}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-reviewer-info .review_rating{margin-left:auto}.i-reviews .i-reviews-list .i-product-review-block.rated .i-product-review-desc .i-product-review{display:block;margin:.5rem 0 0 1.25rem;color:#777;white-space:pre;line-height:1.3rem}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse{box-shadow:none;border:1px solid rgba(0,0,0,0.07);border-radius:5px;align-items:center}[data-theme="dark"] .i-reviews .i-reviews-list .i-product-review-block.loader-pulse{border-color:rgba(255,255,255,0.07)}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-product-review-title{width:80%;height:20px;margin-bottom:1rem}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-rates-list{margin-bottom:3rem;display:flex;width:60%;height:20px;justify-content:space-around}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-rates-list > span{color:rgba(0,0,0,0.05)}[data-theme="dark"] .i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-rates-list > span{filter:invert(1)}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse .i-product-review-support{width:100%;height:20px}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse > span{background:rgba(0,0,0,0.05);border-radius:5px}.i-reviews .i-reviews-list .i-product-review-block.loader-pulse:hover{box-shadow:none !important}.i-reviews .i-reviews-list .i-product-review-icon{flex-shrink:0;display:flex;justify-content:center;align-items:center;height:140px;margin-bottom:.72rem}.i-reviews .i-reviews-list .i-product-review-icon img{max-width:268px;height:auto;max-height:120px}.i-reviews .i-reviews-list .i-product-review-icon img.border{border:1px solid rgba(0,0,0,0.1);border-radius:5px}.i-reviews .i-reviews-list .i-product-review-icon img.size-limit{max-width:96px}.i-reviews .i-reviews-list .i-product-review-desc{display:flex;flex-direction:column;align-items:center;height:100%}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-title{font-weight:bold;font-size:1rem;text-align:center;margin-bottom:1.286rem}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list{position:relative;margin-bottom:.5rem}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list::after{content:'';width:160px;height:30px;background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,var(--background-color-blank) 25px,rgba(255,255,255,0) 80px);background-size:600px;animation:shine-lines 5s infinite linear;position:absolute;top:0;left:0}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list:hover::after{animation:none;z-index:-1}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list > span{color:var(--light-gray)}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list > span.is-active{color:var(--yellow)}.i-reviews .i-reviews-list .i-product-review-desc .i-rates-list svg{width:1.5rem;height:1.5rem}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-support{display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;color:var(--gray);font-size:.875rem;border-top:1px solid var(--border-color-soft);padding:1rem 1rem 0;margin-top:1rem}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-support:hover span{color:var(--red)}.i-reviews .i-reviews-list .i-product-review-desc .i-product-review-support span{color:var(--text-color-link)}.i-reviews .i-reviews-list .i-product-review-desc .i-product-reviewer-info,.i-reviews .i-reviews-list .i-product-review-desc .i-product-review{display:none}.i-reviews .i-loading-wrapper{position:absolute;top:200px;left:calc(50% - 50px);opacity:.5;width:100px;height:100px;background:url("../img/icons/spinner.gif") no-repeat;background-size:100px 100px !important;cursor:default}.i-reviews .i-loading-wrapper.pulsed{display:grid;grid-template-columns:repeat(auto-fit,minmax(252px,1fr));grid-gap:20px;position:relative;top:0;left:0;opacity:1;width:100%;height:100%;background:none}.i-reviews .hidden{display:none !important}.i-reviews .border-no-color{border-color:transparent !important}.i-reviews .overlay{position:absolute !important;top:0 !important;right:0 !important;bottom:0 !important;left:0 !important;z-index:5;background:#fff !important}.loader-pulse{animation:loader-keyframes-pulse var(--timing--slowest) ease-in-out var(--timing-default) infinite}@-moz-keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@-webkit-keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@-o-keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@keyframes loader-keyframes-pulse{0%{opacity:1}50%{opacity:.4}100%{opacity:1}}@-moz-keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@-webkit-keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@-o-keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@keyframes pulse{0%{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}100%{transform:scale3d(1,1,1)}}@media (max-width:760px){.installer-update__table thead{display:none}.installer-update__table tr{display:flex;flex-wrap:wrap;border-top:1px solid var(--border-color-soft)}.installer-update__table tr.installer-update__table-tr{border-top-width:3px}.installer-update__table td{display:block;border-bottom:none}.installer-update__table td:empty{display:none}.installer-update__table td:nth-child(3),.installer-update__table td:nth-child(4){width:100%}.installer-update__table td:nth-child(4){display:flex;justify-content:center}.installer-update__table td.installer-update__table-hidden{display:none}.installer-update__table td.i-update-name{align-self:center}.installer-update__table td.min-width{width:auto}}.installer-update__table td p{margin:inherit}.update-result-apps-list{list-style:none;padding:0}/*# sourceMappingURL=app.installer.css.map */ diff --git a/wa-apps/installer/lib/config/app.php b/wa-apps/installer/lib/config/app.php index 5978efb31..afa406947 100644 --- a/wa-apps/installer/lib/config/app.php +++ b/wa-apps/installer/lib/config/app.php @@ -4,8 +4,8 @@ 'description' => 'Install new apps from the Webasyst Store', 'icon' => 'img/installer.svg', 'mobile' => false, - 'version' => '2.6.0', - 'critical' => '2.6.0', + 'version' => '2.6.2', + 'critical' => '2.6.2', 'system' => true, 'vendor' => 'webasyst', 'csrf' => true, diff --git a/wa-apps/installer/lib/config/installerConfig.class.php b/wa-apps/installer/lib/config/installerConfig.class.php index 694355282..725bb5a99 100644 --- a/wa-apps/installer/lib/config/installerConfig.class.php +++ b/wa-apps/installer/lib/config/installerConfig.class.php @@ -274,7 +274,7 @@ public function getTokenData($actual = false) protected function loadAnnouncements() { - $cache = new waVarExportCache('announcements', self::ANNOUNCE_CACHE_TTL, 'installer'); + $cache = $this->getAnnouncementsCache(); if ($cache->isCached() && ($res = $cache->get())) { return; } @@ -307,9 +307,7 @@ protected function loadAnnouncements() $wasm = new waAppSettingsModel(); if (!$res['data']) { - $wcsm = new waContactSettingsModel(); - $wasm->exec("DELETE FROM {$wasm->getTableName()} WHERE app_id = 'installer' AND name LIKE 'a-%'"); - $wcsm->exec("DELETE FROM {$wcsm->getTableName()} WHERE app_id = 'installer' AND name LIKE 'a-%'"); + $this->clearBanners(); return; } $ads = (array)$res['data']; @@ -343,6 +341,24 @@ protected function loadAnnouncements() } } + public function clearAnnouncementsCache() + { + $this->clearBanners(); + $this->getAnnouncementsCache()->delete(); + } + + protected function clearBanners() + { + $m = new waModel(); + $m->exec("DELETE FROM wa_app_settings WHERE app_id = 'installer' AND name LIKE 'a-%'"); + $m->exec("DELETE FROM wa_contact_settings WHERE app_id = 'installer' AND name LIKE 'a-%'"); + } + + protected function getAnnouncementsCache() + { + return new waVarExportCache('announcements', self::ANNOUNCE_CACHE_TTL, 'installer'); + } + public function loadLicenses() { $cache = new waVarExportCache('licenses', self::LICENSE_CACHE_TTL, $this->getApplication()); diff --git a/wa-apps/installer/lib/handlers/webasyst.backend_header.handler.php b/wa-apps/installer/lib/handlers/webasyst.backend_header.handler.php index adfe69c7c..863fbd70d 100644 --- a/wa-apps/installer/lib/handlers/webasyst.backend_header.handler.php +++ b/wa-apps/installer/lib/handlers/webasyst.backend_header.handler.php @@ -87,8 +87,68 @@ protected function getSlugsToSwitchOff($top_header_list, $notification_list) return array_keys($slugs); } + protected function getProductsLeaseStatus($slugs) + { + try { + $installer = installerHelper::getInstaller(); + $domain = $installer->getDomain(); + $hash = $installer->getHash(); + $url = $installer->getCheckProductLeaseStatusUrl(); + + $net_options = [ + 'timeout' => 20, + 'format' => waNet::FORMAT_JSON, + 'request_format' => waNet::FORMAT_RAW, + 'expected_http_code' => null + ]; + + $net = new waNet($net_options); + $params = [ + 'domain' => $domain, + 'hash' => $hash, + 'slug' => array_values($slugs), + ]; + + $result = []; + foreach($slugs as $slug) { + $result[$slug] = 'unknown'; + } + $response = $net->query($url, $params, waNet::METHOD_POST); + $response = is_array($response) && isset($response['data']['statuses']) && is_array($response['data']['statuses']) ? $response['data']['statuses'] : []; + foreach($response as $slug => $arr) { + $result[$slug] = ifset($arr, 'status', 'unknown'); + } + return $result; + } catch (waException $e) { + return []; + } + } + protected function switchOffSlugs($slugs) { + // Filter $slugs: only keep app plugins that are actually still enabled + $slugs = array_filter($slugs, function($slug) { + try { + if (preg_match('~^([^/]+)/plugins/([^/]+)$~', $slug, $matches)) { + list($_, $app_id, $plugin_id) = $matches; + if (wa()->appExists($app_id)) { + $app_plugins = wa($app_id)->getConfig()->getPlugins(); + return isset($app_plugins[$plugin_id]); + } + } + } catch (waException $e) { + } + return false; + }); + + if ($slugs) { + // Ask WA server again if client has licenses: + // they might have fixed licensing since last banner update. + $lease_status = $this->getProductsLeaseStatus($slugs); + $slugs = array_filter($slugs, function($slug) use ($lease_status) { + return ifset($lease_status, $slug, null) == 'blocked'; + }); + } if (!$slugs) { return; } @@ -96,40 +156,27 @@ protected function switchOffSlugs($slugs) $old_app_id = wa()->getApp(); wa('installer', true); - $something_changed = false; $installer = new waInstallerApps(); foreach($slugs as $slug) { - if (preg_match('~^([^/]+)/plugins/([^/]+)$~', $slug, $matches)) { - list($_, $app_id, $plugin_id) = $matches; - try { - // Make sure plugin is actually turned on before trying to disable it - if (!wa()->appExists($app_id)) { - continue; - } - $app_plugins = wa($app_id)->getConfig()->getPlugins(); - if (!isset($app_plugins[$plugin_id])) { - continue; - } - - // Disable plugin - $something_changed = true; - $installer->updateAppPluginsConfig($app_id, $plugin_id, false); - (new waLogModel())->add('item_disable', [ - 'type' => 'plugins', - 'id' => sprintf('%s/%s', $app_id, $plugin_id), - 'reason' => 'license', - ], null, 0); - } catch (waException $e) { - } - } else { - // Yaarrr! + if (!preg_match('~^([^/]+)/plugins/([^/]+)$~', $slug, $matches)) { + continue; + } + list($_, $app_id, $plugin_id) = $matches; + try { + // Disable plugin + $installer->updateAppPluginsConfig($app_id, $plugin_id, false); + (new waLogModel())->add('item_disable', [ + 'type' => 'plugins', + 'id' => sprintf('%s/%s', $app_id, $plugin_id), + 'reason' => 'license', + ], null, 0); + } catch (waException $e) { } } - if ($something_changed) { - installerHelper::flushCache(); - } + wa('installer')->getConfig()->clearAnnouncementsCache(); + installerHelper::flushCache(); wa($old_app_id, true); } diff --git a/wa-apps/installer/templates/actions/assets/Assets.html b/wa-apps/installer/templates/actions/assets/Assets.html index 87b08788e..5e10d7351 100644 --- a/wa-apps/installer/templates/actions/assets/Assets.html +++ b/wa-apps/installer/templates/actions/assets/Assets.html @@ -55,6 +55,8 @@

+ -
- -
-
-
-
- - {$errors = $errors|default:[]} - -
-
- -

[`Login Webasyst`]

-

- [`Create the first user in your Webasyst installation.`] - [`The information provided in this form will be stored in your local Webasyst installation only, and will not be sent anywhere outside your server.`] -

- {if !empty($errors.all)} -

{$errors.all}

- {/if} -
-
-
-
- [`Login name`] * -
-
- - {if !empty($errors.login)}{$errors.login}{/if} -
-
-
-
- [`Password`] * -
-
- - -
-
-
-
- [`Confirm password`] * -
-
- - {if !empty($errors.password)}{$errors.password}{/if} -
-
-
-
-
+
+ +
+
+
+ + + {$errors = $errors|default:[]} + +
+
+ +

[`Login Webasyst`]

+

+ [`Create the first user in your Webasyst installation.`] + [`The information provided in this form will be stored in your local Webasyst installation only, and will not be sent anywhere outside your server.`] +

+ {if !empty($errors.all)} +

{$errors.all}

+ {/if} +
+
+
+
+ [`Login name`] * +
+
+ + {if !empty($errors.login)}{$errors.login}{/if} +
+
+
+
+ [`Password`] * +
+
+ + +
+
+
+
+ [`Confirm password`] * +
+
+ + {if !empty($errors.password)}{$errors.password}{/if} +
+
+
+
+
[`First name`]
@@ -78,44 +78,44 @@

[`Login Webasyst`]

-
-
-
- [`Email`] * -
-
- - {if !empty($errors.email)}{$errors.email}{/if} -
-
+
+
+
+ [`Email`] * +
+
+ + {if !empty($errors.email)}{$errors.email}{/if} +
+
[`Company name`]
- +
-
-
- -
- -
-
- -
-
- - -
-
- -
- - -
- -
+
+
+ +
+ +
+
+ +
+
+ + +
+
+ +
+ + +
+ +