Password protect extension

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Re: Password protect extension

Postby hansfn » Tue Oct 05, 2010 9:00 pm

Yes, understanding the debug output is difficult. It was correct of you to include it initially, but very nice of you to delete it too ;-)

Anyway, I found the bug causing the first problem - fixed in revision 3108 and 3109. In stead of upgrading to PivotX 2.1.2, grab pivotx-2.1.x-latest.zip which contains the bug fixes after the 2.1.2 release.
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Password protect extension

Postby ankedesign » Thu Oct 07, 2010 7:14 pm

Thanx.
Updated, to the latest PivotX, and the checkbox is fully functional! Yee!
I had a little chat with Bob about the password not working, and the live server probably has 'htauth' turned off. (I have no clue what is it, but I understand now how it works.) So next step is trying to override the server settings in .htaccess. Will keep it updated here!
ankedesign
 
Posts: 21
Joined: Sun Oct 12, 2008 1:51 pm

Re: Password protect extension

Postby ankedesign » Tue Oct 19, 2010 4:14 pm

Okay, checked all, bottomline is; The Apache module that is used by password protected pages is not running on the live server.
So the extension will never work. (For Dutch visitors: it is xs4all hosting we are talking about)

Details, for who want to know:
Code: Select all
The HTTP Authentication hooks in PHP are only available when it is running as an Apache module and is hence not available in the CGI version. In an Apache module PHP script, it is possible to use the header() function to send an "Authentication Required" message to the client browser causing it to pop up a Username/Password input window.


Sad but true, hope the client will ultimately decide to move to a proper and better functioning server. 8-)
ankedesign
 
Posts: 21
Joined: Sun Oct 12, 2008 1:51 pm

Re: Password protect extension

Postby Sanzine » Mon Sep 12, 2011 11:11 am

I just installed the password protect extension. I added a page which I set to be 'password protected'. I configured the extension to only protect certain pages/entries.

When I now click on the link to the password protected page, a dialog box appears which asks me for a password. The text in this dialog box doesn't read the same a what is set in the extension configuration ('password question'). Also, when I click on 'Cancel' in the dialog box, the page that is shown doesn't contain any of the text mentioned in the configuration ('no access' title and 'no access' text aren't shown). And when I type the wrong password, I will keep asking me for the password over and over again.

What did I do wrong? When will the 'no access' text/title be shown?

Thanks!

P.S. Working with PivotX 2.3.0 and Password Protect 1.1.1
Sanzine
 
Posts: 75
Joined: Tue Jan 20, 2009 10:15 am

Re: Password protect extension

Postby hansfn » Mon Sep 12, 2011 12:40 pm

When I now click on the link to the password protected page, a dialog box appears which asks me for a password. The text in this dialog box doesn't read the same a what is set in the extension configuration ('password question')

This seems like a bug. In the file extensions/passwordprotect/admin_passwordprotect.php, try to replace

Code: Select all
            if (passwordcheck_login($page) == false) {
                Header("WWW-Authenticate: Basic realm=\"PivotX Protected Page\"");
                Header("HTTP/1.0 401 Unauthorized");

with

Code: Select all
            if (passwordcheck_login($page) == false) {
                $question = $PIVOTX['config']->get('passwordprotect_text');
                Header("WWW-Authenticate: Basic realm=\"$question\"");
                Header("HTTP/1.0 401 Unauthorized");


Also, when I click on 'Cancel' in the dialog box, the page that is shown doesn't contain any of the text mentioned in the configuration ('no access' title and 'no access' text aren't shown).

Because the template you selected doesn't contain a [[title]] and [[introduction]] tag? (Look at the default template skinny/page_template.html.)

Yes, if you give the wrong password, it will ask again. It's a feature of HTTP Basic Auth (which this extension is using).
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Password protect extension

Postby Sanzine » Mon Sep 12, 2011 1:35 pm

Thanks for the quick reply! Replacing the code with the one you gave, did the trick. The dialog box now shows the correct question.

Because the template you selected doesn't contain a [[title]] and [[introduction]] tag? (Look at the default template skinny/page_template.html.)


The selected template does contain [[title]] and [[introduction]]. I have also replaced my selected template with the template skinny/page_template.html, but even then the page isn't showing the 'no access' text.
Sanzine
 
Posts: 75
Joined: Tue Jan 20, 2009 10:15 am

Re: Password protect extension

Postby hansfn » Mon Sep 12, 2011 4:52 pm

Changing the "'No access' title" and "'No access' text" just works for me. Are you 110% sure you have changed these settings? (Have you enable output caching - it might cause problems for time to time.)

PS! If we aren't able to resolve this through the forum, you could give me access to your PivotX.
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Password protect extension

Postby Sanzine » Tue Sep 13, 2011 7:19 am

OK.... I didn't know that I had to change the input that was already present in the extension configuration (is that mentioned somewhere in the quick doc?). I just left it like that and it didn't work. Now I have changed the text, saved and... tada! It does show!

Thanks for the help!
Sanzine
 
Posts: 75
Joined: Tue Jan 20, 2009 10:15 am

Re: Password protect extension

Postby hansfn » Tue Sep 13, 2011 11:23 am

I didn't know that I had to change the input that was already present in the extension configuration

That was a bug too.

I will be uploading a new version (1.1.2) today - with this and the other bug you found, fixed. Thx for reporting.
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Password protect extension

Postby Sanzine » Tue Sep 13, 2011 11:45 am

You're welcome!
Sanzine
 
Posts: 75
Joined: Tue Jan 20, 2009 10:15 am

PreviousNext

Return to 2.x Extensions

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron