Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Subpages without password

Asked Modified Viewed 2,684 times
M
mauri1
M
mauri1 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
asked
Junior Member

:oWhen somebody could remember the address of my subpage, e.g. www.mypage.com/games then this sub is easily available without password! Can I do anything to protect the whole content which is supposed to be accessed for user only? I found no hints in Search... Thank you
0 replies

18 posts

E
engelavdod
E
i123.photobucket.com/albums/o297/engelavdod/stuff%20i%20made%20on%20CS2/engelavdod.jpg
  • Member, joined since
  • Contributed 53 posts on the community forums.
  • Started 17 threads in the forums
answered
Member

correct me if im wrong about this guys, but i think you can define the content with:

iGuest
iMember
iAdmin
iSuperAdmin

im pretty sure thats right
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

Yes it is right, but we need more info about mauri's subpages. How have You done that, since the entire system is/should be protected via the login?
0 replies
M
mauri1
M
mauri1 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Junior Member

It's, in fact, very simple. When you know the address of my subpage, you "bypass" the password. I heven't created any group of users, there are only 3 categories: Superadmin (it's me), user and guest. And for user there is an access to a few menu items e.g. Downloads...
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

You are useing PHPFusion on your subpages, aren't you?

Then you can use the iGuest, iMember, iAdmin or iSuperAdmin.

It is so:

if(iMember) {
echo "you are a member";
} else {
echo "you are not logged in";
}


But you also can give only some members access:
Put these members in a group an give only the group access to this page with check:

if (!checkgroup(4)) { redirect(BASEDIR."index.php"); }

There 4 is the id of the group
Edited by Basti on 27-08-2007 12:54,
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

But you can set access level on Custom Pages...:|
It is done in the dialogue above content, to the right of the Page Title.
Edited by Homdax on 27-08-2007 12:57,
0 replies
A
adicrst
A
  • Member, joined since
  • Contributed 111 posts on the community forums.
  • Started 32 threads in the forums
answered
Member

When you are creating a custom page, the access level can be set:

Page Title:sadasdads Access: public|member|admin and so on...
0 replies
M
mauri1
M
mauri1 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Junior Member

Quote

slaughter wrote:

But you also can give only some members access:
Put these members in a group an give only the group access to this page with check:

if (!checkgroup(4)) { redirect(BASEDIR."index.php"); }

There 4 is the id of the group


And this works good... I put the code (1 in place of 4) to weblinks.php and the link is not available to guest. But when I'm trying to put same code to my html page - it fails...
Example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

////here I put this:
<?php if (!checkgroup(4)) { redirect(BASEDIR."index.php"); } ?>

////
and I get the error:

Fatal error: Call to undefined function: checkgroup() in /home.5/s/e/j/sejsmika/www/sejsmika/tarczch/prod/prod.php on line 5
Where is the error? I tried to place the page in main catalogue but it doesn't matter...
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

Of course, it does not work. The file musst be a .php-file and you musst include the maincore.php at the beginnig of the file:


require_once "maincore.php";
0 replies
M
mauri1
M
mauri1 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Junior Member

My file is basically html, I renamed it to php and it generally works properly. This is its start:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
require_once "maincore.php";
if (!checkgroup(4)) { redirect(BASEDIR."index.php"wink; } ?>

<html>
/// and there are some references, etc. Still I'm getting this:

Warning: main(maincore.php) [function.main]: failed to open stream: No such file or directory in /home.5/s/e/j/sejsmika/www/sejsmika/tarczch/prod/prod.php on line 3

Fatal error: main() [function.require]: Failed opening required 'maincore.php' (include_path='.:/usr/local/lib/php'wink in /home.5/s/e/j/sejsmika/www/sejsmika/tarczch/prod/prod.php on line 3



Wihout php commands it's O.K. (but "open" for everybody). Excuse my annoying details but I'm hardly beginner to php...
0 replies
J
Josso
J
Josso 10
–––
Without faith, nothing is possible. With it, nothing is impossible
  • Senior Member, joined since
  • Contributed 309 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

The start may see like this:
<?php
require_once "../maincore.php";
if (!checkgroup(4)) { redirect(BASEDIR."index.php"); } ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

And remember to switch 4 out with the right ID. ;)
0 replies
M
mauri1
M
mauri1 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Junior Member

I copied maincore.php to the folder with prod.php and it finally opened; but there the following message appeared (at the top of the page):


Warning: Cannot modify header information - headers already sent by (output started at /home.5/s/e/j/sejsmika/www/sejsmika/tarczch/prod/prod.php:2) in /home.5/s/e/j/sejsmika/www/sejsmika/tarczch/prod/maincore.php on line 222

And the access is not denied for guests... Terrible...
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

You might want to include subheader.php and footer.php. Look at any of the original files code for hints.
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

In which folder do you have the file and in which folder is your config.php?
Edited by Basti on 27-08-2007 23:22,
0 replies
M
mauri1
M
mauri1 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Junior Member

I'm sorry for being out so long time, I'm back. I checked carefully my page prod.php and it looks like working now?!...
What I did:
- changed require_once ".../maincore.php"; to require_once "maincore.php"; , it looks now this way:

<?php
require_once "maincore.php";
if (!checkgroup(1)) { redirect(BASEDIR."index.php"wink; } ?>
<!DOCTYPE HTML PUBLIC "-//W...... etc.


- copied maincore.php to prod folder. So far it's OK.
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

Quote

mauri1 wrote:
I'm sorry for being out so long time, I'm back. I checked carefully my page prod.php and it looks like working now?!...
What I did:
- changed require_once ".../maincore.php"; to require_once "maincore.php"; , it looks now this way:

<?php
require_once "maincore.php";
if (!checkgroup(1)) { redirect(BASEDIR."index.php"); } ?>
<!DOCTYPE HTML PUBLIC "-//W...... etc.


- copied maincore.php to prod folder. So far it's OK.



You should not copy the maincore.php into an other folder.

Do this:

if your file is in this folder:
php-files/YOURFILE.php
then you hav to do this in your file:
require_once "maincore.php";


and if it looks so:
php-files/FOLDER/YOURFILE.php
then you hav to do this in your file:
require_once "../maincore.php";


and if it looks so:
php-files/FOLDER/FOLDER2/YOURFILE.php
then you hav to do this in your file:
require_once "../../maincore.php";


Do you understand how the path has to be? :)


//edit: Sry, Homy. my mistake :|
Edited by Basti on 28-08-2007 21:43,
0 replies
F
Falk
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

Quote

engelavdod wrote:
iGuest
iMember
iAdmin
iSuperAdmin


Nearly, but only the i is lower case, correct usage:

iGUEST
iMEMBER
iADMIN
iSUPERADMIN

0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

The path is "../../" not ".../.../"
TWO dots not THREE!

/ grmble...damn n00bs...:@
Edited by Homdax on 28-08-2007 21:35,
0 replies
M
mauri1
M
mauri1 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Junior Member

Thank you, I will make an order with slashes and folders... There is one more thing, that I finally understood: when my page (any) is *.php then I can protect it as I have actually done. When my reference is e.g. .../book.pdf or book.xls or so then it may be password bypassed. It means that each file that is supposed to be protected must be somehow "hidden" within php file. Thanks again...
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 18 posts
  • Votes 0 votes
  • Topic users 7 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet