Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend
Hello Claire,
i am struggling with a strange behavior only in Chrome :
cbe_frontauth_redirect used
when entering the credentials in the login form and submitting , form get submitted but the page still show the login form.
Then if i hit the “connect” button (nothing else in the form) the protected content appear.
Weardest : if i reload the page (using the adress bar) protected content disappear and i get the login form again. Hitting “connect” will show me the protected content.
I just can’t make anything logical about this !
If you can give any idea where i should look ?
Edit 13/02 : after some more test it is my plugin fault. This did not happened in local server.
Last edited by planeth (2013-02-13 09:29:55)
Offline
Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend
Hi claire
I made a little modification to your plugin, it is about the class css, the checkbox cant be set freely it s allways “checkbox” due to checkbox funtion limitation in textpattern , i also needed a class for labels then i made changes in code to add a class, the change is not perfect, the best way was to add a labelclass into the call but i havent enough time to improve it that way.
May be add it to your todo list.
Cheers
Offline
Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend
This is a great plugin… thanks so much… I notice bloke asked for some functionality that I too would have expected and don’t see… failed login message
Did this ever get resolved, added? I don’t see it.
Offline
Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend
A very-quick update has been just released.
If login fails, an error message appears before the login form. Its wrapping tag (default: span
) and class (default: cbe_fa_error
) can be customised:
<txp:cbe_frontauth_box tag_error="p" class_error="err_msg" />
<txp:cbe_frontauth_login tag_error="p" class_error="err_msg" />
Messages are now customisable too by editing the first function (_cbe_fa_lang()
). Their default values are as much as possible pulled from the default language (i.e. table txp_lang
).
The <txp:cbe_frontauth_invite />
tag and various invite
attributes are still present for backward compatibility, but you will probably find more convenient to directly edit the plugin.
Reminder: the plugin page is here.
Offline
Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend
Thanks so much Claire.
Offline
#90 2013-06-04 13:34:00
- EdwardS
- Member
- Registered: 2013-02-23
- Posts: 13
Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend
Hello Claire, just wanted to say thanks for creating this fantastic plugin we use it to control access to a multi user intranet system. I have managed to use your plugin to display a customised “restricted message” when a user privs are too low, and wanted to share it with anyone else thats trying to do the same thing.
This (with correct styling) will give you a login page with javascript and cookie enabled message (disabled login button if not enabled). A whois logged in, logout and edit buttons when logged in. And a message from HAL 9000 if you enter an area without sufficient privs. Hope this helps someone setup a quick access control system using this plugin. Thanks again claire, we will be donating (:
At the top of my page i have:
<!-- START HAL RESTRICTED ZONE -->
<txp:cbe_frontauth_protect level="4,5,6,7">
<object style="visibility:hidden; height:0px">
<param name="autostart" value="true">
<param name="src" value="/media/cantdo.wav">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed src="/media/cantdo.wav" controller="true" autoplay="true" autostart="True" type="audio/wav" />
</object>
<h1 style="color:white; margin:auto">I'm sorry Dave, I'm afraid I can't do that</h1>
<style>
body {
background-image: url('/images/20120716-Hal-9000.jpg');
background-size: 100%;
background-position: center;
}
</style>
</txp:cbe_frontauth_protect>
<!-- START LOGOUT BOX -->
<txp:cbe_frontauth_if_logged>
<div class="logout">
<txp:cbe_frontauth_box logout_type="button" >
User: <txp:cbe_frontauth_whois type="RealName" />
<txp:cbe_frontauth_edit_article label="Edit"/>
</txp:cbe_frontauth_box>
</div>
and at bottom i have:
</txp:cbe_frontauth_protect>
<txp:else />
<body>
<div class="login">
<p><txp:cbe_frontauth_login invite="Connect to Intranet"></p>
<br>
<txp:cbe_frontauth_logname label="Name: " />
<txp:cbe_frontauth_password label="Password: " />
<!-- javascript and cookie notices -->
<script>document.write("<input type='submit' value='Login'>");</script>
<noscript><input type="submit" value="Login" title="Please enable Javascript" disabled /></noscript>
<br>
<br>
<txp:cbe_frontauth_stay label="Stay Logged-in?" />
<txp:cbe_frontauth_reset label="forgotten Password?" />
<br>
</txp:cbe_frontauth_login>
<div style="float:right">
<noscript><span style="color:red">Please <a href="http://www.enable-javascript.com/">enable Javascript</a> to continue</span></noscript>
<script>document.write("Javascript ENABLED");</script>
<br>
<script type="text/javascript">
function are_cookies_enabled()
{
var cookieEnabled = (navigator.cookieEnabled) ? true : false;
if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled)
{
document.cookie="testcookie";
cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
}
return (cookieEnabled);
}
if (are_cookies_enabled())
{
document.write("Cookies ENABLED");
}
else
{
document.write("<span style='color:red'>Please ENABLE cookies to continue</span>");
}
</script>
</div>
<!-- end notice -->
</div>
</body>
</txp:cbe_frontauth_if_logged>
{Edited to add Textile for code/apostrophe display. – Uli}
Last edited by uli (2013-06-04 16:15:51)
Offline
Re: cbe_frontauth: Connect to (and disconnect from) backend from frontend
Hi EdwardS,
A very big thank you for your contribution !
Offline
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
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
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
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
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