I think the code that processes this decision needs to be on the Moodle side. I believe you can set up a chaining authentication in moodle... or maybe just a button for 'local authentication'?<br><br><div class="gmail_quote">
On Tue, Apr 17, 2012 at 1:18 PM, Wang, Holly <span dir="ltr"><<a href="mailto:holly.wang@csun.edu" target="_blank">holly.wang@csun.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">We have three kind of users, regular user log in through shibboleth, and moodle admin/guest will be just direct to moodle website for them to log in. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I am thinking weather the login page can see which website the user is logged in, then display different form based on the source. Do you think following code will work?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">StorageService storageService = HttpServletHelper.getStorageService(application);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">LoginContext loginContext = HttpServletHelper.getLoginContext(storageService,application, request);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">String entityId = loginContext.getRelyingPartyId();<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">if (loginContext.getRelyingPartyId().equals("<a href="http://moodle.net" target="_blank">http://moodle.net</a>")){<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">then display a different html form here<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">else{<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">the default html login form here<u></u><u></u></span></p>
<div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Holly Wang, IT Department CSUN, <a href="tel:818-677-2031" value="+18186772031" target="_blank">818-677-2031</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p></div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:users-bounces@shibboleth.net" target="_blank">users-bounces@shibboleth.net</a> [mailto:<a href="mailto:users-bounces@shibboleth.net" target="_blank">users-bounces@shibboleth.net</a>] <b>On Behalf Of </b>Karla Borecky<br>
<b>Sent:</b> Tuesday, April 17, 2012 10:14 AM<br><b>To:</b> Shib Users<br><b>Subject:</b> Re: any advice on how to modify the login.jsp page?<u></u><u></u></span></p></div><div><div><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Holly, could you possibly branch the behavior based on an attribute (after the authentication)? or is this something that has to happen to actually process the login in different ways?<u></u><u></u></p>
<div><p class="MsoNormal">On Mon, Apr 16, 2012 at 4:31 PM, Wang, Holly <<a href="mailto:holly.wang@csun.edu" target="_blank">holly.wang@csun.edu</a>> wrote:<u></u><u></u></p><p class="MsoNormal">Hi,<br><br>I am asked to modify shib login.jsp page so the form with take multiple submit command. Depending on the submit button value, we send the form to different places.<br>
<br>I did some testing, tried to add a new jsp page to handle it. But I can't find a place to define the servlet definition for the new jsp page.<br><br>Does anyone has an example on the login.jsp which takes multiple submit commend?<br>
<br>Current login.jsp form:<br><br><form action="j_security_check" method="post" autocomplete="off"><br><input type="text" id="uid" name="j_username" style="width:100px" value=""/><br>
<input type="password" name="j_password" style="width:100px"/><br><input type="submit" value="Login" /><br></form><br><br><br>We want it to be like following, but action lead to different places per the submit value:<br>
<br><form action=" " method="post" autocomplete="off"><br><input type="text" id="uid" name="j_username" style="width:100px" value=""/><br>
<input type="password" name="j_password" style="width:100px"/><br><input type="submit" value="Login" /><br><input value="moodleadmin" type="submit" name="moodleadmin" id="moodleadmin"><br>
</form><br><br>thanks<br><br>Holly Wang, IT Department CSUN, <a href="tel:818-677-2031" target="_blank">818-677-2031</a><br><br>--<br>To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net" target="_blank">users-unsubscribe@shibboleth.net</a><u></u><u></u></p>
</div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- <u></u><u></u></p><div style="margin-left:30.0pt"><p class="MsoNormal">Karla Borecky<br>
Systems Administrator<br>ITS<br>Smith College<br>Northampton, MA 01063<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div><br>--<br>
To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net" target="_blank">users-unsubscribe@shibboleth.net</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div style="margin-left:40px">
Karla Borecky<br>Systems Administrator<br>ITS<br>Smith College<br>Northampton, MA 01063<br></div><br>