[BETA] Dead Man's Switch

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Dead Man's Switch

Post by MartectX »

IPB_Refugee wrote:I haven't looked at the code of 0.0.3 yet because I'd like to stay with my version of your MOD.
Well' it's BETA and you can help development the most if you play around with the most recent version. :)

I also thought of a way to make this language independent - by having an install_deadman.php which has a nice interface and in turn creates deadman.php in /includes. The install file is subsequently deleted and it is from then on that users will have to edit includes/deadman.php directly.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Dead Man's Switch

Post by IPB_Refugee »

Hello,

@all: I suggest that you go along with Martin's version - the original one - of this MOD as I experienced something I cannot explain a few minutes ago: I got dead man's mail (test mode enabled) although I visited my board less than half an hour ago. (I set DEAD_MAN_DAYS to 0.2.)

Hmm, wait, I have been visiting my board regularly within the last few hours, and my session length is two hours. I'm pretty sure that this is the reason: user_lastvisit has not been reset, and a few minutes ago

time() > (last_time_founder_logged_in() + (DEAD_MAN_DAYS * 86400))

became true. So I guess it would be the best to set

dead_man_time_for_final_mail

everytime new when DEAD_MAN_USER visits a page and to forget about user_lastvisit in table phpbb_users.

Please note that this affects only my version of Martin's MOD and not the original one. And as there is obviously no interest in my version, I promise to not longer hijack this topic (which has never been my intention. :oops:)

Keep up the good work, Martin! This is really a useful MOD! :)
Wolfgang
I also thought of a way to make this language independent - by having an install_deadman.php which has a nice interface and in turn creates deadman.php in /includes. The install file is subsequently deleted and it is from then on that users will have to edit includes/deadman.php directly.
Surely a nice idea, especially regarding users who do not have much experience in installing MODs. Hope you will be able to realize your idea without asking too much of the not so experienced user. (E.g.: Can you simply delete the install file without setting the CHMOD to 0777? I don't know if it is really easier to change the CHMOD of a file for someone who is not even able to edit a text file properly.)
RooMeat
Registered User
Posts: 204
Joined: Sat Jun 24, 2006 10:39 pm
Contact:

Re: [BETA] Dead Man's Switch

Post by RooMeat »

Not sure I understand the usefulness of this mod.
In my own forums I have a second admin that I know and trust. He already has access to everything.. but he does not play. This way.. I get to "test" if my chosen admin is going to do the right things in the event that something happens to me. I don't need to worry about the security of my settings or my site.. as the details have already been passed to the person I trust.
I think simply.. having a second admin negates any need for a mod like this. Just MHO of course :)
Live site: http://www.ozsportsbikes.com (Converted from Nuked phpbb2 to stand alone phpBB3)
Test site: http://www.ozsuperbikes.com
Local Test site with XAMPP
User avatar
GoBieN
Registered User
Posts: 546
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium
Contact:

Re: [BETA] Dead Man's Switch

Post by GoBieN »

RooMeat wrote:Not sure I understand the usefulness of this mod.
In my own forums I have a second admin that I know and trust. He already has access to everything.. but he does not play. This way.. I get to "test" if my chosen admin is going to do the right things in the event that something happens to me. I don't need to worry about the security of my settings or my site.. as the details have already been passed to the person I trust.
I think simply.. having a second admin negates any need for a mod like this. Just MHO of course :)
True, but i have a team with 6 mods, of those mods, 2 have admin powers. But none other than myself, know the FTP passwords or the control panel passwords, or details of my hosting etc ...

Maybe i will implement this ...
RooMeat
Registered User
Posts: 204
Joined: Sat Jun 24, 2006 10:39 pm
Contact:

Re: [BETA] Dead Man's Switch

Post by RooMeat »

Yeah but thats what I am saying.
My second Admin DOES have those details already. I don't need to risk these details being stored on any internet site or anything else. I have them.. and my second Admin has them. If I die.. he can take straight over without a problem. Of course.. you need to be able to select a admin that ou can trust with these details.. but if your going to set it up in a mod to send it to them.. you may as well give it to them now ;)
Live site: http://www.ozsportsbikes.com (Converted from Nuked phpbb2 to stand alone phpBB3)
Test site: http://www.ozsuperbikes.com
Local Test site with XAMPP
User avatar
GoBieN
Registered User
Posts: 546
Joined: Fri Mar 05, 2004 5:22 pm
Location: Belgium
Contact:

Re: [BETA] Dead Man's Switch

Post by GoBieN »

Let's hope for you, that the trustee hasn't forgotten this important information by then. Since he can't use it NOW, it could be that he forgets where to find it to ;)
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Dead Man's Switch

Post by MartectX »

IPB_Refugee wrote:Hello,

@all: I suggest that you go along with Martin's version - the original one - of this MOD as I experienced something I cannot explain a few minutes ago: I got dead man's mail (test mode enabled) although I visited my board less than half an hour ago. (I set DEAD_MAN_DAYS to 0.2.)

Hmm, wait, I have been visiting my board regularly within the last few hours, and my session length is two hours. I'm pretty sure that this is the reason: user_lastvisit has not been reset, and a few minutes ago

time() > (last_time_founder_logged_in() + (DEAD_MAN_DAYS * 86400))

became true. So I guess it would be the best to set

dead_man_time_for_final_mail

everytime new when DEAD_MAN_USER visits a page and to forget about user_lastvisit in table phpbb_users.
This scenario will most surely not happen in reality as §dead_man_days has a minimum setting of 7.

But thanks for reporting, I'm glad that the mod is tested by others, too! ;)
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Dead Man's Switch

Post by IPB_Refugee »

RooMeat wrote:Yeah but thats what I am saying.
My second Admin DOES have those details already.
You simply do not need this MOD when your second admin has already got all information to keep your board running when you passed away.

@Martin: I'm pretty sure that the issue I mentioned affects only my version of the MOD (which no longer exists for the public). ;) (Of course, I will try to continue developing my version because I can improve my PHP skills this way. Should I ever find an issue which affects also your version, I will surely let you know!)

Regards
Wolfgang
User avatar
chatalie
Registered User
Posts: 46
Joined: Wed Mar 19, 2008 11:34 pm
Contact:

Re: [BETA] Dead Man's Switch

Post by chatalie »

Dang, how gruesome :o . But I will be needing it, JIC :cry:

Thanks for the mod
(^.^)
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Dead Man's Switch

Post by IPB_Refugee »

Hi Martin,

here is an idea to save some lines of code: Let's try to make dead_man_nextcheck a dynamical value in phpBB_config. Then you will be able to always have the correct time when the founder last visited the board without doing a double check.

To get an idea (it's taken from my experimental code but you will understand):

When initializing the database at the first running of the script:

Code: Select all

set_config('dead_man_last_visit', $letzter_login, true);
Later:

Code: Select all

// Check all five minutes if DEAD_MAN_USER runs the script and set dead_man_last_visit properly
if ( $user->data['user_id'] == DEAD_MAN_USER && ((time() - $config['dead_man_last_visit']) > 300) )
	set_config('dead_man_last_visit', time(), true);
Regards
Wolfgang
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Dead Man's Switch

Post by MartectX »

IPB_Refugee, that's brilliant! This way we won't have to do any additional database queries at all! Why didn't I have that idea myself, I must ask?! :lol:

Will implement this tomorrow!!
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Dead Man's Switch

Post by IPB_Refugee »

You are very welcome! :)

In fact, it helped me to reduce the code of my version (with its easy and safely to use test mode) for more than 70 lines... Now my version has only 155 lines at the moment (but haven't fully tested it yet...)

But now to something different which should also affect the original version of this MOD:

trigger_error does not work properly for me in

Code: Select all

// Save the user from pointing to a file that does not exist
and

Code: Select all

// Save the user from setting the timer too low
Obviously I do not get my stylesheet (no .css file gets "parsed" in my Firefox 3), and there are other displaying errors (like not parsed language variables), too.

It's not dangerous but it looks quite ugly. :roll: Therefore I changed trigger_error(...) to

Code: Select all

exit('Invalid $dead_man_file');
and

Code: Select all

exit('$dead_man_days must be 7 or more');
Do you have the same problem with using trigger_error in deadman.php?

Regards
Wolfgang

BTW: I had to purge the cache again after installing the new version. (At the moment I'm doing all testing regarding this MOD with phpMyAdmin opened and looking carefully at phpbb_config.)
Martin wrote:This way we won't have to do any additional database queries at all!
I think we still will need one additional query when deadman.php gets started for the very first time? From my code:

Code: Select all

// Initialize database
if (!isset($config['dead_man_status']))
{
	$sql = 'SELECT user_lastvisit
		FROM ' . USERS_TABLE . '
		WHERE user_id = ' . DEAD_MAN_USER;
	$result = $db->sql_query($sql);
	$letzter_login = $db->sql_fetchfield('user_lastvisit');
	$db->sql_freeresult($result);
	
	(DEAD_MAN_TEST) ? set_config('dead_man_status', 'test', true) : set_config('dead_man_status', 'not_alerted', true);
	set_config('dead_man_last_visit', $letzter_login, true);
}
BTW: I'm not sure about the lines

Code: Select all

	$result = $db->sql_query($sql);
	$letzter_login = $db->sql_fetchfield('user_lastvisit');
	$db->sql_freeresult($result);
They are working well but when I get $letzter_login from $db->sql_fetchfield('user_lastvisit'), do I really need line 1 and 3, too? :oops:
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [BETA] Dead Man's Switch

Post by Dog Cow »

I haven't read all the posts, so I'm sorry if this has already been mentioned, but maybe you should make it so the trustee has to enter his password in order to decrypt the message, ie, his password is always used as the encryption key, so whenever he changes his password, the message is decrypted, the re-encrypted with the new password.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Dead Man's Switch

Post by IPB_Refugee »

That's of course an idea which should be considered, Dog Cow!

But what happens when the trustee forgets his/her password?

It is surely an advantage of this MOD that is highly configurable when you have some knowledge in PHP...

But be sure: The simplier you keep this MOD, the better is the chance that it will do what you want when you go to the stars...

Regards
Wolfgang

BTW: In fact, there is no encryption/decryption system needed to make this MOD a safe one.
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [BETA] Dead Man's Switch

Post by MartectX »

Version 0.1.0
  • Completely changed monitoring mechanism (Big Thank You to IPB_Refugee)
IPB_Refugee wrote:trigger_error does not work properly for me
Thanks, fixed it. Don't know why trigger_error makes so much trouble when called though...
IPB_Refugee wrote:
Martin wrote:This way we won't have to do any additional database queries at all!
I think we still will need one additional query when deadman.php gets started for the very first time?
No, we don't - just pretend that $dead_man_user is alive and rockin' at the time of installation and set $dead_man_nextcheck accordingly (time() + $dead_man_days * 86400)!

By the way, IPB_Refugee, I changed all config variables in the new version, please have a look at it, will you? :)
Dog Cow wrote:I haven't read all the posts, so I'm sorry if this has already been mentioned, but maybe you should make it so the trustee has to enter his password in order to decrypt the message, ie, his password is always used as the encryption key, so whenever he changes his password, the message is decrypted, the re-encrypted with the new password.
But then you'd force your trusted person to have a board account and you could not have more than one. :? Also, as IPB_Refugee pointed out, he/they could always forget his/their passwords.
Locked

Return to “[3.0.x] MODs in Development”