Developing Plugins - Half way there...

7 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 6, 2013   (RSS)

Re: [gversion] Developing Plugins - Half way there...

By gregThomas - November 29, 2012

Hi Greg,

I don't think you need to create your own plugin hook for this plugin as there is already a filter in the file cmsAdmin/lib/menus/login.php. If you look at the file you will see that it has a filter called login_content around line 33. In your plugin file you need to call the function addFilter, and use that to amend your checkbox to the login page.

Then to check if your checkbox has been ticked after the user has logged in you will need to use the action hook admin_prelogin to run your cookie creation code. So in your plugin you need to call the function addAction using the admin_prelogin hook as the first variable, and the name of your function that contains the cookie creation code as the second variable.

I would look for other plugins that use the addAction and addFilter functions to understand how they integrate into a plugin.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [gversion] Developing Plugins - Half way there...

By gversion - December 17, 2012

Hello,

Thanks for your help with this. I have updated the plugin and was wondering if you could try it out?

If it works then I will be pleased to add it as a free plugin for people to use.

Regards,
Greg
Attachments:

loginremember.zip 1K

Re: [gversion] Developing Plugins - Half way there...

By gversion - January 18, 2013

Dear all,

I was wondering if anyone had tried out this plugin I am working on. I'd be grateful to hear back from anyone that can help make this work well.

Regards,

Greg

Re: [gversion] Developing Plugins - Half way there...

By gkornbluth - March 3, 2013

Hi Greg,

Sorry for the delay in replying,

Did you ever get this working?

When I tried to implement your plugin I got a Notice: Undefined variable: checked in /hsphere/local/home/gkornblu/thecmsbcookbook.com/cmsAdmin/plugins/loginRemember.php on line 30, and never had time to really work it through.

Not sure what I have to do to set up the plugin besides activating it.

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gversion] Developing Plugins - Half way there...

By gversion - March 5, 2013

Hi Jerry,

I was trying to create the plugin so that you only need to "activate" it and then it adds the "Remember me" checkbox to the login page. However, I can't seem to get this working without editing some other files. It would be good to hear from the Interactive Tools guys to know if this is actually possible...

Regards,

Greg

Re: [gversion] Developing Plugins - Half way there...

By gkornbluth - March 6, 2013

Hi Greg,

I think the plugin is a great idea.

What other files do you have to edit to make the plugin work?

What fields do you have to add to which editors/viewers with what default values?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php