Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
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

#101 2013-11-24 16:39:02

admi
Member
From: BY
Registered: 2007-12-10
Posts: 145
Website

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

Is there any way to redirect to homepage after logout from the regular admin panel (that would be www.site.com/textpattern/index.php?logout=1) ? Or is the work of .htaccess rather than the plugin?

Offline

#102 2013-12-03 04:36:39

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

It seems <txp:cbe_frontauth_whois type="name" /> returns nothing immediately after login. Is there someway to debug this? I am using it in a form, displayed by a dashboard tab. The tab is created via smd_tabber and selected as the “Default admin tab” in Preferences.

Refreshing the page makes it work but I can’t expect users to do so.

Any help you can provide is appreciated. It’s a great plugin.

EDIT : When trying to do further debugging I added the following to my form:

<!-- logged in <txp:cbe_frontauth_if_logged> true <txp:else/> false </txp:cbe_frontauth_if_logged> -->

All the cbe tags after that worked. So a simple fix was to add this line at the begging of my form. So consider this an FYI rather than a call for help. I’m in good shape now.

Last edited by MattD (2013-12-03 04:50:09)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#103 2014-02-25 17:14:17

fiddle
Member
Registered: 2007-10-03
Posts: 87

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

Hopefully someone can lend a hand in helping me out with some instruction.. I wanted to use the “change password” function, but am not sure how to implement…
This is an example of what I have:

<txp:cbe_frontauth_if_connected>
 <txp:else />

  <h1>Member Login</h1>

   <txp:cbe_frontauth_loginwith value="username" />
  <txp:cbe_frontauth_login invite="">
   <ol class='login'>
    <txp:cbe_frontauth_logname label="Username" wraptag="li" />
    <txp:cbe_frontauth_password label="Password " wraptag="li" />
    <txp:cbe_frontauth_submit label="Login" wraptag="li" class="submit" />
   </ol>
  </txp:cbe_frontauth_login>
</txp:cbe_frontauth_if_connected>


<txp:cbe_frontauth_protect>

 <h1>Welcome to the Member Area</h1>
 <p><txp:cbe_frontauth_link label="Logout" class="btn" link="logout=1" target="_get" /></p>

</txp:cbe_frontauth_protect>


What and were would I insert for the change password feature..??? 
Let me know if any more info is needed in order to explain.. 

Thank you very much......... 
Fiddle

Last edited by fiddle (2014-02-25 17:18:25)

Offline

#104 2014-02-25 18:06:01

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

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

fiddle wrote #279245:

I wanted to use the “change password” function, but am not sure how to implement…

Just download and activate cbe_members.
It is not highly developed but should do the job without any other manipulation.

Offline

#105 2014-02-25 18:08:51

fiddle
Member
Registered: 2007-10-03
Posts: 87

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

By activating the plugin, all i get under my login form is “forget password?”, which I believe is the password reset not the change..?

Thanks

Last edited by fiddle (2014-02-25 18:09:04)

Offline

#106 2014-02-25 18:53:11

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 read too fast, sorry.

A password can be changed by the user only, and (s)he must be connected to perform this action. The “change password” message won’t display as long as the user is not connected.
And… just noticed: use <txp:cbe_frontauth_logout />

Also note that <txp:cbe_frontauth_if_connected> and <txp:cbe_frontauth_protect> are synonyms, so you probably can do something like :

<txp:cbe_frontauth_if_connected>

  <h1>Welcome to the Member Area</h1>
  <txp:cbe_frontauth_logout type="link" class="btn" />

<txp:else />

  <h1>Member Login</h1>

  <txp:cbe_frontauth_login invite="">
   <ol class='login'>
    <txp:cbe_frontauth_logname label="Username" wraptag="li" />
    <txp:cbe_frontauth_password label="Password " wraptag="li" />
    <txp:cbe_frontauth_submit label="Login" wraptag="li" class="submit" />
   </ol>
  </txp:cbe_frontauth_login>

</txp:cbe_frontauth_if_connected>

Last edited by CeBe (2014-02-25 19:00:15)

Offline

#107 2014-02-25 19:01:18

fiddle
Member
Registered: 2007-10-03
Posts: 87

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

Thank you very much.. It was the missing
<txp:cbe_frontauth_logout />
that was doing it..
And thanks for pointing out the if connected, should simplify the code…
Thanks again, really appreciate it..

Offline

#108 2014-04-04 15:39:51

fiddle
Member
Registered: 2007-10-03
Posts: 87

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

Loving the plugin….
One question, is there a way to display all users logged in.? or last login for all users at the same time.?
Thanks

Offline

Board footer

Powered by FluxBB