Commit a00f1f42a7fbc5eb18e6456284975691fe189317
1 parent
1f6e9673
Social auth + view history
Showing
12 changed files
with
446 additions
and
70 deletions
Show diff stats
backend/config/main.php
@@ -35,17 +35,21 @@ | @@ -35,17 +35,21 @@ | ||
35 | 'variant-option-complementary' => 'artbox\catalog\controllers\VariantOptionComplController', | 35 | 'variant-option-complementary' => 'artbox\catalog\controllers\VariantOptionComplController', |
36 | 'variant-option-exclusion' => 'artbox\catalog\controllers\VariantOptionExclController', | 36 | 'variant-option-exclusion' => 'artbox\catalog\controllers\VariantOptionExclController', |
37 | 'product-option-complementary' => 'artbox\catalog\controllers\ProductOptionComplController', | 37 | 'product-option-complementary' => 'artbox\catalog\controllers\ProductOptionComplController', |
38 | - 'product-option-exclusion' => 'artbox\catalog\controllers\ProductOptionExclController', | ||
39 | - 'import' => 'artbox\catalog\controllers\ImportController', | ||
40 | - 'blog-article' => 'artbox\weblog\controllers\ArticleController', | ||
41 | - 'blog-category' => 'artbox\weblog\controllers\CategoryController', | ||
42 | - 'blog-tag' => 'artbox\weblog\controllers\TagController', | ||
43 | - 'order' => 'artbox\order\controllers\OrderController', | ||
44 | - 'order-product' => 'artbox\order\controllers\OrderProductController', | ||
45 | - 'label' => 'artbox\order\controllers\LabelController', | ||
46 | - 'delivery' => 'artbox\order\controllers\DeliveryController', | ||
47 | - 'payment' => 'artbox\order\controllers\PaymentController', | ||
48 | - 'sitemap' => 'artbox\core\controllers\SitemapController', | 38 | + 'product-option-exclusion' => 'artbox\catalog\controllers\ProductOptionExclController', |
39 | + 'import' => 'artbox\catalog\controllers\ImportController', | ||
40 | + 'blog-article' => 'artbox\weblog\controllers\ArticleController', | ||
41 | + 'blog-category' => 'artbox\weblog\controllers\CategoryController', | ||
42 | + 'blog-tag' => 'artbox\weblog\controllers\TagController', | ||
43 | + 'order' => 'artbox\order\controllers\OrderController', | ||
44 | + 'order-product' => 'artbox\order\controllers\OrderProductController', | ||
45 | + 'label' => 'artbox\order\controllers\LabelController', | ||
46 | + 'delivery' => 'artbox\order\controllers\DeliveryController', | ||
47 | + 'payment' => 'artbox\order\controllers\PaymentController', | ||
48 | + 'sitemap' => 'artbox\core\controllers\SitemapController', | ||
49 | + 'comment' => [ | ||
50 | + 'class' => 'artbox\webcomment\controllers\ManageController', | ||
51 | + 'viewPath' => '@artbox/webcomment/views/manage', | ||
52 | + ], | ||
49 | ], | 53 | ], |
50 | 'components' => [ | 54 | 'components' => [ |
51 | 'assetManager' => [ | 55 | 'assetManager' => [ |
common/config/main.php
@@ -52,6 +52,10 @@ | @@ -52,6 +52,10 @@ | ||
52 | 'class' => 'yii\i18n\PhpMessageSource', | 52 | 'class' => 'yii\i18n\PhpMessageSource', |
53 | 'basePath' => '@artbox/webcomment/messages', | 53 | 'basePath' => '@artbox/webcomment/messages', |
54 | ], | 54 | ], |
55 | + 'eauth' => [ | ||
56 | + 'class' => 'yii\i18n\PhpMessageSource', | ||
57 | + 'basePath' => '@eauth/messages', | ||
58 | + ], | ||
55 | ], | 59 | ], |
56 | ], | 60 | ], |
57 | 'filedb' => [ | 61 | 'filedb' => [ |
composer.json
@@ -35,7 +35,8 @@ | @@ -35,7 +35,8 @@ | ||
35 | "bower-asset/amcharts": "@dev", | 35 | "bower-asset/amcharts": "@dev", |
36 | "bower-asset/pnotify": "@dev", | 36 | "bower-asset/pnotify": "@dev", |
37 | "kartik-v/yii2-widget-colorinput": "*", | 37 | "kartik-v/yii2-widget-colorinput": "*", |
38 | - "kartik-v/yii2-widget-datepicker": "@dev" | 38 | + "kartik-v/yii2-widget-datepicker": "@dev", |
39 | + "nodge/yii2-eauth": "~2.0" | ||
39 | }, | 40 | }, |
40 | "require-dev": { | 41 | "require-dev": { |
41 | "yiisoft/yii2-debug": "~2.0.0", | 42 | "yiisoft/yii2-debug": "~2.0.0", |
composer.lock
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
6 | ], | 6 | ], |
7 | - "content-hash": "5df5513d6efdd9ab201fd9f3e65ba409", | 7 | + "content-hash": "f43dbc89b0b20b177ad04a1c8c260992", |
8 | "packages": [ | 8 | "packages": [ |
9 | { | 9 | { |
10 | "name": "2amigos/yii2-tinymce-widget", | 10 | "name": "2amigos/yii2-tinymce-widget", |
@@ -575,16 +575,16 @@ | @@ -575,16 +575,16 @@ | ||
575 | }, | 575 | }, |
576 | { | 576 | { |
577 | "name": "ezyang/htmlpurifier", | 577 | "name": "ezyang/htmlpurifier", |
578 | - "version": "v4.9.2", | 578 | + "version": "v4.9.3", |
579 | "source": { | 579 | "source": { |
580 | "type": "git", | 580 | "type": "git", |
581 | "url": "https://github.com/ezyang/htmlpurifier.git", | 581 | "url": "https://github.com/ezyang/htmlpurifier.git", |
582 | - "reference": "6d50e5282afdfdfc3e0ff6d192aff56c5629b3d4" | 582 | + "reference": "95e1bae3182efc0f3422896a3236e991049dac69" |
583 | }, | 583 | }, |
584 | "dist": { | 584 | "dist": { |
585 | "type": "zip", | 585 | "type": "zip", |
586 | - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6d50e5282afdfdfc3e0ff6d192aff56c5629b3d4", | ||
587 | - "reference": "6d50e5282afdfdfc3e0ff6d192aff56c5629b3d4", | 586 | + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/95e1bae3182efc0f3422896a3236e991049dac69", |
587 | + "reference": "95e1bae3182efc0f3422896a3236e991049dac69", | ||
588 | "shasum": "" | 588 | "shasum": "" |
589 | }, | 589 | }, |
590 | "require": { | 590 | "require": { |
@@ -618,7 +618,7 @@ | @@ -618,7 +618,7 @@ | ||
618 | "keywords": [ | 618 | "keywords": [ |
619 | "html" | 619 | "html" |
620 | ], | 620 | ], |
621 | - "time": "2017-03-13T06:30:53+00:00" | 621 | + "time": "2017-06-03T02:28:16+00:00" |
622 | }, | 622 | }, |
623 | { | 623 | { |
624 | "name": "firebase/php-jwt", | 624 | "name": "firebase/php-jwt", |
@@ -1545,6 +1545,68 @@ | @@ -1545,6 +1545,68 @@ | ||
1545 | "time": "2017-04-12 09:00:24" | 1545 | "time": "2017-04-12 09:00:24" |
1546 | }, | 1546 | }, |
1547 | { | 1547 | { |
1548 | + "name": "lusitanian/oauth", | ||
1549 | + "version": "v0.3.6", | ||
1550 | + "source": { | ||
1551 | + "type": "git", | ||
1552 | + "url": "https://github.com/Lusitanian/PHPoAuthLib.git", | ||
1553 | + "reference": "4ce8c488971410233eb3b1e6d9ac4e81debb41d5" | ||
1554 | + }, | ||
1555 | + "dist": { | ||
1556 | + "type": "zip", | ||
1557 | + "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/4ce8c488971410233eb3b1e6d9ac4e81debb41d5", | ||
1558 | + "reference": "4ce8c488971410233eb3b1e6d9ac4e81debb41d5", | ||
1559 | + "shasum": "" | ||
1560 | + }, | ||
1561 | + "require": { | ||
1562 | + "php": ">=5.3.0" | ||
1563 | + }, | ||
1564 | + "require-dev": { | ||
1565 | + "phpunit/phpunit": "3.7.*", | ||
1566 | + "predis/predis": "0.8.*@dev", | ||
1567 | + "symfony/http-foundation": "~2.1" | ||
1568 | + }, | ||
1569 | + "suggest": { | ||
1570 | + "ext-openssl": "Allows for usage of secure connections with the stream-based HTTP client.", | ||
1571 | + "predis/predis": "Allows using the Redis storage backend.", | ||
1572 | + "symfony/http-foundation": "Allows using the Symfony Session storage backend." | ||
1573 | + }, | ||
1574 | + "type": "library", | ||
1575 | + "extra": { | ||
1576 | + "branch-alias": { | ||
1577 | + "dev-master": "0.1-dev" | ||
1578 | + } | ||
1579 | + }, | ||
1580 | + "autoload": { | ||
1581 | + "psr-0": { | ||
1582 | + "OAuth": "src", | ||
1583 | + "OAuth\\Unit": "tests" | ||
1584 | + } | ||
1585 | + }, | ||
1586 | + "notification-url": "https://packagist.org/downloads/", | ||
1587 | + "license": [ | ||
1588 | + "MIT" | ||
1589 | + ], | ||
1590 | + "authors": [ | ||
1591 | + { | ||
1592 | + "name": "David Desberg", | ||
1593 | + "email": "david@daviddesberg.com" | ||
1594 | + }, | ||
1595 | + { | ||
1596 | + "name": "Pieter Hordijk", | ||
1597 | + "email": "info@pieterhordijk.com" | ||
1598 | + } | ||
1599 | + ], | ||
1600 | + "description": "PHP 5.3+ oAuth 1/2 Library", | ||
1601 | + "keywords": [ | ||
1602 | + "Authentication", | ||
1603 | + "authorization", | ||
1604 | + "oauth", | ||
1605 | + "security" | ||
1606 | + ], | ||
1607 | + "time": "2015-09-09T06:43:02+00:00" | ||
1608 | + }, | ||
1609 | + { | ||
1548 | "name": "monolog/monolog", | 1610 | "name": "monolog/monolog", |
1549 | "version": "1.22.1", | 1611 | "version": "1.22.1", |
1550 | "source": { | 1612 | "source": { |
@@ -1718,6 +1780,105 @@ | @@ -1718,6 +1780,105 @@ | ||
1718 | "time": "2016-11-29T18:17:37+00:00" | 1780 | "time": "2016-11-29T18:17:37+00:00" |
1719 | }, | 1781 | }, |
1720 | { | 1782 | { |
1783 | + "name": "nodge/lightopenid", | ||
1784 | + "version": "1.1.2", | ||
1785 | + "source": { | ||
1786 | + "type": "git", | ||
1787 | + "url": "https://github.com/Nodge/LightOpenID.git", | ||
1788 | + "reference": "a5492cc0c932c557b7e9b54a6e5bbd85cc5fa041" | ||
1789 | + }, | ||
1790 | + "dist": { | ||
1791 | + "type": "zip", | ||
1792 | + "url": "https://api.github.com/repos/Nodge/LightOpenID/zipball/a5492cc0c932c557b7e9b54a6e5bbd85cc5fa041", | ||
1793 | + "reference": "a5492cc0c932c557b7e9b54a6e5bbd85cc5fa041", | ||
1794 | + "shasum": "" | ||
1795 | + }, | ||
1796 | + "require": { | ||
1797 | + "php": ">=5.2" | ||
1798 | + }, | ||
1799 | + "type": "library", | ||
1800 | + "autoload": { | ||
1801 | + "classmap": [ | ||
1802 | + "openid.php", | ||
1803 | + "provider/provider.php" | ||
1804 | + ] | ||
1805 | + }, | ||
1806 | + "notification-url": "https://packagist.org/downloads/", | ||
1807 | + "license": [ | ||
1808 | + "MIT License" | ||
1809 | + ], | ||
1810 | + "authors": [ | ||
1811 | + { | ||
1812 | + "name": "Mewp", | ||
1813 | + "homepage": "http://code.google.com/p/lightopenid/" | ||
1814 | + }, | ||
1815 | + { | ||
1816 | + "name": "Ignat Ignatov", | ||
1817 | + "homepage": "https://github.com/iignatov/LightOpenID" | ||
1818 | + } | ||
1819 | + ], | ||
1820 | + "description": "Lightweight PHP5 library for easy OpenID authentication.", | ||
1821 | + "homepage": "https://github.com/Nodge/LightOpenID", | ||
1822 | + "keywords": [ | ||
1823 | + "Authentication", | ||
1824 | + "OpenId" | ||
1825 | + ], | ||
1826 | + "time": "2013-08-31T16:48:56+00:00" | ||
1827 | + }, | ||
1828 | + { | ||
1829 | + "name": "nodge/yii2-eauth", | ||
1830 | + "version": "2.5.0", | ||
1831 | + "source": { | ||
1832 | + "type": "git", | ||
1833 | + "url": "https://github.com/Nodge/yii2-eauth.git", | ||
1834 | + "reference": "04798651fdb3a0db9ed5272330f18b26733507a0" | ||
1835 | + }, | ||
1836 | + "dist": { | ||
1837 | + "type": "zip", | ||
1838 | + "url": "https://api.github.com/repos/Nodge/yii2-eauth/zipball/04798651fdb3a0db9ed5272330f18b26733507a0", | ||
1839 | + "reference": "04798651fdb3a0db9ed5272330f18b26733507a0", | ||
1840 | + "shasum": "" | ||
1841 | + }, | ||
1842 | + "require": { | ||
1843 | + "lib-curl": "*", | ||
1844 | + "lusitanian/oauth": "~0.3.0", | ||
1845 | + "nodge/lightopenid": "~1.1.0", | ||
1846 | + "php": ">=5.4.0", | ||
1847 | + "yiisoft/yii2": "*" | ||
1848 | + }, | ||
1849 | + "type": "yii2-extension", | ||
1850 | + "extra": { | ||
1851 | + "bootstrap": "nodge\\eauth\\Bootstrap" | ||
1852 | + }, | ||
1853 | + "autoload": { | ||
1854 | + "psr-4": { | ||
1855 | + "nodge\\eauth\\": "src/" | ||
1856 | + } | ||
1857 | + }, | ||
1858 | + "notification-url": "https://packagist.org/downloads/", | ||
1859 | + "license": [ | ||
1860 | + "New BSD License" | ||
1861 | + ], | ||
1862 | + "authors": [ | ||
1863 | + { | ||
1864 | + "name": "Maxim Zemskov", | ||
1865 | + "email": "nodge@yandex.ru", | ||
1866 | + "homepage": "http://nodge.ru/" | ||
1867 | + } | ||
1868 | + ], | ||
1869 | + "description": "Yii2 EAuth Extension. EAuth allows to authenticate users with accounts on other websites (Google, Facebook, Twitter, etc).", | ||
1870 | + "homepage": "https://github.com/Nodge/yii2-eauth", | ||
1871 | + "keywords": [ | ||
1872 | + "Authentication", | ||
1873 | + "OpenId", | ||
1874 | + "eauth", | ||
1875 | + "extension", | ||
1876 | + "oauth", | ||
1877 | + "yii2" | ||
1878 | + ], | ||
1879 | + "time": "2017-04-09T20:23:01+00:00" | ||
1880 | + }, | ||
1881 | + { | ||
1721 | "name": "phpoffice/phpexcel", | 1882 | "name": "phpoffice/phpexcel", |
1722 | "version": "1.8.1", | 1883 | "version": "1.8.1", |
1723 | "source": { | 1884 | "source": { |
@@ -1776,16 +1937,16 @@ | @@ -1776,16 +1937,16 @@ | ||
1776 | }, | 1937 | }, |
1777 | { | 1938 | { |
1778 | "name": "phpseclib/phpseclib", | 1939 | "name": "phpseclib/phpseclib", |
1779 | - "version": "2.0.5", | 1940 | + "version": "2.0.6", |
1780 | "source": { | 1941 | "source": { |
1781 | "type": "git", | 1942 | "type": "git", |
1782 | "url": "https://github.com/phpseclib/phpseclib.git", | 1943 | "url": "https://github.com/phpseclib/phpseclib.git", |
1783 | - "reference": "f8dd0e18d2328c447dd4190fecd11ef52680d968" | 1944 | + "reference": "34a7699e6f31b1ef4035ee36444407cecf9f56aa" |
1784 | }, | 1945 | }, |
1785 | "dist": { | 1946 | "dist": { |
1786 | "type": "zip", | 1947 | "type": "zip", |
1787 | - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f8dd0e18d2328c447dd4190fecd11ef52680d968", | ||
1788 | - "reference": "f8dd0e18d2328c447dd4190fecd11ef52680d968", | 1948 | + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/34a7699e6f31b1ef4035ee36444407cecf9f56aa", |
1949 | + "reference": "34a7699e6f31b1ef4035ee36444407cecf9f56aa", | ||
1789 | "shasum": "" | 1950 | "shasum": "" |
1790 | }, | 1951 | }, |
1791 | "require": { | 1952 | "require": { |
@@ -1864,7 +2025,7 @@ | @@ -1864,7 +2025,7 @@ | ||
1864 | "x.509", | 2025 | "x.509", |
1865 | "x509" | 2026 | "x509" |
1866 | ], | 2027 | ], |
1867 | - "time": "2017-05-08T05:58:35+00:00" | 2028 | + "time": "2017-06-05T06:31:10+00:00" |
1868 | }, | 2029 | }, |
1869 | { | 2030 | { |
1870 | "name": "psr/cache", | 2031 | "name": "psr/cache", |
@@ -2253,21 +2414,21 @@ | @@ -2253,21 +2414,21 @@ | ||
2253 | }, | 2414 | }, |
2254 | { | 2415 | { |
2255 | "name": "yiisoft/yii2", | 2416 | "name": "yiisoft/yii2", |
2256 | - "version": "2.0.11.2", | 2417 | + "version": "2.0.12", |
2257 | "source": { | 2418 | "source": { |
2258 | "type": "git", | 2419 | "type": "git", |
2259 | "url": "https://github.com/yiisoft/yii2-framework.git", | 2420 | "url": "https://github.com/yiisoft/yii2-framework.git", |
2260 | - "reference": "ee996adec1dfd7babb67bd0c604f5bd6425fe5ab" | 2421 | + "reference": "70acbecc75cb26b6cd66d16be0b06e4b73db190d" |
2261 | }, | 2422 | }, |
2262 | "dist": { | 2423 | "dist": { |
2263 | "type": "zip", | 2424 | "type": "zip", |
2264 | - "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/ee996adec1dfd7babb67bd0c604f5bd6425fe5ab", | ||
2265 | - "reference": "ee996adec1dfd7babb67bd0c604f5bd6425fe5ab", | 2425 | + "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/70acbecc75cb26b6cd66d16be0b06e4b73db190d", |
2426 | + "reference": "70acbecc75cb26b6cd66d16be0b06e4b73db190d", | ||
2266 | "shasum": "" | 2427 | "shasum": "" |
2267 | }, | 2428 | }, |
2268 | "require": { | 2429 | "require": { |
2269 | "bower-asset/jquery": "2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", | 2430 | "bower-asset/jquery": "2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", |
2270 | - "bower-asset/jquery.inputmask": "~3.2.2 | ~3.3.3", | 2431 | + "bower-asset/jquery.inputmask": "~3.2.2 | ~3.3.5", |
2271 | "bower-asset/punycode": "1.3.*", | 2432 | "bower-asset/punycode": "1.3.*", |
2272 | "bower-asset/yii2-pjax": "~2.0.1", | 2433 | "bower-asset/yii2-pjax": "~2.0.1", |
2273 | "cebe/markdown": "~1.0.0 | ~1.1.0", | 2434 | "cebe/markdown": "~1.0.0 | ~1.1.0", |
@@ -2349,7 +2510,7 @@ | @@ -2349,7 +2510,7 @@ | ||
2349 | "framework", | 2510 | "framework", |
2350 | "yii2" | 2511 | "yii2" |
2351 | ], | 2512 | ], |
2352 | - "time": "2017-02-08T09:04:32+00:00" | 2513 | + "time": "2017-06-05T14:33:41+00:00" |
2353 | }, | 2514 | }, |
2354 | { | 2515 | { |
2355 | "name": "yiisoft/yii2-bootstrap", | 2516 | "name": "yiisoft/yii2-bootstrap", |
@@ -3568,16 +3729,16 @@ | @@ -3568,16 +3729,16 @@ | ||
3568 | }, | 3729 | }, |
3569 | { | 3730 | { |
3570 | "name": "phpunit/phpunit", | 3731 | "name": "phpunit/phpunit", |
3571 | - "version": "6.2.0", | 3732 | + "version": "6.2.1", |
3572 | "source": { | 3733 | "source": { |
3573 | "type": "git", | 3734 | "type": "git", |
3574 | "url": "https://github.com/sebastianbergmann/phpunit.git", | 3735 | "url": "https://github.com/sebastianbergmann/phpunit.git", |
3575 | - "reference": "23bcb03e5c6a8b8067f6c2b28f6cd84b2df321cc" | 3736 | + "reference": "16999a1e9a8a25d68f0ab8cc8ab818b043ad5374" |
3576 | }, | 3737 | }, |
3577 | "dist": { | 3738 | "dist": { |
3578 | "type": "zip", | 3739 | "type": "zip", |
3579 | - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/23bcb03e5c6a8b8067f6c2b28f6cd84b2df321cc", | ||
3580 | - "reference": "23bcb03e5c6a8b8067f6c2b28f6cd84b2df321cc", | 3740 | + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/16999a1e9a8a25d68f0ab8cc8ab818b043ad5374", |
3741 | + "reference": "16999a1e9a8a25d68f0ab8cc8ab818b043ad5374", | ||
3581 | "shasum": "" | 3742 | "shasum": "" |
3582 | }, | 3743 | }, |
3583 | "require": { | 3744 | "require": { |
@@ -3622,7 +3783,7 @@ | @@ -3622,7 +3783,7 @@ | ||
3622 | "type": "library", | 3783 | "type": "library", |
3623 | "extra": { | 3784 | "extra": { |
3624 | "branch-alias": { | 3785 | "branch-alias": { |
3625 | - "dev-master": "6.1.x-dev" | 3786 | + "dev-master": "6.2.x-dev" |
3626 | } | 3787 | } |
3627 | }, | 3788 | }, |
3628 | "autoload": { | 3789 | "autoload": { |
@@ -3648,7 +3809,7 @@ | @@ -3648,7 +3809,7 @@ | ||
3648 | "testing", | 3809 | "testing", |
3649 | "xunit" | 3810 | "xunit" |
3650 | ], | 3811 | ], |
3651 | - "time": "2017-06-02T08:02:48+00:00" | 3812 | + "time": "2017-06-02T12:24:37+00:00" |
3652 | }, | 3813 | }, |
3653 | { | 3814 | { |
3654 | "name": "phpunit/phpunit-mock-objects", | 3815 | "name": "phpunit/phpunit-mock-objects", |
@@ -4315,7 +4476,7 @@ | @@ -4315,7 +4476,7 @@ | ||
4315 | }, | 4476 | }, |
4316 | { | 4477 | { |
4317 | "name": "symfony/browser-kit", | 4478 | "name": "symfony/browser-kit", |
4318 | - "version": "v3.3.0", | 4479 | + "version": "v3.3.2", |
4319 | "source": { | 4480 | "source": { |
4320 | "type": "git", | 4481 | "type": "git", |
4321 | "url": "https://github.com/symfony/browser-kit.git", | 4482 | "url": "https://github.com/symfony/browser-kit.git", |
@@ -4372,16 +4533,16 @@ | @@ -4372,16 +4533,16 @@ | ||
4372 | }, | 4533 | }, |
4373 | { | 4534 | { |
4374 | "name": "symfony/console", | 4535 | "name": "symfony/console", |
4375 | - "version": "v3.3.0", | 4536 | + "version": "v3.3.2", |
4376 | "source": { | 4537 | "source": { |
4377 | "type": "git", | 4538 | "type": "git", |
4378 | "url": "https://github.com/symfony/console.git", | 4539 | "url": "https://github.com/symfony/console.git", |
4379 | - "reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05" | 4540 | + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e" |
4380 | }, | 4541 | }, |
4381 | "dist": { | 4542 | "dist": { |
4382 | "type": "zip", | 4543 | "type": "zip", |
4383 | - "url": "https://api.github.com/repos/symfony/console/zipball/c80e63f3f5e3a331bfc25e6e9332b10422eb9b05", | ||
4384 | - "reference": "c80e63f3f5e3a331bfc25e6e9332b10422eb9b05", | 4544 | + "url": "https://api.github.com/repos/symfony/console/zipball/70d2a29b2911cbdc91a7e268046c395278238b2e", |
4545 | + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e", | ||
4385 | "shasum": "" | 4546 | "shasum": "" |
4386 | }, | 4547 | }, |
4387 | "require": { | 4548 | "require": { |
@@ -4394,6 +4555,7 @@ | @@ -4394,6 +4555,7 @@ | ||
4394 | }, | 4555 | }, |
4395 | "require-dev": { | 4556 | "require-dev": { |
4396 | "psr/log": "~1.0", | 4557 | "psr/log": "~1.0", |
4558 | + "symfony/config": "~3.3", | ||
4397 | "symfony/dependency-injection": "~3.3", | 4559 | "symfony/dependency-injection": "~3.3", |
4398 | "symfony/event-dispatcher": "~2.8|~3.0", | 4560 | "symfony/event-dispatcher": "~2.8|~3.0", |
4399 | "symfony/filesystem": "~2.8|~3.0", | 4561 | "symfony/filesystem": "~2.8|~3.0", |
@@ -4436,11 +4598,11 @@ | @@ -4436,11 +4598,11 @@ | ||
4436 | ], | 4598 | ], |
4437 | "description": "Symfony Console Component", | 4599 | "description": "Symfony Console Component", |
4438 | "homepage": "https://symfony.com", | 4600 | "homepage": "https://symfony.com", |
4439 | - "time": "2017-05-28T14:08:56+00:00" | 4601 | + "time": "2017-06-02T19:24:58+00:00" |
4440 | }, | 4602 | }, |
4441 | { | 4603 | { |
4442 | "name": "symfony/css-selector", | 4604 | "name": "symfony/css-selector", |
4443 | - "version": "v3.3.0", | 4605 | + "version": "v3.3.2", |
4444 | "source": { | 4606 | "source": { |
4445 | "type": "git", | 4607 | "type": "git", |
4446 | "url": "https://github.com/symfony/css-selector.git", | 4608 | "url": "https://github.com/symfony/css-selector.git", |
@@ -4493,16 +4655,16 @@ | @@ -4493,16 +4655,16 @@ | ||
4493 | }, | 4655 | }, |
4494 | { | 4656 | { |
4495 | "name": "symfony/debug", | 4657 | "name": "symfony/debug", |
4496 | - "version": "v3.3.0", | 4658 | + "version": "v3.3.2", |
4497 | "source": { | 4659 | "source": { |
4498 | "type": "git", | 4660 | "type": "git", |
4499 | "url": "https://github.com/symfony/debug.git", | 4661 | "url": "https://github.com/symfony/debug.git", |
4500 | - "reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a" | 4662 | + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d" |
4501 | }, | 4663 | }, |
4502 | "dist": { | 4664 | "dist": { |
4503 | "type": "zip", | 4665 | "type": "zip", |
4504 | - "url": "https://api.github.com/repos/symfony/debug/zipball/ef5f19a7a68075a0bd05969a329ead3b0776fb7a", | ||
4505 | - "reference": "ef5f19a7a68075a0bd05969a329ead3b0776fb7a", | 4666 | + "url": "https://api.github.com/repos/symfony/debug/zipball/e9c50482841ef696e8fa1470d950a79c8921f45d", |
4667 | + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d", | ||
4506 | "shasum": "" | 4668 | "shasum": "" |
4507 | }, | 4669 | }, |
4508 | "require": { | 4670 | "require": { |
@@ -4545,11 +4707,11 @@ | @@ -4545,11 +4707,11 @@ | ||
4545 | ], | 4707 | ], |
4546 | "description": "Symfony Debug Component", | 4708 | "description": "Symfony Debug Component", |
4547 | "homepage": "https://symfony.com", | 4709 | "homepage": "https://symfony.com", |
4548 | - "time": "2017-05-27T16:02:27+00:00" | 4710 | + "time": "2017-06-01T21:01:25+00:00" |
4549 | }, | 4711 | }, |
4550 | { | 4712 | { |
4551 | "name": "symfony/dom-crawler", | 4713 | "name": "symfony/dom-crawler", |
4552 | - "version": "v3.3.0", | 4714 | + "version": "v3.3.2", |
4553 | "source": { | 4715 | "source": { |
4554 | "type": "git", | 4716 | "type": "git", |
4555 | "url": "https://github.com/symfony/dom-crawler.git", | 4717 | "url": "https://github.com/symfony/dom-crawler.git", |
@@ -4605,16 +4767,16 @@ | @@ -4605,16 +4767,16 @@ | ||
4605 | }, | 4767 | }, |
4606 | { | 4768 | { |
4607 | "name": "symfony/event-dispatcher", | 4769 | "name": "symfony/event-dispatcher", |
4608 | - "version": "v3.3.0", | 4770 | + "version": "v3.3.2", |
4609 | "source": { | 4771 | "source": { |
4610 | "type": "git", | 4772 | "type": "git", |
4611 | "url": "https://github.com/symfony/event-dispatcher.git", | 4773 | "url": "https://github.com/symfony/event-dispatcher.git", |
4612 | - "reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c" | 4774 | + "reference": "4054a102470665451108f9b59305c79176ef98f0" |
4613 | }, | 4775 | }, |
4614 | "dist": { | 4776 | "dist": { |
4615 | "type": "zip", | 4777 | "type": "zip", |
4616 | - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a9f8b02b0ef07302eca92cd4bba73200b7980e9c", | ||
4617 | - "reference": "a9f8b02b0ef07302eca92cd4bba73200b7980e9c", | 4778 | + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4054a102470665451108f9b59305c79176ef98f0", |
4779 | + "reference": "4054a102470665451108f9b59305c79176ef98f0", | ||
4618 | "shasum": "" | 4780 | "shasum": "" |
4619 | }, | 4781 | }, |
4620 | "require": { | 4782 | "require": { |
@@ -4664,20 +4826,20 @@ | @@ -4664,20 +4826,20 @@ | ||
4664 | ], | 4826 | ], |
4665 | "description": "Symfony EventDispatcher Component", | 4827 | "description": "Symfony EventDispatcher Component", |
4666 | "homepage": "https://symfony.com", | 4828 | "homepage": "https://symfony.com", |
4667 | - "time": "2017-05-04T12:23:07+00:00" | 4829 | + "time": "2017-06-04T18:15:29+00:00" |
4668 | }, | 4830 | }, |
4669 | { | 4831 | { |
4670 | "name": "symfony/finder", | 4832 | "name": "symfony/finder", |
4671 | - "version": "v3.3.0", | 4833 | + "version": "v3.3.2", |
4672 | "source": { | 4834 | "source": { |
4673 | "type": "git", | 4835 | "type": "git", |
4674 | "url": "https://github.com/symfony/finder.git", | 4836 | "url": "https://github.com/symfony/finder.git", |
4675 | - "reference": "30cb2a2c09627823a7243638dd456de4e2748fed" | 4837 | + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" |
4676 | }, | 4838 | }, |
4677 | "dist": { | 4839 | "dist": { |
4678 | "type": "zip", | 4840 | "type": "zip", |
4679 | - "url": "https://api.github.com/repos/symfony/finder/zipball/30cb2a2c09627823a7243638dd456de4e2748fed", | ||
4680 | - "reference": "30cb2a2c09627823a7243638dd456de4e2748fed", | 4841 | + "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", |
4842 | + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", | ||
4681 | "shasum": "" | 4843 | "shasum": "" |
4682 | }, | 4844 | }, |
4683 | "require": { | 4845 | "require": { |
@@ -4713,7 +4875,7 @@ | @@ -4713,7 +4875,7 @@ | ||
4713 | ], | 4875 | ], |
4714 | "description": "Symfony Finder Component", | 4876 | "description": "Symfony Finder Component", |
4715 | "homepage": "https://symfony.com", | 4877 | "homepage": "https://symfony.com", |
4716 | - "time": "2017-05-25T23:10:31+00:00" | 4878 | + "time": "2017-06-01T21:01:25+00:00" |
4717 | }, | 4879 | }, |
4718 | { | 4880 | { |
4719 | "name": "symfony/polyfill-mbstring", | 4881 | "name": "symfony/polyfill-mbstring", |
@@ -4776,16 +4938,16 @@ | @@ -4776,16 +4938,16 @@ | ||
4776 | }, | 4938 | }, |
4777 | { | 4939 | { |
4778 | "name": "symfony/yaml", | 4940 | "name": "symfony/yaml", |
4779 | - "version": "v3.3.0", | 4941 | + "version": "v3.3.2", |
4780 | "source": { | 4942 | "source": { |
4781 | "type": "git", | 4943 | "type": "git", |
4782 | "url": "https://github.com/symfony/yaml.git", | 4944 | "url": "https://github.com/symfony/yaml.git", |
4783 | - "reference": "885db865f6b2b918404a1fae28f9ac640f71f994" | 4945 | + "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063" |
4784 | }, | 4946 | }, |
4785 | "dist": { | 4947 | "dist": { |
4786 | "type": "zip", | 4948 | "type": "zip", |
4787 | - "url": "https://api.github.com/repos/symfony/yaml/zipball/885db865f6b2b918404a1fae28f9ac640f71f994", | ||
4788 | - "reference": "885db865f6b2b918404a1fae28f9ac640f71f994", | 4949 | + "url": "https://api.github.com/repos/symfony/yaml/zipball/9752a30000a8ca9f4b34b5227d15d0101b96b063", |
4950 | + "reference": "9752a30000a8ca9f4b34b5227d15d0101b96b063", | ||
4789 | "shasum": "" | 4951 | "shasum": "" |
4790 | }, | 4952 | }, |
4791 | "require": { | 4953 | "require": { |
@@ -4827,7 +4989,7 @@ | @@ -4827,7 +4989,7 @@ | ||
4827 | ], | 4989 | ], |
4828 | "description": "Symfony Yaml Component", | 4990 | "description": "Symfony Yaml Component", |
4829 | "homepage": "https://symfony.com", | 4991 | "homepage": "https://symfony.com", |
4830 | - "time": "2017-05-28T10:56:20+00:00" | 4992 | + "time": "2017-06-02T22:05:06+00:00" |
4831 | }, | 4993 | }, |
4832 | { | 4994 | { |
4833 | "name": "theseer/tokenizer", | 4995 | "name": "theseer/tokenizer", |
environments/index.php
@@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
4 | * This file returns a list of environments that the application | 4 | * This file returns a list of environments that the application |
5 | * may be installed under. The returned data must be in the following | 5 | * may be installed under. The returned data must be in the following |
6 | * format: | 6 | * format: |
7 | - * | ||
8 | * ```php | 7 | * ```php |
9 | * return [ | 8 | * return [ |
10 | * 'environment name' => [ | 9 | * 'environment name' => [ |
@@ -36,6 +35,8 @@ | @@ -36,6 +35,8 @@ | ||
36 | 'backend/web/assets', | 35 | 'backend/web/assets', |
37 | 'frontend/runtime', | 36 | 'frontend/runtime', |
38 | 'frontend/web/assets', | 37 | 'frontend/web/assets', |
38 | + 'storage', | ||
39 | + 'common/config/settings.php', | ||
39 | ], | 40 | ], |
40 | 'setExecutable' => [ | 41 | 'setExecutable' => [ |
41 | 'yii', | 42 | 'yii', |
@@ -54,6 +55,8 @@ | @@ -54,6 +55,8 @@ | ||
54 | 'backend/web/assets', | 55 | 'backend/web/assets', |
55 | 'frontend/runtime', | 56 | 'frontend/runtime', |
56 | 'frontend/web/assets', | 57 | 'frontend/web/assets', |
58 | + 'storage', | ||
59 | + 'common/config/settings.php', | ||
57 | ], | 60 | ], |
58 | 'setExecutable' => [ | 61 | 'setExecutable' => [ |
59 | 'yii', | 62 | 'yii', |
1 | +<?php | ||
2 | + return [ | ||
3 | + 'class' => 'nodge\eauth\EAuth', | ||
4 | + 'popup' => true, | ||
5 | + 'cache' => false, | ||
6 | + 'cacheExpire' => 0, | ||
7 | + 'httpClient' => [ | ||
8 | + // uncomment this to use streams in safe_mode | ||
9 | + //'useStreamsFallback' => true, | ||
10 | + ], | ||
11 | + 'services' => [ | ||
12 | + 'google' => [ | ||
13 | + // register your app here: https://code.google.com/apis/console/ | ||
14 | + 'class' => 'nodge\eauth\services\GoogleOAuth2Service', | ||
15 | + 'clientId' => '857343172443-th52trcqruo6pct71hmn72pud8ob9c9o.apps.googleusercontent.com', | ||
16 | + 'clientSecret' => 'PgQIYSOjEUm4lffk_o7zMhxZ', | ||
17 | + 'title' => 'Google', | ||
18 | + ], | ||
19 | + 'facebook' => [ | ||
20 | + // register your app here: https://developers.facebook.com/apps/ | ||
21 | + 'class' => 'nodge\eauth\services\FacebookOAuth2Service', | ||
22 | + 'clientId' => '1453788021358149', | ||
23 | + 'clientSecret' => '97dc7b9863b482dce6c6e7618bda9738', | ||
24 | + ], | ||
25 | + 'yahoo' => [ | ||
26 | + 'class' => 'nodge\eauth\services\YahooOpenIDService', | ||
27 | + //'realm' => '*.example.org', // your domain, can be with wildcard to authenticate on subdomains. | ||
28 | + ], | ||
29 | + 'linkedin_oauth2' => [ | ||
30 | + // register your app here: https://www.linkedin.com/secure/developer | ||
31 | + 'class' => 'nodge\eauth\services\LinkedinOAuth2Service', | ||
32 | + 'clientId' => '86uay6912iwzn7', | ||
33 | + 'clientSecret' => 'IkOc8oMOlxkyNSfK', | ||
34 | + 'title' => 'LinkedIn (OAuth2)', | ||
35 | + ], | ||
36 | + 'github' => [ | ||
37 | + // register your app here: https://github.com/settings/applications | ||
38 | + 'class' => 'nodge\eauth\services\GitHubOAuth2Service', | ||
39 | + 'clientId' => '1a72fc01be1ecca28c76', | ||
40 | + 'clientSecret' => '188376ae0736133bdca9f4376a99a1cd2a6e6254', | ||
41 | + ], | ||
42 | + 'steam' => [ | ||
43 | + 'class' => 'nodge\eauth\services\SteamOpenIDService', | ||
44 | + //'realm' => '*.example.org', // your domain, can be with wildcard to authenticate on subdomains. | ||
45 | + 'apiKey' => 'ED8812C3AA509B94D4744AADBF4FDF49', | ||
46 | + // Optional. You can get it here: https://steamcommunity.com/dev/apikey | ||
47 | + ], | ||
48 | + 'instagram' => [ | ||
49 | + // register your app here: https://instagram.com/developer/register/ | ||
50 | + 'class' => 'nodge\eauth\services\InstagramOAuth2Service', | ||
51 | + 'clientId' => '7c3de0236bb4467bae58707012addce8', | ||
52 | + 'clientSecret' => 'bfcf8a5eb47d4998b6e3dd573777a857', | ||
53 | + ], | ||
54 | + ], | ||
55 | + ]; | ||
0 | \ No newline at end of file | 56 | \ No newline at end of file |
frontend/config/main.php
1 | <?php | 1 | <?php |
2 | + use artbox\catalog\components\History; | ||
2 | use artbox\core\components\LanguageRequest; | 3 | use artbox\core\components\LanguageRequest; |
3 | use artbox\core\components\SeoUrlManager; | 4 | use artbox\core\components\SeoUrlManager; |
4 | use artbox\order\models\Basket; | 5 | use artbox\order\models\Basket; |
@@ -47,6 +48,14 @@ | @@ -47,6 +48,14 @@ | ||
47 | 'warning', | 48 | 'warning', |
48 | ], | 49 | ], |
49 | ], | 50 | ], |
51 | + [ | ||
52 | + 'class' => 'yii\log\FileTarget', | ||
53 | + 'logFile' => '@frontend/runtime/logs/eauth.log', | ||
54 | + 'categories' => [ | ||
55 | + 'nodge\eauth\*', | ||
56 | + ], | ||
57 | + 'logVars' => [], | ||
58 | + ], | ||
50 | ], | 59 | ], |
51 | ], | 60 | ], |
52 | 'errorHandler' => [ | 61 | 'errorHandler' => [ |
@@ -68,9 +77,9 @@ | @@ -68,9 +77,9 @@ | ||
68 | 'route' => 'category/view', | 77 | 'route' => 'category/view', |
69 | 'defaults' => [ 'filter' => '' ], | 78 | 'defaults' => [ 'filter' => '' ], |
70 | ], | 79 | ], |
71 | - 'special/<type:(new|sale)>' => 'special/index', | ||
72 | - 'special/<category>/<type:(new|sale)>' => 'special/category', | ||
73 | - 'robots.txt' => 'site/robots', | 80 | + 'special/<type:(new|sale)>' => 'special/index', |
81 | + 'special/<category>/<type:(new|sale)>' => 'special/category', | ||
82 | + 'robots.txt' => 'site/robots', | ||
74 | [ | 83 | [ |
75 | 'pattern' => 'artbox-comment/manage/<action>', | 84 | 'pattern' => 'artbox-comment/manage/<action>', |
76 | 'route' => 'notfound', | 85 | 'route' => 'notfound', |
@@ -78,11 +87,16 @@ | @@ -78,11 +87,16 @@ | ||
78 | 'action' => '', | 87 | 'action' => '', |
79 | ], | 88 | ], |
80 | ], | 89 | ], |
90 | + 'login/<service:google|twitter|facebook|yahoo|linkedin|linkedin_oauth2|github|steam|instagram>' => 'site/login', | ||
81 | ], | 91 | ], |
82 | ], | 92 | ], |
83 | 'basket' => [ | 93 | 'basket' => [ |
84 | 'class' => Basket::className(), | 94 | 'class' => Basket::className(), |
85 | ], | 95 | ], |
96 | + 'eauth' => require( 'eauth.php' ), | ||
97 | + 'history' => [ | ||
98 | + 'class' => History::className(), | ||
99 | + ], | ||
86 | ], | 100 | ], |
87 | 'params' => $params, | 101 | 'params' => $params, |
88 | ]; | 102 | ]; |
frontend/controllers/SiteController.php
@@ -7,12 +7,15 @@ | @@ -7,12 +7,15 @@ | ||
7 | use artbox\catalog\models\Product; | 7 | use artbox\catalog\models\Product; |
8 | use artbox\core\models\DummyAlias; | 8 | use artbox\core\models\DummyAlias; |
9 | use artbox\core\models\Feedback; | 9 | use artbox\core\models\Feedback; |
10 | + use artbox\order\models\Customer; | ||
10 | use artbox\order\models\LoginForm; | 11 | use artbox\order\models\LoginForm; |
11 | use artbox\order\models\PasswordResetRequestForm; | 12 | use artbox\order\models\PasswordResetRequestForm; |
12 | use artbox\order\models\ResetPasswordForm; | 13 | use artbox\order\models\ResetPasswordForm; |
13 | use artbox\order\models\SignupForm; | 14 | use artbox\order\models\SignupForm; |
14 | use artbox\weblog\models\Article; | 15 | use artbox\weblog\models\Article; |
15 | use common\models\Settings; | 16 | use common\models\Settings; |
17 | + use nodge\eauth\ErrorException; | ||
18 | + use nodge\eauth\openid\ControllerBehavior; | ||
16 | use Yii; | 19 | use Yii; |
17 | use yii\base\InvalidParamException; | 20 | use yii\base\InvalidParamException; |
18 | use yii\bootstrap\Html; | 21 | use yii\bootstrap\Html; |
@@ -50,6 +53,10 @@ | @@ -50,6 +53,10 @@ | ||
50 | 'feedback' => [ 'post' ], | 53 | 'feedback' => [ 'post' ], |
51 | ], | 54 | ], |
52 | ], | 55 | ], |
56 | + 'eauth' => [ | ||
57 | + 'class' => ControllerBehavior::className(), | ||
58 | + 'only' => [ 'login' ], | ||
59 | + ], | ||
53 | ]; | 60 | ]; |
54 | } | 61 | } |
55 | 62 | ||
@@ -90,6 +97,33 @@ | @@ -90,6 +97,33 @@ | ||
90 | ->is('mask', 4) | 97 | ->is('mask', 4) |
91 | ->limit(20) | 98 | ->limit(20) |
92 | ->all(); | 99 | ->all(); |
100 | + $historyItems = []; | ||
101 | + /** | ||
102 | + * @var \artbox\catalog\components\History $history | ||
103 | + */ | ||
104 | + if ($history = \Yii::$app->get('history', false)) { | ||
105 | + if (!empty($history->get())) { | ||
106 | + $historyItems = Product::find() | ||
107 | + ->with('lang', 'image') | ||
108 | + ->innerJoinWith( | ||
109 | + [ | ||
110 | + 'variants' => function ($query) { | ||
111 | + /** | ||
112 | + * @var \yii\db\ActiveQuery $query | ||
113 | + */ | ||
114 | + $query->with('image'); | ||
115 | + }, | ||
116 | + ] | ||
117 | + ) | ||
118 | + ->where( | ||
119 | + [ | ||
120 | + 'variant.id' => $history->get(), | ||
121 | + ] | ||
122 | + ) | ||
123 | + ->limit(20) | ||
124 | + ->all(); | ||
125 | + } | ||
126 | + } | ||
93 | $productCount = Product::find() | 127 | $productCount = Product::find() |
94 | ->count(); | 128 | ->count(); |
95 | $brandCount = Brand::find() | 129 | $brandCount = Brand::find() |
@@ -124,6 +158,7 @@ | @@ -124,6 +158,7 @@ | ||
124 | 'topItems' => $topItems, | 158 | 'topItems' => $topItems, |
125 | 'newItems' => $newItems, | 159 | 'newItems' => $newItems, |
126 | 'saleItems' => $saleItems, | 160 | 'saleItems' => $saleItems, |
161 | + 'historyItems' => $historyItems, | ||
127 | 'productCount' => $productCount, | 162 | 'productCount' => $productCount, |
128 | 'brandCount' => $brandCount, | 163 | 'brandCount' => $brandCount, |
129 | 'brands' => $brands, | 164 | 'brands' => $brands, |
@@ -249,6 +284,44 @@ | @@ -249,6 +284,44 @@ | ||
249 | 284 | ||
250 | public function actionLogin() | 285 | public function actionLogin() |
251 | { | 286 | { |
287 | + $serviceName = Yii::$app->getRequest() | ||
288 | + ->getQueryParam('service'); | ||
289 | + if (isset($serviceName)) { | ||
290 | + /** @var $eauth \nodge\eauth\ServiceBase */ | ||
291 | + $eauth = Yii::$app->get('eauth') | ||
292 | + ->getIdentity($serviceName); | ||
293 | + $eauth->setRedirectUrl( | ||
294 | + Yii::$app->getUser() | ||
295 | + ->getReturnUrl() | ||
296 | + ); | ||
297 | + $eauth->setCancelUrl( | ||
298 | + Yii::$app->getUrlManager() | ||
299 | + ->createAbsoluteUrl('site/login') | ||
300 | + ); | ||
301 | + | ||
302 | + try { | ||
303 | + if ($eauth->authenticate()) { | ||
304 | + // var_dump($eauth->getIsAuthenticated(), $eauth->getAttributes()); exit; | ||
305 | + $identity = Customer::findByEAuth($eauth); | ||
306 | + Yii::$app->getUser() | ||
307 | + ->login($identity); | ||
308 | + | ||
309 | + // special redirect with closing popup window | ||
310 | + $eauth->redirect(); | ||
311 | + } else { | ||
312 | + // close popup window and redirect to cancelUrl | ||
313 | + $eauth->cancel(); | ||
314 | + } | ||
315 | + } catch (ErrorException $e) { | ||
316 | + // save error to show it later | ||
317 | + Yii::$app->getSession() | ||
318 | + ->setFlash('error', 'EAuthException: ' . $e->getMessage()); | ||
319 | + | ||
320 | + // close popup window and redirect to cancelUrl | ||
321 | + // $eauth->cancel(); | ||
322 | + $eauth->redirect($eauth->getCancelUrl()); | ||
323 | + } | ||
324 | + } | ||
252 | if (!\Yii::$app->user->isGuest) { | 325 | if (!\Yii::$app->user->isGuest) { |
253 | return $this->redirect([ 'index' ]); | 326 | return $this->redirect([ 'index' ]); |
254 | } | 327 | } |
frontend/controllers/VariantController.php
@@ -27,6 +27,12 @@ | @@ -27,6 +27,12 @@ | ||
27 | { | 27 | { |
28 | $model = $this->findModel($id); | 28 | $model = $this->findModel($id); |
29 | /** | 29 | /** |
30 | + * @var \artbox\catalog\components\History $history | ||
31 | + */ | ||
32 | + if ($history = \Yii::$app->get('history', false)) { | ||
33 | + $history->add($model->id); | ||
34 | + } | ||
35 | + /** | ||
30 | * @var SeoComponent $seo | 36 | * @var SeoComponent $seo |
31 | */ | 37 | */ |
32 | $seo = Yii::$app->get('seo'); | 38 | $seo = Yii::$app->get('seo'); |
frontend/views/layouts/main.php
@@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
16 | use common\models\Settings; | 16 | use common\models\Settings; |
17 | use frontend\assets\AppAsset; | 17 | use frontend\assets\AppAsset; |
18 | use frontend\widgets\LangLink; | 18 | use frontend\widgets\LangLink; |
19 | + use nodge\eauth\Widget; | ||
19 | use yii\base\Model; | 20 | use yii\base\Model; |
20 | use yii\bootstrap\ActiveForm; | 21 | use yii\bootstrap\ActiveForm; |
21 | use yii\bootstrap\Html; | 22 | use yii\bootstrap\Html; |
@@ -368,6 +369,19 @@ _________________________________________________________ --> | @@ -368,6 +369,19 @@ _________________________________________________________ --> | ||
368 | </div> | 369 | </div> |
369 | <div class="modal-body"> | 370 | <div class="modal-body"> |
370 | <?php | 371 | <?php |
372 | + if (\Yii::$app->get('eauth', false)) { | ||
373 | + echo Html::tag( | ||
374 | + 'p', | ||
375 | + \Yii::t( | ||
376 | + 'app', | ||
377 | + 'Do you already have an account on one of these sites? Click the logo to log in with it here' | ||
378 | + ) . ':', | ||
379 | + [ | ||
380 | + 'class' => 'lead', | ||
381 | + ] | ||
382 | + ); | ||
383 | + echo Widget::widget([ 'action' => 'site/login' ]); | ||
384 | + } | ||
371 | $login = ActiveForm::begin( | 385 | $login = ActiveForm::begin( |
372 | [ | 386 | [ |
373 | 'action' => [ '/site/login' ], | 387 | 'action' => [ '/site/login' ], |
frontend/views/site/index.php
@@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
15 | * @var Product[] $topItems | 15 | * @var Product[] $topItems |
16 | * @var Product[] $newItems | 16 | * @var Product[] $newItems |
17 | * @var Product[] $saleItems | 17 | * @var Product[] $saleItems |
18 | + * @var Product[] $historyItems | ||
18 | * @var int $brandCount | 19 | * @var int $brandCount |
19 | * @var int $productCount | 20 | * @var int $productCount |
20 | * @var Brand[] $brands | 21 | * @var Brand[] $brands |
@@ -179,6 +180,36 @@ _________________________________________________________ --> | @@ -179,6 +180,36 @@ _________________________________________________________ --> | ||
179 | </div> | 180 | </div> |
180 | <?php | 181 | <?php |
181 | } | 182 | } |
183 | + if (!empty($historyItems)) { | ||
184 | + ?> | ||
185 | + <div class="heading text-center"> | ||
186 | + <h2><?php echo \Yii::t('app', 'Недавно просматривали'); ?></h2> | ||
187 | + </div> | ||
188 | + <div class="product-carousel"> | ||
189 | + <div class="homepage owl-carousel"> | ||
190 | + <?php | ||
191 | + $newItemsArrays = array_chunk($historyItems, 4); | ||
192 | + foreach ($newItemsArrays as $newItemsArray) { | ||
193 | + ?> | ||
194 | + <div class="products"> | ||
195 | + <?php | ||
196 | + foreach ($newItemsArray as $product) { | ||
197 | + echo $this->render( | ||
198 | + '_slider_product', | ||
199 | + [ | ||
200 | + 'product' => $product, | ||
201 | + ] | ||
202 | + ); | ||
203 | + } | ||
204 | + ?> | ||
205 | + </div> | ||
206 | + <?php | ||
207 | + } | ||
208 | + ?> | ||
209 | + </div> | ||
210 | + </div> | ||
211 | + <?php | ||
212 | + } | ||
182 | ?> | 213 | ?> |
183 | </div> | 214 | </div> |
184 | </section> | 215 | </section> |
frontend/views/site/login.php
@@ -2,9 +2,11 @@ | @@ -2,9 +2,11 @@ | ||
2 | 2 | ||
3 | /* @var $this yii\web\View */ | 3 | /* @var $this yii\web\View */ |
4 | /* @var $form yii\bootstrap\ActiveForm */ | 4 | /* @var $form yii\bootstrap\ActiveForm */ |
5 | - /* @var $loginForm \common\models\LoginForm */ | ||
6 | - /* @var $signupForm \common\models\SignupForm */ | 5 | + /* @var $loginForm LoginForm */ |
6 | + /* @var $signupForm SignupForm */ | ||
7 | 7 | ||
8 | + use artbox\order\models\LoginForm; | ||
9 | + use artbox\order\models\SignupForm; | ||
8 | use yii\bootstrap\ActiveForm; | 10 | use yii\bootstrap\ActiveForm; |
9 | use yii\bootstrap\Html; | 11 | use yii\bootstrap\Html; |
10 | 12 | ||
@@ -73,8 +75,15 @@ | @@ -73,8 +75,15 @@ | ||
73 | <p class="lead"><?php echo \Yii::t('app', 'Уже зарегистрированы?'); ?></p> | 75 | <p class="lead"><?php echo \Yii::t('app', 'Уже зарегистрированы?'); ?></p> |
74 | 76 | ||
75 | <hr> | 77 | <hr> |
76 | - | 78 | + <p class="lead">Do you already have an account on one of these sites? Click the logo to log in with it here:</p> |
79 | + <?php echo \nodge\eauth\Widget::widget([ 'action' => 'site/login' ]); ?> | ||
77 | <?php | 80 | <?php |
81 | + if (Yii::$app->getSession() | ||
82 | + ->hasFlash('error') | ||
83 | + ) { | ||
84 | + echo '<div class="alert alert-danger">' . Yii::$app->getSession() | ||
85 | + ->getFlash('error') . '</div>'; | ||
86 | + } | ||
78 | $formLogin = ActiveForm::begin(); | 87 | $formLogin = ActiveForm::begin(); |
79 | echo $formLogin->field($loginForm, 'username') | 88 | echo $formLogin->field($loginForm, 'username') |
80 | ->textInput(); | 89 | ->textInput(); |