@@ -35,6 +35,7 @@ var versionInfo = require('./version.info'),
35
35
ip = require ( '../../api/parts/mgmt/ip.js' ) ,
36
36
url = require ( 'url' ) ,
37
37
authorize = require ( '../../api/utils/authorizer.js' ) , //for token validations
38
+ languages = require ( '../../frontend/express/locale.conf' ) ,
38
39
render = require ( '../../api/utils/render.js' ) ;
39
40
40
41
@@ -665,6 +666,7 @@ function renderDashboard(req, res, next, member, adminOfApps, userOfApps, countl
665
666
_ . extend ( req . config , configs ) ;
666
667
var countlyGlobal = {
667
668
countlyTitle : req . countly . title ,
669
+ languages : languages ,
668
670
countlyVersion : req . countly . version ,
669
671
countlyFavicon : req . countly . favicon ,
670
672
pluginsSHA : sha1Hash ( plugins . getPlugins ( ) ) ,
@@ -684,6 +686,7 @@ function renderDashboard(req, res, next, member, adminOfApps, userOfApps, countl
684
686
685
687
var toDashboard = {
686
688
countlyTitle : req . countly . title ,
689
+ languages : languages ,
687
690
countlyFavicon : req . countly . favicon ,
688
691
adminOfApps : adminOfApps ,
689
692
userOfApps : userOfApps ,
@@ -857,7 +860,7 @@ app.get(countlyConfig.path + '/setup', function(req, res) {
857
860
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
858
861
res . header ( 'Expires' , '0' ) ;
859
862
res . header ( 'Pragma' , 'no-cache' ) ;
860
- 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 } ) ;
863
+ 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 } ) ;
861
864
}
862
865
else if ( err ) {
863
866
res . status ( 500 ) . send ( 'Server Error' ) ;
@@ -884,7 +887,7 @@ app.get(countlyConfig.path + '/login', function(req, res) {
884
887
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
885
888
res . header ( 'Expires' , '0' ) ;
886
889
res . header ( 'Pragma' , 'no-cache' ) ;
887
- 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 } ) ;
890
+ 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 } ) ;
888
891
}
889
892
else {
890
893
res . redirect ( countlyConfig . path + '/setup' ) ;
@@ -904,7 +907,7 @@ app.get(countlyConfig.path + '/forgot', function(req, res) {
904
907
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
905
908
res . header ( 'Expires' , '0' ) ;
906
909
res . header ( 'Pragma' , 'no-cache' ) ;
907
- 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 } ) ;
910
+ 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 } ) ;
908
911
}
909
912
} ) ;
910
913
@@ -926,7 +929,7 @@ app.get(countlyConfig.path + '/reset/:prid', function(req, res) {
926
929
res . header ( 'Cache-Control' , 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0' ) ;
927
930
res . header ( 'Expires' , '0' ) ;
928
931
res . header ( 'Pragma' , 'no-cache' ) ;
929
- 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 } ) ;
932
+ 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 } ) ;
930
933
}
931
934
}
932
935
else {
@@ -961,12 +964,13 @@ app.post(countlyConfig.path + '/reset', function(req, res, next) {
961
964
} ) ;
962
965
}
963
966
else {
964
- 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 } ) ;
967
+ 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 } ) ;
965
968
}
966
969
}
967
970
else {
968
971
res . render ( 'reset' ,
969
972
{
973
+ languages : languages ,
970
974
countlyFavicon : req . countly . favicon ,
971
975
countlyTitle : req . countly . title ,
972
976
countlyPage : req . countly . page ,
@@ -993,11 +997,11 @@ app.post(countlyConfig.path + '/forgot', function(req, res, next) {
993
997
countlyDb . collection ( 'password_reset' ) . insert ( { "prid" : prid , "user_id" : member . _id , "timestamp" : timestamp } , { safe : true } , function ( ) {
994
998
countlyMail . sendPasswordResetInfo ( member , prid ) ;
995
999
plugins . callMethod ( "passwordRequest" , { req : req , res : res , next : next , data : req . body } ) ;
996
- 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 } ) ;
1000
+ 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 } ) ;
997
1001
} ) ;
998
1002
}
999
1003
else {
1000
- 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 } ) ;
1004
+ 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 } ) ;
1001
1005
}
1002
1006
} ) ;
1003
1007
}
0 commit comments