Changeset 37628
- Timestamp:
- 2023-04-08T17:44:39+12:00 (13 months ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default/transform
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/pages/authen.xsl
r37627 r37628 65 65 </xsl:with-param> 66 66 </xsl:call-template> 67 <!--68 <form method="POST" action="{$library_name}/admin/{/page/pageRequest/paramList/param[@name = 's1.authpage']/@value}">69 <table id="loginTable">70 <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/>: </td><td><input type="text" name="username"/></td></tr>71 <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/>: </td><td><input type="password" name="password"/></td></tr>72 <tr><td><input type="submit" value="Login"/></td><td><xsl:text> </xsl:text></td></tr>73 </table>74 </form>75 <script type="text/javascript">76 <xsl:text disable-output-escaping="yes">77 {78 $("#loginTable input[name=\"username\"]").focus();79 }80 </xsl:text>81 </script>82 -->83 67 </xsl:when> 84 68 -
main/trunk/greenstone3/web/interfaces/default/transform/pages/login.xsl
r37627 r37628 74 74 <xsl:with-param name="action-url" select="/page/pageRequest/paramList/param[@name = 'redirectURL']/@value" /> 75 75 </xsl:call-template> 76 <!--77 <form method="POST"78 id="login-form"79 action="{/page/pageRequest/paramList/param[@name = 'redirectURL']/@value}">80 <table id="loginTable">81 <tr>82 <td colspan="2">83 <input type="text" name="username" style="width:95%;" autocomplete="username">84 <xsl:attribute name="placeholder">85 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/>86 </xsl:attribute>87 </input>88 </td>89 </tr>90 <tr>91 <td colspan="2">92 <input type="password" name="password" style="width:95%;" autocomplete="current-password">93 <xsl:attribute name="placeholder">94 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.password')"/>95 </xsl:attribute>96 </input>97 </td>98 </tr>99 <tr>100 <td colspan="2">101 <input name="googleidentity-signin" type="hidden" value="0" />102 <input type="submit" class="gsloginform"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_b')"/></xsl:attribute></input>103 </td>104 </tr>105 <xsl:if test="$googlesignin_client_id">106 <tr>107 <td colspan="2">108 <div class="hr-with-text">or</div>109 </td>110 </tr>111 <tr>112 <td colspan="2">113 <gsf:variable name="serlvetProtocol"><xsl:value-of select="/page/pageResponse/interfaceOptions/option[@name='servlet_protocol']/@value"/></gsf:variable>114 < ! - - <gsf:variable name="baseURL"><xsl:value-of select="/page/pageRequest/@baseURL"/></gsf:variable> - - >115 <gsf:variable name="redirectURL"><xsl:value-of select="/page/pageRequest/paramList/param[@name = 'redirectURL']/@value"/></gsf:variable>116 <gsf:div id="g_id_onload"117 data-client_id="{$googlesignin_client_id}"118 data-ux_mode="redirect">119 <xsl:attribute name="data-login_uri">120 <xsl:call-template name="generateGoogleIdentityLoginURL">121 <xsl:with-param name="servletProtocol" select="$servletProtocol"></xsl:with-param>122 < ! - -<xsl:with-param name="baseURL" select="$baseURL"></xsl:with-param> - - >123 <xsl:with-param name="baseURL" select="$base-href"></xsl:with-param>124 <xsl:with-param name="redirectURL" select="$redirectURL"></xsl:with-param>125 </xsl:call-template>126 127 </xsl:attribute>128 129 130 </gsf:div>131 132 <gsf:div class="g_id_signin" data-type="standard"/>133 134 </td>135 </tr>136 </xsl:if>137 138 </table>139 </form>140 141 <gsf:variable name="googleSigninClientId"><xsl:value-of select="/page/pageResponse/interfaceOptions/option[@name = 'googlesignin_client_id']/@value"/></gsf:variable>142 143 <gsf:script>144 145 function decodeJwtResponse(jwt) {146 // Split the JWT into its three parts147 var parts = jwt.split('.');148 149 // Decode the header and payload parts using base64150 var header = JSON.parse(atob(parts[0]));151 var payload = JSON.parse(atob(parts[1]));152 153 // Return an object containing the decoded header and payload154 //return {155 // header: header,156 // payload: payload157 //};158 return payload;159 160 }161 162 function googleSigninHandleCredentialResponseUNUSED(response)163 {164 console.log("onGoogleSignin() called");165 166 const responsePayload = decodeJwtResponse(response.credential);167 168 console.log("ID: " + responsePayload.sub);169 console.log('Full Name: ' + responsePayload.name);170 console.log('Given Name: ' + responsePayload.given_name);171 console.log('Family Name: ' + responsePayload.family_name);172 console.log("Image URL: " + responsePayload.picture);173 console.log("Email: " + responsePayload.email);174 console.log("Email verified: " + responsePayload.email_verified);175 176 177 var google_fullname = responsePayload.name;178 console.log('Google-authenicated login as: ' + google_fullname);179 180 //var googlesignin_id_token = googleUser.getAuthResponse().id_token;181 // //console.log('Google ID Token: ' + googlesignin_id_token);182 183 // $("#googlesignin_id_token").val(googlesignin_id_token);184 // $("#login-form").submit();185 186 187 }188 189 </gsf:script>190 191 <script type="text/javascript">192 <xsl:text disable-output-escaping="yes">193 {194 $("#loginTable input[name=\"username\"]").focus();195 }196 </xsl:text>197 </script>198 -->199 76 </xsl:template> 200 77 </xsl:stylesheet> -
main/trunk/greenstone3/web/interfaces/default/transform/shared-templates.xsl
r37627 r37628 274 274 function googleSigninHandleCredentialResponseUNUSED(response) 275 275 { 276 console.log("onGoogleSignin() called");276 //console.log("onGoogleSignin() called"); 277 277 278 278 const responsePayload = decodeJwtResponse(response.credential); 279 279 280 console.log("ID: " + responsePayload.sub);281 console.log('Full Name: ' + responsePayload.name);282 console.log('Given Name: ' + responsePayload.given_name);283 console.log('Family Name: ' + responsePayload.family_name);284 console.log("Image URL: " + responsePayload.picture);285 console.log("Email: " + responsePayload.email);286 console.log("Email verified: " + responsePayload.email_verified);280 //console.log("ID: " + responsePayload.sub); 281 //console.log('Full Name: ' + responsePayload.name); 282 //console.log('Given Name: ' + responsePayload.given_name); 283 //console.log('Family Name: ' + responsePayload.family_name); 284 //console.log("Image URL: " + responsePayload.picture); 285 //console.log("Email: " + responsePayload.email); 286 //console.log("Email verified: " + responsePayload.email_verified); 287 287 288 288 … … 297 297 </gsf:script> 298 298 299 <!--300 <script type="text/javascript">301 <xsl:text disable-output-escaping="yes">302 {303 $("#loginTable input[name=\"username\"]").focus();304 }305 </xsl:text>306 </script>307 -->308 309 299 </xsl:template> 310 300
Note:
See TracChangeset
for help on using the changeset viewer.