v1rusxx
  •  v1rusxx
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-08-06T20:05:49Z
I have install yaf forum on a separate folder name forum so the whole path be like \forumtest\forum, I have already set it up and is working. Now what I want to do is use the yaf user role and authentication to limit who can see certain pages.

Example I created a folder name cool and in cool i added a page name cool.aspx. I have also added a web.config file into the cool directory to allow who can view this page.

here is my web.config file in the cool directory

<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<!--<allow roles="Administrators" />-->
<allow users="*"/>
<deny users="*"/>
</authorization>
</system.web>
<!-- Allow all users to visit RoleBasedAuthorization.aspx -->
<location path="#">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>

</configuration>

If i am login it will let me view teh cool.aspx page but if i am not login and I try to view cool it tries to redirect me to
/forumtest/login.aspx. /forumtest is my root directory but the login is not in my root directory but in the /forum directory.

so my question is how can i redirect users trying to visit cool.aspx to the yaf login page so they can log in and view teh cool.aspx page?
Sponsor
tha_watcha
2012-08-06T22:19:50Z
If i understand correctly you need a custom Login Redirect Url? if yes there is a Host Setting for that "Custom Login Redirect Url"
UserPostedImage
v1rusxx
  •  v1rusxx
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-08-07T02:46:07Z
Originally Posted by: tha_watcha 

If i understand correctly you need a custom Login Redirect Url? if yes there is a Host Setting for that "Custom Login Redirect Url"



Let me better explain
I have a page name cool.aspx under \forumtest\cool\cool.aspx and when i am not log into the page and i click on the cool link it should redirect me to the forum log page which is http://localhost:65526/forumtest/forum/yaf_login.aspx, it actually tries to redirect me to /forumtest/login.aspx which is wrong since i dont have a page login.aspx in the rootdirectory which is /forumtest.

here are some SS to help maybe piece together what i mean
v1rusxx attached the following image(s):
tha_watcha
2012-08-07T12:10:36Z
Did you set the AppRoot & FileRoot Setting in the app.config correctly?

  <add key="YAF.FileRoot" value="~/forum"/>
  <add key="YAF.AppRoot" value="~/forum" />

UserPostedImage
v1rusxx
  •  v1rusxx
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2012-08-07T13:05:31Z
Originally Posted by: tha_watcha 

Did you set the AppRoot & FileRoot Setting in the app.config correctly?

  <add key="YAF.FileRoot" value="~/forum"/>
  <add key="YAF.AppRoot" value="~/forum" />



that-watcha How would you go about implementing a directory with pages that only register users will see. Example

Having a directory name Members1/ and in Members1 there would be pages name page1.aspx and page2.aspx, this pages would only be seen by register login users, guest wouldnt be able to see them. If the guest tries to click on them link for page1.aspx it would redirect them to the actuall yaf forum login so they can autheticate and if they have the proper rights to see page1.aspx it would redirect them back to page1.aspx but now as a user that has already been authenticated. Any suggestions? Maybe do something like this in your samplewebapplication so i can see how you work it all out.

Again thanks so much

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