Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2011-09-13 08:27:43

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,314
Website

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

Pat64 a écrit:

Pat64 wrote in french:
I’m very sorry, but it’s DragonDz the first french speaker in his post!

Yes, it s me, but i always translated my post in english

@Patrick : Cafteur va!

Offline

#32 2012-01-06 17:07:38

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

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

Some additions to the documentation to help with cookies and subdomains (which can lead to malfunctions if not handled properly).
Documentations translated into french for french-speaking people who can’t (under)stand english.

Versions 0.7.1 and 0.7.1-fr are here

… immediately followed by v0.8 ; v0.8-fr is in progress
See changelog

Last edited by CeBe (2012-01-13 17:10:10)

Offline

#33 2012-01-14 09:08:02

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,284
Website

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

Hi all.

<txp:cbe_frontauth_loginwith value="auto | username | email" />

I think this new feature need some details and examples. How to use it? Instead of <txp:cbe_frontauth_logname label="Name" wraptag="" class="text-field" />?
What about the <txp:cbe_frontauth_password /> tag into this process? Do we have to use only one cbe_input for login or the two tags are always needed?

Cheers,
Pat.


Patrick.

Github | CodePen | Simplr theme | Wait Me a maintenance theme

Offline

#34 2012-01-14 10:20:35

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

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

<txp:cbe_frontauth_loginwith /> is meant to set a global initialization. It is at the same level as <txp:cbe_frontauth_redirect />.

It tells the plugin that the identifier will be, everywhere, either the username (as usual), or the email, or any of them (i.e. automatic detection, this is the default).
So here we go :

<!-- At the very beginning !-->
<txp:cbe_frontauth_loginwith value="email" />

<!-- Now, if I try to connect with my username, it will fail and I have to use my email address. !-->

<!-- And later !-->
<txp:cbe_frontauth_login wraptag="div" class="auth">
  <txp:cbe_frontauth_logname label="Name" wraptag="" class="text-field" />
  <txp:cbe_frontauth_password label="Password" wraptag="" class="text-field" />
</txp:cbe_frontauth_login>

Basic usage will work too :

<!-- Identifier must be the email address !-->
<txp:cbe_frontauth_loginwith value="email" />
...
<!-- Display adapted form whether we are connected or not !-->
<txp:cbe_frontauth />

Offline

#35 2012-01-14 12:35:04

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,284
Website

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

…Sure gal. Maybe to be added into the doc for newbies (like me;)


Patrick.

Github | CodePen | Simplr theme | Wait Me a maintenance theme

Offline

#36 2012-01-17 15:58:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,753
Website

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

Finally got round to using this in anger. It’s brilliant, thanks Claire. I love the flexibility of being able to use the quick combo frontauth_box, and being able to mix and match attributes / forms / containers and dedicated tags to build up my own login / logout / protection logic.

One thing I’d like to find out is how to display a message if login failed for some reason. I can display an invite message easily for visitors to the page, but if they subsequently type their username/password wrong they are just returned to the login box with no explanation why.

Is there some combination of cbe_ tags I can employ to detect this situation (not logged in AND recent unsuccessful login attempt) so I can offer the visitor some assistance? Or would it need an additional tag like, hmmmmm, off the top of my head:

<txp:cbe_frontauth_login>
   <txp:cbe_frontauth_error type="fail_login" wraptag="div" class="oops">
      Could not log in. Please check your login name and password are typed correctly.
   </txp:cbe_frontauth_error>
   <txp:cbe_frontauth_error type="empty_logname" wraptag="div" class="warn">
      Please type a login name before trying to log in.
   </txp:cbe_frontauth_error>
   <txp:cbe_frontauth_error type="empty_password" wraptag="div" class="warn">
      Please type a password to log in.
   </txp:cbe_frontauth_error>
   <p>Username<br /><txp:cbe_frontauth_logname label="" /></p>
   <p>Password<br /><txp:cbe_frontauth_password label="" /></p>
   <div id="login_btn"><txp:cbe_frontauth_submit label="Go" /></div>
</txp:cbe_frontauth_login>

(btw, I’m using the Some label<br/><txp:cbe_frontauth_... label="" /> format because the tag doesn’t support break="br", right?)

Perhaps text and form attributes would be useful for people who don’t want to use the container and prefer to specify the error string inline, or in a reusable Form (hehe, the contents of text could even be passed to gTxt() first for a neat l10n solution!)

As a possible extension, being able to supply a list of error types would cut down on the amount of typing (the last two error conditions could then be rolled into one ‘Please complete both input boxes to log in’). <txp:else> support would also be cool, so we could choose to display a custom invite message only when there are no errors detected.

Alternatively, you could operate like mem_form and ign_password_protect do things by setting a global error string that holds the last encountered error. Then a simple <txp:cbe_frontauth_error wraptag= | class=> could be used to display it. Of course, this is less friendly for international users and requires you to set the error message in the code, which might be less than desirable. Or maybe some hybrid solution (or something entirely better).

Any thoughts? Perhaps I’m just missing something obvious.

Thanks again for a fantastic plugin.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#37 2012-01-17 21:08:47

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

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

Bloke, thank you for your comment. I appreciate both the compliment and the constructive criticism :)

So… (and note for myself too) :
  • <br /> support is missing. Bad. It shouldn’t.
  • Error messages are missing too. Bad too. They shouldn’t neither, it’s a little rough.

All I can promise now is to have a look in the next few days.
Thanks again to help making it better.

Offline

#38 2012-01-17 22:34:02

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 583
Website

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

Great plugin, Claire. I really enjoy using it so far. Thanks for your work on this.

Offline

#39 2012-01-18 22:14:02

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

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

@maruchan: Thank you very much.

To all, and about break tag:
A sudden idea crossed my mind: what about a css display: block; ? Like in this (quick and dirty) code:

<html>
<head>
<style type="text/css">
input, label {
	display: block;
}
</style>
</head>

<body>
<form action="test.php" method="post">
  <label for="entry1">Value1 :</label>
  <input type="text" id="entry1" value="" />
  <label for="entry2">Value2 :</label>
  <input type="text" id="entry2" value="" />
  <input type="submit" value="Go" />
</form>
</body>

</html>

Offline

#40 2012-01-19 20:55:47

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,284
Website

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

Hi Claire.

If you want to place yours labels above inputs, that the good choice. Just add this:

label{display:block}

Cheers,


Patrick.

Github | CodePen | Simplr theme | Wait Me a maintenance theme

Offline

Board footer

Powered by FluxBB