X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/3e79bc188ef0d5b603b26163c0d0048c9310ec4c..e95272d60f03ab1e62912ce9b99943ced8acb527:/lib/functions.php?ds=sidebyside diff --git a/lib/functions.php b/lib/functions.php index f1c1d77..c613d4a 100755 --- a/lib/functions.php +++ b/lib/functions.php @@ -90,6 +90,18 @@ jirafeau_gen_random ($l) return $code; } +function is_ssl() { + if ( isset($_SERVER['HTTPS']) ) { + if ( 'on' == strtolower($_SERVER['HTTPS']) ) + return true; + if ( '1' == $_SERVER['HTTPS'] ) + return true; + } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { + return true; + } + return false; +} + function jirafeau_human_size ($octets) { @@ -491,10 +503,10 @@ show_errors () } } -function check_errors () +function check_errors ($cfg) { if (file_exists (JIRAFEAU_ROOT . 'install.php') - && !file_exists (JIRAFEAU_ROOT . 'lib/config.local.php')) + && !($cfg['installation_done'] === true)) { header('Location: install.php'); exit; @@ -515,12 +527,6 @@ function check_errors () if (!is_writable (VAR_BLOCK)) add_error (t('The block directory is not writable!'), VAR_BLOCK); - - /* Check if the install.php script is still in the directory. */ - if (file_exists (JIRAFEAU_ROOT . 'install.php')) - add_error (t('Installer script still present'), - t('Please make sure to delete the installer script ' . - '"install.php" before continuing.')); } /** @@ -905,7 +911,7 @@ jirafeau_async_end ($ref, $code, $crypt, $link_name_length) $crypt_key = ''; if ($crypt == true && extension_loaded('mcrypt')) { - $cypt_key = jirafeau_encrypt_file ($p, $p); + $crypt_key = jirafeau_encrypt_file ($p, $p); if (strlen($crypt_key) > 0) $crypted = true; }