- added email notifications for "rally points", closed #279

This commit is contained in:
Exodus4D
2016-08-08 20:48:28 +02:00
parent 97f20677ac
commit e23bb6790b
6 changed files with 74 additions and 8 deletions

View File

@@ -35,7 +35,9 @@ class User extends Controller\Controller{
const SESSION_KEY_CHARACTER_REFRESH_TOKEN = 'SESSION.CHARACTER.REFRESH_TOKEN';
// log text
const LOG_LOGGED_IN = 'userId: %s, userName: %s, charId: %s, charName: %s';
const LOG_LOGGED_IN = 'userId: [%10s], userName: [%30s], charId: [%20s], charName: %s';
const LOG_DELETE_ACCOUNT = 'userId: [%10s], userName: [%30s], ip: [%45s]';
/**
* valid reasons for captcha images
@@ -340,9 +342,8 @@ class User extends Controller\Controller{
if($status){
// save log
$logText = "id: %s, name: %s, ip: %s";
self::getLogger('DELETE_ACCOUNT')->write(
sprintf($logText, $user->id, $user->name, $f3->get('IP'))
sprintf(self::LOG_DELETE_ACCOUNT, $user->id, $user->name, $f3->get('IP'))
);
// remove user

View File

@@ -19,9 +19,8 @@ class Controller {
const COOKIE_NAME_STATE = 'cookie';
const COOKIE_PREFIX_CHARACTER = 'char';
const LOG_UNAUTHORIZED = 'IP: [%-20s] Agent: [%s]';
const ERROR_SESSION_SUSPECT = 'Suspect id: [%30s], ip: [%40s], new ip: [%40s], User-Agent: %s ';
const LOG_UNAUTHORIZED = 'ip: [%45s], User-Agent: [%s]';
const ERROR_SESSION_SUSPECT = 'Suspect id: [%45s], ip: [%45s], new ip: [%45s], User-Agent: %s ';
/**
* @var \Base
*/

View File

@@ -41,4 +41,19 @@ class MailController extends \SMTP{
return $status;
}
/**
* send notification mail for new rally point systems
* @param $to
* @param $msg
* @return bool
*/
public function sendRallyPoint($to, $msg){
$this->set('To', '<' . $to . '>');
$this->set('From', 'Pathfinder <' . Controller::getEnvironmentData('SMTP_FROM') . '>');
$this->set('Subject', 'PATHFINDER - New rally point');
$status = $this->send($msg);
return $status;
}
}