From: Janusz Dobrowolski Date: Thu, 4 Dec 2008 14:20:40 +0000 (+0000) Subject: Fixed company subdirs creation during upgrade and company addition. X-Git-Tag: 2.3-final~1366 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=388b76390023fb33ed063682cb2ddb3b14a9ce15 Fixed company subdirs creation during upgrade and company addition. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 37a23099..c9a1606a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,14 @@ Legend: ! -> Note $ -> Affected files +04-Dec-2008 Janusz Dobrowolski +# Check write permissions and create per company subdirectory structure. +$ /update.html + /update_db.php +# Fixed index.php files in new company dirs. +$ /admin/create_coy.php + /admin/db/maintenance_db.inc + 04-Dec-2008 Joe Hunt # [0000095] Inbalance double entry on Documents $ /gl/includes/db/gl_db_trans.inc diff --git a/admin/create_coy.php b/admin/create_coy.php index 8324fa7d..50dcca0f 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -137,19 +137,10 @@ function handle_submit() { return false; } - $index = ""; if ($new) { - $cdir = $comp_path.'/'.$id; - @mkdir($cdir); - save_to_file($cdir.'/'.'index.php', 0, $index); - - foreach($comp_subdirs as $dir) - { - @mkdir($cdir.'/'.$dir); - save_to_file($cdir.'/'.$dir.'/'.'index.php', 0, $index); - } + create_comp_dirs("$comp_path/$id", $comp_subdirs); } return true; } diff --git a/admin/db/maintenance_db.inc b/admin/db/maintenance_db.inc index c40c4ef6..21236b62 100644 --- a/admin/db/maintenance_db.inc +++ b/admin/db/maintenance_db.inc @@ -632,5 +632,21 @@ function save_to_file($backupfile, $zip, $fileData) } } - +function create_comp_dirs($comp_path, $comp_subdirs) +{ + $index = ""; + $cdir = $comp_path; + @mkdir($cdir); + $f = @fopen("$cdir/index.php", "wb"); + @fwrite($f, $index); + @fclose($f); + + foreach($comp_subdirs as $dir) + { + @mkdir($cdir.'/'.$dir); + $f = @fopen("$cdir/$dir/index.php", "wb"); + @fwrite($f, $index); + @fclose($f); + } +} ?> \ No newline at end of file diff --git a/update.html b/update.html index cc0bb64d..5a87aafd 100644 --- a/update.html +++ b/update.html @@ -38,7 +38,7 @@ these files too.
  • Upload all the new files.
  • Restore the files mentioned in #1. Be careful with - config.db. Look into variances. There might be new variables in + config.php. Look into variances. There might be new variables in the new version. It might be easier to manually change your former values in the new file.
  • @@ -53,7 +53,7 @@ password and choose the update script from the local harddisk. do this, before entering FrontAccounting! Enter the database user and the password and choose the alter.sql script.  Do the same for the alter2.sql script. If you have -already updated release 2.0 Beta, you can just run the alter2.sql script.
    You must also manuelly ensure that you have write permission to the new folder /company/0.
    There are no database changes during a major and minor release. Like from 2.0 to 2.0.1 - 2.0.5 . +already updated release 2.0 Beta, you can just run the alter2.sql script.
    You must also manuelly ensure that you have write permission to the new folder /company .
    There are no database changes during a major and minor release. Like from 2.0 to 2.0.1 - 2.0.5 .

     

    diff --git a/update_db.php b/update_db.php index 26c14ee5..4ebbbc74 100644 --- a/update_db.php +++ b/update_db.php @@ -9,6 +9,8 @@ $js .= get_js_set_focus("user"); $image = $path_to_root."/themes/default/images/logo_frontaccounting.png"; $title = "Update All Company Databases"; +$comp_subdirs = array('images', 'pdf_files', 'backup','js_cache'); + function get_js_png_fix() { $js = "