@@ -34,6 +34,7 @@ var versionInfo = require('./version.info'),
34
34
log = require ( '../../api/utils/log.js' ) ( 'core:app' ) ,
35
35
url = require ( 'url' ) ,
36
36
authorize = require ( '../../api/utils/authorizer.js' ) , //for token validations
37
+ languages = require ( '../../frontend/express/locale.conf' ) ,
37
38
render = require ( '../../api/utils/render.js' ) ,
38
39
argon2 = require ( 'argon2' ) ;
39
40
@@ -772,6 +773,7 @@ function renderDashboard(req, res, next, member, adminOfApps, userOfApps, countl
772
773
_ . extend ( req . config , configs ) ;
773
774
var countlyGlobal = {
774
775
countlyTitle : req . countly . title ,
776
+ languages : languages ,
775
777
countlyVersion : req . countly . version ,
776
778
countlyFavicon : req . countly . favicon ,
777
779
pluginsSHA : sha1Hash ( plugins . getPlugins ( ) ) ,
@@ -791,6 +793,7 @@ function renderDashboard(req, res, next, member, adminOfApps, userOfApps, countl
791
793
792
794
var toDashboard = {
793
795
countlyTitle : req . countly . title ,
796
+ languages : languages ,
794
797
countlyFavicon : req . countly . favicon ,
795
798
adminOfApps : adminOfApps ,
796
799
userOfApps : userOfApps ,
@@ -964,7 +967,7 @@ app.get(countlyConfig.path + '/setup', function(req, res) {
964
967
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
965
968
res . header ( 'Expires' , '0' ) ;
966
969
res . header ( 'Pragma' , 'no-cache' ) ;
967
- res . render ( 'setup' , { countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
970
+ res . render ( 'setup' , { languages : languages , countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
968
971
}
969
972
else if ( err ) {
970
973
res . status ( 500 ) . send ( 'Server Error' ) ;
@@ -991,7 +994,7 @@ app.get(countlyConfig.path + '/login', function(req, res) {
991
994
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
992
995
res . header ( 'Expires' , '0' ) ;
993
996
res . header ( 'Pragma' , 'no-cache' ) ;
994
- res . render ( 'login' , { countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "message" : req . flash ( 'info' ) , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
997
+ res . render ( 'login' , { languages : languages , countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "message" : req . flash ( 'info' ) , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
995
998
}
996
999
else {
997
1000
res . redirect ( countlyConfig . path + '/setup' ) ;
@@ -1011,7 +1014,7 @@ app.get(countlyConfig.path + '/forgot', function(req, res) {
1011
1014
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
1012
1015
res . header ( 'Expires' , '0' ) ;
1013
1016
res . header ( 'Pragma' , 'no-cache' ) ;
1014
- res . render ( 'forgot' , { countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , "message" : req . flash ( 'info' ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1017
+ res . render ( 'forgot' , { languages : languages , countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , "message" : req . flash ( 'info' ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1015
1018
}
1016
1019
} ) ;
1017
1020
@@ -1033,7 +1036,7 @@ app.get(countlyConfig.path + '/reset/:prid', function(req, res) {
1033
1036
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
1034
1037
res . header ( 'Expires' , '0' ) ;
1035
1038
res . header ( 'Pragma' , 'no-cache' ) ;
1036
- res . render ( 'reset' , { countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , "prid" : req . params . prid , "message" : "" , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1039
+ res . render ( 'reset' , { languages : languages , countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , "prid" : req . params . prid , "message" : "" , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1037
1040
}
1038
1041
}
1039
1042
else {
@@ -1069,12 +1072,13 @@ app.post(countlyConfig.path + '/reset', function(req, res, next) {
1069
1072
} ) ;
1070
1073
}
1071
1074
else {
1072
- res . render ( 'reset' , { countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , "prid" : req . body . prid , "message" : "" , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1075
+ res . render ( 'reset' , { languages : languages , countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "csrf" : req . csrfToken ( ) , "prid" : req . body . prid , "message" : "" , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1073
1076
}
1074
1077
}
1075
1078
else {
1076
1079
res . render ( 'reset' ,
1077
1080
{
1081
+ languages : languages ,
1078
1082
countlyFavicon : req . countly . favicon ,
1079
1083
countlyTitle : req . countly . title ,
1080
1084
countlyPage : req . countly . page ,
@@ -1101,11 +1105,11 @@ app.post(countlyConfig.path + '/forgot', function(req, res, next) {
1101
1105
countlyDb . collection ( 'password_reset' ) . insert ( { "prid" : prid , "user_id" : member . _id , "timestamp" : timestamp } , { safe : true } , function ( ) {
1102
1106
countlyMail . sendPasswordResetInfo ( member , prid ) ;
1103
1107
plugins . callMethod ( "passwordRequest" , { req : req , res : res , next : next , data : req . body } ) ;
1104
- res . render ( 'forgot' , { countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "message" : "forgot.result" , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1108
+ res . render ( 'forgot' , { languages : languages , countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "message" : "forgot.result" , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1105
1109
} ) ;
1106
1110
}
1107
1111
else {
1108
- res . render ( 'forgot' , { countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "message" : "forgot.result" , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1112
+ res . render ( 'forgot' , { languages : languages , countlyFavicon : req . countly . favicon , countlyTitle : req . countly . title , countlyPage : req . countly . page , "message" : "forgot.result" , "csrf" : req . csrfToken ( ) , path : countlyConfig . path || "" , cdn : countlyConfig . cdn || "" , themeFiles : req . themeFiles , inject_template : req . template } ) ;
1109
1113
}
1110
1114
} ) ;
1111
1115
}
0 commit comments