Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#81 2012-10-18 17:05:41

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

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

sacripant a écrit:

I want limited an article for all admins (whatever their name) and the author of the article.

The logic involved in <txp:cbe_frontauth_if_connected> is an AND.
So, the solution for the moment is… duplicate code (sorry) :

<txp:cbe_frontauth_if_connected level="1">
  <txp:output_form form="protected_content" />
</txp:cbe_frontauth_if_connected>

<txp:cbe_frontauth_if_connected name='<txp:author title="0" />'>
  <txp:output_form form="protected_content" />
</txp:cbe_frontauth_if_connected>

Offline

#82 2012-10-18 17:29: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

sacripant a écrit:

…And a strang behavior for cbe_frontauth_whois
It is possible to improve this?

It will :) Bug spotted, but needs more tests.

For the moment, it is safe to use it the way you do, or this one : <txp:cbe_frontauth_if_logged><txp:cbe_frontauth_whois /></txp:cbe_frontauth_if_logged>

Offline

#83 2012-10-19 11:07:41

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 478
Website

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

Hello Claire,

It’s me again :D …

with this code to generate a login form

<txp:cbe_frontauth_login invite="">
	<fieldset>
		<legend>Connexion</legend>
		<txp:cbe_frontauth_logname label="Name" wraptag="div" class="form-12-12" />
		<txp:cbe_frontauth_password label="Pass" wraptag="div" class="form-12-12" />
		<div class="form-12-12">
			<txp:cbe_frontauth_submit label="Go" class="btn" />
			<txp:cbe_frontauth_reset label="Password forgotten ?" />
		</div>	
	</fieldset>
</txp:cbe_frontauth_login>

I’m this warning :

Erreur de balise : <txp:cbe_frontauth_reset label="Password forgotten ?" /> -> Textpattern Warning: cette balise n’existe pas lors du traitement du module “Aucun” dans le gabarit “default”

textpattern/lib/txplib_publish.php:425 trigger_error()
textpattern/lib/txplib_publish.php:311 processTags()
textpattern/lib/txplib_misc.php(812) : eval()’d code:530 parse()
textpattern/lib/txplib_misc.php(812) : eval()’d code:774 _cbe_fa_inout()
textpattern/lib/txplib_misc.php(812) : eval()’d code:450 cbe_frontauth()
textpattern/lib/txplib_misc.php(812) : eval()’d code:98 _cbe_fa_inout_process()
textpattern/lib/txplib_publish.php:411 cbe_frontauth_login()
textpattern/lib/txplib_publish.php:324 processTags()
textpattern/lib/txplib_misc.php(812) : eval()’d code:753 parse()
textpattern/lib/txplib_misc.php(812) : eval()’d code:128 cbe_frontauth()

Offline

#84 2013-01-30 19:33:21

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

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

Hi Claire.

I try to use your plugin on a multisites installation. It seems that the login system doesn’t work due to different subdomains in use: en.domain.com Vs admin.en.domain.com.

Some ideas to correct it?

Edit: Config error. No worry: all works fine ;)

Cheers,

Last edited by Pat64 (2013-01-30 21:33:42)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#85 2013-02-12 15:20:17

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 199
Website

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

#86 2013-03-06 10:55:17

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

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

#87 2013-03-23 15:20:47

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

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

#88 2013-03-27 11:48:02

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

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

#89 2013-03-27 21:15:27

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

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

Board footer

Powered by FluxBB