From: Rob Crittenden Date: Fri, 4 Sep 2015 15:37:09 +0000 (-0400) Subject: Derive splink when registering SP, allow visible = True in SP portal X-Git-Tag: v1.1.0~10 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=commitdiff_plain;h=a770ce045f86abdfc1e61c630dbf146e4a59b4ad Derive splink when registering SP, allow visible = True in SP portal The splink value wasn't being passed when registering a new client. We don't need to prompt for this since we know it already Accept 'True' as a value for visible when determining if we should show a provider on the SP portal page. https://fedorahosted.org/ipsilon/ticket/148 Signed-off-by: Rob Crittenden Reviewed-by: Patrick Uiterwijk --- diff --git a/ipsilon/install/ipsilon-client-install b/ipsilon/install/ipsilon-client-install index 668cd58..44c3df3 100755 --- a/ipsilon/install/ipsilon-client-install +++ b/ipsilon/install/ipsilon-client-install @@ -153,12 +153,14 @@ def saml2(): logger.error("Failed to read SP Image file!\n" + "Error: [%s]" % e) + sp_link = 'https://%s%s' % (args['hostname'], args['saml_auth']) + # Register the SP try: saml2_register_sp(args['saml_idp_url'], args['admin_user'], admin_password, args['saml_sp_name'], sp_metadata, args['saml_sp_description'], - args['saml_sp_visible'], sp_image) + args['saml_sp_visible'], sp_image, sp_link) except Exception as e: # pylint: disable=broad-except logger.error("Failed to register SP with IDP!\n" + "Error: [%s]" % e) @@ -225,7 +227,7 @@ def saml2(): def saml2_register_sp(url, user, password, sp_name, sp_metadata, - sp_description, sp_visible, sp_image): + sp_description, sp_visible, sp_image, sp_link): s = requests.Session() # Authenticate to the IdP @@ -253,6 +255,7 @@ def saml2_register_sp(url, user, password, sp_name, sp_metadata, if sp_image: if sp_image: sp_data['imagefile'] = sp_image + sp_data['splink'] = sp_link sp_data = urlencode(sp_data) r = s.post(sp_url, headers=sp_headers, data=sp_data) diff --git a/templates/index.html b/templates/index.html index cf54fc4..db1339b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -86,7 +86,7 @@
{% for p in providers %} - {% if p.visible == '1' %} + {% if (p.visible == '1') or (p.visible == 'True') %}