From 273986351ab38efd0fe816a1831bf0ebf6ed3053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com> Date: Tue, 10 Jul 2012 14:59:57 +0200 Subject: [PATCH] Implement Google authorisation. --- .../vifib_base/Base_createOauth2User.xml | 1 - master/bt5/vifib_base/bt/revision | 2 +- ...google_server_auth_token_cache_factory.xml | 76 ++++ .../volatile_cache_plugin.xml | 20 ++ .../hosting/login_with_google.xml | 183 ++++++++++ .../login_with_google/google_callback.xml | 137 +++++++ master/bt5/vifib_data_web/bt/revision | 2 +- .../bt5/vifib_data_web/bt/template_path_list | 2 + ...d_vifib_google_application_id_property.xml | 65 ++++ ...fib_google_application_secret_property.xml | 65 ++++ .../vifib_slap/SystemPreference_viewVifib.xml | 2 + ..._preferred_vifib_google_application_id.xml | 96 +++++ ...ferred_vifib_google_application_secret.xml | 96 +++++ master/bt5/vifib_slap/bt/revision | 2 +- .../ExtensionTemplateItem/ViFiBWeb.py | 92 ++++- .../Google_checkUserExistence.xml | 28 ++ .../Google_getAccessTokenFromCode.xml | 28 ++ .../vifib_hosting/Google_getServerToken.xml | 28 ++ .../vifib_hosting/Google_getUserId.xml | 28 ++ .../vifib_hosting/Google_setServerToken.xml | 28 ++ .../WebSection_facebookCallbackLogin.xml | 2 +- .../WebSection_googleCallbackLogin.xml | 83 +++++ .../WebSection_googleInitiateLogin.xml | 75 ++++ .../WebSection_viewVifibKVMOrder.xml | 3 +- ...xml => your_user_preparation_facebook.xml} | 2 +- .../your_user_preparation_google.xml | 335 ++++++++++++++++++ .../vifib_hosting/WebSite_logout.xml | 1 + .../vifib_jauks_theme/login_form.xml | 3 +- .../vifib_image/google_logo.png.xml | 92 +++++ master/bt5/vifib_web/bt/revision | 2 +- 30 files changed, 1569 insertions(+), 10 deletions(-) create mode 100644 master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory.xml create mode 100644 master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory/volatile_cache_plugin.xml create mode 100644 master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google.xml create mode 100644 master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google/google_callback.xml create mode 100644 master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_id_property.xml create mode 100644 master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_secret_property.xml create mode 100644 master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_id.xml create mode 100644 master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_secret.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_checkUserExistence.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getAccessTokenFromCode.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getServerToken.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getUserId.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_setServerToken.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleCallbackLogin.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleInitiateLogin.xml rename master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/{your_user_preparation.xml => your_user_preparation_facebook.xml} (99%) create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation_google.xml create mode 100644 master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/vifib_image/google_logo.png.xml diff --git a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/Base_createOauth2User.xml b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/Base_createOauth2User.xml index 79e7e740e..165bd1d79 100644 --- a/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/Base_createOauth2User.xml +++ b/master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/Base_createOauth2User.xml @@ -52,7 +52,6 @@ <key> <string>_body</string> </key> <value> <string encoding="cdata"><![CDATA[ -script.log(\'called\')\n from DateTime import DateTime\n \n portal = context.getPortalObject()\n diff --git a/master/bt5/vifib_base/bt/revision b/master/bt5/vifib_base/bt/revision index a6d80d584..02416eb97 100644 --- a/master/bt5/vifib_base/bt/revision +++ b/master/bt5/vifib_base/bt/revision @@ -1 +1 @@ -466 \ No newline at end of file +467 \ No newline at end of file diff --git a/master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory.xml b/master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory.xml new file mode 100644 index 000000000..9b727e65e --- /dev/null +++ b/master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory.xml @@ -0,0 +1,76 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Cache Factory" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_count</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_mt_index</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>_tree</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + <item> + <key> <string>cache_duration</string> </key> + <value> <int>3600</int> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>google_server_auth_token_cache_factory</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Cache Factory</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> + <none/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="Length" module="BTrees.Length"/> + </pickle> + <pickle> <int>0</int> </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory/volatile_cache_plugin.xml b/master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory/volatile_cache_plugin.xml new file mode 100644 index 000000000..3455556ba --- /dev/null +++ b/master/bt5/vifib_data_web/PathTemplateItem/portal_caches/google_server_auth_token_cache_factory/volatile_cache_plugin.xml @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Ram Cache" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>volatile_cache_plugin</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Ram Cache</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google.xml b/master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google.xml new file mode 100644 index 000000000..0a6f6cf6f --- /dev/null +++ b/master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google.xml @@ -0,0 +1,183 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Web Section" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_folders_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Copy_or_Move_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Delete_objects_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + <string>Owner</string> + </tuple> + </value> + </item> + <item> + <key> <string>__translation_dict</string> </key> + <value> + <dictionary/> + </value> + </item> + <item> + <key> <string>_count</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_identity_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>_mt_index</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + <item> + <key> <string>_range_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> + </value> + </item> + <item> + <key> <string>_tree</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent> + </value> + </item> + <item> + <key> <string>custom_render_method_id</string> </key> + <value> <string>WebSection_googleInitiateLogin</string> </value> + </item> + <item> + <key> <string>default_page_displayed</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>login_with_google</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Web Section</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Login with Google</string> </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="Length" module="BTrees.Length"/> + </pickle> + <pickle> <int>0</int> </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> + <record id="5" aka="AAAAAAAAAAU="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="6" aka="AAAAAAAAAAY="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google/google_callback.xml b/master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google/google_callback.xml new file mode 100644 index 000000000..a1c1eca45 --- /dev/null +++ b/master/bt5/vifib_data_web/PathTemplateItem/web_site_module/hosting/login_with_google/google_callback.xml @@ -0,0 +1,137 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Web Section" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_folders_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Copy_or_Move_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Delete_objects_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + <string>Owner</string> + </tuple> + </value> + </item> + <item> + <key> <string>_identity_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_range_criterion</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>custom_render_method_id</string> </key> + <value> <string>WebSection_googleCallbackLogin</string> </value> + </item> + <item> + <key> <string>default_page_displayed</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>google_callback</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Web Section</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Supports Google\'s callback</string> </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_data_web/bt/revision b/master/bt5/vifib_data_web/bt/revision index bd753ccc4..90be1cdd8 100644 --- a/master/bt5/vifib_data_web/bt/revision +++ b/master/bt5/vifib_data_web/bt/revision @@ -1 +1 @@ -94 \ No newline at end of file +95 \ No newline at end of file diff --git a/master/bt5/vifib_data_web/bt/template_path_list b/master/bt5/vifib_data_web/bt/template_path_list index 3246059ab..350267b02 100644 --- a/master/bt5/vifib_data_web/bt/template_path_list +++ b/master/bt5/vifib_data_web/bt/template_path_list @@ -3,6 +3,8 @@ image_module/vifib.kvm image_module/vifib.rack portal_caches/facebook_server_auth_token_cache_factory portal_caches/facebook_server_auth_token_cache_factory/volatile_cache_plugin +portal_caches/google_server_auth_token_cache_factory +portal_caches/google_server_auth_token_cache_factory/volatile_cache_plugin web_page_module/vifib* web_site_module/cash web_site_module/cash/** diff --git a/master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_id_property.xml b/master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_id_property.xml new file mode 100644 index 000000000..4f57bd07b --- /dev/null +++ b/master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_id_property.xml @@ -0,0 +1,65 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Standard Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>mode</string> </value> + </item> + <item> + <key> <string>type</string> </key> + <value> <string>string</string> </value> + </item> + </dictionary> + </tuple> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>elementary_type/string</string> + </tuple> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string>Google application id.</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>preferred_vifib_google_application_id_property</string> </value> + </item> + <item> + <key> <string>mode</string> </key> + <value> <string>w</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Standard Property</string> </value> + </item> + <item> + <key> <string>preference</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>property_default</string> </key> + <value> <string>python: \'\'</string> </value> + </item> + <item> + <key> <string>write_permission</string> </key> + <value> <string>Manage properties</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_secret_property.xml b/master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_secret_property.xml new file mode 100644 index 000000000..25afb69ab --- /dev/null +++ b/master/bt5/vifib_slap/PropertySheetTemplateItem/portal_property_sheets/VifibSystemPreference/preferred_vifib_google_application_secret_property.xml @@ -0,0 +1,65 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Standard Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>mode</string> </value> + </item> + <item> + <key> <string>type</string> </key> + <value> <string>string</string> </value> + </item> + </dictionary> + </tuple> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>elementary_type/string</string> + </tuple> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string>Facebook application secret.</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>preferred_vifib_google_application_secret_property</string> </value> + </item> + <item> + <key> <string>mode</string> </key> + <value> <string>w</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Standard Property</string> </value> + </item> + <item> + <key> <string>preference</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>property_default</string> </key> + <value> <string>python: \'\'</string> </value> + </item> + <item> + <key> <string>write_permission</string> </key> + <value> <string>Manage properties</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib.xml index 47114403d..6edfd04ea 100644 --- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib.xml +++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib.xml @@ -114,6 +114,8 @@ <string>my_preferred_vifib_facebook_application_id</string> <string>my_preferred_vifib_facebook_application_secret</string> <string>my_preferred_vifib_rest_api_login_check</string> + <string>my_preferred_vifib_google_application_id</string> + <string>my_preferred_vifib_google_application_secret</string> </list> </value> </item> diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_id.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_id.xml new file mode 100644 index 000000000..65a1d8f31 --- /dev/null +++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_id.xml @@ -0,0 +1,96 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_preferred_vifib_google_application_id</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_string_field</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Preferred Google Application Id</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_secret.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_secret.xml new file mode 100644 index 000000000..bae82d503 --- /dev/null +++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/SystemPreference_viewVifib/my_preferred_vifib_google_application_secret.xml @@ -0,0 +1,96 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_preferred_vifib_google_application_secret</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_string_field</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Preferred Google Application Secret</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_slap/bt/revision b/master/bt5/vifib_slap/bt/revision index 7392849d5..19e03cffa 100644 --- a/master/bt5/vifib_slap/bt/revision +++ b/master/bt5/vifib_slap/bt/revision @@ -1 +1 @@ -775 \ No newline at end of file +776 \ No newline at end of file diff --git a/master/bt5/vifib_web/ExtensionTemplateItem/ViFiBWeb.py b/master/bt5/vifib_web/ExtensionTemplateItem/ViFiBWeb.py index 152c85ee7..029492765 100644 --- a/master/bt5/vifib_web/ExtensionTemplateItem/ViFiBWeb.py +++ b/master/bt5/vifib_web/ExtensionTemplateItem/ViFiBWeb.py @@ -29,7 +29,13 @@ import subprocess import facebook from Products.ERP5Type.Cache import DEFAULT_CACHE_SCOPE import httplib +import urllib import urlparse +import json +import apiclient.discovery +import httplib2 +import oauth2client.client +import socket def formatXml(self, xml): """Simple way to have nicely formatted XML""" @@ -78,10 +84,73 @@ def Facebook_getAccessTokenFromCode(self, code, redirect_uri): app_id=self.portal_preferences.getPreferredVifibFacebookApplicationId(), app_secret=self.portal_preferences.getPreferredVifibFacebookApplicationSecret()) +# Google AS +def Google_setServerToken(self, key, body): + setServerToken(self, key, body, 'google_server_auth_token_cache_factory') + +def Google_getServerToken(self, key): + return getServerToken(self, key, 'google_server_auth_token_cache_factory') + +def Facebook_getAccessTokenFromCode(self, code, redirect_uri): + return facebook.get_access_token_from_code(code=code, + redirect_uri=redirect_uri, + app_id=self.portal_preferences.getPreferredVifibFacebookApplicationId(), + app_secret=self.portal_preferences.getPreferredVifibFacebookApplicationSecret()) + +def Google_getAccessTokenFromCode(self, code, redirect_uri): + connection_kw = {'host': 'accounts.google.com', 'timeout': 30} + connection = httplib.HTTPSConnection(**connection_kw) + data = { + 'client_id': self.portal_preferences.getPreferredVifibGoogleApplicationId(), + 'client_secret': self.portal_preferences.getPreferredVifibGoogleApplicationSecret(), + 'grant_type': 'authorization_code', + 'redirect_uri': redirect_uri, + 'code': code + } + data = urllib.urlencode(data) + headers = { + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "*/*" + } + connection.request('POST', '/o/oauth2/token', data, headers) + response = connection.getresponse() + + if response.status != 200: + return None + + try: + body = json.loads(response.read()) + except Exception: + return None + + try: + return body + except Exception: + return None + def Facebook_getUserId(access_token): facebook_entry = facebook.GraphAPI(access_token).get_object("me") return facebook_entry['id'].encode('utf-8') +def Google_getUserId(access_token): +# import ipdb ; ipdb.set_trace() + timeout = socket.getdefaulttimeout() + try: + # require really fast interaction +# socket.setdefaulttimeout(10) + http = oauth2client.client.AccessTokenCredentials(access_token, 'Vifib' + ).authorize(httplib2.Http()) + service = apiclient.discovery.build("oauth2", "v1", http=http) + google_entry = service.userinfo().get().execute() + except Exception: + google_entry = None + finally: + socket.setdefaulttimeout(timeout) + + if google_entry is not None: + return google_entry['id'].encode('utf-8') + return None + def Facebook_checkUserExistence(self): hash = self.REQUEST.get('__ac_facebook_hash') try: @@ -90,7 +159,7 @@ def Facebook_checkUserExistence(self): return False access_token = access_token_dict.get('access_token') url = urlparse.urlsplit(self.portal_preferences.getPreferredVifibRestApiLoginCheck()) - connection_kw = {'host': url.netloc, 'timeout': 5} + connection_kw = {'host': url.netloc, 'timeout': 30} if url.scheme == 'http': connection = httplib.HTTPConnection(**connection_kw) else: @@ -102,3 +171,24 @@ def Facebook_checkUserExistence(self): # user exist if server gave some correct response without waiting for user return response.status in (200, 204) + +def Google_checkUserExistence(self): + hash = self.REQUEST.get('__ac_google_hash') + try: + access_token_dict = Google_getServerToken(self, hash) + except KeyError: + return False + access_token = access_token_dict.get('access_token') + url = urlparse.urlsplit(self.portal_preferences.getPreferredVifibRestApiLoginCheck()) + connection_kw = {'host': url.netloc, 'timeout': 30} + if url.scheme == 'http': + connection = httplib.HTTPConnection(**connection_kw) + else: + connection = httplib.HTTPSConnection(**connection_kw) + connection.request('GET', url.path, headers = { + 'Authorization' : 'Google %s' % access_token, + 'Accept': 'application/json'}) + response = connection.getresponse() + + # user exist if server gave some correct response without waiting for user + return response.status in (200, 204) diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_checkUserExistence.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_checkUserExistence.xml new file mode 100644 index 000000000..0bcae7b9a --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_checkUserExistence.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>Google_checkUserExistence</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ViFiBWeb</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Google_checkUserExistence</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getAccessTokenFromCode.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getAccessTokenFromCode.xml new file mode 100644 index 000000000..d0adfe9a7 --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getAccessTokenFromCode.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>Google_getAccessTokenFromCode</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ViFiBWeb</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Google_getAccessTokenFromCode</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getServerToken.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getServerToken.xml new file mode 100644 index 000000000..2a338c3b1 --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getServerToken.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>Google_getServerToken</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ViFiBWeb</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Google_getServerToken</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getUserId.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getUserId.xml new file mode 100644 index 000000000..c8470b08f --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_getUserId.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>Google_getUserId</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ViFiBWeb</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Google_getUserId</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_setServerToken.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_setServerToken.xml new file mode 100644 index 000000000..9b2533411 --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/Google_setServerToken.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>Google_setServerToken</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ViFiBWeb</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Google_setServerToken</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_facebookCallbackLogin.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_facebookCallbackLogin.xml index ab0718532..6147ac9b7 100644 --- a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_facebookCallbackLogin.xml +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_facebookCallbackLogin.xml @@ -65,7 +65,7 @@ elif get(\'code\') is not None:\n hash = context.Base_getHMAC(access_token, access_token)\n context.REQUEST.RESPONSE.setCookie(\'__ac_facebook_hash\', hash, path=\'/\')\n context.Facebook_setServerToken(hash, access_token_dict)\n - return context.Base_redirect(context.getWebSiteValue().absolute_url())\n + return context.REQUEST.RESPONSE.redirect(context.getWebSiteValue().absolute_url())\n return handleError()\n </string> </value> </item> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleCallbackLogin.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleCallbackLogin.xml new file mode 100644 index 000000000..685e2e62d --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleCallbackLogin.xml @@ -0,0 +1,83 @@ +<?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>_body</string> </key> + <value> <string>get = context.REQUEST.get\n +\n +def handleError():\n + context.Base_redirect(\'login_form\', keep_items={"portal_status_message": "There was problem with Google login: %s. Please try again later." % get(\'error\')})\n +\n +if get(\'error\') is not None:\n + return handleError()\n +elif get(\'code\') is not None:\n + access_token_dict = context.Google_getAccessTokenFromCode(get(\'code\'), context.absolute_url())\n + if access_token_dict is not None:\n + access_token = access_token_dict[\'access_token\'].encode(\'utf-8\')\n + access_token_dict[\'login\'] = \'go_\' + context.Google_getUserId(access_token)\n + hash = context.Base_getHMAC(access_token, access_token)\n + context.REQUEST.RESPONSE.setCookie(\'__ac_google_hash\', hash, path=\'/\')\n + context.Google_setServerToken(hash, access_token_dict)\n + return context.REQUEST.RESPONSE.redirect(context.getWebSiteValue().absolute_url())\n +return handleError()\n +</string> </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>code=None, error=None</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>WebSection_googleCallbackLogin</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleInitiateLogin.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleInitiateLogin.xml new file mode 100644 index 000000000..03e667f6d --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_googleInitiateLogin.xml @@ -0,0 +1,75 @@ +<?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>_body</string> </key> + <value> <string>from ZTUtils import make_query\n +query = make_query({\n + \'response_type\': \'code\',\n + \'client_id\': context.portal_preferences.getPreferredVifibGoogleApplicationId(),\n + \'redirect_uri\': context.google_callback.absolute_url(),\n + \'scope\': \'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email\'\n +})\n +\n +context.REQUEST.RESPONSE.redirect(\'\'\'https://accounts.google.com/o/oauth2/auth?\'\'\' + query)\n +</string> </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>WebSection_googleInitiateLogin</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder.xml index ce00c76d4..3009d1481 100644 --- a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder.xml +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder.xml @@ -104,7 +104,8 @@ <key> <string>normal</string> </key> <value> <list> - <string>your_user_preparation</string> + <string>your_user_preparation_facebook</string> + <string>your_user_preparation_google</string> </list> </value> </item> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation_facebook.xml similarity index 99% rename from master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation.xml rename to master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation_facebook.xml index 3dedf96ff..5e84ac054 100644 --- a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation.xml +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation_facebook.xml @@ -8,7 +8,7 @@ <dictionary> <item> <key> <string>id</string> </key> - <value> <string>your_user_preparation</string> </value> + <value> <string>your_user_preparation_facebook</string> </value> </item> <item> <key> <string>message_values</string> </key> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation_google.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation_google.xml new file mode 100644 index 000000000..94921076e --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewVifibKVMOrder/your_user_preparation_google.xml @@ -0,0 +1,335 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="EditorField" module="Products.ERP5Form.EditorField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>your_user_preparation_google</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + <item> + <key> <string>line_too_long</string> </key> + <value> <string>A line was too long.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>You entered too many characters.</string> </value> + </item> + <item> + <key> <string>too_many_lines</string> </key> + <value> <string>You entered too many lines.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>height</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>text_editor</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>width</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>height</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>text_editor</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>width</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string encoding="cdata"><![CDATA[ + +<script type="text/JavaScript">\n +<!--\n +function timedRefresh(timeoutPeriod) {\n +setTimeout("location.reload(true);",timeoutPeriod);\n +}\n +timedRefresh(3000);\n +// -->\n +</script>\n +<p><img src="ERP5VCS_imgs/wait.gif"></p>\n +We are preparing your user. + +]]></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>height</string> </key> + <value> <int>5</int> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>text_editor</string> </key> + <value> <string>text_area</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>your_user_preparation</string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>width</string> </key> + <value> <int>40</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: here.REQUEST.get(\'__ac_google_hash\') is not None and not here.Google_checkUserExistence()</string> </value> + </item> + </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: \'\'</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSite_logout.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSite_logout.xml index e7b766eef..6f2a4efb7 100644 --- a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSite_logout.xml +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSite_logout.xml @@ -179,6 +179,7 @@ if REQUEST.has_key(\'portal_skin\'):\n context.portal_skins.clearSkinCookie()\n REQUEST.RESPONSE.expireCookie(\'__ac\', path=\'/\')\n REQUEST.RESPONSE.expireCookie(\'__ac_facebook_hash\', path=\'/\')\n +REQUEST.RESPONSE.expireCookie(\'__ac_google_hash\', path=\'/\')\n msg = context.Base_translateString(\'You have been logged out. Thank you for using this website.\')\n return website.Base_redirect(form_id, keep_items = {\'portal_status_message\' : msg}, **kw)\n </string> </value> diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/login_form.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/login_form.xml index e30b6d792..ff0fd2efd 100644 --- a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/login_form.xml +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/login_form.xml @@ -65,7 +65,8 @@ tal:attributes="value request/came_from" />\n <fieldset>\n <div class="field nolabel validate widthAuto forgotten_password">\n - You can <a href="./login_with_facebook">login with with <img width="25px" src="./vifib_image/facebook_logo.png" alt="Facebook" title="Facebook"></a>, or use traditional methods below.\n + You can login with with <a href="./login_with_facebook"><img width="25px" src="./vifib_image/facebook_logo.png" alt="Facebook" title="Facebook"></a>,\n + with <a href="./login_with_google"><img src="./vifib_image/google_logo.png" alt="Google" title="Google"></a>, or use traditional methods below.\n </div>\n <div class="field login_name">\n <label for="name" class="required" i18n:translate="" i18n:domain="ui">Name</label>\n diff --git a/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/vifib_image/google_logo.png.xml b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/vifib_image/google_logo.png.xml new file mode 100644 index 000000000..8b7a66e96 --- /dev/null +++ b/master/bt5/vifib_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/vifib_image/google_logo.png.xml @@ -0,0 +1,92 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Image" module="OFS.Image"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_EtagSupport__etag</string> </key> + <value> <string>ts41840780.52</string> </value> + </item> + <item> + <key> <string>__name__</string> </key> + <value> <string>google_logo.png</string> </value> + </item> + <item> + <key> <string>content_type</string> </key> + <value> <string>image/png</string> </value> + </item> + <item> + <key> <string>data</string> </key> + <value> <string encoding="base64">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</string> </value> + </item> + <item> + <key> <string>height</string> </key> + <value> <int>23</int> </value> + </item> + <item> + <key> <string>precondition</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <int>2563</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>width</string> </key> + <value> <int>66</int> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/vifib_web/bt/revision b/master/bt5/vifib_web/bt/revision index bbb3d1899..903dc0f53 100644 --- a/master/bt5/vifib_web/bt/revision +++ b/master/bt5/vifib_web/bt/revision @@ -1 +1 @@ -389 \ No newline at end of file +390 \ No newline at end of file -- 2.30.9