Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 140
    • Merge requests 140
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !179

Closed
Created Oct 11, 2016 by Gabriel Monnerat@gabrielDeveloper
  • Report abuse
Report abuse

Login in ERP5 with Google Account

  • Overview 41
  • Commits 79
  • Changes 441

This branch is a fork of allow_login_change and contains the feature to login in ERP5 with Google Account plus business templates migrated to the new format.

Feel free to review @cedric.leninivin @kazuhiko

I tried to add a script that creates automatically through upgrader, the ERP5 Google Extraction Plugin and enable it. But, this plugin only works if created manually. Any idea?

## Script (Python) "ERP5Site_setupGoogleLoginAccessTokenExtraction"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=fixit=False
##title=
##
token_extraction_id = "google_access_token_plugin"

pas = context.getPortalObject().acl_users
access_extraction_list = [q for q in pas.objectValues() \
  if q.meta_type == 'ERP5 Google Extraction Plugin']

assert len(access_extraction_list) <= 1, "More than one found %s" % access_extraction_list
result_list = []
if not access_extraction_list:
  # See https://github.com/Nexedi/erp5/commit/0bee523da0075c6efe3c06296dddd01d9dd5045a
  # a dump http extraction plugin is required as fallback if we use an access token
  if 'erp5_dumb_http_extraction' not in pas.objectIds():
    if fixit:
      dispacher = pas.manage_addProduct['ERP5Security']
      dispacher.addERP5DumbHTTPExtractionPlugin('erp5_dumb_http_extraction')
      pas.erp5_dumb_http_extraction.manage_activateInterfaces(('IExtractionPlugin', ))
      result_list.append('erp5_dumb_http_extraction created')
    else:
      result_list.append('erp5_dumb_http_extraction is required')

  if fixit:
    dispacher = pas.manage_addProduct['ERP5Security']
    dispacher.addERP5AccessTokenExtractionPlugin(token_extraction_id)
    getattr(pas, token_extraction_id).manage_activateInterfaces(('IExtractionPlugin',))
    result_list.append('%s created' % token_extraction_id)
  else:
    result_list.append('%s is required' % token_extraction_id)

return result_list
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: allow_login_change_merge_with_master
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7