Commit fc742752 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_core: Don't enable login buttons if the connector isnt configured

  If the login button isnt suppose to work, dont display it.
parent 7feb1a67
...@@ -3,9 +3,13 @@ oauth_login_list = [] ...@@ -3,9 +3,13 @@ oauth_login_list = []
portal_skin = context.getPortalObject().portal_skins portal_skin = context.getPortalObject().portal_skins
if getattr(portal_skin, "erp5_oauth_google_login", None) is not None: if getattr(portal_skin, "erp5_oauth_google_login", None) is not None:
connector = context.ERP5Site_getGoogleConnector()
if connector and connector[0].getClientId() is not None:
oauth_login_list.append("google") oauth_login_list.append("google")
if getattr(portal_skin, "erp5_oauth_facebook_login", None) is not None: if getattr(portal_skin, "erp5_oauth_facebook_login", None) is not None:
connector = context.ERP5Site_getFacebookConnector()
if connector and connector[0].getClientId() is not None:
oauth_login_list.append("facebook") oauth_login_list.append("facebook")
if getattr(portal_skin, "erp5_openid_connect_client", None) is not None: if getattr(portal_skin, "erp5_openid_connect_client", None) is not None:
......
...@@ -52,6 +52,14 @@ ...@@ -52,6 +52,14 @@
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_getAvailableOAuthLoginList</string> </value> <value> <string>ERP5Site_getAvailableOAuthLoginList</string> </value>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment