diff --git a/server/controllers/staff/invite.php b/server/controllers/staff/invite.php index ce1748e5..28231ba4 100755 --- a/server/controllers/staff/invite.php +++ b/server/controllers/staff/invite.php @@ -69,8 +69,6 @@ class InviteStaffController extends Controller { if(!$staffRow->isNull()) throw new RequestException(ERRORS::ALREADY_A_STAFF); - if(!MailSender::getInstance()->isConnected()) throw new RequestException(ERRORS::MAIL_SENDER_NOT_CONNECTED); - $staff = new Staff(); $staff->setProperties([ 'name'=> $this->name, diff --git a/server/controllers/user/invite.php b/server/controllers/user/invite.php index d2eb2668..469829d5 100755 --- a/server/controllers/user/invite.php +++ b/server/controllers/user/invite.php @@ -26,7 +26,6 @@ DataValidator::with('CustomValidations', true); * @apiUse ALREADY_BANNED * @apiUse NO_PERMISSION * @apiUse INVALID_CUSTOM_FIELD_OPTION - * @apiUse MAIL_SENDER_NOT_CONNECTED * * @apiSuccess {Object} data Information about invited user * @apiSuccess {Number} data.userId Id of the invited user @@ -83,30 +82,26 @@ class InviteUserController extends Controller { throw new RequestException(ERRORS::ALREADY_BANNED); } - if(MailSender::getInstance()->isConnected()) { - $userId = $this->createNewUserAndRetrieveId(); + $userId = $this->createNewUserAndRetrieveId(); - $this->token = Hashing::generateRandomToken(); + $this->token = Hashing::generateRandomToken(); - $recoverPassword = new RecoverPassword(); - $recoverPassword->setProperties(array( - 'email' => $this->userEmail, - 'token' => $this->token, - 'staff' => false - )); - $recoverPassword->store(); + $recoverPassword = new RecoverPassword(); + $recoverPassword->setProperties(array( + 'email' => $this->userEmail, + 'token' => $this->token, + 'staff' => false + )); + $recoverPassword->store(); - $this->sendInvitationMail(); + $this->sendInvitationMail(); - Response::respondSuccess([ - 'userId' => $userId, - 'userEmail' => $this->userEmail - ]); + Response::respondSuccess([ + 'userId' => $userId, + 'userEmail' => $this->userEmail + ]); - Log::createLog('INVITE', $this->userName); - } else { - throw new RequestException(ERRORS::MAIL_SENDER_NOT_CONNECTED); - } + Log::createLog('INVITE', $this->userName); } public function storeRequestData() { diff --git a/server/data/ERRORS.php b/server/data/ERRORS.php index da679009..831086a9 100755 --- a/server/data/ERRORS.php +++ b/server/data/ERRORS.php @@ -251,10 +251,6 @@ * @apiDefine INVALID_COLOR * @apiError {String} INVALID_COLOR The color should be in hexadecimal, preceded by a '#' */ -/** - * @apiDefine MAIL_SENDER_NOT_CONNECTED - * @apiError {String} MAIL_SENDER_NOT_CONNECTED The mail sender is not connected. - */ class ERRORS { const INVALID_CREDENTIALS = 'INVALID_CREDENTIALS'; @@ -321,5 +317,4 @@ class ERRORS { const INVALID_CUSTOM_FIELD_OPTION = 'INVALID_CUSTOM_FIELD_OPTION'; const UNAVAILABLE_STATS = 'UNAVAILABLE_STATS'; const INVALID_COLOR = 'INVALID_COLOR'; - const MAIL_SENDER_NOT_CONNECTED = 'MAIL_SENDER_NOT_CONNECTED'; }