2018-09-29 18:20:00 +00:00
|
|
|
<?php
|
2018-09-29 18:44:13 +00:00
|
|
|
/**
|
|
|
|
* @file jcryption.lnk.php
|
|
|
|
* @date 2018-09-30
|
|
|
|
* @author Go Namhyeon <gnh1201@gmail.com>
|
2018-09-29 18:49:26 +00:00
|
|
|
* @brief jCryption (alternative HTTPS on javascript) Helper
|
2018-09-29 18:44:13 +00:00
|
|
|
*/
|
|
|
|
|
2018-09-29 18:30:30 +00:00
|
|
|
if(!function_exists("jcryption_load")) {
|
|
|
|
function jcryption_load() {
|
|
|
|
$required_files = array(
|
|
|
|
"jCryption/sqAES",
|
|
|
|
"jCryption/JCryption"
|
|
|
|
);
|
|
|
|
foreach($required_files as $file) {
|
2018-09-29 18:58:34 +00:00
|
|
|
$inc_file = get_current_working_dir() . "/vendor/" . $file . ".php";
|
2018-09-29 18:30:30 +00:00
|
|
|
if(file_exists($inc_file)) {
|
|
|
|
include($inc_file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!function_exists("jcryption_get_code")) {
|
|
|
|
function jcryption_get_code() {
|
|
|
|
}
|
2018-09-29 18:42:40 +00:00
|
|
|
|
|
|
|
if(!function_exists("jcryption_get_jscode")) {
|
|
|
|
function jcryption_get_jscode($selector) {
|
|
|
|
return "$(function() { $(" . $selector . ").jCryption(); });";
|
|
|
|
}
|
|
|
|
}
|
2018-09-29 18:48:45 +00:00
|
|
|
|
|
|
|
if(!function_exists("jcryption_get_js_url")) {
|
|
|
|
function jcryption_get_js_url() {
|
2018-09-29 18:58:34 +00:00
|
|
|
return "JCryption::decrypt();";
|
|
|
|
}
|
2018-09-29 18:48:45 +00:00
|
|
|
return base_url() . "vendor/jCryption/js/jquery.jcryption.3.1.0.js";
|
|
|
|
}
|
|
|
|
}
|