Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
46b3ab24
Commit
46b3ab24
authored
Jun 08, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_advanced_ecommerce: add facebook login
parent
37a97743
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
528 additions
and
3 deletions
+528
-3
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/ERP5Site_createFacebookUserToOAuth.py
..._advanced_ecommerce/ERP5Site_createFacebookUserToOAuth.py
+30
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/ERP5Site_createFacebookUserToOAuth.xml
...advanced_ecommerce/ERP5Site_createFacebookUserToOAuth.xml
+71
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Person_editPersonalInformation.py
...erp5_advanced_ecommerce/Person_editPersonalInformation.py
+3
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSite_viewLoginForm.xml
...l_skins/erp5_advanced_ecommerce/WebSite_viewLoginForm.xml
+58
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSite_viewLoginForm.zpt
...l_skins/erp5_advanced_ecommerce/WebSite_viewLoginForm.zpt
+25
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/login_form.xml
...eItem/portal_skins/erp5_advanced_ecommerce/login_form.xml
+1
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/login_form/login_html.xml
...l_skins/erp5_advanced_ecommerce/login_form/login_html.xml
+322
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/login_form/traditional_login_html.xml
..._advanced_ecommerce/login_form/traditional_login_html.xml
+16
-1
bt5/erp5_advanced_ecommerce/bt/dependency_list
bt5/erp5_advanced_ecommerce/bt/dependency_list
+2
-1
No files found.
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/ERP5Site_createFacebookUserToOAuth.py
0 → 100644
View file @
46b3ab24
portal
=
context
.
getPortalObject
()
person_list
=
[
x
for
x
in
portal
.
acl_users
.
searchUsers
(
login
=
user_reference
,
exact_match
=
True
)
if
'path'
in
x
]
if
person_list
:
return
person
=
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
user_dict
[
'name'
]
)
user_id
=
person
.
Person_getUserId
()
# Create default career
# Create assignment
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
,
role
=
'client'
,)
# Required for security based on role
login
=
person
.
newContent
(
portal_type
=
'Facebook Login'
,
reference
=
user_reference
)
login
.
validate
()
assignment
.
open
()
person
.
validate
()
person
.
manage_setLocalRoles
(
user_id
,
[
'Auditor'
])
person
.
WebSite_immediateReindex
()
login
.
WebSite_immediateReindex
()
# Set owner local role for cart if needed
shopping_cart
=
context
.
SaleOrder_getShoppingCart
()
if
shopping_cart
is
not
None
:
shopping_cart
.
manage_setLocalRoles
(
user_id
,
[
'Owner'
])
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/ERP5Site_createFacebookUserToOAuth.xml
0 → 100644
View file @
46b3ab24
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
user_reference, user_dict
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_createFacebookUserToOAuth
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Person_editPersonalInformation.py
View file @
46b3ab24
...
...
@@ -10,7 +10,9 @@ if result_type != 'edit':
# Update data
kw
,
_
=
result
context
.
edit
(
**
kw
)
context
.
WebSite_executeMethodAsSuperUser
(
'edit'
,
**
kw
)
#context.edit(**kw)
login_come_from_url
=
context
.
REQUEST
.
get
(
"field_your_login_come_from_url"
)
edit_portal_status_message
=
context
.
REQUEST
.
get
(
"field_your_edit_portal_status_message"
,
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSite_viewLoginForm.xml
0 → 100644
View file @
46b3ab24
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSite_viewLoginForm
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSite_viewLoginForm.zpt
0 → 100644
View file @
46b3ab24
<tal:block tal:define="login_come_from_url python: request.get('field_your_login_come_from_url', None) or request.get('came_from', None) or '..';
is_shopping_cart python: request.get('field_your_is_shopping_cart') and 1 or 0;
is_loyalty_section python: login_come_from_url.endswith('loyalty') and 1 or 0;">
<p tal:condition="python: not is_shopping_cart and not is_loyalty_section" i18n:translate="" i18n:domain="ui">
Use your Facebook accounts to signup
</p>
<p tal:condition="is_shopping_cart" i18n:translate="" i18n:domain="ui">
Before we can proceed to payment, please login with your Facebook account.
</p>
<p tal:condition="is_loyalty_section" i18n:translate="" i18n:domain="ui">
Before access loyalty area, please login with your Facebook account.
</p>
<p>
<a class="zocial facebook" href="ERP5Site_redirectToFacebookLoginPage" i18n:translate="" i18n:domain="ui">Signup with Facebook</a>
</p>
<p>
<a class="login_old_style" tal:attributes="href string:./login_form?is_traditional_login:int=1&is_shopping_cart:int=${is_shopping_cart}&is_loyalty_section:int=${is_loyalty_section}&came_from=${login_come_from_url}&"
i18n:translate="" i18n:domain="ui">
or login using a traditional account...
</a>
</p>
</tal:block>
\ No newline at end of file
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/login_form.xml
View file @
46b3ab24
...
...
@@ -79,6 +79,7 @@
<value>
<list>
<string>
traditional_login_html
</string>
<string>
login_html
</string>
</list>
</value>
</item>
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/login_form/login_html.xml
0 → 100644
View file @
46b3ab24
This diff is collapsed.
Click to expand it.
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/login_form/traditional_login_html.xml
View file @
46b3ab24
...
...
@@ -148,7 +148,9 @@
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
...
...
@@ -304,4 +306,17 @@
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: request.get("is_traditional_login")
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/bt/dependency_list
View file @
46b3ab24
...
...
@@ -4,4 +4,5 @@ erp5_xhtml_style
erp5_web_multiflex5_theme
erp5_dms
erp5_jquery_plugin_jqzoom
erp5_jquery_plugin_lightbox
\ No newline at end of file
erp5_jquery_plugin_lightbox
erp5_oauth_facebook_login
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment