1
slander
restrict access
  • 2007/6/4 16:48

  • slander

  • Just popping in

  • Posts: 4

  • Since: 2007/6/4 1


I created a custom html page and added it to my XOOPS site. Its completely separate from any of the modules. I need to restrict access to this page so that users must login to view it. Can anyone tell me how I can do this, maybe by adding a piece of code to the html or something? thanks in advance

2
BroHam
Re: restrict access
  • 2007/6/4 17:44

  • BroHam

  • Just popping in

  • Posts: 100

  • Since: 2007/3/31


You can make your content a module, and you can set permissions for it like your other modules. Use something like Pagewrap. To acomplish this with Pagewrap, in a nutshell, you simply edit the info in the xoops_version.php to name the module, etc. Then, you place the code of your content in the appropriate middle area of the index.php file. Upload your modified Pagewrap folder to /modules/, install it like all other modules and configure permissions, etc.

Good luck.
I don't know.

3
slander
Re: restrict access
  • 2007/6/4 21:59

  • slander

  • Just popping in

  • Posts: 4

  • Since: 2007/6/4 1


well, that kind of works. The only problem is, when you're not logged in, you cant even see the link in the navigation menu. I want them to be able see the link for my custom page, even if not logged in, if they click on it while not logged in, it should take them to the restricted access page. Any idea how to do this?

4
BroHam
Re: restrict access
  • 2007/6/4 22:09

  • BroHam

  • Just popping in

  • Posts: 100

  • Since: 2007/3/31


Sure, I believe you can edit your Main Menu template (be sure to clone your template set first and edit only your cloned version's file(s)).
Add this after your module menu loop
<class="menuMain" href="<{$xoops_url}>/modules/modulename/


I believe that this will always remain visible to everyone, even anonymous visitors. Meanwhile, in SystemAdmin > Modules > Order, be sure to make your created module have a zero, so it is not visible twice. Then, your permissions should take care of the rest.

Another way to accomplish that would be to make the system main menu not visible and use something else like Multi Menu in its place. Or, you could make the replacement menu only visible to anonymous visitors. Whatever works best.

Just suggestions.
I don't know.

5
DobePhat
Re: restrict access
  • 2007/6/5 4:14

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


I reccommend to use a multimenu module if yu want to have custom links to such custom sections.

Scenario:
If its a main section, like one that registered members can click to and browse, but anonymous can click on the link (which also can have whatever title you want) but will get the "please register or sign in" message...

Also cjay content, tinycontent,etc-
all good mods for wrapping pages as well.

Login

Who's Online

346 user(s) are online (250 user(s) are browsing Support Forums)


Members: 0


Guests: 346


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits