source: TI12-security/trunk/python/ndg.security.client/ndg/security/client/ssoclient/ssoclient/templates/ndg/security/ndgPage.kid @ 3918

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.client/ndg/security/client/ssoclient/ssoclient/templates/ndg/security/ndgPage.kid@3918
Revision 3918, 5.3 KB checked in by pjkersha, 12 years ago (diff)

Initial Integration of Single Sign On Service with OpenID and Pylons AuthKit?:

  • WAYF now contains an OpenID textbox for sign in
  • No role integration carried out yet - OpenID has no better privileges than an anonymous user(!)
  • Integrated into Authkit - requires lots of config settings in pylons ini file
  • HTTP 401 error get redirected automatically to WAYF
  • Need to create an AuthKit? egg from SVN 151 checkout - will put on NDG dist
Line 
1<!-- This is a bunch of named templates for use in pages -->
2<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#">
3   
4    <!-- HTML Header and Document header follow -->
5   
6    <head py:def="pagehead()" py:strip="True">
7        <title py:content="c.title">title</title>
8        <!--! The following includes the javascript, note that the XML
9        function is needed to avoid escaping the < character -->
10        ${XML(h.javascript_include_tag(builtins=True))}
11        <script type="text/javascript" src="$g.ndg.security.common.sso.cfg.server/js/toggleDiv.js"/>
12
13        <link media="all, screen" href="$g.ndg.security.common.sso.cfg.server/layout/ndg2.css" type="text/css" rel="stylesheet"/>
14        <link rel="icon" type="image/ico" href="$g.ndg.security.common.sso.cfg.server/layout/favicon.jpg" />
15
16    </head>
17
18    <div py:def="header()">
19        <div id="header"/>
20        <div id="logo"><img src="$g.ndg.security.common.sso.cfg.LeftLogo" alt="$g.ndg.security.common.sso.cfg.LeftAlt" /></div>
21    </div>
22   
23    <div py:def="PageTabs(tabv)" id="PageTabs">
24        <div id="PageTabRow">
25            <ul>
26                <span py:for="tab in c.pageTabs">
27                    <?python
28                    linkto=True
29                    if tab[0] == tabv:
30                        status='current'
31                        linkto=False
32                    else: status='hidden'
33                    ?>
34                    <li class="$status"><span class="pagetab">
35                        ${XML(h.link_to_if(linkto,tab[0],tab[1]))}
36                    </span></li>
37                 </span>
38            </ul>
39        </div>
40        <div class="line"/>
41        <div class="clear"/>
42    </div>
43    <py if="c.UpdatePageTabs" py:replace="PageTabs(c.current)"/>
44
45    <!-- Page Footer follows -->
46    <div py:def="footer(showLoginStatus=True)" id="Footer">
47        <center><table><tbody>
48            <tr>
49                <td align="left" width="60%">
50                    <table><tbody>
51                    <tr><td><span py:replace="linkimage(g.ndg.security.common.sso.cfg.ndgLink,g.ndg.security.common.sso.cfg.ndgImage,'NDG')"/></td>
52                    <td> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a>
53                    ${g.ndg.security.common.sso.cfg.disclaimer} </td>
54                    </tr>
55                    </tbody></table>
56                </td>
57                <td width="40%" align="center">
58                    <div py:if="showLoginStatus" id="loginStatus">
59                        <!--! now we choose one of the next two (logged in or not) -->
60                        <div py:if="'ndgSec' in session"><table><tbody><tr><td>
61                        User [${session['ndgSec']['u']}] logged in at
62                        ${session['ndgSec']['org']} with roles
63                        [${len(session['ndgSec']['roles'])==1 and session['ndgSec']['roles'][0] or ', '.join(session['ndgSec']['roles'])}]</td><td>
64                        &nbsp;<span py:replace="logOut()"/></td></tr></tbody></table></div>
65                        <div py:if="'ndgSec' not in session">Further services maybe available if you can
66                            <span py:replace="logIn()"/></div>
67                    </div>
68                </td>
69                <td align="right"><span py:replace="linkimage(g.ndg.security.common.sso.cfg.stfcLink,g.ndg.security.common.sso.cfg.stfcImage,'Hosted by the STFC CEDA')"/></td>
70            </tr>
71        </tbody></table></center>
72    </div>
73   
74    <!-- Utility Functions follow -->
75   
76    <!-- hyperlinked image -->
77    <span py:def="linkimage(linkref,imageref,alttext)">
78        <a href="$linkref"><image src="$imageref" alt="$alttext" title="$alttext"/></a>
79    </span>
80   
81    <!-- Help Icons -->
82    <span py:def="helpIcon(value)">
83        <span>
84            <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','div'); return false;">
85            <img src="$g.ndg.security.common.sso.cfg.helpIcon" alt="Toggle help" class="helpicon"/></a>     
86        </span>
87    </span>
88   
89    <!-- Login and out buttons -->   
90    <span py:def="logOut()" class="logOut">
91            <?python
92            from base64 import urlsafe_b64encode
93           
94            # Base 64 encode to enable passing around in 'r' argument of query
95            # string for use with login/logout
96            g.ndg.security.common.sso.returnToURL = c.requestURL
97            g.ndg.security.common.sso.b64encReturnToURL = urlsafe_b64encode(c.requestURL)
98            ?>
99        <form action="$g.ndg.security.common.sso.cfg.logoutURI">
100            <input type="hidden" name="r" value="${g.ndg.security.common.sso.b64encReturnToURL}"/>
101            <input type="submit" value="Logout"/>
102        </form>
103    </span>
104   
105    <span py:def="logIn()" class="logIn">
106            <?python
107            from base64 import urlsafe_b64encode
108           
109            # Base 64 encode to enable passing around in 'r' argument of query
110            # string for use with login/logout
111            g.ndg.security.common.sso.returnToURL = c.requestURL
112            g.ndg.security.common.sso.b64encReturnToURL = urlsafe_b64encode(c.requestURL)
113            ?>
114        <form action="$g.ndg.security.common.sso.cfg.wayfuri">
115            <input type="hidden" name="r" value="${g.ndg.security.common.sso.b64encReturnToURL}"/>
116            <input type="submit" value="Login"/>
117        </form>
118    </span>
119   
120   
121   
122</html>
Note: See TracBrowser for help on using the repository browser.