]> git.pld-linux.org Git - packages/gallery.git/blame - gallery-PLD.patch
- update .sh scripts from debian. odd, their princible is same as here
[packages/gallery.git] / gallery-PLD.patch
CommitLineData
649899bd
ER
1--- ./lib/url.php~ 2005-12-26 23:23:03.000000000 +0200
2+++ ./lib/url.php 2006-01-27 00:45:58.479261981 +0200
3@@ -17,7 +17,7 @@
4 $currentFile = __FILE__;
5 if ( $currentFile == '/usr/share/gallery/lib/url.php') {
6 /* We assum Gallery runs on as Debian Package */
7- define ("GALLERY_CONFDIR", "/etc/gallery");
7e9cfd11 8+ define ("GALLERY_CONFDIR", "/usr/share/gallery");
649899bd
ER
9 define ("GALLERY_SETUPDIR", "/var/lib/gallery/setup");
10 } else {
11 define ("GALLERY_CONFDIR", dirname(dirname(__FILE__)));
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@@ -317,7 +317,7 @@
15 'desc' => '(<span class="attention">' . gTranslate('config',"REQUIRED") . '</span>) ' .
16 sprintf(gTranslate('config',"The full path on physical disk to the directory where your photos will be stored. This directory should start off empty&#8212;Gallery will fill it. Note that this directory needs to have write access by the user who is running the web server (in your case this user is %s)."),
17 '<b>'. $webserver_user . '</b>'),
18- 'value' => getenv('DOCUMENT_ROOT') . '/albums',
19+ 'value' => '/var/lib/gallery/albums',
20 'require-write-dir' => 1,
21 'filename' => 1,
22 'type' => 'text',
23@@ -330,7 +330,7 @@
24 'desc' => '(<span class="attention">' . gTranslate('config',"REQUIRED") . '</span>) ' .
25 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."),
26 '<i>/tmp</i>','<i>c:\\windows\\temp</i>'),
27- 'value' => getenv('TMP'),
28+ 'value' => '/var/tmp',
29 'filename' => 1,
30 'require-write-dir' => 1,
31 'type' => 'text',
7e9cfd11
ER
32--- gallery/setup/config_data.inc 2006-01-27 01:22:22.000000000 +0200
33+++ /tmp/config_data.inc 2006-01-27 01:38:25.000000000 +0200
34@@ -354,7 +354,7 @@
35 'desc' => '(<span class="attention">' . gTranslate('config',"REQUIRED") . '</span>) ' .
36 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."),
37 '<i>http://www.example.com/albums</i>'),
38- 'value' => 'http://' . getenv('SERVER_NAME') . '/albums',
39+ 'value' => 'http://' . getenv('SERVER_NAME') . $GALLERY_URL . '/albums',
40 'no-trailing-slash' => 1,
41 'type' => 'text',
42 'attrs' => array('size' => 50),
43--- gallery-1.5.2.orig/configure.sh
44+++ gallery-1.5.2/configure.sh
45@@ -1,20 +1,28 @@
46 #!/bin/sh
47-# $Id$
48
49-chmod 755 setup
50+set -e
51
52-if [ ! -f config.php ]; then
53- touch config.php
54-fi
55+ROOT=/usr/share/gallery
56+CONFDIR=/etc/webapps/gallery
57
58-if [ ! -f .htaccess ]; then
59- touch .htaccess
60+if [ `whoami` != "root" ] ; then
61+ echo "You must be root to run this script" 2>&1
62+ exit 1
63 fi
64
65-chmod 666 config.php .htaccess
66+for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
67+ if [ ! -f $file ]; then
68+ touch $file
69+ fi
70+ chown root:http $file
71+ chmod 660 $file
72+done
73+
74+chmod 755 $ROOT/setup
75+
76
77 echo ""
78-echo "You are now in setup mode. Your Gallery installation"
79+echo "You are now in setup mode. Your Gallery installation"
80 echo "can be configured by pointing your web browser"
81-echo "to the URL to 'setup' in this directory."
82+echo "to the setup wizard (e.g. http://www.example.com/gallery/setup/index.php) "
83 echo ""
84--- gallery-1.5.2.orig/secure.sh
85+++ gallery-1.5.2/secure.sh
86@@ -1,21 +1,31 @@
87 #!/bin/sh
88-# $Id$
89+# $Id$
90
91-if [ -f config.php ]; then
92- chmod 644 config.php
93-fi
94
95-if [ -f .htaccess ]; then
96- chmod 644 .htaccess
97+set -e
98+
99+ROOT=/usr/share/gallery
100+CONFDIR=/etc/webapps/gallery
101+
102+if [ `whoami` != "root" ] ; then
103+ echo "You must be root to run this script" 2>&1
104+ exit 1
105 fi
106
107-if [ -f setup/resetadmin ]; then
108- rm -f setup/resetadmin
109+for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
110+ if [ -f $file ]; then
111+ chown root:http $file
112+ chmod 640 $file
113+ fi
114+done
115+
116+if [ -f $ROOT/setup/resetadmin ]; then
117+ rm -f $ROOT/setup/resetadmin
118 fi
119
120 echo ""
121 echo "Your Gallery is now secure and cannot be configured. If"
122-echo "you wish to reconfigure it, run:"
123+echo "you wish to reconfigure it, run configure.sh as root:"
124 echo ""
125-echo " % ./configure.sh"
126+echo " # $ROOT/configure.sh"
127 echo ""
128--- gallery-1.5.2.orig/setup/confirm.inc
129+++ gallery-1.5.2/setup/confirm.inc
130@@ -53,7 +53,7 @@
131 ${str_replace('.', '', $outfile) . '_file'} = 0;
132 } else {
133 $error++;
134- $viewheader .= '<br>'. gallery_error(sprintf(_("File %s is not writable by the webserver - chmod it 777 before proceeding. See %s for more details."), "<i><b>$outfile</b></i>", $docs)) . "</p>\n";
135+ $viewheader .= gallery_error(sprintf(_("File %s 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";
136 ${str_replace('.', '', $outfile) . '_file'} = 1;
137 }
138 }
139--- gallery-1.5.2.orig/setup/write.inc
140+++ gallery-1.5.2/setup/write.inc
141@@ -193,7 +193,7 @@
142 $message .= "<br><br>";
143 else
144 $message = "";
145- $message .= _("We highly suggest that you run 'secure.sh', or chmod your .htaccess and config.php to 644 for increased security.");
146+ $message .= _("We highly suggest that you run '/usr/share/gallery/secure.sh' for increased security.");
147 }
148
149 // Inform the user that their gallery is not secure until they remove the 'resetadmin' file
This page took 0.101912 seconds and 4 git commands to generate.