Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2021-04-16 14:50:26

gavnosis
Member
From: Milton Keynes, UK
Registered: 2005-03-12
Posts: 151
Website

Re: Fatal error

Well, firstly a big thank you for helping me fix a thing which I didn’t know was broken ;-)
I have changed the tables collations and tables columns collations to utf8_general_ci

This has allowed me to see all the plugins installed again (hooray), although I’m not sure I could enter Mastermind on undertanding the differences between unicode characters types (I’m hoping this collation isn’t some terrible faux pas which will have you rolling your eyes in despair…)

I have then changed the line in Claire’s cbe_frontauth plugin as suggested

include_once(txpath.'/include/txp_admin.php');

And this unfortunately takes me back to my original error message

Fatal error: Uncaught Error: Call to undefined function txp_validate()

As an alternative, is there another better way to have a password protected area of the website, which will display one thing if a user is logged in and something else if they’re not?

Offline

#32 2021-04-16 15:59:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,500
Website GitHub

Re: Fatal error

gavnosis wrote #329879:

I’m hoping this collation isn’t some terrible faux pas

Glad you got it sorted. Collations are a law unto themselves so you’re not alone being a little in the dark. I’m sure somebody out there understands them, but that person ain’t me!

this unfortunately takes me back to my original error message

Drat. I’ll have to look more closely at the code.

As an alternative, is there another better way to have a password protected area of the website, which will display one thing if a user is logged in and something else if they’re not?

If you don’t mind letting people log in via the back-end then how about <txp:if_logged_in>?


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#33 2021-04-16 16:49:17

gavnosis
Member
From: Milton Keynes, UK
Registered: 2005-03-12
Posts: 151
Website

Re: Fatal error

If you don’t mind letting people log in via the back-end then how about <txp:if_logged_in>?

And just do something funny with one of the (your!) plugins to restrict everything?

I just quite liked there being a nice box on the page which said login …and then was pleased with myself to show a sticky article if not logged in and the other articles in the section if they were

I almost needed a lie down after thinking up something so fiendishly clever (Like Pooh bear, with only a small brain)

Last edited by gavnosis (2021-04-16 16:49:57)

Offline

#34 2021-04-16 17:15:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,500
Website GitHub

Re: Fatal error

gavnosis wrote #329882:

And just do something funny with one of the (your!) plugins to restrict everything?

Sure, or rah_privileges. If you want to be even cleverer, I’ve done this in the past:

Front-end

<a href="/textpattern">Login</a>
<txp:if_logged_in>
Show sticky content
</txp:if_logged_in>

Back-end

  1. Set all your semi-untrusted front-end editors to the same group (e.g. Staff Writer).
  2. Use rah_privileges to turn off everything of interest for StaffWriter. Just in case.
  3. Write a five-line plugin that detects if the user is a StaffWriter on a page with /textpattern in it. If so, redirect them to the front-end instead. Bonus points for redirecting them to the page they came from if you can somehow get the referer header from the page where they clicked Login.

:)


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#35 2021-04-19 09:02:11

gavnosis
Member
From: Milton Keynes, UK
Registered: 2005-03-12
Posts: 151
Website

Re: Fatal error

Thank you Stef,

I think you might have mixed me up with a super hero, and I was with you until stage 3 ;-)
Me? Write a plugin?? Well, I’ll dust off my ‘PHP Programming for Beginners’ book. What’s the worst that could happen?

Offline

#36 2021-04-19 09:16:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,500
Website GitHub

Re: Fatal error

gavnosis wrote #329897:

I think you might have mixed me up with a super hero, and I was with you until stage 3 ;-)

Haha, well if you get stuck and would like a hand with it, just let me know. I have a bunch of tiny little helper plugins dotted around that do various things like this, so it should be a cinch to cobble those together into one to suit your requirements. Just let me know how far you get and which role you’ve chosen as your no access to the admin side group and how opinionated you want to be with redirecting (and where they should end up, etc).


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB