ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-843 Fixed email settings.
Date Fri, 15 Jan 2016 08:32:39 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 dc63b9bb5 -> 97ae680bc


IGNITE-843 Fixed email settings.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/97ae680b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/97ae680b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/97ae680b

Branch: refs/heads/ignite-843-rc2
Commit: 97ae680bceb51ecbd4ba5a2681d8c41cdf6d31b3
Parents: dc63b9b
Author: Andrey <anovikov@gridgain.com>
Authored: Fri Jan 15 15:32:44 2016 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Fri Jan 15 15:32:44 2016 +0700

----------------------------------------------------------------------
 .../src/main/js/config/default.json                 |  7 ++++---
 .../src/main/js/helpers/configuration-loader.js     |  4 ++++
 .../control-center-web/src/main/js/routes/admin.js  |  6 +++---
 .../control-center-web/src/main/js/routes/public.js | 16 ++++++++--------
 4 files changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/97ae680b/modules/control-center-web/src/main/js/config/default.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/config/default.json b/modules/control-center-web/src/main/js/config/default.json
index bf1e88b..2bd250e 100644
--- a/modules/control-center-web/src/main/js/config/default.json
+++ b/modules/control-center-web/src/main/js/config/default.json
@@ -18,8 +18,9 @@
         "keyPassphrase": "password"
     },
     "smtp": {
-        "service": "",
-        "username": "",
-        "password": ""
+             "service": "gmail",
+         "username": "GridGain Web Console",
+            "email": "no-reply@gridgain.com",
+            "password": "wANyMw4fyjkT0Q6DuEtG"
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/97ae680b/modules/control-center-web/src/main/js/helpers/configuration-loader.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/configuration-loader.js b/modules/control-center-web/src/main/js/helpers/configuration-loader.js
index 0169036..5342cc3 100644
--- a/modules/control-center-web/src/main/js/helpers/configuration-loader.js
+++ b/modules/control-center-web/src/main/js/helpers/configuration-loader.js
@@ -68,4 +68,8 @@ config.findIgniteModules = function () {
     return _find(igniteModules);
 };
 
+config.address = function (username, email) {
+    return username ? '"' + username + '" <' + email + '>' : email;
+};
+
 module.exports = config;

http://git-wip-us.apache.org/repos/asf/ignite/blob/97ae680b/modules/control-center-web/src/main/js/routes/admin.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/admin.js b/modules/control-center-web/src/main/js/routes/admin.js
index 1f53cd4..6d948f6 100644
--- a/modules/control-center-web/src/main/js/routes/admin.js
+++ b/modules/control-center-web/src/main/js/routes/admin.js
@@ -55,7 +55,7 @@ router.post('/remove', function (req, res) {
         var transporter = {
             service: config.get('smtp:service'),
             auth: {
-                user:config.get('smtp:username'),
+                user:config.get('smtp:email'),
                 pass: config.get('smtp:password')
             }
         };
@@ -64,8 +64,8 @@ router.post('/remove', function (req, res) {
             var mailer  = nodemailer.createTransport(transporter);
 
             var mailOptions = {
-                from: transporter.auth.user,
-                to: user.email,
+                from: config.address(config.get('smtp:username'), config.get('smtp:email')),
+                to: config.address(user.username, user.email),
                 subject: 'Your account was deleted',
                 text: 'You are receiving this e-mail because admin remove your account.\n\n'
+
                 '--------------\n' +

http://git-wip-us.apache.org/repos/asf/ignite/blob/97ae680b/modules/control-center-web/src/main/js/routes/public.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/public.js b/modules/control-center-web/src/main/js/routes/public.js
index 5e83f81..44786a8 100644
--- a/modules/control-center-web/src/main/js/routes/public.js
+++ b/modules/control-center-web/src/main/js/routes/public.js
@@ -107,13 +107,13 @@ router.post('/password/forgot', function(req, res) {
     var transporter = {
         service: config.get('smtp:service'),
         auth: {
-            user:config.get('smtp:username'),
+            user:config.get('smtp:email'),
             pass: config.get('smtp:password')
         }
     };
 
     if (transporter.service == '' || transporter.auth.user == '' || transporter.auth.pass
== '')
-        return res.status(401).send('Can\'t send e-mail with instructions to reset password.
Please ask webmaster to setup smtp server!');
+        return res.status(401).send('Can\'t send e-mail with instructions to reset password.
Please ask webmaster to setup SMTP server!');
 
     var token = $commonUtils.randomString(20);
 
@@ -135,8 +135,8 @@ router.post('/password/forgot', function(req, res) {
             var mailer  = nodemailer.createTransport(transporter);
 
             var mailOptions = {
-                from: transporter.auth.user,
-                to: user.email,
+                from: config.address(config.get('smtp:username'), config.get('smtp:email')),
+                to: config.address(user.username, user.email),
                 subject: 'Password Reset',
                 text: 'You are receiving this because you (or someone else) have requested
the reset of the password for your account.\n\n' +
                 'Please click on the following link, or paste this into your browser to complete
the process:\n\n' +
@@ -148,7 +148,7 @@ router.post('/password/forgot', function(req, res) {
 
             mailer.sendMail(mailOptions, function(err){
                 if (err)
-                    return res.status(401).send('Failed to send e-mail with reset link!<br
/>' + err);
+                    return res.status(401).send('Failed to send e-mail with reset link! '
+ err);
 
                 return res.status(200).send('An e-mail has been sent with further instructions.');
             });
@@ -181,7 +181,7 @@ router.post('/password/reset', function(req, res) {
                 var transporter = {
                     service: config.get('smtp:service'),
                     auth: {
-                        user: config.get('smtp:username'),
+                        user: config.get('smtp:email'),
                         pass: config.get('smtp:password')
                     }
                 };
@@ -189,8 +189,8 @@ router.post('/password/reset', function(req, res) {
                 var mailer = nodemailer.createTransport(transporter);
 
                 var mailOptions = {
-                    from: transporter.auth.user,
-                    to: user.email,
+                    from: config.address(config.get('smtp:username'), config.get('smtp:email')),
+                    to: config.address(user.username, user.email),
                     subject: 'Your password has been changed',
                     text: 'Hello,\n\n' +
                     'This is a confirmation that the password for your account ' + user.email
+ ' has just been changed.\n\n' +


Mime
View raw message