]> git.pld-linux.org Git - packages/coppermine-gallery.git/blob - coppermine-gallery-pld.patch
- some hints on how to use CPG in safe_mode without SILLY_SAFE_MODE
[packages/coppermine-gallery.git] / coppermine-gallery-pld.patch
1 --- cpg145/install.php  2006-05-01 13:05:17.582794094 +0300
2 +++ cpg145/install.php  2006-05-01 13:29:35.775346224 +0300
3 @@ -339,14 +339,14 @@
4            <td width="40%" class="tableb"><b>MySQL Database Name</b>
5            </td>
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') ?>" />
9            </td>
10           </tr>
11           <tr>
12            <td width="40%" class="tableb"><b>MySQL Username</b>
13            </td>
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') ?>" />
17            </td>
18           </tr>
19           <tr>
20 @@ -360,7 +360,7 @@
21            <td width="40%" class="tableb"><b>MySQL table prefix</b><br />(default value is OK; do not use dots!)
22            </td>
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'] : '') ?>" />
26            </td>
27           </tr>
28           <tr>
29 @@ -376,7 +376,7 @@
30            <td width="40%" class="tableb"><b>ImageMagick path</b>
31            </td>
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') ?>" />
35            </td>
36           </tr>
37           <tr>
38 @@ -472,8 +472,8 @@
39      $sql_query .= "REPLACE INTO CPG_config VALUES ('gallery_admin_email', '{$_POST['admin_email']}');\n";
40      // Test write permissions for main dir
41      if (!is_writable('.')) {
42 -        $sql_query .= "REPLACE INTO CPG_config VALUES ('default_dir_mode', '0777');\n";
43 -        $sql_query .= "REPLACE INTO CPG_config VALUES ('default_file_mode', '0666');\n";
44 +        $sql_query .= "REPLACE INTO CPG_config VALUES ('default_dir_mode', '0300');\n";
45 +        $sql_query .= "REPLACE INTO CPG_config VALUES ('default_file_mode', '0600');\n";
46      }
47      // Update table prefix
48      $sql_query = preg_replace('/CPG_/', $_POST['table_prefix'], $sql_query);
49 @@ -536,10 +536,12 @@
50  set_magic_quotes_runtime(0);
51  // The defaults values
52  $table_prefix = $_POST['table_prefix'];
53 -$DFLT = array('cfg_d' => 'include', // The config file dir
54 -    'lck_f' => 'include/install.lock', // Name of install lock file
55 -    'cfg_f' => 'include/config.inc.php', // The config file name
56 -    'alb_d' => 'albums', // The album dir
57 +$webapps_dir = '/etc/webapps/coppermine-gallery';
58 +$var_dir = '/var/lib/coppermine-gallery';
59 +$DFLT = array('cfg_d' => $webapps_dir, // The config file dir
60 +    'lck_f' => "$webapps_dir/install.lock", // Name of install lock file
61 +    'cfg_f' => "$webapps_dir/config.inc.php", // The config file name
62 +    'alb_d' => "$var_dir/albums", // The album dir
63      'upl_d' => 'userpics', // The uploaded pic dir
64      'edit_d' => 'edit',
65      'sql_d' => 'sql'
66 --- cpg145/include/init.inc.php 2006-05-01 13:37:00.735274303 +0300
67 +++ cpg145/include/init.inc.php 2006-05-01 13:54:20.578477527 +0300
68 @@ -150,9 +150,9 @@
69  define('CRITICAL_ERROR', 3);
70  
71  // Include config and functions files
72 -if(file_exists('include/config.inc.php')){
73 +if (file_exists('/etc/webapps/coppermine-gallery/config.inc.php') and filesize('/etc/webapps/coppermine-gallery/config.inc.php') > 0) {
74                  ob_start();
75 -                require_once 'include/config.inc.php';
76 +                require_once '/etc/webapps/coppermine-gallery/config.inc.php';
77                  ob_clean();
78  } else {
79    // error handling: if the config file doesn't exist go to install
This page took 0.076466 seconds and 3 git commands to generate.