Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2.0.0.0-dev55

* Modularity improvements:
  * Session configuration moved to library
  * FormKey logic was moved from Session
  * SessionIdFlags from Session was removed
  * Move Page logic to the Theme module and library
* Created integration module UX
* Created authorization service (Magento_Authz module)
* Fixed bugs:
  * Fixed the issue that prevented a customer group's shopping cart rules from applying properly to prices. The issue occurred when a customer was manually assigned to a customer group and automatic group assignment was enabled.
  * Fixed the bug with schema upgrade scripts not running after installation
  * Fixed the error with a blank page when user tries to get access to a restricted resource via URL (add Secret Key for URL set to "No")
  • Loading branch information...
commit 28dcec29a20c2fc6a7c5a208b67043ead03edf89 1 parent 6e24c0b
mage2-team mage2-team authored
Showing with 3,348 additions and 2,533 deletions.
  1. +14 −0 CHANGELOG.md
  2. +10 −12 app/code/Magento/AdminNotification/Block/System/Messages.php
  3. +10 −12 app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php
  4. +10 −12 app/code/Magento/AdminNotification/Block/ToolbarEntry.php
  5. +12 −14 app/code/Magento/AdminNotification/Block/Window.php
  6. +7 −5 app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php
  7. +1 −1  app/code/Magento/AdminNotification/etc/module.xml
  8. +3 −3 app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml
  9. +1 −1  app/code/Magento/AdminNotification/view/adminhtml/notification/window.phtml
  10. +11 −2 app/code/Magento/AdminNotification/view/adminhtml/system/messages/popup.phtml
  11. +9 −2 app/code/Magento/AdminNotification/view/adminhtml/toolbar_entry.js
  12. +10 −12 app/code/Magento/Adminhtml/Block/Urlrewrite.php
  13. +14 −16 app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php
  14. +27 −21 app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php
  15. +0 −3  app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php
  16. +16 −18 app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php
  17. +14 −16 app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php
  18. +0 −3  app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php
  19. +12 −14 app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php
  20. +1 −3 app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php
  21. +1 −1  app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php
  22. +1 −1  app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php
  23. +6 −2 app/code/Magento/Adminhtml/Model/Session/Quote.php
  24. +1 −1  app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/categories.phtml
  25. +1 −1  app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/selector.phtml
  26. +3 −5 app/code/Magento/Authorizenet/Block/Directpost/Form.php
  27. +5 −7 app/code/Magento/Authorizenet/Block/Directpost/Iframe.php
  28. +2 −2 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php
  29. +1 −1  app/code/Magento/Authorizenet/Model/Directpost/Observer.php
  30. +6 −2 app/code/Magento/Authorizenet/Model/Directpost/Session.php
  31. +1 −1  app/code/Magento/Authorizenet/etc/module.xml
  32. +1 −1  app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml
  33. +1 −1  app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml
  34. +130 −0 app/code/Magento/Authz/Model/UserIdentifier.php
  35. +64 −0 app/code/Magento/Authz/Model/UserIdentifier/Factory.php
  36. +64 −0 app/code/Magento/Authz/Model/UserLocator/Admin.php
  37. +50 −0 app/code/Magento/Authz/Model/UserLocator/Guest.php
  38. +12 −13 app/code/Magento/{Page/Block/Link.php → Authz/Model/UserLocatorInterface.php}
  39. +254 −0 app/code/Magento/Authz/Service/AuthorizationV1.php
  40. +72 −0 app/code/Magento/Authz/Service/AuthorizationV1Interface.php
  41. +28 −0 app/code/Magento/Authz/etc/adminhtml/di.xml
  42. +29 −0 app/code/Magento/Authz/etc/di.xml
  43. +3 −7 app/code/Magento/{Page → Authz}/etc/module.xml
  44. +10 −12 app/code/Magento/Backend/App/AbstractAction.php
  45. +1 −1  app/code/Magento/Backend/App/Action/Context.php
  46. +1 −1  app/code/Magento/Backend/Block/AbstractBlock.php
  47. +1 −1  app/code/Magento/Backend/Block/Admin/Formkey.php
  48. +1 −3 app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php
  49. +26 −5 app/code/Magento/Backend/Block/Context.php
  50. +10 −12 app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php
  51. +12 −14 app/code/Magento/Backend/Block/Dashboard/Graph.php
  52. +21 −15 app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php
  53. +24 −1 app/code/Magento/Backend/Block/Dashboard/Sales.php
  54. +21 −15 app/code/Magento/Backend/Block/Dashboard/Searches/Last.php
  55. +21 −15 app/code/Magento/Backend/Block/Dashboard/Searches/Top.php
  56. +12 −14 app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php
  57. +12 −14 app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php
  58. +21 −15 app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php
  59. +12 −14 app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php
  60. +24 −1 app/code/Magento/Backend/Block/Dashboard/Totals.php
  61. +10 −12 app/code/Magento/Backend/Block/Denied.php
  62. +2 −4 app/code/Magento/Backend/Block/Media/Uploader.php
  63. +16 −18 app/code/Magento/Backend/Block/Menu.php
  64. +19 −14 app/code/Magento/Backend/Block/Page/Head.php
  65. +12 −14 app/code/Magento/Backend/Block/Page/Header.php
  66. +19 −16 app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php
  67. +14 −16 app/code/Magento/Backend/Block/Store/Switcher.php
  68. +16 −18 app/code/Magento/Backend/Block/System/Account/Edit/Form.php
  69. +23 −0 app/code/Magento/Backend/Block/System/Cache/Form.php
  70. +12 −13 app/code/Magento/Backend/Block/System/Config/Edit.php
  71. +2 −4 app/code/Magento/Backend/Block/System/Config/Form.php
  72. +1 −1  app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php
  73. +12 −14 app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php
  74. +2 −4 app/code/Magento/Backend/Block/System/Config/Switcher.php
  75. +10 −12 app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php
  76. +10 −12 app/code/Magento/Backend/Block/System/Config/Tabs.php
  77. +10 −12 app/code/Magento/Backend/Block/System/Design/Edit.php
  78. +16 −18 app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php
  79. +12 −14 app/code/Magento/Backend/Block/System/Shipping/Ups.php
  80. +10 −12 app/code/Magento/Backend/Block/System/Store/Edit.php
  81. +18 −20 app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php
  82. +16 −18 app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php
  83. +14 −16 app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php
  84. +10 −12 app/code/Magento/Backend/Block/System/Variable/Edit.php
  85. +9 −5 app/code/Magento/Backend/Block/Template.php
  86. +20 −2 app/code/Magento/Backend/Block/Template/Context.php
  87. +1 −1  app/code/Magento/Backend/Block/Text/ListText.php
  88. +1 −1  app/code/Magento/Backend/Block/Widget/Accordion.php
  89. +1 −1  app/code/Magento/Backend/Block/Widget/Accordion/Item.php
  90. +1 −1  app/code/Magento/Backend/Block/Widget/Button.php
  91. +1 −1  app/code/Magento/Backend/Block/Widget/Container.php
  92. +10 −12 app/code/Magento/Backend/Block/Widget/Form.php
  93. +1 −1  app/code/Magento/Backend/Block/Widget/Form/Container.php
  94. +25 −27 app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php
  95. +12 −14 app/code/Magento/Backend/Block/Widget/Form/Generic.php
  96. +5 −7 app/code/Magento/Backend/Block/Widget/Grid.php
  97. +8 −10 app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php
  98. +1 −3 app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php
  99. +14 −18 app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php
  100. +5 −7 app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php
  101. +11 −13 app/code/Magento/Backend/Block/Widget/Grid/Export.php
  102. +2 −2 app/code/Magento/Backend/Block/Widget/Grid/Extended.php
  103. +22 −1 app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php
  104. +14 −16 app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php
  105. +20 −14 app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php
  106. +3 −3 app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php
  107. +22 −3 app/code/Magento/Backend/Block/Widget/Grid/Serializer.php
  108. +18 −13 app/code/Magento/Backend/Block/Widget/Tabs.php
  109. +20 −24 app/code/Magento/Backend/Controller/Adminhtml/Cache.php
  110. +1 −1  app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php
  111. +10 −17 app/code/Magento/Backend/Model/Auth/Session.php
  112. +3 −3 app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php
  113. +1 −2  app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php
  114. +3 −3 app/code/Magento/Backend/Model/Config/Backend/Baseurl.php
  115. +2 −4 app/code/Magento/Backend/Model/Config/Backend/File.php
  116. +3 −3 app/code/Magento/Backend/Model/Config/Backend/Secure.php
  117. +2 −2 app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php
  118. +10 −14 app/code/Magento/Backend/Model/Session.php
  119. +21 −9 app/code/Magento/Backend/Model/Url.php
  120. +0 −28 app/code/Magento/Backend/etc/adminhtml/di.xml
  121. +31 −0 app/code/Magento/Backend/etc/di.xml
  122. +1 −1  app/code/Magento/Backend/etc/module.xml
  123. +3 −3 app/code/Magento/Backend/view/adminhtml/admin/login.phtml
  124. +2 −2 app/code/Magento/Backend/view/adminhtml/admin/overlay_popup.phtml
  125. +1 −1  app/code/Magento/Backend/view/adminhtml/admin/page.phtml
  126. +5 −5 app/code/Magento/Backend/view/adminhtml/admin/popup.phtml
  127. +1 −1  app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml
  128. +1 −1  app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml
  129. +47 −47 app/code/Magento/Backend/view/adminhtml/layout/default.xml
  130. +9 −9 app/code/Magento/Backend/view/adminhtml/layout/editor.xml
  131. +3 −3 app/code/Magento/Backend/view/adminhtml/page/head.phtml
  132. +1 −1  app/code/Magento/Backend/view/adminhtml/page/js/calendar.phtml
  133. +1 −1  app/code/Magento/Backend/view/adminhtml/page/js/components.phtml
  134. +1 −1  app/code/Magento/Backend/view/adminhtml/page/js/translate.phtml
  135. +1 −1  app/code/Magento/Backend/view/adminhtml/widget/grid.phtml
  136. +1 −1  app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml
  137. +2 −2 app/code/Magento/Backup/Block/Adminhtml/Dialogs.php
  138. +1 −2  app/code/Magento/Backup/Controller/Adminhtml/Index.php
  139. +2 −2 app/code/Magento/Backup/Model/Fs/Collection.php
  140. +5 −2 app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php
  141. +10 −12 app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php
  142. +10 −12 app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php
  143. +3 −5 app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php
  144. +14 −16 app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php
  145. +3 −5 app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php
  146. +5 −5 app/code/Magento/Bundle/Block/Catalog/Product/Price.php
  147. +35 −25 app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php
  148. +3 −5 app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php
  149. +2 −2 app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php
  150. +4 −4 app/code/Magento/Bundle/Model/Price/Index.php
  151. +3 −5 app/code/Magento/Bundle/Model/Resource/Bundle.php
  152. +3 −5 app/code/Magento/Bundle/Model/Resource/Price/Index.php
  153. +7 −7 app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php
  154. +7 −7 app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php
  155. +7 −7 app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php
  156. +2 −2 app/code/Magento/Bundle/Model/Selection.php
  157. +1 −1  app/code/Magento/Bundle/etc/module.xml
  158. +1 −1  app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml
  159. +9 −11 app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml
  160. +31 −20 app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml
  161. +21 −16 app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml
  162. +52 −29 app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml
  163. +36 −20 app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml
  164. +2 −2 app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml
  165. +3 −5 app/code/Magento/Captcha/Block/Adminhtml/Captcha/DefaultCaptcha.php
  166. +4 −6 app/code/Magento/Captcha/Block/Captcha.php
  167. +4 −6 app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php
  168. +1 −1  app/code/Magento/Captcha/etc/module.xml
  169. +1 −1  app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml
  170. +12 −14 app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php
  171. +27 −2 app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php
  172. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php
  173. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php
  174. +18 −18 app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php
  175. +29 −23 app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php
  176. +12 −14 app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php
  177. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php
  178. +12 −14 app/code/Magento/Catalog/Block/Adminhtml/Product.php
  179. +10 −12 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php
  180. +16 −18 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php
  181. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php
  182. +12 −14 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php
  183. +23 −17 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php
  184. +30 −24 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php
  185. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php
  186. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php
  187. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php
  188. +12 −14 app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php
  189. +20 −14 app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php
  190. +2 −2 app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php
  191. +3 −5 app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php
  192. +11 −13 app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php
  193. +22 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php
  194. +19 −13 app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php
  195. +21 −15 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php
  196. +10 −12 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php
  197. +1 −3 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php
  198. +10 −12 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php
  199. +10 −12 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php
  200. +10 −12 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php
  201. +23 −17 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php
  202. +1 −1  app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php
  203. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php
  204. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php
  205. +16 −18 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php
  206. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php
  207. +24 −26 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php
  208. +16 −20 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php
  209. +3 −5 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php
  210. +2 −4 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php
  211. +16 −18 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php
  212. +10 −12 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php
  213. +24 −26 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php
  214. +9 −4 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php
  215. +16 −18 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php
  216. +16 −19 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php
  217. +18 −20 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php
  218. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php
  219. +24 −26 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php
  220. +16 −18 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php
  221. +29 −21 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php
  222. +15 −15 app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php
  223. +24 −26 app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php
  224. +9 −4 app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php
  225. +12 −6 app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php
  226. +22 −14 app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php
  227. +18 −20 app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php
  228. +10 −12 app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php
  229. +14 −16 app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php
  230. +4 −6 app/code/Magento/Catalog/Block/Breadcrumbs.php
  231. +5 −7 app/code/Magento/Catalog/Block/Category/View.php
  232. +3 −5 app/code/Magento/Catalog/Block/Category/Widget/Link.php
  233. +4 −6 app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php
  234. +4 −6 app/code/Magento/Catalog/Block/Layer/State.php
  235. +4 −6 app/code/Magento/Catalog/Block/Layer/View.php
  236. +4 −6 app/code/Magento/Catalog/Block/Navigation.php
  237. +4 −6 app/code/Magento/Catalog/Block/Product.php
  238. +6 −8 app/code/Magento/Catalog/Block/Product/AbstractProduct.php
  239. +3 −5 app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php
  240. +9 −4 app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php
  241. +3 −5 app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php
  242. +12 −14 app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php
  243. +4 −6 app/code/Magento/Catalog/Block/Product/Gallery.php
  244. +10 −12 app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php
  245. +4 −6 app/code/Magento/Catalog/Block/Product/Image.php
  246. +3 −5 app/code/Magento/Catalog/Block/Product/ListProduct.php
  247. +4 −6 app/code/Magento/Catalog/Block/Product/NewProduct.php
  248. +13 −7 app/code/Magento/Catalog/Block/Product/Price.php
  249. +1 −1  app/code/Magento/Catalog/Block/Product/Price/Template.php
  250. +2 −5 app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php
  251. +2 −5 app/code/Magento/Catalog/Block/Product/ProductList/Random.php
  252. +3 −5 app/code/Magento/Catalog/Block/Product/ProductList/Related.php
  253. +5 −7 app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
  254. +3 −5 app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php
  255. +3 −5 app/code/Magento/Catalog/Block/Product/Send.php
  256. +4 −6 app/code/Magento/Catalog/Block/Product/TemplateSelector.php
  257. +21 −7 app/code/Magento/Catalog/Block/Product/View.php
  258. +3 −5 app/code/Magento/Catalog/Block/Product/View/AbstractView.php
  259. +1 −1  app/code/Magento/Catalog/Block/Product/View/Additional.php
  260. +4 −6 app/code/Magento/Catalog/Block/Product/View/Attributes.php
  261. +4 −6 app/code/Magento/Catalog/Block/Product/View/Description.php
  262. +19 −5 app/code/Magento/Catalog/Block/Product/View/Options.php
  263. +4 −6 app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php
  264. +6 −8 app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php
  265. +1 −1  app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php
  266. +4 −6 app/code/Magento/Catalog/Block/Product/View/Price.php
  267. +1 −1  app/code/Magento/Catalog/Block/Product/View/Tabs.php
  268. +17 −11 app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php
  269. +1 −1  app/code/Magento/Catalog/Block/Product/Widget/Html/Pager.php
  270. +3 −5 app/code/Magento/Catalog/Block/Product/Widget/Link.php
  271. +1 −1  app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php
  272. +8 −10 app/code/Magento/Catalog/Block/Widget/Link.php
  273. +2 −2 app/code/Magento/Catalog/Controller/Adminhtml/Category.php
  274. +2 −2 app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php
  275. +1 −1  app/code/Magento/Catalog/Controller/Category.php
  276. +2 −2 app/code/Magento/Catalog/Helper/Catalog.php
  277. +2 −4 app/code/Magento/Catalog/Helper/Category.php
  278. +0 −2  app/code/Magento/Catalog/Helper/Category/Flat.php
  279. +3 −5 app/code/Magento/Catalog/Helper/Data.php
  280. +0 −2  app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php
  281. +2 −4 app/code/Magento/Catalog/Helper/Image.php
  282. +2 −4 app/code/Magento/Catalog/Helper/Output.php
  283. +5 −7 app/code/Magento/Catalog/Helper/Product.php
  284. +5 −7 app/code/Magento/Catalog/Helper/Product/Compare.php
  285. +2 −2 app/code/Magento/Catalog/Helper/Product/Composite.php
  286. +2 −2 app/code/Magento/Catalog/Helper/Product/Configuration.php
  287. +0 −2  app/code/Magento/Catalog/Helper/Product/Flat.php
  288. +3 −5 app/code/Magento/Catalog/Helper/Product/Url.php
  289. +5 −5 app/code/Magento/Catalog/Helper/Product/View.php
  290. +2 −4 app/code/Magento/Catalog/Model/AbstractModel.php
  291. +7 −11 app/code/Magento/Catalog/Model/Category.php
  292. +3 −3 app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php
  293. +4 −6 app/code/Magento/Catalog/Model/Category/Indexer/Flat.php
  294. +2 −4 app/code/Magento/Catalog/Model/Config/Backend/Category.php
  295. +4 −6 app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php
  296. +4 −6 app/code/Magento/Catalog/Model/Design.php
  297. +4 −6 app/code/Magento/Catalog/Model/Indexer/Url.php
  298. +1 −1  app/code/Magento/Catalog/Model/Layer/Filter/Category.php
  299. +3 −3 app/code/Magento/Catalog/Model/Layer/Filter/Item.php
  300. +19 −27 app/code/Magento/Catalog/Model/Product.php
Sorry, we could not display the entire diff because too many files (2,128) changed.
14 CHANGELOG.md
View
@@ -1,3 +1,17 @@
+2.0.0.0-dev55
+=============
+* Modularity improvements:
+ * Session configuration moved to library
+ * FormKey logic was moved from Session
+ * SessionIdFlags from Session was removed
+ * Move Page logic to the Theme module and library
+* Created integration module UX
+* Created authorization service (Magento_Authz module)
+* Fixed bugs:
+ * Fixed the issue that prevented a customer group's shopping cart rules from applying properly to prices. The issue occurred when a customer was manually assigned to a customer group and automatic group assignment was enabled.
+ * Fixed the bug with schema upgrade scripts not running after installation
+ * Fixed the error with a blank page when user tries to get access to a restricted resource via URL (add Secret Key for URL set to "No")
+
2.0.0.0-dev54
=============
* Modularity improvements:
22 app/code/Magento/AdminNotification/Block/System/Messages.php
View
@@ -32,19 +32,17 @@ class Messages extends \Magento\Backend\Block\Template
*/
protected $_messages;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages,
- array $data = array()
- ) {
- parent::__construct($context, $coreData, $data);
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages,
+ array $data = array()
+ ) {
+ parent::__construct($context, $data);
$this->_messages = $messages;
}
22 app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php
View
@@ -42,19 +42,17 @@ class UnreadMessagePopup extends \Magento\Backend\Block\Template
*/
protected $_messages;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages,
- array $data = array()
- ) {
- parent::__construct($context, $coreData, $data);
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages,
+ array $data = array()
+ ) {
+ parent::__construct($context, $data);
$this->_messages = $messages;
}
22 app/code/Magento/AdminNotification/Block/ToolbarEntry.php
View
@@ -42,19 +42,17 @@ class ToolbarEntry extends \Magento\Backend\Block\Template
*/
protected $_notificationList;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList,
- array $data = array()
- ) {
- parent::__construct($context, $coreData, $data);
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList,
+ array $data = array()
+ ) {
+ parent::__construct($context, $data);
$this->_notificationList = $notificationList;
}
26 app/code/Magento/AdminNotification/Block/Window.php
View
@@ -60,21 +60,19 @@ class Window extends \Magento\Backend\Block\Template
*/
protected $_latestItem;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\Backend\Model\Auth\Session $authSession
- * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Backend\Model\Auth\Session $authSession
+ * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\Backend\Model\Auth\Session $authSession,
- \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection,
- array $data = array()
- ) {
- parent::__construct($context, $coreData, $data);
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Backend\Model\Auth\Session $authSession,
+ \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection,
+ array $data = array()
+ ) {
+ parent::__construct($context, $data);
$this->_authSession = $authSession;
$this->_criticalCollection = $criticalCollection;
}
12 app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php
View
@@ -42,23 +42,25 @@ class Collection
protected $_countBySeverity = array();
/**
- * @param \Magento\Event\ManagerInterface $eventManager
+ * @param \Magento\Core\Model\EntityFactory $entityFactory
* @param \Magento\Logger $logger
* @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
- * @param \Magento\Core\Model\EntityFactory $entityFactory
+ * @param \Magento\Event\ManagerInterface $eventManager
* @param \Magento\AdminNotification\Model\System\MessageList $messageList
+ * @param mixed $connection
* @param \Magento\Core\Model\Resource\Db\AbstractDb $resource
*/
public function __construct(
- \Magento\Event\ManagerInterface $eventManager,
+ \Magento\Core\Model\EntityFactory $entityFactory,
\Magento\Logger $logger,
\Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
- \Magento\Core\Model\EntityFactory $entityFactory,
+ \Magento\Event\ManagerInterface $eventManager,
\Magento\AdminNotification\Model\System\MessageList $messageList,
+ $connection = null,
\Magento\Core\Model\Resource\Db\AbstractDb $resource = null
) {
$this->_messageList = $messageList;
- parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource);
+ parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
}
/**
2  app/code/Magento/AdminNotification/etc/module.xml
View
@@ -33,7 +33,7 @@
<module name="Magento_Core"/>
<module name="Magento_Adminhtml"/>
<module name="Magento_Backend"/>
- <module name="Magento_Page"/>
+ <module name="Magento_Theme"/>
</depends>
</module>
</config>
6 app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml
View
@@ -31,7 +31,7 @@
<block class="Magento\AdminNotification\Block\Window" name="notification_window" as="notification_window" acl="Magento_AdminNotification::show_toolbar" template="notification/window.phtml"/>
</container>
<referenceBlock name="head">
- <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminnotification-system-notification-js">
+ <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-system-notification-js">
<arguments>
<argument name="file" xsi:type="string">Magento_AdminNotification::system/notification.js</argument>
</arguments>
@@ -42,12 +42,12 @@
<block class="Magento\AdminNotification\Block\ToolbarEntry" template="toolbar_entry.phtml" before="-"/>
</referenceBlock>
<referenceBlock name="head">
- <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css">
+ <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css">
<arguments>
<argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument>
</arguments>
</block>
- <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminnotification-toolbar-entry-js">
+ <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-toolbar-entry-js">
<arguments>
<argument name="file" xsi:type="string">Magento_AdminNotification::toolbar_entry.js</argument>
</arguments>
2  app/code/Magento/AdminNotification/view/adminhtml/notification/window.phtml
View
@@ -39,7 +39,7 @@
<span><?php echo $this->getSeverityText();?></span>
<p class="message-text"><?php echo $this->getNoticeMessageText(); ?></p>
- <a href="<?php echo $this->getNoticeMessageUrl(); ?>" class="action-more"><?php echo $this->getReadDetailsText(); ?></a>
+ <a href="<?php echo $this->getNoticeMessageUrl(); ?>"><?php echo $this->getReadDetailsText(); ?></a>
</div>
<span class="close" data-dismiss="popup" title="<?php echo __('Close popup'); ?>"><?php echo __('Close'); ?></span>
</div>
13 app/code/Magento/AdminNotification/view/adminhtml/system/messages/popup.phtml
View
@@ -34,10 +34,19 @@
</div>
<script type="text/javascript">
jQuery(function() {
- jQuery( "#system_messages_list" ).dialog({
+ jQuery("#system_messages_list").dialog({
autoOpen: true,
resizable: false,
- width: 650
+ width: 650,
+ position: {
+ using: function(pos) {
+ jQuery(this).css({
+ "position": "absolute",
+ "top": Math.ceil(jQuery(window).height()/2 - jQuery(this).height()/2),
+ "left": pos.left
+ });
+ }
+ }
});
});
</script>
11 app/code/Magento/AdminNotification/view/adminhtml/toolbar_entry.js
View
@@ -39,11 +39,10 @@
showLoader: false
});
};
-
+ var notificationCount = $('.notifications').attr('data-notification-count');
// Remove notification from the list
var removeNotificationFromList = function(notificationEntry) {
notificationEntry.remove();
- var notificationCount = $('.notifications').attr('data-notification-count');
notificationCount--;
$('.notifications').attr('data-notification-count', notificationCount);
@@ -54,6 +53,7 @@
notificationIcon.removeAttr('data-toggle');
notificationIcon.off('click.dropdown');
$('.notifications .notifications-icon .value').text('');
+ $('.notifications .notifications-icon .value').hide();
} else {
$('.notifications .notifications-icon .value').text(notificationCount);
// Modify caption of the 'See All' link
@@ -114,5 +114,12 @@
removeNotificationFromList(notificationEntry);
event.stopPropagation();
});
+
+ // Hide notifications bubble
+ if (notificationCount == 0) {
+ $('.notifications .notifications-icon .value').hide();
+ } else {
+ $('.notifications .notifications-icon .value').show();
+ }
});
})(window.jQuery);
22 app/code/Magento/Adminhtml/Block/Urlrewrite.php
View
@@ -50,20 +50,18 @@ class Urlrewrite extends \Magento\Adminhtml\Block\Widget\Grid\Container
*/
protected $_urlrewriteSelector;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector,
- array $data = array()
- ) {
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector,
+ array $data = array()
+ ) {
$this->_urlrewriteSelector = $urlrewriteSelector;
- parent::__construct($context, $coreData, $data);
+ parent::__construct($context, $data);
}
/**
30 app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php
View
@@ -45,24 +45,22 @@ class Edit
*/
protected $_categoryFactory;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
- * @param \Magento\Backend\Helper\Data $adminhtmlData
- * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
+ * @param \Magento\Backend\Helper\Data $adminhtmlData
+ * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
- \Magento\Backend\Helper\Data $adminhtmlData,
- \Magento\Catalog\Model\CategoryFactory $categoryFactory,
- array $data = array()
- ) {
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
+ \Magento\Backend\Helper\Data $adminhtmlData,
+ \Magento\Catalog\Model\CategoryFactory $categoryFactory,
+ array $data = array()
+ ) {
$this->_categoryFactory = $categoryFactory;
- parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data);
+ parent::__construct($context, $rewriteFactory, $adminhtmlData, $data);
}
/**
48 app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php
View
@@ -61,30 +61,36 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory
*/
protected $_productFactory;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree
- * @param \Magento\Core\Model\Registry $registry
- * @param \Magento\Catalog\Model\ProductFactory $productFactory
- * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
- * @param \Magento\Backend\Helper\Data $adminhtmlData
- * @param array $data
+ /**
+ * @var \Magento\Json\EncoderInterface
+ */
+ protected $_jsonEncoder;
+
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Json\EncoderInterface $jsonEncoder
+ * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree
+ * @param \Magento\Core\Model\Registry $registry
+ * @param \Magento\Catalog\Model\ProductFactory $productFactory
+ * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
+ * @param \Magento\Backend\Helper\Data $adminhtmlData
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\Catalog\Model\Resource\Category\Tree $categoryTree,
- \Magento\Core\Model\Registry $registry,
- \Magento\Catalog\Model\ProductFactory $productFactory,
- \Magento\Catalog\Model\CategoryFactory $categoryFactory,
- \Magento\Backend\Helper\Data $adminhtmlData,
- array $data = array()
- ) {
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Catalog\Model\Resource\Category\Tree $categoryTree,
+ \Magento\Core\Model\Registry $registry,
+ \Magento\Json\EncoderInterface $jsonEncoder,
+ \Magento\Catalog\Model\ProductFactory $productFactory,
+ \Magento\Catalog\Model\CategoryFactory $categoryFactory,
+ \Magento\Backend\Helper\Data $adminhtmlData,
+ array $data = array()
+ ) {
+ $this->_jsonEncoder = $jsonEncoder;
$this->_categoryFactory = $categoryFactory;
$this->_productFactory = $productFactory;
$this->_adminhtmlData = $adminhtmlData;
- parent::__construct($context, $coreData, $categoryTree, $registry, $data);
+ parent::__construct($context, $categoryTree, $registry, $data);
}
/**
@@ -118,7 +124,7 @@ public function getTreeArray($parentId = null, $asJson = false, $recursionLevel
}
if ($asJson) {
- return $this->_coreData->jsonEncode($result);
+ return $this->_jsonEncoder->encode($result);
}
$this->_allowedCategoryIds = null;
3  app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php
View
@@ -62,7 +62,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form
/**
* @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
* @param \Magento\Core\Model\Registry $registry
* @param \Magento\Data\FormFactory $formFactory
* @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory
@@ -79,7 +78,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
\Magento\Core\Model\Registry $registry,
\Magento\Data\FormFactory $formFactory,
\Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory,
@@ -97,7 +95,6 @@ public function __construct(
$this->_catalogUrl = $catalogUrl;
parent::__construct(
$context,
- $coreData,
$registry,
$formFactory,
$typesFactory,
34 app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php
View
@@ -52,27 +52,25 @@ class Edit extends \Magento\Adminhtml\Block\Urlrewrite\Edit
*/
protected $_categoryFactory;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
- * @param \Magento\Backend\Helper\Data $adminhtmlData
- * @param \Magento\Catalog\Model\ProductFactory $productFactory
- * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
+ * @param \Magento\Backend\Helper\Data $adminhtmlData
+ * @param \Magento\Catalog\Model\ProductFactory $productFactory
+ * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
- \Magento\Backend\Helper\Data $adminhtmlData,
- \Magento\Catalog\Model\ProductFactory $productFactory,
- \Magento\Catalog\Model\CategoryFactory $categoryFactory,
- array $data = array()
- ) {
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
+ \Magento\Backend\Helper\Data $adminhtmlData,
+ \Magento\Catalog\Model\ProductFactory $productFactory,
+ \Magento\Catalog\Model\CategoryFactory $categoryFactory,
+ array $data = array()
+ ) {
$this->_categoryFactory = $categoryFactory;
$this->_productFactory = $productFactory;
- parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data);
+ parent::__construct($context, $rewriteFactory, $adminhtmlData, $data);
}
/**
30 app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php
View
@@ -43,24 +43,22 @@ class Edit extends \Magento\Adminhtml\Block\Urlrewrite\Edit
*/
protected $_pageFactory;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
- * @param \Magento\Backend\Helper\Data $adminhtmlData
- * @param \Magento\Cms\Model\PageFactory $pageFactory
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
+ * @param \Magento\Backend\Helper\Data $adminhtmlData
+ * @param \Magento\Cms\Model\PageFactory $pageFactory
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
- \Magento\Backend\Helper\Data $adminhtmlData,
- \Magento\Cms\Model\PageFactory $pageFactory,
- array $data = array()
- ) {
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
+ \Magento\Backend\Helper\Data $adminhtmlData,
+ \Magento\Cms\Model\PageFactory $pageFactory,
+ array $data = array()
+ ) {
$this->_pageFactory = $pageFactory;
- parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data);
+ parent::__construct($context, $rewriteFactory, $adminhtmlData, $data);
}
/**
3  app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php
View
@@ -55,7 +55,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form
/**
* @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
* @param \Magento\Core\Model\Registry $registry
* @param \Magento\Data\FormFactory $formFactory
* @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory
@@ -71,7 +70,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
\Magento\Core\Model\Registry $registry,
\Magento\Data\FormFactory $formFactory,
\Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory,
@@ -87,7 +85,6 @@ public function __construct(
$this->_pageFactory = $pageFactory;
parent::__construct(
$context,
- $coreData,
$registry,
$formFactory,
$typesFactory,
26 app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php
View
@@ -69,23 +69,21 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Container
*/
protected $_rewriteFactory;
- /**
- * @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
- * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
- * @param \Magento\Backend\Helper\Data $adminhtmlData
- * @param array $data
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory
+ * @param \Magento\Backend\Helper\Data $adminhtmlData
+ * @param array $data
*/
- public function __construct(
- \Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
- \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
- \Magento\Backend\Helper\Data $adminhtmlData,
- array $data = array()
- ) {
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Core\Model\Url\RewriteFactory $rewriteFactory,
+ \Magento\Backend\Helper\Data $adminhtmlData,
+ array $data = array()
+ ) {
$this->_rewriteFactory = $rewriteFactory;
$this->_adminhtmlData = $adminhtmlData;
- parent::__construct($context, $coreData, $data);
+ parent::__construct($context, $data);
}
/**
4 app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php
View
@@ -91,7 +91,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic
/**
* @param \Magento\Backend\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
* @param \Magento\Core\Model\Registry $registry
* @param \Magento\Data\FormFactory $formFactory
* @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory
@@ -105,7 +104,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
\Magento\Core\Model\Registry $registry,
\Magento\Data\FormFactory $formFactory,
\Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory,
@@ -120,7 +118,7 @@ public function __construct(
$this->_rewriteFactory = $rewriteFactory;
$this->_systemStore = $systemStore;
$this->_adminhtmlData = $adminhtmlData;
- parent::__construct($context, $coreData, $registry, $formFactory, $data);
+ parent::__construct($context, $registry, $formFactory, $data);
}
/**
2  app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php
View
@@ -37,7 +37,7 @@
*/
namespace Magento\Adminhtml\Block\Urlrewrite;
-class Link extends \Magento\View\Block\AbstractBlock
+class Link extends \Magento\View\Element\AbstractBlock
{
/**
* Render output
2  app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php
View
@@ -33,7 +33,7 @@
*/
namespace Magento\Adminhtml\Block\Urlrewrite;
-class Selector extends \Magento\View\Block\Template
+class Selector extends \Magento\View\Element\Template
{
/**
* List of available modes from source model
8 app/code/Magento/Adminhtml/Model/Session/Quote.php
View
@@ -78,6 +78,8 @@ class Quote extends \Magento\Core\Model\Session\AbstractSession
/**
* @param \Magento\Core\Model\Session\Context $context
+ * @param \Magento\Session\SidResolverInterface $sidResolver
+ * @param \Magento\Session\Config\ConfigInterface $sessionConfig
* @param \Magento\Sales\Model\QuoteFactory $quoteFactory
* @param \Magento\Customer\Model\CustomerFactory $customerFactory
* @param \Magento\Sales\Model\OrderFactory $orderFactory
@@ -85,6 +87,8 @@ class Quote extends \Magento\Core\Model\Session\AbstractSession
*/
public function __construct(
\Magento\Core\Model\Session\Context $context,
+ \Magento\Session\SidResolverInterface $sidResolver,
+ \Magento\Session\Config\ConfigInterface $sessionConfig,
\Magento\Sales\Model\QuoteFactory $quoteFactory,
\Magento\Customer\Model\CustomerFactory $customerFactory,
\Magento\Sales\Model\OrderFactory $orderFactory,
@@ -93,8 +97,8 @@ public function __construct(
$this->_quoteFactory = $quoteFactory;
$this->_customerFactory = $customerFactory;
$this->_orderFactory = $orderFactory;
- parent::__construct($context, $data);
- $this->init('adminhtml_quote');
+ parent::__construct($context, $sidResolver, $sessionConfig, $data);
+ $this->start('adminhtml_quote');
if ($this->_storeManager->hasSingleStore()) {
$this->setStoreId($this->_storeManager->getStore(true)->getId());
}
2  app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/categories.phtml
View
@@ -23,7 +23,7 @@
*/
/** @var $this \Magento\Adminhtml\Block\Urlrewrite\Catalog\Category\Tree */
?>
-<fieldset class="fieldset">
+<fieldset class="fieldset" data-ui-id="category-selector">
<legend class="legend"><span><?php echo __('Select Category') ?></span></legend>
<div class="content" style="clear: both;">
<input type="hidden" name="categories" id="product_categories" value="" />
2  app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/selector.phtml
View
@@ -31,7 +31,7 @@
*/
?>
<div class="form-inline">
- <fieldset class="fieldset">
+ <fieldset class="fieldset" data-ui-id="urlrewrite-type-selector">
<div class="field field-url-rewrite-option-select">
<label for="url-rewrite-option-select" class="label"><?php echo $this->getSelectorLabel() ?></label>
<div class="control">
8 app/code/Magento/Authorizenet/Block/Directpost/Form.php
View
@@ -48,22 +48,20 @@ class Form extends \Magento\Payment\Block\Form\Cc
protected $_checkoutModel;
/**
- * @param \Magento\View\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
+ * @param \Magento\View\Element\Template\Context $context
* @param \Magento\Payment\Model\Config $paymentConfig
* @param \Magento\Authorizenet\Model\Directpost $model
* @param \Magento\Checkout\Model\Type\Onepage $checkoutModel
* @param array $data
*/
public function __construct(
- \Magento\View\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
+ \Magento\View\Element\Template\Context $context,
\Magento\Payment\Model\Config $paymentConfig,
\Magento\Authorizenet\Model\Directpost $model,
\Magento\Checkout\Model\Type\Onepage $checkoutModel,
array $data = array()
) {
- parent::__construct($context, $coreData, $paymentConfig, $data);
+ parent::__construct($context, $paymentConfig, $data);
$this->_model = $model;
$this->_checkoutModel = $checkoutModel;
}
12 app/code/Magento/Authorizenet/Block/Directpost/Iframe.php
View
@@ -33,7 +33,7 @@
*/
namespace Magento\Authorizenet\Block\Directpost;
-class Iframe extends \Magento\View\Block\Template
+class Iframe extends \Magento\View\Element\Template
{
/**
* Core registry
@@ -43,19 +43,17 @@ class Iframe extends \Magento\View\Block\Template
protected $_coreRegistry = null;
/**
- * @param \Magento\View\Block\Template\Context $context
- * @param \Magento\Core\Helper\Data $coreData
+ * @param \Magento\View\Element\Template\Context $context
* @param \Magento\Core\Model\Registry $registry
* @param array $data
*/
public function __construct(
- \Magento\View\Block\Template\Context $context,
- \Magento\Core\Helper\Data $coreData,
+ \Magento\View\Element\Template\Context $context,
\Magento\Core\Model\Registry $registry,
array $data = array()
) {
$this->_coreRegistry = $registry;
- parent::__construct($context, $coreData, $data);
+ parent::__construct($context, $data);
}
/**
@@ -63,7 +61,7 @@ public function __construct(
*
* You can redefine this method in child classes for changing layout
*
- * @return \Magento\View\Block\AbstractBlock
+ * @return \Magento\View\Element\AbstractBlock
*/
protected function _prepareLayout()
{
4 app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php
View
@@ -204,9 +204,9 @@ public function redirectAction()
}
}
//clear sessions
- $this->_getSession()->clear();
+ $this->_getSession()->clearStorage();
$this->_getDirectPostSession()->removeCheckoutOrderIncrementId($redirectParams['x_invoice_num']);
- $this->_objectManager->get('Magento\Adminhtml\Model\Session')->clear();
+ $this->_objectManager->get('Magento\Adminhtml\Model\Session')->clearStorage();
$this->_objectManager->get('Magento\Adminhtml\Model\Session')->addSuccess(__('You created the order.'));
}
2  app/code/Magento/Authorizenet/Model/Directpost/Observer.php
View
@@ -126,7 +126,7 @@ public function addAdditionalFieldsToResponseFrontend(\Magento\Event\Observer $o
if ($payment && $payment->getMethod() == $this->_modelFactory->create()->getCode()) {
$request = $observer->getEvent()->getRequest();
$response = $observer->getEvent()->getResponse();
- $result = $this->_coreData->jsonDecode($response->getBody('default'), \Zend_Json::TYPE_ARRAY);
+ $result = $this->_coreData->jsonDecode($response->getBody('default'));
if (empty($result['error'])) {
$payment = $order->getPayment();
8 app/code/Magento/Authorizenet/Model/Directpost/Session.php
View
@@ -37,16 +37,20 @@ class Session extends \Magento\Core\Model\Session\AbstractSession
{
/**
* @param \Magento\Core\Model\Session\Context $context
+ * @param \Magento\Session\SidResolverInterface $sidResolver
+ * @param \Magento\Session\Config\ConfigInterface $sessionConfig
* @param array $data
* @param string|null $sessionName
*/
public function __construct(
\Magento\Core\Model\Session\Context $context,
+ \Magento\Session\SidResolverInterface $sidResolver,
+ \Magento\Session\Config\ConfigInterface $sessionConfig,
array $data = array(),
$sessionName = null
) {
- parent::__construct($context, $data);
- $this->init('authorizenet_directpost', $sessionName);
+ parent::__construct($context, $sidResolver, $sessionConfig, $data);
+ $this->start('authorizenet_directpost', $sessionName);
}
/**
2  app/code/Magento/Authorizenet/etc/module.xml
View
@@ -38,7 +38,7 @@
<module name="Magento_Backend"/>
<module name="Magento_Core"/>
<module name="Magento_Payment"/>
- <module name="Magento_Page"/>
+ <module name="Magento_Theme"/>
<module name="Magento_Centinel"/>
</depends>
</module>
2  app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml
View
@@ -25,7 +25,7 @@
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<referenceBlock name="head">
- <block class="Magento\Page\Block\Html\Head\Script" name="magento-directpost-js">
+ <block class="Magento\Theme\Block\Html\Head\Script" name="magento-directpost-js">
<arguments>
<argument name="file" xsi:type="string">mage/directpost.js</argument>
</arguments>
2  app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml
View
@@ -25,7 +25,7 @@
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<referenceBlock name="head">
- <block class="Magento\Page\Block\Html\Head\Script" name="mage-centinel-centinel-authenticate-js">
+ <block class="Magento\Theme\Block\Html\Head\Script" name="mage-centinel-centinel-authenticate-js">
<arguments>
<argument name="file" xsi:type="string">Magento_Authorizenet::js/directpost.js</argument>
</arguments>
130 app/code/Magento/Authz/Model/UserIdentifier.php
View
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Authz\Model;
+
+/**
+ * User identifier class. By user can be understood admin, customer, guest, web API integration.
+ */
+class UserIdentifier
+{
+ /**#@+
+ * User types.
+ */
+ const USER_TYPE_GUEST = 'Guest';
+ const USER_TYPE_CUSTOMER = 'Customer';
+ const USER_TYPE_ADMIN = 'Admin';
+ const USER_TYPE_INTEGRATION = 'Integration';
+ /**#@-*/
+
+ /**
+ * User type (admin, customer, guest, web API integration).
+ *
+ * @var string
+ */
+ protected $_userType;
+
+ /** @var int */
+ protected $_userId;
+
+ /**
+ * Initialize user type and user id.
+ *
+ * @param UserLocatorInterface $userLocator Locator of active user.
+ * @param string|null $userType
+ * @param int|null $userId
+ * @throws \LogicException
+ */
+ public function __construct(UserLocatorInterface $userLocator, $userType = null, $userId = null)
+ {
+ $userType = isset($userType) ? $userType : $userLocator->getUserType();
+ $userId = isset($userId) ? $userId : $userLocator->getUserId();
+ if ($userType == self::USER_TYPE_GUEST && $userId) {
+ throw new \LogicException('Guest user must not have user ID set.');
+ }
+ $this->_setUserId($userId);
+ $this->_setUserType($userType);
+ }
+
+ /**
+ * Get user ID. Null is possible when user type is 'guest'.
+ *
+ * @return int
+ */
+ public function getUserId()
+ {
+ return $this->_userId;
+ }
+
+ /**
+ * Retrieve user type (admin, customer, guest, web API integration).
+ *
+ * @return string
+ */
+ public function getUserType()
+ {
+ return $this->_userType;
+ }
+
+ /**
+ * Set user ID.
+ *
+ * @param int
+ * @return UserIdentifier
+ * @throws \LogicException
+ */
+ protected function _setUserId($userId)
+ {
+ $userId = is_numeric($userId) ? (int)$userId : $userId;
+ if (!is_integer($userId) || ($userId < 0)) {
+ throw new \LogicException("Invalid user ID: '{$userId}'.");
+ }
+ $this->_userId = $userId;
+ return $this;
+ }
+
+ /**
+ * Set user type.
+ *
+ * @param string $userType
+ * @return UserIdentifier
+ * @throws \LogicException
+ */
+ protected function _setUserType($userType)
+ {
+ $availableTypes = array(
+ self::USER_TYPE_GUEST,
+ self::USER_TYPE_CUSTOMER,
+ self::USER_TYPE_ADMIN,
+ self::USER_TYPE_INTEGRATION
+ );
+ if (!in_array($userType, $availableTypes)) {
+ throw new \LogicException(
+ "Invalid user type: '{$userType}'. Allowed types: " . implode(", ", $availableTypes)
+ );
+ }
+ $this->_userType = $userType;
+ return $this;
+ }
+}
64 app/code/Magento/Authz/Model/UserIdentifier/Factory.php
View
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Authz\Model\UserIdentifier;
+
+use Magento\ObjectManager;
+use Magento\Authz\Model\UserIdentifier;
+
+/**
+ * User identifier factory.
+ */
+class Factory
+{
+ /**
+ * @var \Magento\ObjectManager
+ */
+ protected $_objectManager;
+
+ /**
+ * Initialize dependencies
+ *
+ * @param ObjectManager $objectManager
+ */
+ public function __construct(ObjectManager $objectManager)
+ {
+ $this->_objectManager = $objectManager;
+ }
+
+ /**
+ * Create instance of user identifier.
+ *
+ * @param string $userType
+ * @param int $userId
+ * @return UserIdentifier
+ */
+ public function create($userType, $userId = 0)
+ {
+ return $this->_objectManager->create(
+ 'Magento\Authz\Model\UserIdentifier',
+ array('userType' => $userType, 'userId' => $userId)
+ );
+ }
+}
64 app/code/Magento/Authz/Model/UserLocator/Admin.php
View
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Authz\Model\UserLocator;
+
+use Magento\Authz\Model\UserLocatorInterface;
+use Magento\Authz\Model\UserIdentifier;
+use Magento\Backend\Model\Auth\Session as AdminSession;
+
+/**
+ * Admin user locator.
+ */
+class Admin implements UserLocatorInterface
+{
+ /** @var AdminSession */
+ protected $_adminSession;
+
+ /**
+ * Initialize dependencies.
+ *
+ * @param AdminSession $adminSession
+ */
+ public function __construct(AdminSession $adminSession)
+ {
+ $this->_adminSession = $adminSession;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getUserId()
+ {
+ return $this->_adminSession->hasUser() ? (int)$this->_adminSession->getUser()->getId() : 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getUserType()
+ {
+ return UserIdentifier::USER_TYPE_ADMIN;
+ }
+}
50 app/code/Magento/Authz/Model/UserLocator/Guest.php
View
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Authz\Model\UserLocator;
+
+use Magento\Authz\Model\UserIdentifier;
+use Magento\Authz\Model\UserLocatorInterface;
+
+/**
+ * Guest user locator.
+ */
+class Guest implements UserLocatorInterface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function getUserId()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getUserType()
+ {
+ return UserIdentifier::USER_TYPE_GUEST;
+ }
+}
25 app/code/Magento/Page/Block/Link.php → ...code/Magento/Authz/Model/UserLocatorInterface.php
View
@@ -22,25 +22,24 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-namespace Magento\Page\Block;
+namespace Magento\Authz\Model;
/**
- * Block representing link
- *
- * @method string getLabel()
- * @method string getPath()
- * @method string getTitle()
+ * Interface for current user identification.
*/
-class Link extends \Magento\View\Block\Template
+interface UserLocatorInterface
{
- /** @var string */
- protected $_template = 'Magento_Page::link.phtml';
+ /**
+ * Identify current user ID.
+ *
+ * @return int
+ */
+ public function getUserId();
/**
+ * Retrieve current user type (Admin, Customer, Guest, Integration).
+ *
* @return string
*/
- public function getHref()
- {
- return $this->getUrl($this->getPath());
- }
+ public function getUserType();
}
254 app/code/Magento/Authz/Service/AuthorizationV1.php
View
@@ -0,0 +1,254 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Authz\Service;
+
+use Magento\Acl\Builder as AclBuilder;
+use Magento\Acl;
+use Magento\Authz\Model\UserIdentifier;
+use Magento\Logger;
+use Magento\Service\Exception as ServiceException;
+use Magento\Service\ResourceNotFoundException;
+use Magento\User\Model\Resource\Role\CollectionFactory as RoleCollectionFactory;
+use Magento\User\Model\Resource\Rules\CollectionFactory as RulesCollectionFactory;
+use Magento\User\Model\Role;
+use Magento\User\Model\RoleFactory;
+use Magento\User\Model\RulesFactory;
+use Magento\Core\Model\Acl\RootResource as RootAclResource;
+
+/**
+ * Authorization service.
+ *
+ * @SuppressWarnings(PHPMD.LongVariable)
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
+class AuthorizationV1 implements AuthorizationV1Interface
+{
+ /** @var AclBuilder */
+ protected $_aclBuilder;
+
+ /** @var UserIdentifier */
+ protected $_userIdentifier;
+
+ /** @var RoleFactory */
+ protected $_roleFactory;
+
+ /** @var RoleCollectionFactory */
+ protected $_roleCollectionFactory;
+
+ /** @var RulesFactory */
+ protected $_rulesFactory;
+
+ /** @var RulesCollectionFactory */
+ protected $_rulesCollectionFactory;
+
+ /** @var Logger */
+ protected $_logger;
+
+ /** @var RootAclResource */
+ protected $_rootAclResource;
+
+ /**
+ * Initialize dependencies.
+ *
+ * @param AclBuilder $aclBuilder
+ * @param UserIdentifier $userIdentifier
+ * @param RoleFactory $roleFactory
+ * @param RoleCollectionFactory $roleCollectionFactory
+ * @param RulesFactory $rulesFactory
+ * @param RulesCollectionFactory $rulesCollectionFactory
+ * @param Logger $logger
+ * @param RootAclResource $rootAclResource
+ */
+ public function __construct(
+ AclBuilder $aclBuilder,
+ UserIdentifier $userIdentifier,
+ RoleFactory $roleFactory,
+ RoleCollectionFactory $roleCollectionFactory,
+ RulesFactory $rulesFactory,
+ RulesCollectionFactory $rulesCollectionFactory,
+ Logger $logger,
+ RootAclResource $rootAclResource
+ ) {
+ $this->_aclBuilder = $aclBuilder;
+ $this->_userIdentifier = $userIdentifier;
+ $this->_roleFactory = $roleFactory;
+ $this->_rulesFactory = $rulesFactory;
+ $this->_rulesCollectionFactory = $rulesCollectionFactory;
+ $this->_roleCollectionFactory = $roleCollectionFactory;
+ $this->_logger = $logger;
+ $this->_rootAclResource = $rootAclResource;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isAllowed($resources, UserIdentifier $userIdentifier = null)
+ {
+ $resources = is_array($resources) ? $resources : array($resources);
+ $userIdentifier = $userIdentifier ? $userIdentifier : $this->_userIdentifier;
+ try {
+ $role = $this->_getUserRole($userIdentifier);
+ if (!$role) {
+ throw new ResourceNotFoundException(
+ __(
+ 'Role for user with ID "%1" and user type "%2" cannot be found.',
+ $userIdentifier->getUserId(),
+ $userIdentifier->getUserType()
+ )
+ );
+ }
+ foreach ($resources as $resource) {
+ if (!$this->_aclBuilder->getAcl()->isAllowed($role->getId(), $resource)) {
+ return false;
+ }
+ }
+ return true;
+ } catch (\Exception $e) {
+ $this->_logger->logException($e);
+ return false;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function grantPermissions(UserIdentifier $userIdentifier, array $resources)
+ {
+ try {
+ $role = $this->_getUserRole($userIdentifier);
+ if (!$role) {
+ $role = $this->_createRole($userIdentifier);
+ }
+ $this->_associateResourcesWithRole($role, $resources);
+ } catch (ServiceException $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ $this->_logger->logException($e);
+ throw new ServiceException(
+ __('Error happened while granting permissions. Check exception log for details.')
+ );
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function grantAllPermissions(UserIdentifier $userIdentifier)
+ {
+ $this->grantPermissions($userIdentifier, array($this->_rootAclResource->getId()));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getAllowedResources(UserIdentifier $userIdentifier)
+ {
+ $allowedResources = array();
+ try {
+ $role = $this->_getUserRole($userIdentifier);
+ if (!$role) {
+ throw new ServiceException(__('The role associated with the specified user cannot be found.'));
+ }
+ $rulesCollection = $this->_rulesCollectionFactory->create();
+ $rulesCollection->getByRoles($role->getId())->load();
+ $acl = $this->_aclBuilder->getAcl();
+ /** @var \Magento\User\Model\Rules $ruleItem */
+ foreach ($rulesCollection->getItems() as $ruleItem) {
+ $resourceId = $ruleItem->getResourceId();
+ if ($acl->has($resourceId) && $acl->isAllowed($role->getId(), $resourceId)) {
+ $allowedResources[] = $resourceId;
+ }
+ }
+ } catch (ServiceException $e) {
+ throw $e;
+ } catch (\Exception $e) {
+ $this->_logger->logException($e);
+ throw new ServiceException(
+ __('Error happened while getting a list of allowed resources. Check exception log for details.')
+ );
+ }
+ return $allowedResources;
+ }
+
+ /**
+ * Create new ACL role.
+ *
+ * @param UserIdentifier $userIdentifier
+ * @return Role
+ * @throws \LogicException
+ */
+ protected function _createRole($userIdentifier)
+ {
+ $userType = $userIdentifier->getUserType();
+ $userId = $userIdentifier->getUserId();
+ switch ($userType) {
+ case UserIdentifier::USER_TYPE_INTEGRATION:
+ $roleName = $userType . $userId;
+ $roleType = \Magento\User\Model\Acl\Role\User::ROLE_TYPE;
+ $parentId = 0;
+ $userId = $userIdentifier->getUserId();
+ break;
+ default:
+ throw new \LogicException("Unknown user type: '{$userType}'.");
+ }
+ $role = $this->_roleFactory->create();
+ $role->setRoleName($roleName)
+ ->setUserType($userType)
+ ->setUserId($userId)
+ ->setRoleType($roleType)
+ ->setParentId($parentId)
+ ->save();
+ return $role;
+ }
+
+ /**
+ * Identify user role from user identifier.
+ *
+ * @param UserIdentifier $userIdentifier
+ * @return Role|false Return false in case when no role associated with provided user was found.
+ */
+ protected function _getUserRole($userIdentifier)
+ {
+ $roleCollection = $this->_roleCollectionFactory->create();
+ $userType = $userIdentifier->getUserType();
+ $userId = $userIdentifier->getUserId();
+ /** @var Role $role */
+ $role = $roleCollection->setUserFilter($userId, $userType)->getFirstItem();
+ return $role->getId() ? $role : false;
+ }
+
+ /**
+ * Associate resources with the specified role. All resources previously assigned to the role will be unassigned.
+ *
+ * @param Role $role
+ * @param string[] $resources
+ */
+ protected function _associateResourcesWithRole($role, array $resources)
+ {
+ /** @var \Magento\User\Model\Rules $rules */
+ $rules = $this->_rulesFactory->create();
+ $rules->setRoleId($role->getId())->setResources($resources)->saveRel();
+ }
+}
72 app/code/Magento/Authz/Service/AuthorizationV1Interface.php
View
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Authz\Service;
+
+use Magento\Authz\Model\UserIdentifier;
+use Magento\Service\Exception as ServiceException;
+
+/**
+ * Authorization service interface.
+ */
+interface AuthorizationV1Interface
+{
+ /**
+ * Grant permissions to user to access the specified resources.
+ *
+ * @param UserIdentifier $userIdentifier
+ * @param string[] $resources List of resources which should be available to the specified user.
+ * @throws ServiceException
+ */
+ public function grantPermissions(UserIdentifier $userIdentifier, array $resources);
+
+ /**
+ * Grant permissions to the user to access all resources available in the system.
+ *
+ * @param UserIdentifier $userIdentifier
+ * @throws ServiceException
+ */
+ public function grantAllPermissions(UserIdentifier $userIdentifier);
+
+ /**
+ * Check if the user has permission to access the requested resources.
+ *
+ * Access is prohibited if there is a lack of permissions to any of the requested resources.
+ *
+ * @param string|string[] $resources Single resource or a list of resources
+ * @param UserIdentifier|null $userIdentifier Context of current user is used by default
+ * @return bool
+ * @throws ServiceException
+ */
+ public function isAllowed($resources, UserIdentifier $userIdentifier = null);
+
+ /**
+ * Get a list of resources available to the specified user.
+ *
+ * @param UserIdentifier $userIdentifier
+ * @return string[]
+ * @throws ServiceException
+ */
+ public function getAllowedResources(UserIdentifier $userIdentifier);
+}
28 app/code/Magento/Authz/etc/adminhtml/di.xml
View
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0)
+ * that is bundled with this package in the file LICENSE_AFL.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/afl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+ */
+-->
+<config>
+ <preference for="Magento\Authz\Model\UserLocatorInterface" type="Magento\Authz\Model\UserLocator\Admin"/>
+</config>
29 app/code/Magento/Authz/etc/di.xml
View
@@ -0,0 +1,29 @@