4 require_once(
'class.ilWACSignedPath.php');
67 assert(is_string(
$path));
75 if (isset(
$_SERVER[
'REMOTE_ADDR'])) {
109 if (self::getSALT()) {
113 if (is_file(self::SALT_FILE_PATH)) {
114 require self::SALT_FILE_PATH;
115 self::setSALT($salt);
118 if (strcmp($salt,
'') === 0) {
131 if (is_file(self::SALT_FILE_PATH)) {
132 unlink(self::SALT_FILE_PATH);
134 $template = file_get_contents(
'./Services/WebAccessChecker/wacsalt.php.template');
135 $random = new \ilRandom();
136 $salt = md5(
time() * $random->int(1000, 9999) . self::SALT_FILE_PATH);
137 self::setSALT($salt);
139 if (is_writable(dirname(self::SALT_FILE_PATH))) {
140 file_put_contents(self::SALT_FILE_PATH,
$template);
202 assert(is_string(
$ip));
222 assert(is_string(
$token));
242 assert(is_string(
$path));
261 return (
string) md5($this->
id);
270 assert(is_string(
$id));
280 return (
string) self::$SALT;
290 assert(is_string($salt));
330 assert(is_int(
$ttl));
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
__construct($path, $client, $timestamp=0, $ttl=0)
ilWACToken constructor.
const DATA_DIR_NON_WRITEABLE
Create styles array
The data for the language used.
setSessionId($session_id)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static getTokenMaxLifetimeInSeconds()