Commit 8c144d34ac717925145892f5515c4d8b83dd9645
1 parent
5fd0d0f403
Exists in
master
reset pwd
Showing
4 changed files
with
134 additions
and
0 deletions
Show diff stats
app/partials/forgetPassword/forgetPassword.service.js
File was created | 1 | (function(){ | |
2 | 'use strict'; | ||
3 | angular.module('acufuel') | ||
4 | .service('forgetPasswordService', ['$q', '$http', 'BASE_URL', forgetPasswordService]); | ||
5 | |||
6 | function forgetPasswordService($q, $http, BASE_URL) { | ||
7 | |||
8 | this.recoverpassword = function(email) { | ||
9 | var param = 'email='+ email; | ||
10 | var deferred = $q.defer(); | ||
11 | $http({ | ||
12 | method : 'PUT', | ||
13 | url : BASE_URL.url +'/user/recoverpassword', | ||
14 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, | ||
15 | data: param | ||
16 | }) | ||
17 | .then(function (result){ | ||
18 | deferred.resolve(result.data); | ||
19 | },function (result){ | ||
20 | deferred.resolve(result.data); | ||
21 | }) | ||
22 | return deferred.promise; | ||
23 | } | ||
24 | |||
25 | } | ||
26 | |||
27 | })(); |
app/partials/resetpwd/resetPassword.controller.js
File was created | 1 | (function() { | |
2 | 'use strict' | ||
3 | |||
4 | angular.module('acufuel') | ||
5 | .controller('resetPasswordController', [ '$scope', '$filter', '$rootScope', 'ResetPasswordService', '$state','LoginService', resetPasswordController]); | ||
6 | |||
7 | function resetPasswordController($scope, $filter, $rootScope, ResetPasswordService, $state,LoginService) { | ||
8 | $scope.submitLogin = function() { | ||
9 | ResetPasswordService.changepassword($scope.password, $scope.confirmPassword).then(function(result){ | ||
10 | toastr.info("Password updated successfully"); | ||
11 | localStorage.removeItem("requiredChangePwd"); | ||
12 | LoginService.authenticate(); | ||
13 | }) | ||
14 | } | ||
15 | } | ||
16 | })(); |
app/partials/resetpwd/resetPassword.html
File was created | 1 | <nav class="navbar navbar-inverse" role="navigation"> | |
2 | <div class="container"> | ||
3 | <!-- Brand and toggle get grouped for better mobile display --> | ||
4 | <div class="navbar-header"> | ||
5 | <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> | ||
6 | <span class="sr-only">Toggle navigation</span> | ||
7 | <span class="icon-bar"></span> | ||
8 | <span class="icon-bar"></span> | ||
9 | <span class="icon-bar"></span> | ||
10 | </button> | ||
11 | <a class="navbar-brand" href="./index.html"><img src="img/acufuelLOGOwhite.png" class="img-logo"> </a> | ||
12 | </div> | ||
13 | <!-- Collect the nav links, forms, and other content for toggling --> | ||
14 | <div class="collapse navbar-collapse navbar-ex1-collapse"> | ||
15 | <ul class="nav navbar-nav navbar-right"> | ||
16 | |||
17 | </ul> | ||
18 | </div> | ||
19 | <!-- /.navbar-collapse --> | ||
20 | </div> | ||
21 | <!-- /.container --> | ||
22 | </nav> | ||
23 | <div class="account-container stacked"> | ||
24 | <div class="content clearfix"> | ||
25 | <form class="form-signin" ng-submit="submitLogin()"> | ||
26 | <center><p class="forget-password"> | ||
27 | Reset New Password Here</center> | ||
28 | </p> | ||
29 | <label for="Password" class="sr-only">Password</label> | ||
30 | <input | ||
31 | type="password" id="password" class="form-control custom-fields" | ||
32 | placeholder="Password" ng-model="password" required autofocus> | ||
33 | <br/> | ||
34 | <label for="Confirm-Password" class="sr-only">Confirm | ||
35 | Password</label> | ||
36 | <input type="password" id="confirmPassword" | ||
37 | class="form-control custom-fields" placeholder="Confirm Password" | ||
38 | ng-model="confirmPassword" required autofocus> | ||
39 | <br/> | ||
40 | <div class="text-center"> | ||
41 | <button class="btn btn-primary btn-primary-color" type="submit" | ||
42 | ng-disabled="form.$invalid || dataLoading"> | ||
43 | Submit | ||
44 | </button> | ||
45 | </div> | ||
46 | <div class="clearfix"></div> | ||
47 | </form> | ||
48 | |||
49 | </div> | ||
50 | <div class="col-xs-12 col-md-3"></div> | ||
51 | <div style="clear: both"></div> | ||
52 | </div> | ||
53 | <!-- /content --> | ||
54 | |||
55 | <!-- /account-container --> | ||
56 | <!-- Text Under Box --> | ||
57 | |||
58 | <!-- /login-extra --> | ||
59 | <!-- Le javascript | ||
60 | ================================================== --> | ||
61 | <!-- Placed at the end of the document so the pages load faster --> | ||
62 | <!-- <script src="./js/libs/jquery-ui-1.10.0.custom.min.js"></script> | ||
63 | <script src="./js/libs/bootstrap.min.js"></script> | ||
64 | <script src="./js/Application.js"></script> | ||
65 | <script src="./js/demo/signin.js"></script> --> | ||
66 |
app/partials/resetpwd/resetPassword.service.js
File was created | 1 | (function(){ | |
2 | 'use strict'; | ||
3 | angular.module('acufuel') | ||
4 | .service('ResetPasswordService', ['$q', '$http', 'BASE_URL', ResetPasswordService]); | ||
5 | |||
6 | function ResetPasswordService($q, $http, BASE_URL) { | ||
7 | var temp = {}; | ||
8 | |||
9 | this.changepassword = function(password, confirmpassword) { | ||
10 | var deferred = $q.defer(); | ||
11 | var param = 'password='+ password + '&confirmpassword=' +confirmpassword; | ||
12 | $http({ | ||
13 | method : 'PUT', | ||
14 | url : BASE_URL.url+'/user/changepassword', | ||
15 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, | ||
16 | data: param | ||
17 | }).then(function (result){ | ||
18 | deferred.resolve(result.data); | ||
19 | },function (result){ | ||
20 | deferred.resolve(result.data); | ||
21 | }); | ||
22 | return deferred.promise; | ||
23 | } | ||
24 | } | ||
25 | |||
26 | })(); |