YAFLogo

v1rusxx
  • v1rusxx
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
12 years ago
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

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
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago
If i understand correctly you need a custom Login Redirect Url? if yes there is a Host Setting for that "Custom Login Redirect Url"
v1rusxx
  • v1rusxx
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
12 years ago

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

Originally Posted by: tha_watcha 

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

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago
Did you set the AppRoot & FileRoot Setting in the app.config correctly?

  <add key="YAF.FileRoot" value="~/forum"/>
  <add key="YAF.AppRoot" value="~/forum" />
v1rusxx
  • v1rusxx
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
12 years ago

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

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

Originally Posted by: tha_watcha 

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