Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-01-24 00:50:59

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Solved - Send users to site home from "set password"

My site is only accessible to logged in users (residents of our group of units). These users have no back-end access courtesy of rah_privileges. But when they enter an initial password in the Set Password screen, it takes them to /textpattern to login. Logging in there takes them to the admin area with a big Restricted Area sign.

How can I get the “Set Password” screen to go to the site home page rather than the admin page?

Stay safe
Bruce

Last edited by Bruce Bowden (2021-01-24 19:46:06)

Offline

#2 2021-01-24 19:44:53

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Re: Solved - Send users to site home from "set password"

Solved – I can set each user’s initial email address to one I have access to so the set password email comes to me. I can set a suitable password then change the users email address to their own address. I will then send out my own custom welcome email, independent of Textpattern.

A number of my users are older (80+) and everything needs to be as simple as possible for them. The loss of security by sending passwords in emails is minor by comparison.

This avoids trying to twist Textpattern into something it isn’t designed to do.

Offline

#3 2021-01-24 21:15:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,262
Website GitHub

Re: Solved - Send users to site home from "set password"

Yes, not an ideal workflow if you’re not using the back-end.

A few possible solutions:

1) Use a front-end sign-up plugin (e.g. cbe_frontauth, mck_login). Not sure how well these work with the latest Textpattern versions but they’ll need updating at some point so any feedback here would be welcome.

2) Presuming your users are all of a particular User group (which could be a custom one if you use a plugin to extend the built-in types) a way round this is to write a tiny simple plugin that runs on all pages in the back-end. It checks if someone is logged in and of user group xyz and, if they are, redirects them to the front-end home page.

The latter means you can preserve the Txp password-setting process (saving yourself time). The users get the regular admin-side login screen but as soon as they log in (is_logged_in() is your friend here) you can check the user type and if it matches, just do a simple redirect. Probably about 6 lines of code.

If you need a hand with that, we can see what we can do to whip up a 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

#4 2021-01-24 22:29:13

Bruce Bowden
Member
From: Melbourne, Australia
Registered: 2020-10-22
Posts: 28

Re: Solved - Send users to site home from "set password"

Writing my own plugin! I will have to explore that. Your idea is fairly simple, which is good. And “someone” has written some very detailed documentation on how to write a plugin.

Given my small number of users, is it more work than my crude solution? Probably. But that won’t stop me.

stay safe
Bruce

Offline

Board footer

Powered by FluxBB