Skip to content

Commit d83e42f

Browse files
committed
added: forgot pass config
1 parent d4ce593 commit d83e42f

File tree

14 files changed

+205
-51
lines changed

14 files changed

+205
-51
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tmp
3232
# configs
3333
databases
3434
config
35-
config-debug
35+
#config-debug
3636
config-release
3737

3838
# related packages used for dev

config-debug

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name : dev-enterprise-admin
2+
version : 0.1.1
3+
4+
default-ip : 127.0.0.1
5+
default-port : 8080
6+
7+
// session cookie name, expiration in hours
8+
session-cookie-name : __user
9+
session-cookie-secure : false
10+
session-cookie-httpOnly : true
11+
session-cookie-expires : 24
12+
13+
// auth settings - default datasource is MongoDataSource
14+
// auth-datasource : JsonFileDataSource
15+
// auth-datasource-filePath : ./databases/users.json
16+
auth-datasource-database : dev
17+
auth-datasource-collection : users
18+
auth-mailer-use : mailer-primary
19+
auth-mailer-subject : Password changed
20+
auth-mailer-forgotpass : emails/forgotpass
21+
22+
// main datasource setings
23+
datasource-primary-database : admin_dev
24+
25+
// primary mailer conf
26+
mailer-primary-from : [email protected]
27+
mailer-primary-name : Some Name
28+
mailer-primary-host : smtp.gmail.com
29+
mailer-primary-port : 465
30+
mailer-primary-secure : true
31+
mailer-primary-user : [email protected]
32+
mailer-primary-password : password

enterprise-admin.package

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

packages/enterprise-admin.package/app/angular-modules/ne-modules-all.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,6 +2704,16 @@ angular.module('neDirectives',['neObject'])
27042704
}
27052705
};
27062706
}])
2707+
.directive('neBindHtml',['$sce', function($sce) {
2708+
return {
2709+
restrict: 'A',
2710+
link: function(scope, element, attrs) {
2711+
attrs.$observe('neBindHtml', function(htmlText){
2712+
element.html(htmlText);
2713+
});
2714+
}
2715+
};
2716+
}])
27072717
.filter('html', ['$sce', function ($sce) {
27082718
return function (text) {
27092719
return $sce.trustAsHtml(text);
@@ -4060,8 +4070,8 @@ angular.module('neNotifications',['neLoading'])
40604070
' </td>'+
40614071
' <td style="padding:0px 5px">'+
40624072
' <div ng-if="!n.include">'+
4063-
' <strong ng-if="n.title">{{n.title|translate}}<br></strong>'+
4064-
' {{n.text|translate}}'+
4073+
' <strong ng-if="n.title"><span ne-bind-html="{{n.title|translate}}"></span><br></strong>'+
4074+
' <span ne-bind-html="{{n.text|translate}}"></span>'+
40654075
' </div>'+
40664076
' <div ng-if="n.include" ng-include="n.include"></div>'+
40674077
' </td>'+

packages/enterprise-admin.package/app/angular-modules/ne-modules-all.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/enterprise-admin.package/app/angular-modules/ne-modules-all.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/enterprise-admin.package/app/angular-modules/ne-modules.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,6 +2704,16 @@ angular.module('neDirectives',['neObject'])
27042704
}
27052705
};
27062706
}])
2707+
.directive('neBindHtml',['$sce', function($sce) {
2708+
return {
2709+
restrict: 'A',
2710+
link: function(scope, element, attrs) {
2711+
attrs.$observe('neBindHtml', function(htmlText){
2712+
element.html(htmlText);
2713+
});
2714+
}
2715+
};
2716+
}])
27072717
.filter('html', ['$sce', function ($sce) {
27082718
return function (text) {
27092719
return $sce.trustAsHtml(text);
@@ -4060,8 +4070,8 @@ angular.module('neNotifications',['neLoading'])
40604070
' </td>'+
40614071
' <td style="padding:0px 5px">'+
40624072
' <div ng-if="!n.include">'+
4063-
' <strong ng-if="n.title">{{n.title|translate}}<br></strong>'+
4064-
' {{n.text|translate}}'+
4073+
' <strong ng-if="n.title"><span ne-bind-html="{{n.title|translate}}"></span><br></strong>'+
4074+
' <span ne-bind-html="{{n.text|translate}}"></span>'+
40654075
' </div>'+
40664076
' <div ng-if="n.include" ng-include="n.include"></div>'+
40674077
' </td>'+

packages/enterprise-admin.package/app/angular-modules/ne-modules.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/enterprise-admin.package/app/angular-modules/ne-modules.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/enterprise-admin.package/app/ne-admin.js

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ angular.module('neAdmin',['neDirectives',
184184

185185
var text = '';
186186
for(var i=0;i<errArray.length;i++){
187-
text+= (i>0 ? ',\n' : '') + local.translate(errArray[i]);
187+
text+= (i>0 ? ', ' : '') + local.translate(errArray[i]);
188188
}
189189
return text;
190190
}
@@ -196,7 +196,7 @@ angular.module('neAdmin',['neDirectives',
196196
text = '';
197197
var first = true;
198198
for (var key in data) {
199-
text += (first ? '' : '\n,') + '"'+local.translate(key) + '" ' + local.translate('have to be') + ': ' + translateValidations(data[key]);
199+
text += (first ? '' : '<br>') + '<strong>'+local.translate(key) + '</strong> ' + local.translate('must be') + ': ' + translateValidations(data[key]);
200200
first = false;
201201
}
202202
}
@@ -255,6 +255,16 @@ angular.module('neAdmin',['neDirectives',
255255
}
256256
});
257257

258+
admin.mailers = new RestResource({
259+
baseUrl: 'mailers',
260+
commands:{
261+
test:{
262+
url:'test',
263+
method:'POST',
264+
}
265+
}
266+
});
267+
258268
admin.configs = new RestResource({
259269
baseUrl: 'config'
260270
});
@@ -380,6 +390,12 @@ angular.module('neAdmin',['neDirectives',
380390
.controller('ConfigCtrl',['$scope','neAdmin','neNotifications', function($scope, admin, notify){
381391
$scope.configItems = angular.copy($scope.appConfig);
382392

393+
$scope.getConfig = function(id, item){
394+
admin.configs.one(id, function(data){
395+
item[ '$'+id ] = data;
396+
});
397+
};
398+
383399
$scope.loadConfig = function(id, item){
384400
admin.configs.one(id, function(data){
385401
item.loaded = true;
@@ -397,6 +413,22 @@ angular.module('neAdmin',['neDirectives',
397413
$scope.deleteKey = function(key, obj){
398414
if(obj) delete obj[ key ];
399415
};
416+
417+
// TODO: move to another controller
418+
$scope.sendEmail = function(mailer, subject, body){
419+
admin.mailers.test({
420+
mailer: mailer,
421+
subject: subject,
422+
body: body
423+
}, function(data){
424+
notify.success('Email Sent');
425+
return true;
426+
}, function(data, status){
427+
if(status === 408) notify.error('Email Sending Error', 'Timeout');
428+
else notify.error('Email Sending Error', data);
429+
return true;
430+
});
431+
};
400432
}])
401433
.controller('ProfileCtrl',['$scope','neAdmin','neNotifications', function($scope, admin, notify){
402434
$scope.updateProfile = function(){

0 commit comments

Comments
 (0)