$this->errors = array();
$this->backup = null;
- $this->save_log = ini_set('error_log', dirname(__FILE__).'/../../tmp/upgrade.'.$this->cur_company.'.log');
+ $this->save_log = ini_set('error_log', VARLOG_PATH.'/upgrade.'.$this->cur_company.'.log');
$this->log_error(sprintf(_("Upgrade started for company %s."), $this->cur_company), 'Info');
if (!set_global_connection($this->cur_company))
$i = find_submit('Clear');
if ($i != -1)
{
- unlink($path_to_root.'/tmp/upgrade.'.$i.'.log');
+ unlink(VARLOG_PATH.'/upgrade.'.$i.'.log');
$Ajax->activate('_page_body');
}
if (get_post('_select_comp_update'))
label_cell($comp['version'], 'align=center' .($status ? '':' class=redfg')/*, 'class='.( $status ? 'ok' : 'error')*/);
- $log = $path_to_root.'/tmp/upgrade.'.$i.'.log';
+ $log = VARLOG_PATH.'/upgrade.'.$i.'.log';
if (file_exists($log))
{
label_cell(viewer_link(_('View log'), "admin/view/view_upgrade_log.php?id=$i", null, $i, 'log.png')
start_table();
start_row();
- $log = strtr(file_get_contents($path_to_root.'/tmp/upgrade.'.$_GET['id'].'.log'),
+ $log = strtr(file_get_contents(VARLOG_PATH.'/upgrade.'.$_GET['id'].'.log'),
array('Fatal error' => 'Fatal error')); // prevent misinterpretation in output_handler
label_cells(null, nl2br(html_specials_encode($log)));
end_row();
// writable by www server. When set to empty string logging is switched off.
// Special value 'syslog' can be used for system logger usage (see php manual).
//$error_logfile = '';
- $error_logfile = $path_to_root.'/tmp/errors.log';
+ $error_logfile = VARLOG_PATH.'/errors.log';
$debug = 1; // show sql on database errors
$show_sql = 0; // show all sql queries in page footer for debugging purposes
do {
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $proto.$site.$filename);
- curl_setopt ($ch, CURLOPT_COOKIEJAR, "$path_to_root/tmp/cookie.txt");
+ curl_setopt ($ch, CURLOPT_COOKIEJAR, VARLIB_PATH."/cookie.txt");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
// prevent warning while safe_mode/open_basedir on (redirection doesn't occur at least on ECB page)
// and check remote signature with local copy of public key
//
$loclist = PKG_CACHE_PATH.'/Release.gz';
- $target_dir = $download==true ? "$path_to_root/tmp/" : $download;
+ $target_dir = $download==true ? VARLIB_PATH."/" : $download;
if (isset($type) && !is_array($type)) {
$type = array($type);
uninstall_package($old_pkg);
}
- $package = new package("$path_to_root/tmp/".$pkg['Filename'].'.pkg');
+ $package = new package(VARLIB_PATH."/".$pkg['Filename'].'.pkg');
if ($package->install()) {
$lang = array(
'name' => $pkg['Name'],
$lang['rtl'] = true;
$installed_languages[$i] = $lang;
write_lang($installed_languages);
- unlink("$path_to_root/tmp/".$pkg['Filename'].'.pkg');
+ unlink(VARLIB_PATH."/".$pkg['Filename'].'.pkg');
$Ajax->activate('lang_tbl');
} else {
display_error(implode('<br>', $package->error));
$pkg = get_pkg_or_list(array('extension', 'theme', 'chart'), $pkg_name);
if ($pkg) {
- $package = new package("$path_to_root/tmp/".$pkg['Filename'].'.pkg');
+ $package = new package(VARLIB_PATH."/".$pkg['Filename'].'.pkg');
$local_exts = get_company_extensions();
if ($package->install()) {
$ext_id = array_search_key($pkg['Package'], $local_exts, 'package');
activate_hooks($ext['package'], $comp);
}
- unlink("$path_to_root/tmp/".$pkg['Filename'].'.pkg');
+ unlink(VARLIB_PATH."/".$pkg['Filename'].'.pkg');
$Ajax->activate('ext_tbl');
return $ret;
} else {
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
+define('VARLIB_PATH', $path_to_root.'/tmp');
+define('VARLOG_PATH', $path_to_root.'/tmp');
class SessionManager
{
$msg .= "*/\n";
$msg .= "\$login_faillog = " .var_export($login_faillog, true). ";\n";
- $filename = $path_to_root."/tmp/faillog.php";
+ $filename = VARLIB_PATH."/faillog.php";
- if ((!file_exists($filename) && is_writable($path_to_root.'/tmp')) || is_writable($filename))
+ if ((!file_exists($filename) && is_writable(VARLIB_PATH)) || is_writable($filename))
{
file_put_contents($filename, $msg);
cache_invalidate($filename);
to avoid unexpeced session timeouts.
Make sure this directory exists and is writable!
*/
-// ini_set('session.save_path', dirname(__FILE__).'/../tmp/');
+// ini_set('session.save_path', VARLIB_PATH.'/');
ini_set('session.gc_maxlifetime', 36000); // 10hrs
get_text_init();
-if ($SysPrefs->login_delay > 0 && file_exists($path_to_root . "/tmp/faillog.php"))
- include_once($path_to_root . "/tmp/faillog.php");
+if ($SysPrefs->login_delay > 0 && file_exists(VARLIB_PATH."/faillog.php"))
+ include_once(VARLIB_PATH."/faillog.php");
// Page Initialisation
if (!isset($_SESSION['wa_current_user']) || !$_SESSION['wa_current_user']->logged_in()
$test['descr'] = _('Temporary directory');
$test['type'] = 3;
- $test['test'] = $path_to_root.'/tmp';
+ $test['test'] = VARLIB_PATH;
$test['result'] = is_dir($test['test']) && is_writable($test['test']);
$test['comments'][] = sprintf(_("'%s' is not writeable"), $test['test']);
return $test;
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
+define('VARLIB_PATH', $path_to_root.'/tmp');
+define('VARLOG_PATH', $path_to_root.'/tmp');
+
function output_html($text)
{
global $before_box, $Ajax, $messages;