wbd
  •  wbd
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
2009-02-11T14:06:43Z
This is NOT a integration question, I've got YAF integrated into my site beautifully and SSO works just fine.

I have my YAF set up so that guests have read-only access to all forums. But if a guest, for example, clicks on a user's name hyperlink in a post, they are redirected to YAF's login page (default.aspx?g=login...). I would like them to go to MY login page (~/Login.aspx) for the sake of consistency. Again, the YAF login page functions just fine, but I'd like my login page to be used at all times.

Is this possible?

Thanks in advance.
Sponsor
Jaben
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2009-02-11T15:43:32Z
You would need to modify the source. Unfortunately, a central function isn't being used for login... for that reason, you would need to modify quite a few pages. Do a source search for "YafBuildLink.Redirect( ForumPages.login"

and you'd need to modify all elements.

If you want to help the project, you could really assist by doing the following:

1. Create a method in YAF.Classes.Utils/BuildLink.cs called "RedirectLogin()"
2. Add the basic login code -- of course, you can modify for your source.
3. Change all redirects to call the "RedirectLogin" function instead of this code:

YafBuildLink.Redirect( ForumPages.login, "ReturnUrl={0}", General.GetSafeRawUrl() );

Interested? Otherwise, you are basically doing that much modifying but the next release you'd have to do the same thing :)


wbd
  •  wbd
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
2009-02-11T15:58:27Z
Thaks Jaben, I might be interested in doing that.

If I were to code this for the main source, where would you want the login page URL to be configured from?

For my purposes, the cleanest solution would be to have YafBuildLink.RedirectLogin() call System.Web.Security.FormsAuthentication.RedirectToLoginPage(). In my ASP.NET application, my logn page URL is configured in web.config under the //system.web/authentication(mode='Forms') node.

This is how I'd want it to work, but certainly this is too specific of an implementation for the YAF source?
sircutbreaker
2009-02-12T08:58:54Z
you can add a line to the url rewriter and solve it like that...

Here is my actual rewrite:

 <rewrite url="^~/forum/(.+?)?yaf_login?\.aspx\?returnurl\=(.+)$" to="~/login/Default.aspx?ReturnURL=$2" processing="stop" />


If you dont have your login in a folder, like I do, you will have to alter that....

If I am correct in reading your post, your line would read like this:

 <rewrite url="^~/forum/(.+?)?yaf_login?\.aspx\?returnurl\=(.+)$" to="~/login.aspx?ReturnURL=$2" processing="stop" />


just make sure that your authentication mode also points to your login page...

<authentication mode="Forms">
      <forms name=".YAFNET_Authentication" protection="All" timeout="43200" loginUrl="~/login/default.aspx" cookieless="UseCookies" />
    </authentication>


Works like a charm...
smithlanger1
2010-06-02T09:47:16Z
sounds good to me :wink: :wink:
smith

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved