Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
f92b62ff
Commit
f92b62ff
authored
Sep 08, 2014
by
Marc Duez
Browse files
database.js : ssl check
parent
d740a42c
Changes
2
Hide whitespace changes
Inline
Side-by-side
browser/js/database.js
View file @
f92b62ff
...
...
@@ -49,15 +49,25 @@ Database.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
popupMsg
(
"
t
imeout
"
)
;
myConsole
.
flash
(
"
database : T
imeout
"
)
}
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
);
...
...
browser/js/main.js
View file @
f92b62ff
...
...
@@ -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
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment