You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/08/17 10:10:51 UTC
[1/3] incubator-ignite git commit: # IGNITE-843 Link fix.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-843 e5812a7e9 -> ce7c763a3
# IGNITE-843 Link fix.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/facf9b6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/facf9b6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/facf9b6d
Branch: refs/heads/ignite-843
Commit: facf9b6d9c67d1f63adbb306d0ebddc360bb932a
Parents: 83e0457
Author: Andrey <an...@gridgain.com>
Authored: Mon Aug 17 14:20:30 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Aug 17 14:20:30 2015 +0700
----------------------------------------------------------------------
.../src/main/js/controllers/admin-controller.js | 7 ++++++-
.../src/main/js/public/stylesheets/style.scss | 11 ++++++++++-
.../src/main/js/views/includes/header.jade | 4 ++--
.../src/main/js/views/settings/admin.jade | 7 +++----
4 files changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/facf9b6d/modules/control-center-web/src/main/js/controllers/admin-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/admin-controller.js b/modules/control-center-web/src/main/js/controllers/admin-controller.js
index 09490fe..894ead6 100644
--- a/modules/control-center-web/src/main/js/controllers/admin-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/admin-controller.js
@@ -15,7 +15,8 @@
* limitations under the License.
*/
-controlCenterModule.controller('adminController', ['$scope', '$http', '$common', '$confirm', function ($scope, $http, $common, $confirm) {
+controlCenterModule.controller('adminController', ['$scope', '$window', '$http', '$common', '$confirm',
+ function ($scope, $window, $http, $common, $confirm) {
$scope.users = null;
function reload() {
@@ -30,6 +31,10 @@ controlCenterModule.controller('adminController', ['$scope', '$http', '$common',
reload();
+ $scope.becomeUser = function (user) {
+ $window.location = '/admin/become?viewedUserId=' + user._id;
+ };
+
$scope.removeUser = function (user) {
$confirm.show('Are you sure you want to remove user: "' + user.username + '"?').then(function () {
$http.post('admin/remove', {userId: user._id}).success(
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/facf9b6d/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 28a3de7..bdddd5b 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -1021,6 +1021,10 @@ label {
margin-right: 0;
}
+.fa-eye {
+ cursor: pointer;
+}
+
.fa-plus {
cursor: pointer;
}
@@ -1164,8 +1168,13 @@ input.ng-dirty.ng-invalid, button.ng-dirty.ng-invalid {
border-radius: 6px;
}
-.nav-tabs > li > a {
+.theme-line .nav-tabs > li > a {
padding: 5px 5px;
+ color: #555;
+}
+
+.theme-line .nav-tabs > li.active > a {
+ color: $ignite-red;
}
.viewedUser {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/facf9b6d/modules/control-center-web/src/main/js/views/includes/header.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/header.jade b/modules/control-center-web/src/main/js/views/includes/header.jade
index b690ba2..aecdf16 100644
--- a/modules/control-center-web/src/main/js/views/includes/header.jade
+++ b/modules/control-center-web/src/main/js/views/includes/header.jade
@@ -32,11 +32,11 @@ header#header.header
li(ng-controller='notebooks')
a.dropdown-toggle(ng-hide='notebooks.length == 0' data-toggle='dropdown' bs-dropdown='notebookDropdown' data-placement='bottom-right') SQL
span.caret
- a(ng-hide='notebooks.length > 0' ng-class='{active: isActive("/sql")}' href='/notebooks/new') SQL
+ a(ng-hide='notebooks.length > 0' href='/notebooks/new') SQL
//+header-item('/deploy', '/deploy', 'Deploy')
ul.nav.navbar-nav.pull-right
li(ng-if='user')
- a.dropdown-toggle(data-toggle='dropdown' bs-dropdown='userDropdown' data-placement='bottom-right' data-ng-bind='::user.username')
+ a.dropdown-toggle(data-toggle='dropdown' bs-dropdown='userDropdown' data-placement='bottom-right') {{::user.username}}
span.caret
li.nav-login(ng-if='!user')
a(ng-click='login()') Log In
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/facf9b6d/modules/control-center-web/src/main/js/views/settings/admin.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/settings/admin.jade b/modules/control-center-web/src/main/js/views/settings/admin.jade
index 8345bb9..46210cb 100644
--- a/modules/control-center-web/src/main/js/views/settings/admin.jade
+++ b/modules/control-center-web/src/main/js/views/settings/admin.jade
@@ -47,10 +47,9 @@ block container
input(type='checkbox' ng-disabled='row.adminChanging || row._id == user._id'
ng-model='row.admin' ng-change='toggleAdmin(row)')
td(style='text-align: center;')
- a(ng-click='removeUser(row)' ng-show='row._id != user._id' bs-tooltip data-title='Remove user')
- i.fa.fa-remove
- a(style='margin-left: 5px' ng-href='admin/become?viewedUserId={{row._id}}' ng-show='row._id != user._id' bs-tooltip data-title='Become this user')
- i.fa.fa-eye
+ div(ng-show='row._id != user._id')
+ i.fa.fa-remove(ng-click='removeUser(row)' bs-tooltip data-title='Remove user')
+ i.fa.fa-eye(ng-click='becomeUser(row)' style='margin-left: 5px' bs-tooltip data-title='Become this user')
tfoot
tr
td.text-right(colspan='5')
[3/3] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-843' into ignite-843
Posted by an...@apache.org.
Merge remote-tracking branch 'origin/ignite-843' into ignite-843
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ce7c763a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ce7c763a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ce7c763a
Branch: refs/heads/ignite-843
Commit: ce7c763a3d9c461ce2d0f961ca69175ff750ddd2
Parents: 7d5299e e5812a7
Author: Andrey <an...@gridgain.com>
Authored: Mon Aug 17 15:10:45 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Aug 17 15:10:45 2015 +0700
----------------------------------------------------------------------
.../main/js/controllers/clusters-controller.js | 61 +++++++------------
.../src/main/js/controllers/common-module.js | 64 ++++++++++++++++----
.../main/js/controllers/models/clusters.json | 1 +
.../src/main/js/public/stylesheets/style.scss | 8 +--
.../src/main/js/views/includes/controls.jade | 28 +++++----
.../src/main/js/views/templates/popover.jade | 10 ++-
6 files changed, 101 insertions(+), 71 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ce7c763a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
[2/3] incubator-ignite git commit: # IGNITE-843 Cleanup forgot
password.
Posted by an...@apache.org.
# IGNITE-843 Cleanup forgot password.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7d5299e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7d5299e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7d5299e8
Branch: refs/heads/ignite-843
Commit: 7d5299e8cf026b2af0dd32506f5691ade6112a4e
Parents: facf9b6
Author: Andrey <an...@gridgain.com>
Authored: Mon Aug 17 15:10:29 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Mon Aug 17 15:10:29 2015 +0700
----------------------------------------------------------------------
.../src/main/js/routes/public.js | 57 +++++++++++++++++++-
.../src/main/js/views/login.jade | 31 ++++++-----
2 files changed, 74 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d5299e8/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 ef00f56..e29c7e6 100644
--- a/modules/control-center-web/src/main/js/routes/public.js
+++ b/modules/control-center-web/src/main/js/routes/public.js
@@ -112,9 +112,9 @@ router.get('/logout', function (req, res) {
});
/**
- * Request for password reset and send e-mail to user with reset token.
+ * Send e-mail to user with reset token.
*/
-router.post('/request_password_reset', function(req, res) {
+router.post('/forgot_password', function(req, res) {
var transporter = {
service: config.get('smtp:service'),
auth: {
@@ -166,6 +166,59 @@ router.post('/request_password_reset', function(req, res) {
});
});
+/**
+ * Change password with given token.
+ */
+router.post('/reset_password', function(req, res) {
+ db.Account.findOne({ resetPasswordToken: req.body.token }, function(err, user) {
+ if (!user)
+ return res.status(500).send('Invalid token for password reset!');
+
+ if (err)
+ return res.status(500).send(err);
+
+ user.setPassword(req.body.password, function (err, updatedUser) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ updatedUser.resetPasswordToken = undefined;
+
+ updatedUser.save(function (err) {
+ if (err)
+ return res.status(500).send(err.message);
+
+ var transporter = {
+ service: config.get('smtp:service'),
+ auth: {
+ user: config.get('smtp:username'),
+ pass: config.get('smtp:password')
+ }
+ };
+
+ var mailer = nodemailer.createTransport(transporter);
+
+ var mailOptions = {
+ from: transporter.auth.user,
+ to: 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' +
+ 'Now you can login: http://' + req.headers.host + '\n\n' +
+ '--------------\n' +
+ 'Apache Ignite Web Control Center\n'
+ };
+
+ mailer.sendMail(mailOptions, function (err) {
+ if (err)
+ return res.status(503).send('Password was changed, but failed to send confirmation e-mail!<br />' + err);
+
+ return res.status(200).send(user.email);
+ });
+ });
+ });
+ });
+});
+
router.get('/reset', function (req, res) {
res.render('reset', {});
});
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d5299e8/modules/control-center-web/src/main/js/views/login.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/login.jade b/modules/control-center-web/src/main/js/views/login.jade
index 19979e2..90af007 100644
--- a/modules/control-center-web/src/main/js/views/login.jade
+++ b/modules/control-center-web/src/main/js/views/login.jade
@@ -28,7 +28,9 @@ mixin lbl(txt)
p(style='padding-right: 55px') Log in or register in order to collaborate
form.form-horizontal(name='loginForm' ng-init='action == "login"')
.modal-body.row
- .col-sm-9.col-sm-offset-1
+ .col-sm-10.col-sm-offset-1
+ p(ng-show='action == "forgot_password"')
+ | That's ok! Simply enter your email below and a reset password link will be sent to you via email. You can then follow that link and select a new password.
.details-row(ng-show='action == "register"')
+lbl('Full Name:')
.col-sm-9
@@ -36,20 +38,25 @@ mixin lbl(txt)
.details-row
+lbl('Email:')
.col-sm-9
- input#user_email.form-control(enter-focus-next='user_password' type='email' ng-model='user_info.email' placeholder='you@domain.com' required on-enter='action == "request_password_reset" && loginForm.$valid && auth(action, user_info)')
- .details-row(ng-show='action != "request_password_reset"')
+ input#user_email.form-control(enter-focus-next='user_password' type='email' ng-model='user_info.email' placeholder='you@domain.com' required on-enter='action == "forgot_password" && loginForm.$valid && auth(action, user_info)')
+ .details-row(ng-show='action != "forgot_password"')
+lbl('Password:')
.col-sm-9
- input#user_password.form-control(enter-focus-next='user_confirm' type='password' ng-model='user_info.password' placeholder='Password' ng-required='action != "request_password_reset"' on-enter='action == "login" && loginForm.$valid && auth(action, user_info)')
+ input#user_password.form-control(enter-focus-next='user_confirm' type='password' ng-model='user_info.password' placeholder='Password' ng-required='action != "forgot_password"' on-enter='action == "login" && loginForm.$valid && auth(action, user_info)')
.details-row(ng-if='action == "register"')
+lbl('Confirm:')
.col-sm-9
input#user_confirm.form-control(type='password' ng-model='user_info.confirm' match='user_info.password' placeholder='Confirm password' ng-required='action == "register"' on-enter='loginForm.$valid && auth(action, user_info)')
- .modal-footer
- a.labelField(ng-show='action != "request_password_reset"' ng-click='action = "request_password_reset"' on-click-focus='user_email') Forgot password?
- a.labelField(ng-show='action == "request_password_reset"' ng-click='action = "login"' on-click-focus='user_email') Log In
- a.labelLogin(ng-show='action == "register"' on-click-focus='user_email' ng-click='action = "login";') Log In
- a.labelLogin(ng-show='action == "login"' on-click-focus='user_name' ng-click='action = "register"') Sign Up
- button.btn.btn-primary(ng-show='action == "login"' ng-disabled='loginForm.$invalid' ng-click='auth(action, user_info)') Log In
- button.btn.btn-primary(ng-show='action == "register"' ng-disabled='loginForm.$invalid' ng-click='auth(action, user_info)') Sign Up
- button.btn.btn-primary(ng-show='action == "request_password_reset"' ng-disabled='loginForm.$invalid' ng-click='auth(action, user_info)') Reset Password
+ .modal-footer(ng-show='action == "register"')
+ a.labelField(ng-click='action = "forgot_password"' on-click-focus='user_email') Forgot password?
+ a.labelLogin(ng-click='action = "login";' on-click-focus='user_email') Log In
+ button.btn.btn-primary(ng-click='auth(action, user_info)' ng-disabled='loginForm.$invalid') Sign Up
+
+ .modal-footer(ng-show='action == "forgot_password"')
+ a.labelField(ng-click='action = "login"' on-click-focus='user_email') Log In
+ button.btn.btn-primary(ng-click='auth(action, user_info)' ng-disabled='loginForm.$invalid') Send it to me
+
+ .modal-footer(ng-show='action == "login"')
+ a.labelField(ng-click='action = "forgot_password"' on-click-focus='user_email') Forgot password?
+ a.labelLogin(ng-click='action = "register"' on-click-focus='user_name') Sign Up
+ button.btn.btn-primary(ng-click='auth(action, user_info)' ng-disabled='loginForm.$invalid') Log In
\ No newline at end of file