How to use front-end visitor permissions
#16
Posted 29 September 2006 - 01:23 PM
Please correct me if I'm wrong.
#17
Posted 29 September 2006 - 03:42 PM
But what you want can definately be achieved using the information in this topic. As a matter of fact, I'm using the same functionality!
#18
Posted 23 October 2006 - 10:46 PM
i made a fresh install of etomite 0.6.1.2 and followed the instructions ... mostly. I did not update the index.php (1) as mentioned because i supposed eto 0.6.1.2 already contains the one with the new permission API. All the other steps i followed word by word and added the authListMenu and the LogInOut-Snippet to my template.
First it seemed to work. I can login as a member, but then i still have no access to my so-called "member-area". And when i log in i got redirected to my "login-failed.html"-page, but the snippet on that page shows me that i have successfully logged in.
This behaviour can be seen at my eto testsite:
http://test.bildcontext.org/etomite2/
I generated two members, the first as "member1" with pwd "testme", the second as "member2" with pwd "member2".
The Login-Link is at the bottom right, and the Member Area is the last point at the menu. For testing purposes now the standard ListMenu is used again.
It would be nice if someone could take a look and give me some advice. If it's necessary i also could provide access to the manager.
Edited by Jim Browski, 23 October 2006 - 10:55 PM.
#19
Posted 24 October 2006 - 12:00 AM
Jim Browski, on Oct 23 2006, 06:46 PM, said:
#20
Posted 24 October 2006 - 08:21 AM
Ralph (rad14701), on Oct 24 2006, 02:00 AM, said:
As i'm no english native speaker sometimes it's hard for me to say exactly what i'm thinking of
Sorry for that. I think there is some misunderstanding.
I do use the index.php file that is shipped with the download package of eto 0.6.1.2.
I do not use the modified index.php file Jelmer in the orginal post has linked to.
Is this wrong?
The rest of Jelmers posting i followed step by step ...
#21
Posted 24 October 2006 - 01:28 PM
#22
Posted 24 October 2006 - 04:57 PM
#23
Posted 24 October 2006 - 05:13 PM
Jelmer, on Oct 24 2006, 06:57 PM, said:
#24
Posted 24 October 2006 - 06:17 PM
IT WORKS! :!:
The credits go to Jelmer. I PM'ed him my login details and he found this tiny little checkmark that caused the problem in just a minute.
I'm ashamed to say it but for all the users that may struggle with similar probs ...
i just did not put the members to the members group.
Ok, stop laughin' and get back to business.
#25
Posted 24 November 2006 - 01:23 PM
I have one little problem though. When I use the LoginOut snippet and click on the "Logout" link, I get following SQL error:
« Error » Etomite encountered the following error while attempting to parse the requested resource: « Row count error in template query result. » SQL: SELECT * FROM `isr7`.etomite_site_templates WHERE `isr7`.etomite_site_templates.id = ''; [Copy SQL to ClipBoard] Parser timing MySQL: 0.0079 s s (2 Requests) PHP: 0.0229 s s Total: 0.0307 s s
Logout via submit button (authenticate_visitor snippet) works fine.
What's wrong?
Thanks in advance!
#26
Posted 24 November 2006 - 03:31 PM
Psycho Mantis, on Nov 24 2006, 08:23 AM, said:
I have one little problem though. When I use the LoginOut snippet and click on the "Logout" link, I get following SQL error:
« Error » Etomite encountered the following error while attempting to parse the requested resource: « Row count error in template query result. » SQL: SELECT * FROM `isr7`.etomite_site_templates WHERE `isr7`.etomite_site_templates.id = ''; [Copy SQL to ClipBoard] Parser timing MySQL: 0.0079 s s (2 Requests) PHP: 0.0229 s s Total: 0.0307 s s
Logout via submit button (authenticate_visitor snippet) works fine.
What's wrong?
Thanks in advance!
#27
Posted 26 November 2006 - 12:03 PM
#28
Posted 26 November 2006 - 07:24 PM
Psycho Mantis, on Nov 26 2006, 07:03 AM, said:
Quote
I changed:
CODE
if($_SESSION['validated']) { $output = '<a href="[~1~]?logout=1">Logout ('.$_SESSION['shortname'].')</a>'; }
To:
CODE
if($_SESSION['validated']) { $output = '<a href="[~1~]&logout=1">Logout ('.$_SESSION['shortname'].')</a>'; }
The problem is that you can only have one ? in your URL's GET arguments... Changing the second one to & assures XHTML compliance but it could have just as easily been left as &...
#29
Posted 13 July 2007 - 05:47 PM
#30
Posted 13 July 2007 - 06:56 PM
cathode, on Jul 13 2007, 01:47 PM, said:
if($_SESSION['validated'])
{
$output = '<a href="'.$etomite->makeUrl($id=1, $alias=$etomite->aliases[1], $args="?logout=1").'">Logout ('.$_SESSION['shortname'].')</a>';
}
#31
Posted 13 July 2007 - 08:51 PM
$doc=$etomite->documentIdentifier;
$show=$etomite->checkPermissions($doc);
if($show==1){
run code for logged in, validated user with permissions to edit this page;
}else{
run code for non-logged in visitors or logged in users without permissions for editing this page;
}
EDITED:
1st of all, I just noticed in the checkPermissions() code, that the documentIdentifier is set to $this->documentIdentifier by default, which makes the $doc call obselete.
2nd: If I have read the API code correctly user roles MUST be enabled for this work, otherwise if document permissions aren't in use, everyone will have access to the logged in code because the function returns true by default in this case. Therefore, it looks like I have answered my own question again. No, this is NOT OK (unless the site has document permissions enabled).
Therefore, to write snippets for users who may or may not have document permissions enabled I should be using something like...
$show=0;
$permission=0;
$permission=$etomite->checkPermissions();
if($_SESSION['validated'] && $permissions==1){$show=1;}
if($show==1){
run secure code;
}else{
run unsecure code;
}
Please correct me if I am wrong.
Edited by Cris D., 14 July 2007 - 10:03 AM.
#32
Posted 15 July 2007 - 07:42 PM
Your method should work with simple authentications as well... When visitor permissions are not enabled checkPermissions() should check against the documents authenticate flag... Hence, simple authentication... The method I use is displayed below...If you are only checking the current document you can omit $id but I generally keep it in place because most of the time I am using this for conditional menu item generation and I use whatever variable suits my needs in place of $id... Because checkPermissions() always returns TRUE or FALSE, any additional code is just wasting server clock cycles...
if($etomite->checkPermissions($id))
{
...do something...
}
else
}
...do whatever needs to be done on failure, or omit this part...
}
#33
Posted 05 September 2007 - 09:35 PM
using 0.6.1 Final (PL:4) (Prelude) both IE/FF, PHP Version 5.1.3, IIS
have user groups, doc groups and user/doc links set up
I have a role created, and a user with that role and permissions for the doc group checked.
I have a document, with Authenticate checked and document group checked under 'permissions'
When I log in with authenticate_visitor nothing happens. it is checking the user/password and captcha correctly, just doesn't give me permission to view the document.
I know this is something easy but I'm missing it.and open for sugestions. willing to pm my login, even. It's just a testing/development site but do want to include this on a site next month. thx
#34
Posted 05 September 2007 - 09:44 PM
darren, on Sep 5 2007, 05:35 PM, said:
using 0.6.1 Final (PL:4) (Prelude) both IE/FF, PHP Version 5.1.3, IIS
have user groups, doc groups and user/doc links set up
I have a role created, and a user with that role and permissions for the doc group checked.
I have a document, with Authenticate checked and document group checked under 'permissions'
When I log in with authenticate_visitor nothing happens. it is checking the user/password and captcha correctly, just doesn't give me permission to view the document.
I know this is something easy but I'm missing it.and open for sugestions. willing to pm my login, even. It's just a testing/development site but do want to include this on a site next month. thx
First, simple authentication... Do you know if the login is working...??? If so, move on to checking for simple authentication which is based on whether or not a visitor is logged in (authenticated)... Do you get any errors to this point...???
Post back with your results and we can go form there... Worst case scenario, PM me login spec's and I'll take a hands-on look at your install...
#35
Posted 05 September 2007 - 11:49 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











