#1 November 10, 2014 4:33pm

Vykintas
Member
Registered: November 10, 2014
Posts: 4

User Login / Register

Hello, I'm Vykintas.

First i must say i like BigTree CMS quite a lot. Especially the way how clean it is. One thing i was wondering though. Is there a module or some sort of guide how to let users register, login, have their own profiles and certain data attributes, module entries associated with them. I found that users can be created via the admin panel. But i don't want them to be able to access the backend. Also i've read that there is a events plugin. But i can't find any plugin repository. It would be nice to have some plugins or examples to around with.

All help would be very much appreciated.



Thanks, Vykintas

Offline

#2 November 10, 2014 4:40pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: User Login / Register

BigTree doesn't come with any front-end user system built in (other CMSes like Drupal have a unified user system, but we don't really agree with that paradigm).

What I would normally do is create a custom Users module and copy several method implementations from the BigTreeAdmin class (found in /core/inc/bigtree/admin.php). Specifically, these are the most relevant: __construct, login, logout, createUser. You can probably strip out most of the stuff that has to do with permissions in those methods and you will need to change the session and cookie keys if you want it to work alongside the admin logins. If you're not doing front end sign ups, createUser probably isn't needed either. If you're adding users from an admin side form you'll need to create a custom field type that creates the password hashes for you.

If you'd like I can whip up a quick package you can import that will include the class, a custom field type, and the view / form you'd need.

We're working on a better packages/extensions portion of the website for the BigTree 4.2 launch (which will include a more feature-rich "extensions" system to go alongside the current import/export of packages). We'll be sure to add the Events extension when 4.2 launches -- right now it's not all that well documented.

Offline

#3 November 10, 2014 4:44pm

Vykintas
Member
Registered: November 10, 2014
Posts: 4

Re: User Login / Register

timbuckingham wrote:

If you'd like I can whip up a quick package you can import that will include the class, a custom field type, and the view / form you'd need.

That would be super cool! I'm still learning my ways around the system, so it would help out a lot.

Offline

#4 November 11, 2014 11:09am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: User Login / Register

I've put together a package with three things:
- A template called Example Front End User Login that will show you how the front end login would work
- A module called Front End Users that has a simple name, email, and encrypted password field.
- A field type called Encrypted Password that creates password hashes.

You can download it here: http://www.timbuckingham.com/example-fr … -users.zip

You can install it by uploading the zip file in the Developer -> Packages -> Install section of the admin.

Let me know if you have any questions!

Offline

#5 November 11, 2014 2:27pm

Vykintas
Member
Registered: November 10, 2014
Posts: 4

Re: User Login / Register

timbuckingham wrote:

I've put together a package with three things:
- A template called Example Front End User Login that will show you how the front end login would work
- A module called Front End Users that has a simple name, email, and encrypted password field.
- A field type called Encrypted Password that creates password hashes.

You can download it here: http://www.timbuckingham.com/example-fr … -users.zip

You can install it by uploading the zip file in the Developer -> Packages -> Install section of the admin.

Let me know if you have any questions!


Sounds straight forward. Huge thanks for the help! I'll try it and let you know.

Do you have any thoughts on maybe creating a list of downloadable packages for developers? I think that would be quite helpful.


EDIT: Works like a charm! Huge thanks.

Last edited by Vykintas (November 11, 2014 3:03pm)

Offline

#6 November 11, 2014 3:16pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: User Login / Register

Glad it worked well for you!

We have designed a page for showing available packages and extensions, things just got busy and we're waiting for the BigTree 4.2 release before we implement it.

Offline

#7 November 11, 2014 3:21pm

Vykintas
Member
Registered: November 10, 2014
Posts: 4

Re: User Login / Register

Nice! Looking forward to the release. Got a date set for it yet? Maybe need some help testing?

Offline

#8 November 11, 2014 3:23pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: User Login / Register

We're internally developing two projects right now on BigTree 4.2 -- how well the bug testing goes with them will change the release date. Probably January, though!

If you'd like to test it, it's available on GitHub:
https://github.com/bigtreecms/BigTree-C … -devel.zip

Lots of cool new features, you can read about most of them in the readme:
https://github.com/bigtreecms/BigTree-C … 42-release

Offline

#9 October 6, 2015 4:53am

victorng
Member
Registered: October 6, 2015
Posts: 1

Re: User Login / Register

timbuckingham wrote:

I've put together a package with three things:
- A template called Example Front End User Login that will show you how the front end login would work
- A module called Front End Users that has a simple name, email, and encrypted password field.
- A field type called Encrypted Password that creates password hashes.

You can download it here: http://www.timbuckingham.com/example-fr … -users.zip

You can install it by uploading the zip file in the Developer -> Packages -> Install section of the admin.

Let me know if you have any questions!

Please I have the same challenge and when I clicked to download the example front-end users package, it's no longer available.
Kindly help me with the package please.

Offline

#10 October 6, 2015 9:32am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: User Login / Register

Unfortunately it looks like I deleted the package from the server at some point and I don't have the bandwidth right now to put together another one. At some point I'll try to get together an extension that demonstrates a front-end user system, possibly in November after work calms down.

Offline

#11 February 28, 2016 11:58pm

levi730
Member
Registered: February 28, 2016
Posts: 3

Re: User Login / Register

Hello everybody!

I sure would like to get a hold of that .zip package.  Does anybody have access to it?

I'm just getting into the framework and looking to add a front-end login.  Thank you!

Offline

#12 March 3, 2016 10:32am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: User Login / Register

Unfortunately I don't have the package anymore but I do have some good news:
In BigTree 4.3 there will be a common "Auth" class that can be used for your own user system that handles logging in, creating users, password policies and bans, etc.

Offline

#13 March 17, 2016 10:23pm

davidnewcomb
Member
Registered: March 17, 2016
Posts: 7

Re: User Login / Register

I have created a work around that gives me users and protected areas. (Apache only)
1) Make sure your installation uses "End URLs with /".
2) Create a folder in your document root with the same name as the (virtual) folder you want to protect.
3) Create an .htaccess file with:

AuthType Basic
AuthName "Members Area"
AuthUserFile "/path/to/.htpasswd"
require valid-user

4) Add users to the file using htpasswd.

The solution is a bit system-administrator'y but it gets you up and running with no code changes or module/extension installations.

Offline

#14 November 4, 2016 2:14pm

connellhunte
Member
Registered: September 1, 2014
Posts: 2

Re: User Login / Register

davidnewcomb approach above makes sense.

I'm basically looking to create a system where persons can register/login and access specific services.Having looked at the code reference, it seems i should be able to copy the requisite core class as Tim suggested above, create the appropriate module to handle users and sessions. So far so good. Is there an easier way? The default admin class is a huge thing and the API does not seem to have a way to just extract the functions i need.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.