From 18be18ebf86329bfd78c281011c200c85a103dd3 Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Tue, 29 Oct 2019 16:11:37 -0300 Subject: [PATCH] Adds log for user invitations --- client/src/app-components/activity-row.js | 2 ++ client/src/data/languages/en.js | 1 + server/controllers/user/invite.php | 3 ++- server/models/Log.php | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/app-components/activity-row.js b/client/src/app-components/activity-row.js index cb5dec18..d7c7215f 100644 --- a/client/src/app-components/activity-row.js +++ b/client/src/app-components/activity-row.js @@ -23,6 +23,7 @@ class ActivityRow extends React.Component { 'EDIT_SETTINGS', 'SIGNUP', + 'INVITE', 'ADD_TOPIC', 'ADD_ARTICLE', 'DELETE_TOPIC', @@ -106,6 +107,7 @@ class ActivityRow extends React.Component { 'EDIT_SETTINGS': 'wrench', 'SIGNUP': 'user-plus', + 'INVITE': 'user-plus', 'ADD_TOPIC': 'book', 'ADD_ARTICLE': 'book', 'DELETE_TOPIC': 'book', diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 17917dc2..c671f716 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -234,6 +234,7 @@ export default { 'ACTIVITY_EDIT_SETTINGS': 'edited settings', 'ACTIVITY_SIGNUP': 'signed up', + 'ACTIVITY_INVITE': 'invited user', 'ACTIVITY_ADD_TOPIC': 'added topic', 'ACTIVITY_ADD_ARTICLE': 'added article', 'ACTIVITY_DELETE_TOPIC': 'deleted topic', diff --git a/server/controllers/user/invite.php b/server/controllers/user/invite.php index d5dd7666..d2eb2668 100755 --- a/server/controllers/user/invite.php +++ b/server/controllers/user/invite.php @@ -102,7 +102,8 @@ class InviteUserController extends Controller { 'userId' => $userId, 'userEmail' => $this->userEmail ]); - // TODO: Log::createLog('SIGN_UP', null, User::getDataStore($userId)); + + Log::createLog('INVITE', $this->userName); } else { throw new RequestException(ERRORS::MAIL_SENDER_NOT_CONNECTED); } diff --git a/server/models/Log.php b/server/models/Log.php index a1d99687..fd126fcf 100755 --- a/server/models/Log.php +++ b/server/models/Log.php @@ -26,7 +26,7 @@ class Log extends DataStore { ]; } - public static function createLog($type,$to, $author = null) { + public static function createLog($type, $to, $author = null) { if($author === null) { $author = Controller::getLoggedUser(); }