Commit d3da6108 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3090 using CACHE_DIR for the auth file instead of /tmp

Showing with 12 additions and 15 deletions
+12 -15
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2007 Fabian Hickert
Copyright (C) 2011-2013 FusionDirectory
Copyright (C) 2011-2014 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -25,11 +24,13 @@ class Step_Welcome extends setup_step
var $languages = array();
var $attributes = array();
var $header_image = "images/setup/welcome.png";
var $authPath;
function Step_Welcome()
{
$this->is_enabled = TRUE;
$this->is_active = TRUE;
$this->authPath = CACHE_DIR.'/fusiondirectory.auth';
$this->update_strings();
}
......@@ -45,8 +46,8 @@ class Step_Welcome extends setup_step
$smarty = get_smarty();
$smarty->assign('auth_id', session_id());
$smarty->assign("path",'/tmp/fusiondirectory.auth');
return($smarty->fetch(get_template_path("setup_welcome.tpl",TRUE,dirname(__FILE__))));
$smarty->assign("path", $this->authPath);
return $smarty->fetch(get_template_path("setup_welcome.tpl", TRUE, dirname(__FILE__)));
}
function save_object()
......@@ -54,21 +55,17 @@ class Step_Welcome extends setup_step
$id = "";
/* Get auth ID from file */
$path = '/tmp/fusiondirectory.auth';
if (file_exists($path) && is_readable($path)){
$contents= file($path);
$id= chop($contents[0]);
if (file_exists($this->authPath) && is_readable($this->authPath)) {
$contents = file($this->authPath);
$id = chop($contents[0]);
}
/* Continue if we've the correct ID */
if ($id == session_id()){
$this->is_completed = true;
if ($id == session_id()) {
$this->is_completed = TRUE;
} else {
$this->is_completed = false;
$this->is_completed = FALSE;
}
}
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
......@@ -25,7 +25,7 @@
<b>{t}To continue...{/t}</b>
</p>
<p>
{t}For security reasons you need to authenticate for the installation by creating the file '/tmp/fusiondirectory.auth', containing the current session ID on the servers local filesystem. This can be done by executing the following command:{/t}
{t 1=$path}For security reasons you need to authenticate for the installation by creating the file '%1', containing the current session ID on the servers local filesystem. This can be done by executing the following command:{/t}
</p>
<tt>
echo -n <b>{$auth_id}</b> &gt; {$path}
......
  • bmortier @bmortier

    mentioned in issue #1044

    By Côme Chilliet on 2017-09-02T15:10:17 (imported from GitLab)

    ·

    mentioned in issue #1044

    By Côme Chilliet on 2017-09-02T15:10:17 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment