1 --- cpg145/install.php 2006-05-01 13:05:17.582794094 +0300
2 +++ cpg145/install.php 2006-05-01 13:29:35.775346224 +0300
4 <td width="40%" class="tableb"><b>MySQL Database Name</b>
6 <td width="60%" class="tableb">
7 - <input type="text" class="textinput" name="dbname" value="<?php echo $_POST['dbname'] ?>" />
8 + <input type="text" class="textinput" name="dbname" value="<?php echo ($_POST['dbname'] ? $_POST['dbname'] : 'cpg') ?>" />
12 <td width="40%" class="tableb"><b>MySQL Username</b>
14 <td width="60%" class="tableb">
15 - <input type="text" class="textinput" name="dbuser" value="<?php echo $_POST['dbuser'] ?>" />
16 + <input type="text" class="textinput" name="dbuser" value="<?php echo ($_POST['dbuser'] ? $_POST['dbuser'] : 'cpg') ?>" />
21 <td width="40%" class="tableb"><b>MySQL table prefix</b><br />(default value is OK; do not use dots!)
23 <td width="60%" class="tableb" valign="top">
24 - <input type="text" class="textinput" name="table_prefix" value="<?php echo ($_POST['table_prefix'] ? $_POST['table_prefix'] : 'cpg14x_') ?>" />
25 + <input type="text" class="textinput" name="table_prefix" value="<?php echo ($_POST['table_prefix'] ? $_POST['table_prefix'] : '') ?>" />
30 <td width="40%" class="tableb"><b>ImageMagick path</b>
32 <td width="60%" class="tableb" valign="top">
33 - <input type="text" class="textinput" name="impath" value="<?php echo $_POST['impath'] ?>" />
34 + <input type="text" class="textinput" name="impath" value="<?php echo (isset($_POST['impath']) ? $_POST['impath'] : '/usr/bin') ?>" />
39 set_magic_quotes_runtime(0);
40 // The defaults values
41 $table_prefix = $_POST['table_prefix'];
42 -$DFLT = array('cfg_d' => 'include', // The config file dir
43 - 'lck_f' => 'include/install.lock', // Name of install lock file
44 - 'cfg_f' => 'include/config.inc.php', // The config file name
45 - 'alb_d' => 'albums', // The album dir
46 +$webapps_dir = '/etc/webapps/coppermine-gallery';
47 +$var_dir = '/var/lib/coppermine-gallery';
48 +$DFLT = array('cfg_d' => $webapps_dir, // The config file dir
49 + 'lck_f' => "$webapps_dir/install.lock", // Name of install lock file
50 + 'cfg_f' => "$webapps_dir/config.inc.php", // The config file name
51 + 'alb_d' => "$var_dir/albums", // The album dir
52 'upl_d' => 'userpics', // The uploaded pic dir
55 --- cpg145/include/init.inc.php 2006-05-01 13:37:00.735274303 +0300
56 +++ cpg145/include/init.inc.php 2006-05-01 13:54:20.578477527 +0300
58 define('CRITICAL_ERROR', 3);
60 // Include config and functions files
61 -if(file_exists('include/config.inc.php')){
62 +if (file_exists('/etc/webapps/coppermine-gallery/config.inc.php') and filesize('/etc/webapps/coppermine-gallery/config.inc.php') > 0) {
64 - require_once 'include/config.inc.php';
65 + require_once '/etc/webapps/coppermine-gallery/config.inc.php';
68 // error handling: if the config file doesn't exist go to install