Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#91 2013-06-05 20:37:31

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

Hi EdwardS,

A very big thank you for your contribution !

Offline

#92 2013-06-15 14:02:22

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 265
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

Great to see the community getting around this plugin, possibly the best txp has seen for community/front end login based sites ever lol :) Thanks Claire and all!!


…………………
I <3 txp
…………………

Offline

#93 2013-06-17 03:38:26

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,203
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

Hi Claire,

Your recent changes with error messages were a life saver. Do you think you could just borrow mck_login’s error mechamism, which handles multiple scenarios and language packs. Just a thought…

Offline

#94 2013-06-17 11:26:09

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

After having a look at mck_login, have thought it is now complete (more than cbe_frontauth) and mature, and thinking in terms of complementarity, the logical conclusion is: I strongly suggest that you switch to it to benefit from all its advantages :)

Offline

#95 2013-06-17 14:33:10

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,203
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

I would like to use cbe_frontauth. One of the benefits of cbe that I would love to use is using email as login field. That is a great feature.

Offline

#96 2013-06-17 15:41:07

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

Ah… well. It’s just that something else is cooking in my pot. I think it would be faster if Jukka agrees to borrow and adapt lines 757 to 763 :)

Offline

#97 2013-06-17 15:43:23

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,203
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

Fair enough… thanks for a great plugin…

Offline

#98 2013-06-27 01:46:59

EdwardS
Member
Registered: 2013-02-23
Posts: 13

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

Hi Claire, i have successfully managed to use your plugin to control access to a single page template, if i use it across multiple pages however i have to login multiple times… I’ve been tearing my hair out trying to figure out how to stop this happening, Is there any way around this?

I would have thought after logging in the session would be saved and that would be it?

One of the pages is dynamic so i have headers that stop caching, could that be the reason?

Any help would be greatly appreciated!

This is what i have (truncated):

For the default page:

<txp:cbe_frontauth_if_logged>
<txp:cbe_frontauth_box />
// page information
<txp:else />
<txp:cbe_frontauth_login invite=“Connect”>
</txp:cbe_frontauth_login>
</txp:cbe_frontauth_if_logged>

For the other pages:

<txp:cbe_frontauth_redirect for=“logout” value=“http://www.domain.com” />
<txp:cbe_frontauth_if_logged>
<txp:cbe_frontauth_box />
// page information
<txp:else />
<txp:php>
header(“Location: http://domain.com”, TRUE, 303);
exit;
</txp:php>
</txp:cbe_frontauth_if_logged >

Offline

#99 2013-06-27 17:34:48

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

I think that the problem is partly here:

EdwardS a écrit:

<txp:cbe_frontauth_redirect for=“logout” value=“http://www.domain.com” />

header(“Location: http://domain.com”, TRUE, 303);

These are different domains, therefore different set of cookies.
Chose your domain and stick with it! In addition it is good for SEO.
(BTW: related post)

As stated in the help file, “quick start” paragraph:

  • The login/logout mechanism relies on cookies. A cookie is attached to one, and only one, subdomain.
  • http://domain.tld and http://www.domain.tld are different subdomains, even if you present the same content through both URLs.

=> You will have to choose which base URL you want to use (with or without www) and stick to it along all the navigation. This is also a good practice to avoid duplicate content.

Here is how to:

  1. Plugin load order: as it handles redirections, it has to be loaded before any other plugin. Set by default to 4, adjust according to your needs.
  2. Admin > Preferences : give (or verify) your site URL and save.
  3. Edit the .htaccess file located at the root of your site, and append as closer as possible to RewriteEngine On (replace domain.tld with your actual URL):

EITHER, with www

RewriteCond %{HTTP_HOST} !^www\.domain\.tld$ [NC]
RewriteRule ^(.*) http://www.domain.tld/$1 [QSA,R=301,L]

OR, without www

RewriteCond %{HTTP_HOST} ^www\.domain\.tld$ [NC]
RewriteRule ^(.*) http://domain.tld/$1 [QSA,R=301,L]

Offline

#100 2013-06-27 20:38:49

EdwardS
Member
Registered: 2013-02-23
Posts: 13

Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend

CeBe wrote:

  • The login/logout mechanism relies on cookies. A cookie is attached to one, and only one, subdomain.
  • http://domain.tld and http://www.domain.tld are different subdomains, even if you present the same content through both URLs.

Legendary. That was my problem. Nice one and keep up the good work. +1000

Offline

Board footer

Powered by FluxBB