[2.0.17] Email Admin on ACP Login

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
4
33%
Very Good
1
8%
Good
2
17%
Fair
1
8%
Poor
4
33%
 
Total votes: 12

Been Told
Registered User
Posts: 90
Joined: Sat May 07, 2005 11:26 pm

Post by Been Told »

This mod is not working for me. I don't get an e-mail. I tried changing my board email address but nothing seems to help.

Any ideas?

Other than that: Great idea for a mod!
User avatar
B€RN@RD
Registered User
Posts: 89
Joined: Mon Dec 30, 2002 10:25 am
Location: maisons laffitte / france

Post by B€RN@RD »

see kalipo post on page 3 of this thread !!!
happypappy
Registered User
Posts: 463
Joined: Wed Apr 27, 2005 1:44 am

Post by happypappy »

I have changed all the coding from the post in the first thread......and still getting a parse error in the mods code.......is there a final fixed version of this mod?????? PLEASE :wink:
User avatar
B€RN@RD
Registered User
Posts: 89
Joined: Mon Dec 30, 2002 10:25 am
Location: maisons laffitte / france

Post by B€RN@RD »

hello ,

could it be possible to add one more ID at least. In my case I have a second admin and would like he should be emailed when I'm absent

thks
b€rn@rd
NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP »

I installed this using the script from page 3 on the second try, then tried to force it to send me an email when I entered the ACP. I never got the email. Does this require that the SMTP settings be entered or does it use either the SMTP or standard phpBB email system to email the notice???

I'm withholding judgement until there is an updated version of this MOD. The MOD in the download should be pulled because it is missing the right parenthesis and breaks the ACP when installed. No one should have to read the topic to find a fix for this MOD. How did this MOD get past the validation process in its current state???

:?
User avatar
The Defpom
Registered User
Posts: 101
Joined: Sat Aug 21, 2004 11:58 pm
Location: New Zealand
Contact:

Post by The Defpom »

Yep, there was a bug in the original code, I have tried to resubmit a better version to replace this one, but it got turned down for some minor issue, I will try again to get it replaced.
cotisimo
Registered User
Posts: 2
Joined: Tue Mar 22, 2005 1:22 pm
Location: Boston

Post by cotisimo »

Cool. Thanks for all your hard work man.
User avatar
The Defpom
Registered User
Posts: 101
Joined: Sat Aug 21, 2004 11:58 pm
Location: New Zealand
Contact:

Post by The Defpom »

I have resubmitted the MOD, I am confident that it will be validated this time around.

For those that have already installed my MOD and wish to have the bugs fixed you can get it from my forum MODs section (see my signature), this will be uneccessary once the MOD is updated here with the latest version.

I have installed the latest version on my forum and tested it, it is working for me.
NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP »

Excellent. The 1.1.2 version works much better. I have more than one admin in my community, so it would be nice to be able to set more than one admin, perhaps in the ACP instead of hardcoding it. But I am happy with what this offers. Perhaps in future versions, you can add the additional ACP feature with multiple permissions too...

:lol:
User avatar
The Defpom
Registered User
Posts: 101
Joined: Sat Aug 21, 2004 11:58 pm
Location: New Zealand
Contact:

Post by The Defpom »

NightriderXP wrote: Excellent. The 1.1.2 version works much better. I have more than one admin in my community, so it would be nice to be able to set more than one admin, perhaps in the ACP instead of hardcoding it. But I am happy with what this offers. Perhaps in future versions, you can add the additional ACP feature with multiple permissions too...

:lol:


I have had a couple of requests for the inclusion of multiple admins, and ACP would be the way to go, I will bare it in mind if I do any more work with it, time is getting pretty short around here these days.
NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP »

I was just hardcoding a little workaround until you find the time to add the additional functionality. I'm not sure if it works yet, but I don't see any reason why it wouldn't. Do you???

Code: Select all

	$checkforid = "0"; // sets the ID of the authorised admin/user, anything other than this ID will trigger the mod
	$adminemailid = "2"; // sets the user ID of the person to email if mod is triggered
	$adminemailid2 = "3"; // sets the user ID of the person to email if mod is triggered
	
	if( $userdata['user_id'] != $checkforid ) //User ID of Admin, checks if the user ID is NOT admin user id, if true it runs the statement.
		 {
		 include($phpbb_root_path . 'includes/emailer.'.$phpEx);
		 $emailer = new emailer($board_config['smtp_delivery']);
		  $sql = 'SELECT user_email, user_timezone, user_dateformat FROM ' . USERS_TABLE . 
		  	   	 ' WHERE user_id =' . $adminemailid .
				 ' OR  user_id =' . $adminemailid2;
					if( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
					}
	
					while ($row = $db->sql_fetchrow($result))
					{
						$emailer->from($board_config['board_email']);
						$emailer->replyto($board_config['board_email']);
						$emailer->email_address(trim($row['user_email']));
						$emailer->use_template('admin_acp_login');
						$emailer->set_subject($lang['ACP_Login']);
						$emailer->assign_vars(array(
							'USERNAME' => $userdata['username'],
							'USERID' => $userdata['user_id'],
							'USERIP' => decode_ip($user_ip),
							'SITENAME' => $board_config['sitename'],
						   'TIME' => sprintf($lang['Current_time'], create_date($row['user_dateformat'], time(), $row['user_timezone'])))
						);
						$emailer->send();
						$emailer->reset();
					}
			$db->sql_freeresult($result);
		}
:lol:
NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP »

Can you figure out why this doesn't work? I receive an email all the time even though my userid is in the $adminid array:

Code: Select all

	$adminid = array( "2","3" );
	$emailto = array( "2","3" );
	$validid = 0;
	
	for($i = 0; $i < count($adminid) && !$validid; $i++)
	{
	   $validid = $userdata['user_id'] == $adminid[$i];
	}
	
	if( !$validid ) //User ID of Admin, checks if the user ID is NOT admin user id, if true it runs the statement.
	{
		 include($phpbb_root_path . 'includes/emailer.'.$phpEx);
		 $emailer = new emailer($board_config['smtp_delivery']);
		 $sql = 'SELECT user_email, user_timezone, user_dateformat FROM ' . USERS_TABLE; 

		 for($i = 0; $i < count($emailto); $i++)
		 {
		   if ( !$i )
		   {
			 $sql = $sql . ' WHERE user_id =' . $emailto[$i];
			}
			{
			  $sql = $sql . ' OR  user_id =' . $emailto[$i];
			}
		 }

					if( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
					}
	
					while ($row = $db->sql_fetchrow($result))
					{
						$emailer->from($board_config['board_email']);
						$emailer->replyto($board_config['board_email']);
						$emailer->email_address(trim($row['user_email']));
						$emailer->use_template('admin_acp_login');
						$emailer->set_subject($lang['ACP_Login']);
						$emailer->assign_vars(array(
							'USERNAME' => $userdata['username'],
							'USERID' => $userdata['user_id'],
							'USERIP' => decode_ip($user_ip),
							'SITENAME' => $board_config['sitename'],
						   'TIME' => sprintf($lang['Current_time'], create_date($row['user_dateformat'], time(), $row['user_timezone'])))
						);
						$emailer->send();
						$emailer->reset();
					}
			$db->sql_freeresult($result);
	}
:?
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Updated to version 1.1.3
See first post for Download Link
User avatar
badboy4ever
Registered User
Posts: 177
Joined: Sat Jun 11, 2005 2:38 pm
Location: UK

Post by badboy4ever »

Has the topic become dead? Is anyone having trouble with it becuase I want to know if somone has installed it with no problems.

Image
NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP »

No this topic isn't dead. I installed this on my heavily modded board using EM and it works fine. Of course I made some minor changes to make it so that it recognizes multiple admins and I have one small problem from my modifications that I'm hoping the author will be able to answer. Hopefully the ability to include multiple admins will be added in future versions of this MOD...

:lol:
Post Reply

Return to “[2.0.x] MOD Database Releases”