Window Login Redirect

Topics: Customizing Orchard
Jul 27, 2012 at 4:01 PM

I Posted a reply to Logon Modal Popup at http://orchard.codeplex.com/discussions/283250
I have a question within that, I need a answer to; if possible of how to get the Kendo logon popup to logon and stay on the same page the Orchard.Users Account controller prevents me from doing anything to <form action="something" ...

The code for the window and logon below:

@using System.Web.Mvc;
@{

    Style.Require("openIdStyles");
    
    Script.Require("jQuery");
    Script.Require("openIdSelector");
    Script.Require("openIdLocalization");
}
@using(Script.Foot()) {
<script type="text/javascript">
    $(document).ready(function () {
        openid.setSignInText('Sign In');
        openid.init('ExternalIdentifier');
        //openid.setDemoMode(true); //Stops form submission for client javascript-only test purposes
    });
</script>
    <script type="text/javascript">// <![CDATA[
        $("#window").kendoWindow({ actions: ["Minimize", "Maximize", "Close"], title: "Quick Login", visible: false }); $("#openButton").click(function() { var a = $("#window").data("kendoWindow"); a.center(); a.open() });
        // ]]>
    </script>
}
<div class="user-display">
    @if (WorkContext.CurrentUser != null)
    {
        <span class="k-button">
            @T("Welcome, <strong>{0}</strong>!", new HtmlString(Html.ActionLink(WorkContext.CurrentUser.UserName, "Edit", new { Controller = "Home", Area = "Contrib.Profile" } ).ToString()))
            @Html.ActionLink(T("Change password").ToString(), "ChangePassword", new { Controller = "Account", Area = "Orchard.Users" })
        </span>
        <span class="k-button">
            @Html.ActionLink(T("Sign Out").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
            @if (AuthorizedFor(Orchard.Security.StandardPermissions.AccessAdminPanel))
            {
                @Html.ActionLink(T("Dashboard").ToString(), "Index", new { Area = "Dashboard", Controller = "Admin" })
            }
        </span>
    }
    else
    {
        
    <div class="align-right-login-head" id="loginhead"><button id="openButton" class="loginhead"></button></div>
    <div style="display: none;">
    <div id="window">                
    <span id="registerimg"><a href="/Users/Account/Register" title="Register">Register<button id="register" class="registerimg" title="Registration Window" value="/Users/Account/Register"></button></a><a href="/Users/Account/RequestLostPassword" title="Lost Password?">Lost Password?<button id="lostpassword" class="registerimg" title="Lost Password?"></button></a></span>
    <form action="/Users/Account/LogOn?ReturnUrl=%2F" method="post">
    <fieldset class="login-form group">
        <legend>Account Information</legend>
        <ol>
            <li>
                <input id="username-email" name="userNameOrEmail" type="text" value="" title="Enter Your Name or Email" placeholder="Enter Your Name or Email" />       
            </li>
            <li>
                 <input id="password" name="password" type="password" title="Enter Your Password" placeholder="Enter Your Password" />       
            </li>
            <li>
                 <button class="k-button" type="submit" title="Sign In">Sign In</button><span class="center"><a href="/Users/Account/LogOff" title="Sign Out"><button id="signout"class="k-button" type="submit">Sign Out</button></a></span>
            </li>
        </ol>
    </fieldset> 
    <input name="__RequestVerificationToken" type="hidden" value="npqb0a7kuWsIjAH6GHMPhTEpNLCZKisfvJqmKY60NxJOOuO8/XvLZ3rHnFJN7eA3DiDfjjhPscnEOmwWehZT1mSuxKGnqjRTWzmuk8+N4TJC1rE0cdYu1ncmQjryGrj2JQ4gNtsUAmo+dA2Ymh38TKLCtpvQiE0829TzMqLCOdUG+G5G/6UNewGoiOzxp0Tcp5ALCw==">                        
    </form>
    <div class="center"><a href="https://www.myopenid.com/signup?affiliate_id=72583" target="_blank">Get an OpenID with myOpenID!</a></div>         
    <form action="/OpenId/LogOn?ReturnUrl=%2F" id="openid_form" method="post"><input type="hidden" name="action" value="verify" />
    <fieldset class="login-form group">
        <legend>OpenID account</legend>
         <ol>
             <li>
                <div id="openid_choice">
			        <p>Please click your account provider:</p>
				    <div id="openid_btns"></div>
			    </div>
            </li>
            <li>
                <div id="openid_input_area">
                    <label for="ExternalIdentifier">Enter manually your OpenID</label>
                    <input autofocus="autofocus" class="textMedium" id="ExternalIdentifier" name="ExternalIdentifier" type="text" value="http://" />
                    <button class="k-button" type="submit">Sign In</button>
                </div>
            </li>
        </ol>
     <input name="__RequestVerificationToken" type="hidden" value="vCz4X5IC4I8nf91jA68ReaEuGuolDKg5XOhiPhgNirA0Z2+w/vH/QqcoTl8KRllDaoIL7Pt5loTUCpW0TuGuEd8yEcWkx6xG5RXM7Cc7uZafEBUhW5OrKABzdWXfxoznukHubR6T+3OLcxSnjMd0ckvhrs6i/vE50cAqrbERcP1UiK/8dQJypTiEryT3nY6djPBVaQ==" />
     </fieldset>
     </form>
     <fieldset class="twitterfacebookoauth">
        <a href="/OAuth/LogOn?ReturnUrl=%2F&amp;KnownProvider=Twitter" title="Login With Your Twitter Account. Or Associate Twitter with your Mansbooks registration profile.">
            <img Class="btntwitter" alt="Twitter" src="../../Modules/NGM.OpenAuthentication/Content/oauth/images/twitter88.png" title="Twitter" />
        </a>
    </fieldset>
    <fieldset class="twitterfacebookoauth">
        <a href="/OAuth/LogOn?ReturnUrl=%2F&amp;KnownProvider=Facebook" title="Login With Your Facebook Account. Or Associate Facebook with your PubliusLogic registration profile.">
            <img Class=" btnfacebook" alt="Facebook" src="../../Modules/NGM.OpenAuthentication/Content/oauth/images/facebook88.png" title="Facebook" />
        </a>
     </fieldset>
    </div>
    </div>
    }
</div>

Coordinator
Jul 29, 2012 at 12:51 PM

I don't understand the question. Can you reformulate?

Aug 9, 2012 at 11:54 PM

Sorry for the delay.

I Created in 1.4.2 a shape with designer tools shape tracing User.cshtml, It will not create this shape without the profile module installed, instead it creates Logon.cshtml I wanted a logon popup window for auth and oauth on each page. I works for both regular authentication and oauth, except after post it redirects to the home page, no matter which page I use the logon popup window on. It still work's but after logon the user has to figure out where they were at, or click back on the browser to go to the page they logged in on. How would I get a logon form in orchard on every page to do auth logon and stay on that page. Orchard.Users Account controller is made for the redirect for just the Logon.cshtml shape. Even if I create a page as Signin.cshtml and change the link in my page to it, after auth it always goes to the home page not the page it came from.

Thank for the Help!

Don B.