install folder from your server for security reasons then refresh this page!'); } // Get all the required files and functions require(HESK_PATH . 'hesk_settings.inc.php'); // Save the default language for the settings page before choosing user's preferred one $hesk_settings['language_default'] = $hesk_settings['language']; require(HESK_PATH . 'inc/common.inc.php'); $hesk_settings['language'] = $hesk_settings['language_default']; require(HESK_PATH . 'inc/admin_functions.inc.php'); hesk_load_database_functions(); hesk_session_start(); hesk_dbConnect(); hesk_isLoggedIn(); // Check permissions for this feature hesk_checkPermission('can_man_settings'); // Test languages function if (isset($_GET['test_languages'])) { hesk_testLanguage(0); } $help_folder = '../language/' . $hesk_settings['languages'][$hesk_settings['language']]['folder'] . '/help_files/'; $enable_save_settings = 0; $enable_use_attachments = 0; $server_time = date('H:i', strtotime(hesk_date())); // Print header require_once(HESK_PATH . 'inc/headerAdmin.inc.php'); // Print main manage users page require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); // Get the current version of Mods for Hesk $modsForHeskVersionRS = hesk_dbQuery("SELECT `Value` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'modsForHeskVersion'"); $modsForHeskVersionArray = hesk_dbFetchAssoc($modsForHeskVersionRS); $modsForHeskVersion = $modsForHeskVersionArray['Value']; // Demo mode? Hide values of sensitive settings if (defined('HESK_DEMO')) { $hesk_settings['smtp_host_name'] = $hesklang['hdemo']; $hesk_settings['smtp_user'] = $hesklang['hdemo']; $hesk_settings['smtp_password'] = $hesklang['hdemo']; $hesk_settings['pop3_host_name'] = $hesklang['hdemo']; $hesk_settings['pop3_user'] = $hesklang['hdemo']; $hesk_settings['pop3_password'] = $hesklang['hdemo']; $hesk_settings['recaptcha_public_key'] = $hesklang['hdemo']; $hesk_settings['recaptcha_private_key'] = $hesklang['hdemo']; } ?>
: ' . $hesklang['hud'] . ' '; } elseif ($latest != -1) { // Is this a beta/dev version? if (strpos($hesk_settings['hesk_version'], 'beta') || strpos($hesk_settings['hesk_version'], 'dev') || strpos($hesk_settings['hesk_version'], 'RC')) { echo ' ' . $hesklang['beta'] . ' '; ?> ' . $hesklang['hnw'] . ' '; ?> - -
: ' . $hesklang['mfh_up_to_date'] . ''; } else { ?> - -
:
:
/hesk_settings.inc.php ' . $hesklang['exists'] . ', ' . $hesklang['writable'] . ''; } else { echo '' . $hesklang['exists'] . ', ' . $hesklang['not_writable'] . '
' . $hesklang['e_settings']; } ?>
/ ' . $hesklang['exists'] . ', '; if (is_writable(HESK_PATH . $hesk_settings['attach_dir'])) { $enable_use_attachments = 1; echo '' . $hesklang['writable'] . ''; } else { echo '' . $hesklang['not_writable'] . '
' . $hesklang['e_attdir']; } } else { echo '' . $hesklang['no_exists'] . ', ' . $hesklang['not_writable'] . '
' . $hesklang['e_attdir']; } ?>
=') && @ini_get('max_file_uploads') && @ini_get('max_file_uploads') < $hesk_settings['attachments']['max_number']) { hesk_show_notice($hesklang['fatte1']); } // Check max attachment size $tmp = @ini_get('upload_max_filesize'); if ($tmp) { $last = strtoupper(substr($tmp, -1)); switch ($last) { case 'K': $tmp = $tmp * 1024; break; case 'M': $tmp = $tmp * 1048576; break; case 'G': $tmp = $tmp * 1073741824; break; default: $tmp = $tmp; } if ($tmp < $hesk_settings['attachments']['max_size']) { hesk_show_notice($hesklang['fatte2']); } } // Check max post size $tmp = @ini_get('post_max_size'); if ($tmp) { $last = strtoupper(substr($tmp, -1)); switch ($last) { case 'K': $tmp = $tmp * 1024; break; case 'M': $tmp = $tmp * 1048576; break; case 'G': $tmp = $tmp * 1073741824; break; default: $tmp = $tmp; } if ($tmp < ($hesk_settings['attachments']['max_size'] * $hesk_settings['attachments']['max_number'] + 524288)) { hesk_show_notice($hesklang['fatte3']); } } } $hesklang['err_custname'] = addslashes($hesklang['err_custname']); $modsForHesk_settings = mfh_getSettings(); ?>

 
'; ?>
'; ?>
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
'; ?>
   
   
'; ?>
'; ?>
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
   
'; ?>
 
:



 

 

 
   
'; ?>
 



 


 


   
  () ' . $hesklang['e_attach'] . ''; } ?>
/>
$hesklang['B'] . ' (' . $hesklang['bytes'] . ')', 'kB' => $hesklang['kB'] . ' (' . $hesklang['kilobytes'] . ')', 'MB' => $hesklang['MB'] . ' (' . $hesklang['megabytes'] . ')', 'GB' => $hesklang['GB'] . ' (' . $hesklang['gigabytes'] . ')', ); $tmp = hesk_formatBytes($hesk_settings['attachments']['max_size'], 0); list($size, $unit) = explode(' ', $tmp); ?>
/>
/>


'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
'; ?>
   
   
'; ?>



'; ?>
'; } // End FOR ?>

' . $hesklang['opt'] . '
'; ?>
/>
/>
/>
   
'; ?>
   
'; ?>
autocomplete="off"/>
autocomplete="off"/>
   
'; ?>
   
'; ?>
/>
/>
/>
   
'; ?>
'; ?>
autocomplete="off"/>
autocomplete="off"/>
 

   
'; ?>
$title) { echo '
'; } ?>


'; ?>


'; ?>

' . $server_time . ''; ?>

   
'; ?>


'; } else { echo '
' . $hesklang['e_save_settings'] . ''; } ?>
12) { return -1; } elseif ($latest == $hesk_settings['hesk_version']) { return true; } else { return $latest; } } else { return -1; } } // END hesk_checkVersion() function hesk_getLatestVersion() { global $hesk_settings; // Do we have a cached version file? if (file_exists(HESK_PATH . $hesk_settings['attach_dir'] . '/__latest.txt')) { if (preg_match('/^(\d+)\|([\d.]+)+$/', @file_get_contents(HESK_PATH . $hesk_settings['attach_dir'] . '/__latest.txt'), $matches) && (time() - intval($matches[1])) < 3600) { return $matches[2]; } } // No cached file or older than 3600 seconds, try to get an update $hesk_version_url = 'http://heskcom.s3.amazonaws.com/hesk_version.txt'; // Try using cURL if (function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $hesk_version_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 6); $latest = curl_exec($ch); curl_close($ch); return hesk_cacheLatestVersion($latest); } // Try using a simple PHP function instead if ($latest = file_get_contents($hesk_version_url)) { return hesk_cacheLatestVersion($latest); } // Can't check automatically, will need a manual check return false; } // END hesk_getLatestVersion() function hesk_cacheLatestVersion($latest) { global $hesk_settings; @file_put_contents(HESK_PATH . $hesk_settings['attach_dir'] . '/__latest.txt', time() . '|' . $latest); return $latest; } // END hesk_cacheLatestVersion() function hesk_checkMfhVersion($currentVersion) { if ($latest = hesk_getMfhLatestVersion()) { if (strlen($latest) > 12) { return -1; } elseif ($latest == $currentVersion) { return true; } else { return $latest; } } else { return -1; } } function hesk_getMfhLatestVersion() { global $hesk_settings; // Do we have a cached version file? if (file_exists(HESK_PATH . $hesk_settings['attach_dir'] . '/__latest-mfh.txt')) { if (preg_match('/^(\d+)\|([\d.]+)+$/', @file_get_contents(HESK_PATH . $hesk_settings['attach_dir'] . '/__latest-mfh.txt'), $matches) && (time() - intval($matches[1])) < 3600) { return $matches[2]; } } // No cached file or older than 3600 seconds, try to get an update $hesk_version_url = 'http://mods-for-hesk.mkochcs.com/latestversion.php'; // Try using cURL if (function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $hesk_version_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 6); $latest = curl_exec($ch); curl_close($ch); return hesk_cacheMfhLatestVersion($latest); } // Try using a simple PHP function instead if ($latest = file_get_contents($hesk_version_url)) { return hesk_cacheMfhLatestVersion($latest); } // Can't check automatically, will need a manual check return false; } function hesk_cacheMfhLatestVersion($latest) { global $hesk_settings; @file_put_contents(HESK_PATH . $hesk_settings['attach_dir'] . '/__latest-mfh.txt', time() . '|' . $latest); return $latest; } function hesk_testLanguage($return_options = 0) { global $hesk_settings, $hesklang, $modsForHesk_settings; /* Get a list of valid emails */ include_once(HESK_PATH . 'inc/email_functions.inc.php'); $valid_emails = array_keys(hesk_validEmails()); $dir = HESK_PATH . 'language/'; $path = opendir($dir); $text = ''; $html = ''; $text .= "/language\n"; /* Test all folders inside the language folder */ while (false !== ($subdir = readdir($path))) { if ($subdir == "." || $subdir == "..") { continue; } if (filetype($dir . $subdir) == 'dir') { $add = 1; $langu = $dir . $subdir . '/text.php'; $email = $dir . $subdir . '/emails'; /* Check the text.php */ $text .= " |-> /$subdir\n"; $text .= " |-> text.php: "; if (file_exists($langu)) { $tmp = file_get_contents($langu); // Some servers add slashes to file_get_contents output if (strpos($tmp, '[\\\'LANGUAGE\\\']') !== false) { $tmp = stripslashes($tmp); } $err = ''; if (!preg_match('/\$hesklang\[\'LANGUAGE\'\]\=\'(.*)\'\;/', $tmp, $l)) { $err .= " |----> MISSING: \$hesklang['LANGUAGE']\n"; } if (strpos($tmp, '$hesklang[\'ENCODING\']') === false) { $err .= " |----> MISSING: \$hesklang['ENCODING']\n"; } if (strpos($tmp, '$hesklang[\'_COLLATE\']') === false) { $err .= " |----> MISSING: \$hesklang['_COLLATE']\n"; } if (strpos($tmp, '$hesklang[\'EMAIL_HR\']') === false) { $err .= " |----> MISSING: \$hesklang['EMAIL_HR']\n"; } /* Check if language file is for current version */ if (strpos($tmp, '$hesklang[\'ms01\']') === false) { $err .= " |----> WRONG VERSION (not " . $hesk_settings['hesk_version'] . ")\n"; } if ($err) { $text .= "ERROR\n" . $err; $add = 0; } else { $l[1] = hesk_input($l[1]); $l[1] = str_replace('|', ' ', $l[1]); $text .= "OK ($l[1])\n"; } } else { $text .= "ERROR\n"; $text .= " |----> MISSING: text.php\n"; $add = 0; } /* Check emails folder */ $text .= " |-> /emails: "; if (file_exists($email) && filetype($email) == 'dir') { $err = ''; foreach ($valid_emails as $eml) { if (!file_exists($email . '/' . $eml . '.txt')) { $err .= " |----> MISSING: $eml.txt\n"; } } if ($err) { $text .= "ERROR\n" . $err; $add = 0; } else { $text .= "OK\n"; } } else { $text .= "ERROR\n"; $text .= " |----> MISSING: /emails folder\n"; $add = 0; } $text .= "\n"; /* Add an option for the