Skip to content

Instantly share code, notes, and snippets.

@vncloudsco
Created January 30, 2020 03:40
Show Gist options
  • Save vncloudsco/2be03057e796f19dc9f5f340a310e693 to your computer and use it in GitHub Desktop.
Save vncloudsco/2be03057e796f19dc9f5f340a310e693 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<!--
Copyright (c) 2007-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or https://ckeditor.com/sales/license/ckfinder
-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title>A21tours - File Browser</title>
</head>
<body>
<script src="ckfinder.js"></script>
<script>
loadCheckData("https://xxxxxx.com/rest_api/Admin/login", responCheckLogin);
function loadCheckData(url, cFunction) {
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
cFunction(this);
}
};
xhttp.open("GET", url, true);
xhttp.send();
}
function responCheckLogin(xhttp) {
var _checkReturn = xhttp.responseText;
if(_checkReturn == "true"){
CKFinder.start();
} else {
window.location.replace("https://xxxxxx.com/public/ckeditor/ckfinder/error.html");
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment