]> git.pld-linux.org Git - packages/gallery.git/blob - gallery-PLD.patch
- suggests
[packages/gallery.git] / gallery-PLD.patch
1 --- gallery-1.5.10/lib/url.php~ 2009-08-27 10:16:20.000000000 +0300
2 +++ gallery-1.5.10/lib/url.php  2009-08-27 10:17:03.141519923 +0300
3 @@ -38,7 +38,7 @@
4         $currentFile = __FILE__;
5         if ( $currentFile == '/usr/share/gallery/lib/url.php') {
6                 /* We assume Gallery runs on as Debian Package */
7 -               define ("GALLERY_CONFDIR", "/etc/gallery");
8 +               define ("GALLERY_CONFDIR", "/usr/share/gallery");
9                 define ("GALLERY_SETUPDIR", "/var/lib/gallery/setup");
10         }
11         else {
12 --- gallery/setup/config_data.inc       2006-01-10 07:41:32.000000000 +0200
13 +++ /tmp/config_data.inc        2006-01-27 00:53:36.000000000 +0200
14 @@ -330,7 +330,7 @@
15                 'desc' => '(<span class="attention">' . gTranslate('config',"REQUIRED") . '</span>) ' .
16                   sprintf(gTranslate('config',"The filesystem path to a temporary directory.  E.g. %s or %s.  Note that if you have <b>open_basedir</b> configured on your system, then this temporary directory must be inside the <b>open_basedir</b> path!  In that case you may need to create the directory yourself and make sure that it's writable by the webserver process."),
17                   '<i>/tmp</i>','<i>c:\\windows\\temp</i>'),
18 -               'value' => getenv('TMP'),
19 +               'value' => '/var/tmp',
20                 'filename' => 1,
21                 'require-write-dir' => 1,
22                 'type' => 'text',
23 --- gallery/setup/config_data.inc       2006-01-27 01:22:22.000000000 +0200
24 +++ /tmp/config_data.inc        2006-01-27 01:38:25.000000000 +0200
25 @@ -354,7 +354,7 @@
26                 'desc' => '(<span class="attention">' . gTranslate('config',"REQUIRED") . '</span>) ' .
27                   sprintf(gTranslate('config',"The full URL to your album directory on your web server.  (e.g. %s) Gallery can operate with relative URLs, however some features, such as printing, may not function correctly."),
28                   '<i>http://www.example.com/albums</i>'),
29 -               'value' => 'http://' . getenv('SERVER_NAME') . '/albums',
30 +               'value' => 'http://' . getenv('SERVER_NAME') . $GALLERY_URL . '/albums',
31                 'no-trailing-slash' => 1,
32                 'type' => 'text',
33                 'attrs' => array('size' => 50),
34 --- gallery-1.5.2.orig/configure.sh
35 +++ gallery-1.5.2/configure.sh
36 @@ -1,20 +1,29 @@
37  #!/bin/sh
38  # $Id$
39  
40 -chmod 755 setup
41 +set -e
42  
43 -if [ ! -f config.php ]; then
44 -    touch config.php
45 -fi
46 +ROOT=/usr/share/gallery
47 +CONFDIR=/etc/webapps/gallery
48  
49 -if [ ! -f .htaccess ]; then
50 -    touch .htaccess
51 +if [ `whoami` != "root" ] ; then
52 +    echo "You must be root to run this script" 2>&1
53 +    exit 1
54  fi
55  
56 -chmod 666 config.php .htaccess
57 +for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
58 +    if [ ! -f $file ]; then
59 +        touch $file
60 +    fi
61 +    chown root:http $file
62 +    chmod 660 $file
63 +done
64 +
65 +chmod 755 $ROOT/setup
66 +
67  
68  echo ""
69 -echo "You are now in setup mode. Your Gallery installation"
70 +echo "You are now in setup mode.  Your Gallery installation"
71  echo "can be configured by pointing your web browser"
72 -echo "to the URL to 'setup' in this directory."
73 +echo "to the setup wizard (e.g. http://www.example.com/gallery/setup/index.php) "
74  echo ""
75 --- gallery-1.5.2.orig/secure.sh
76 +++ gallery-1.5.2/secure.sh
77 @@ -1,21 +1,31 @@
78  #!/bin/sh
79  # $Id$
80  
81 -if [ -f config.php ]; then
82 -    chmod 644 config.php 
83 -fi
84  
85 -if [ -f .htaccess ]; then
86 -    chmod 644 .htaccess
87 +set -e
88 +
89 +ROOT=/usr/share/gallery
90 +CONFDIR=/etc/webapps/gallery
91 +
92 +if [ `whoami` != "root" ] ; then
93 +    echo "You must be root to run this script" 2>&1
94 +    exit 1
95  fi
96  
97 -if [ -f setup/resetadmin ]; then
98 -    rm -f setup/resetadmin
99 +for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
100 +    if [  -f $file ]; then
101 +       chown root:http $file
102 +        chmod 640  $file
103 +    fi
104 +done
105 +
106 +if [ -f $ROOT/setup/resetadmin ]; then
107 +    rm -f $ROOT/setup/resetadmin
108  fi
109  
110  echo ""
111  echo "Your Gallery is now secure and cannot be configured.  If"
112 -echo "you wish to reconfigure it, run:"
113 +echo "you wish to reconfigure it, run configure.sh as root:"
114  echo ""
115 -echo "    % ./configure.sh"
116 +echo "    # $ROOT/configure.sh"
117  echo ""
118 --- gallery/setup/confirm.inc~  2007-08-21 09:25:22.650536464 +0300
119 +++ gallery/setup/confirm.inc   2007-08-21 09:28:17.384497289 +0300
120 @@ -53,7 +53,7 @@
121                 ${str_replace('.', '', $outfile) . '_file'} = 0;
122         } else {
123                 $error++;
124 -               $viewheader .= '<br>'. gallery_error(sprintf(gTranslate('config', "File %s in your Gallery mainfolder is not writable by the webserver. - chmod it 777 before proceeding.  See %s for more details."), "<i><b>$outfile</b></i>", $docs)) . "</p>\n";
125 +               $viewheader .= '<br>'. gallery_error(sprintf(gTranslate('config', "File %s in your Gallery mainfolder is not writable by the webserver. - run %s before proceeding.  See %s for more details."), "<i><b>$outfile</b></i>", "<tt>/usr/share/gallery/configure.sh</tt>", $docs)) . "</p>\n";
126                 ${str_replace('.', '', $outfile) . '_file'} = 1;
127         }
128  }
129 --- gallery-1.5.10/setup/write.inc~     2009-08-27 10:17:59.000000000 +0300
130 +++ gallery-1.5.10/setup/write.inc      2009-08-27 10:18:26.424844612 +0300
131 @@ -207,7 +207,7 @@
132                 $message .= "<br><br>";
133         }
134         else {
135 -               $message = gTranslate('config', "We highly suggest that you run 'secure.sh', or chmod your .htaccess and config.php to 644 for increased security.");
136 +               $message = gTranslate('config', "We highly suggest that you run '/usr/share/gallery/secure.sh' for increased security.");
137         }
138  }
139  
This page took 0.147626 seconds and 3 git commands to generate.