| Topic Archived |
View previous topic :: View next topic |
| Author |
Message |
Dizfunkshunal Platinum Supporter


Offline Joined: Mar 23, 2006 Posts: 2064
|
Posted: Wed Sep 20, 2006 3:07 am Post subject: Auto Timer for suspended accounts |
|
Here would be a nice admin feature. A timer forthe suspended account. like suspend acount for 1 or 2 or 3 or 5 or 7 days drop down menu to choose how many days to suspend them for and then when that time is up there account automatically gets unsuspended. and an email should be sent to admins letting them know.
_________________ Diz Web Design Status: Open (Use of resources requires registration.)
Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Multiple Setups
|
|
| Back to top |
|
 |
jeffk Supporter


Offline Joined: Jun 21, 2004 Posts: 322
|
Posted: Wed Sep 20, 2006 9:12 am Post subject: Re: Auto Timer for suspended accounts |
|
good idea , would be of use to me
cant seeing it being developed tho , DF has ground to a halt
maybe try over at dfbounty
_________________ CMS Version 9.1.2.1
PHP Version 4.4.4
MySQL Version 4.1.22-standard (client: 4.1.22)
jeffk's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) CMS Version 9.1.2.1HP Version 4.4.4MySQL Version 4.1.22-standard (client: 4.1.22
|
|
| Back to top |
|
 |
DarrylHadfield Newbie


Offline Joined: Nov 04, 2004 Posts: 15 Location: Ohio
|
Posted: Mon Mar 12, 2007 3:48 pm Post subject: Re: Auto Timer for suspended accounts |
|
Old thread, but I third that motion. Very handy for admins.
DarrylHadfield's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) private. :)
|
|
| Back to top |
|
 |
Kendle 500+ Posts Club


Offline Joined: Dec 16, 2004 Posts: 552
|
Posted: Mon Mar 12, 2007 4:35 pm Post subject: Re: Auto Timer for suspended accounts |
|
How would the account get "automatically" unsuspended? You'd need a cron job or similar running on the server to do this, it'd not be part of the CMS (web pages / programs are initiated by a client, they don't run automatically).
If you have the capability to run cron jobs (and you can execute PHP scripts from a command line) I have just such a system running on www.gamersnation.co.uk
We suspend users for a period of time (day / week / month / year) and a cron job un-suspends them when the time is up. If anyone's interested gimme a shout, I should be able to package up the code I used to do it (DF 9.0.6.1 tho, not tried it with DF9.1).
_________________ Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk
Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
jeffk Supporter


Offline Joined: Jun 21, 2004 Posts: 322
|
Posted: Mon Mar 12, 2007 4:40 pm Post subject: Re: Auto Timer for suspended accounts |
|
is this integrated into df ie admin interface for suspending users and setting a time for suspension ?
_________________ CMS Version 9.1.2.1
PHP Version 4.4.4
MySQL Version 4.1.22-standard (client: 4.1.22)
jeffk's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) CMS Version 9.1.2.1HP Version 4.4.4MySQL Version 4.1.22-standard (client: 4.1.22
|
|
| Back to top |
|
 |
DarrylHadfield Newbie


Offline Joined: Nov 04, 2004 Posts: 15 Location: Ohio
|
Posted: Mon Mar 12, 2007 4:43 pm Post subject: Re: Auto Timer for suspended accounts |
|
You mean a CRON tab? No you wouldn't.
When the user goes to log in, if they're suspended, do a check against the initial ban. CRONtabbing would be too much for this, and would require resources that most providers would (or at least, SHOULD) not want to expose to hosting users.
Simple Example:
Johnny Badman posts a naughty pic of his girlfriend on December 25th (Merry Christmas), and an admin bans him for a day. He tries to log back in on the 25th, and gets a notice that he's been temporarily banned, and the ban will be lifted 24 hours from 10:34am EST, which was when the ban was set.
He tries to log in at 10:33 the next day, the system does a query for his account and sees that it's banned - and Johnny gets a message stating the ban will be lifted in 1 minute.
He tries to log in at 10:35, and he gets in, because the ban automatically lifts when the system checks the expiration date for the ban when he's logging in.
D.
DarrylHadfield's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) private. :)
|
|
| Back to top |
|
 |
Kendle 500+ Posts Club


Offline Joined: Dec 16, 2004 Posts: 552
|
Posted: Mon Mar 12, 2007 5:01 pm Post subject: Re: Auto Timer for suspended accounts |
|
Jeff, yes.
DarrylHadfield, yep, you could do it that way. I just did it the cron job way because a) it required less hacking of core code, and b) because I can, I own and run the server the site mentioned above runs on.
_________________ Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk
Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
jeffk Supporter


Offline Joined: Jun 21, 2004 Posts: 322
|
Posted: Mon Mar 12, 2007 6:44 pm Post subject: Re: Auto Timer for suspended accounts |
|
can you hook me up with a copy then please Mark
_________________ CMS Version 9.1.2.1
PHP Version 4.4.4
MySQL Version 4.1.22-standard (client: 4.1.22)
jeffk's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) CMS Version 9.1.2.1HP Version 4.4.4MySQL Version 4.1.22-standard (client: 4.1.22
|
|
| Back to top |
|
 |
Kendle 500+ Posts Club


Offline Joined: Dec 16, 2004 Posts: 552
|
Posted: Mon Mar 12, 2007 6:48 pm Post subject: Re: Auto Timer for suspended accounts |
|
Will do. You're using DF9.1, or still on 9.0.6.1?
_________________ Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk
Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
jeffk Supporter


Offline Joined: Jun 21, 2004 Posts: 322
|
Posted: Mon Mar 12, 2007 7:00 pm Post subject: Re: Auto Timer for suspended accounts |
|
9.1
_________________ CMS Version 9.1.2.1
PHP Version 4.4.4
MySQL Version 4.1.22-standard (client: 4.1.22)
jeffk's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) CMS Version 9.1.2.1HP Version 4.4.4MySQL Version 4.1.22-standard (client: 4.1.22
|
|
| Back to top |
|
 |
tkog2004 Heavy poster


Offline Joined: May 14, 2006 Posts: 152
|
|
| Back to top |
|
 |
Kendle 500+ Posts Club


Offline Joined: Dec 16, 2004 Posts: 552
|
Posted: Tue Mar 13, 2007 11:47 am Post subject: Re: Auto Timer for suspended accounts |
|
OK, thought I might as well do this reasonably properly, and for DF9.1 as that's the current version (probably works in 9.0.6.1 but don't take my word for it).
Package is attached to this post and can also be downloaded from:-
www.cmsdreams.co.uk/do...nduser.zip
Here's the README :-
===============================================================
Add Suspend User for time period functionality to DragonFly 9.1
13/03/2007 - www.cmsdreams.co.uk
===============================================================
This hack replaces core files of the DragonFly 9.1 CMS.
DO NOT ATTEMPT TO USE THIS HACK IF YOU'RE IN ANY WAY UNCOMFORTABLE ABOUT REPLACING CORE FILES!!!
The files replaced are :-
/admin/modules/users.php
/admin/modules/users_susdel.inc
/includes/classes/cpg_member.php
/modules/Your_Account/edit_profile.php
MAKE SURE YOU KEEP COPIES OF THE ORIGINAL FILES SO YOU CAN RESTORE THEM LATER IF REQUIRED!!!
INSTALLATION
============
1.
Apply the SQL file contained in this package to your database. This SQL file adds 3 new fields to the users table. If your users table is not called "cms_users" you will need to edit the table name in this SQL file before applying it.
If you don't understand what this instruction means, or you don't have access to your database, STOP NOW and do NOT attempt to use this hack.
2.
Upload the files in the "html" folder in this package to your website root folder.
That's all there is to it!
INSTRUCTIONS
============
This hack amends a field on the "Privileges" tab of the "Edit User" Admin panel screen. (Admin -> Members -> Edit User -> Privileges)
You can specify a quantity and a time period for which you wish to suspend a user. So you can suspend them for 3 hours, 6 days, 9 months for example, or suspend them permanently. The email sent to the user informing them they've been suspended will indicate how long they've been suspended for.
Further, on the "Suspended Users" tab of the "Members" Admin panel screen the date / time until which the user has been suspended is included in the list. Restoring a user from this screen clears their suspension data in their user account.
When a suspended user logs into your website their suspension time is checked against current time. If the suspension has expired their suspension data is cleared and they're allowed to log in. If it hasn't, they're not allowed to login, as per standard DragonFly behaviour.
As it says, don't use this if you don't understand the implications of doing so. It replaces core files and is likely to break the very next time the DF Devs release a new version. Use at your own risk, without warranty and all that
Unlike my solution posted earlier this one doesn't require a CRON job to update a user's status. It checks a timestamp in their account (either when logging in or when reading their cookie if already logged in) to see if their suspension has expired. If it has, it clears the suspension data in their account and allows them to acces to the site, or log in if not logged in.
Tested on my own DF9.1 site and seems to work OK.
_________________ Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk
Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
jeffk Supporter


Offline Joined: Jun 21, 2004 Posts: 322
|
Posted: Tue Mar 13, 2007 2:28 pm Post subject: Re: Auto Timer for suspended accounts |
|
thx Mark , installed ok , just testing atm
one typo in language needs changing to
define('_CMSD_PERMANENT','Permanently');
_________________ CMS Version 9.1.2.1
PHP Version 4.4.4
MySQL Version 4.1.22-standard (client: 4.1.22)
jeffk's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) CMS Version 9.1.2.1HP Version 4.4.4MySQL Version 4.1.22-standard (client: 4.1.22
|
|
| Back to top |
|
 |
tkog2004 Heavy poster


Offline Joined: May 14, 2006 Posts: 152
|
|
| Back to top |
|
 |
dusman Dragonfly addicted


Offline Joined: Mar 17, 2006 Posts: 303 Location: Maryland
|
Posted: Wed Mar 14, 2007 1:37 pm Post subject: Re: Auto Timer for suspended accounts |
|
would be a nice feature to have built in for sure
_________________ -Dustin
Celebrity Babes | Celebrity Videos | Funny Videos | Information for Men
dusman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1
|
|
| Back to top |
|
 |
|
|