Skip to content

Commit

Permalink
Restrict geverui cookie to admin unit
Browse files Browse the repository at this point in the history
  • Loading branch information
elioschmutz committed Mar 3, 2020
1 parent 2d5dec4 commit 17cca83
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2020.2.0rc1 (unreleased)
------------------------

- Restrict `geverui` cookie to admin unit. [elioschmutz]
- Extend the opengever deployment directive with workspace roles. [elioschmutz]
- Set seen_tours for all users in test fixture. [njohner]

Expand Down
3 changes: 2 additions & 1 deletion opengever/base/browser/resources/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $(document).delegate('body', 'tabbedview.unknownresponse', function(event, overv
* to the new gever-ui.
*/
function switchUI(){
createCookie('geverui', '1');
var pathname = new URL($('body').data('portal-url')).pathname;
Cookies.set('geverui', '1', {path: pathname});
window.location.reload(true);
}
2 changes: 2 additions & 0 deletions opengever/base/browser/resources/js_cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions opengever/core/profiles/default/jsregistry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@
insert-after="++resource++datetimepicker/js/datetimepicker_widget.js"
/>

<javascript
cacheable="True"
compression="none"
cookable="True"
expression=""
enabled="True"
id="++resource++opengever.base/js_cookie.min.js"
inline="False"
insert-before="*"
/>

<javascript
cacheable="True"
compression="none"
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<object name="portal_javascripts" meta_type="JavaScripts Registry">

<javascript
cacheable="True"
compression="none"
cookable="True"
expression=""
enabled="True"
id="++resource++opengever.base/js_cookie.min.js"
inline="False"
insert-before="*"
/>

</object>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from ftw.upgrade import UpgradeStep


class AddJSCookie(UpgradeStep):
"""Add js cookie.
"""

def __call__(self):
self.install_upgrade_profile()

0 comments on commit 17cca83

Please sign in to comment.