Skip to content

Commit

Permalink
Added IP address to new user creation notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
kulttuuri committed Nov 30, 2016
1 parent 09d8280 commit 819a1e1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions DiscordNotifications/DiscordNotificationsCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,19 @@ static function discord_new_user_account($user, $byEmail)
global $wgDiscordNotificationNewUser;
if (!$wgDiscordNotificationNewUser) return;

$email = "";
$realname = "";
$ipaddress = "";
try { $email = $user->getEmail(); } catch (Exception $e) {}
try { $realname = $user->getEmail(); } catch (Exception $e) {}
try { $ipaddress = $user->getRequest()->getIP(); } catch (Exception $e) {}

$message = sprintf(
"New user account %s was just created (email: %s, real name: %s)",
"New user account %s was just created (email: %s, real name: %s, IP: %s)",
self::getDiscordUserText($user),
$user->getEmail(),
$user->getRealName());
$email,
$realname,
$ipaddress);
self::push_discord_notify($message, $user);
return true;
}
Expand Down

0 comments on commit 819a1e1

Please sign in to comment.