Commit f92b62ff authored by Marc Duez's avatar Marc Duez
Browse files

database.js : ssl check

parent d740a42c
......@@ -49,15 +49,25 @@ Database.prototype = {
},
error: function (request, status, error) {
if (status === "timeout") {
popupMsg("timeout");
myConsole.flash("database : Timeout")
} else {
popupMsg(request.responseText);
self.check_cert()
}
}
});
},
check_cert: function () {
if (typeof sslCertTrusted == 'undefined' || !sslCertTrusted){
var msg = " Warning : </br>"
+ "It seems the database you try to access don't have a valid certificate or use a self signed one. </br>"
+ "If you want to use this database you need to accept this certificate, please follow this link and add this address to the trusted site list. </br>"
+ "<a href='"+DB_ADDRESS+"' target='_blank' > click me ! <a/>"
popupMsg(msg)
}
},
display_result: function (result, url) {
//rétablissement de l'adresse pour les futures requetes
result = result.replace("DB_ADDRESS/", this.db_address);
......
......@@ -7,9 +7,15 @@ var CGI_ADDRESS = "http://127.0.1.1/cgi-bin/";
if (typeof config != 'undefined') {
if (config.cgi_address){
if (config.cgi_address) CGI_ADDRESS = config.cgi_address
if (config.db_address) DB_ADDRESS = config.db_address
if (config.db_address) { DB_ADDRESS = config.db_address}
if (config.db_address == "default") DB_ADDRESS = "https://"+window.location.hostname+"/vidjil/"
if (config.cgi_address == "default") CGI_ADDRESS = "http://"+window.location.hostname+"/cgi/"
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", DB_ADDRESS + "static/js/checkSSL.js")
document.getElementsByTagName("head")[0].appendChild(fileref)
}
if (config.demo && config.demo.file.length != 0){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment