Handy edit to login > public.php while game is new
Posted: Fri Feb 10, 2017 3:09 pm
For anyone else that doesn't want to have to log in constantly to see if anyone else has logged in this line of code will alert you with an email when someone logs into the game. It will include the user name of the person who logged in.
In the login module edit the public.php file around line 55.
becomes
Obviously you'll want to substitute your real email address.
In the login module edit the public.php file around line 55.
Code: Select all
$_SESSION["userid"] = $result->fields[0];
$_SESSION["username"] = $result->fields[1];
$_SESSION["block"] = $result->fields[2];
$userId = $result->fields[0];
$result->Close();
Code: Select all
$_SESSION["userid"] = $result->fields[0];
$_SESSION["username"] = $result->fields[1];
$_SESSION["block"] = $result->fields[2];
//added to send email alerts when someone logs in
mail("somemail@somedomain.com","Someone has logged into the game!", $result->fields[1], Translate("The following player has logged into the game:"));
$userId = $result->fields[0];
$result->Close();