Merge lp:~sleszyk/vallheru/vallheru2 into lp:vallheru

Proposed by Slesz
Status: Merged
Approved by: Bartek Jasicki
Approved revision: 1720
Merge reported by: Bartek Jasicki
Merged at revision: not available
Proposed branch: lp:~sleszyk/vallheru/vallheru2
Merge into: lp:vallheru
Diff against target: 153 lines (+54/-81)
1 file modified
install/install.php (+54/-81)
To merge this branch: bzr merge lp:~sleszyk/vallheru/vallheru2
Reviewer Review Type Date Requested Status
Bartek Jasicki Pending
Review via email: mp+147343@code.launchpad.net

Description of the change

install.php permission check customization

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'install/install.php'
--- install/install.php 2012-05-21 19:47:48 +0000
+++ install/install.php 2013-02-08 11:13:28 +0000
@@ -160,95 +160,68 @@
160Test uprawnień plików oraz katalogów<br />160Test uprawnień plików oraz katalogów<br />
161Zanim zaczniesz instalację upewnij się, że skrypt posiada uprawnienia do modyfikacji odpowiednich plików<br />161Zanim zaczniesz instalację upewnij się, że skrypt posiada uprawnienia do modyfikacji odpowiednich plików<br />
162<?php162<?php
163 $files_to_check = array('../includes/config.php', '../templates_c/test.php', '../avatars/test.php', '../images/tribes/test.php', '../templates_c/layout1/test.php', '../cache/test.php', '../mailer/mailerconfig.php');
163 $result = array();164 $result = array();
164 @$configfile = fopen('../includes/config.php', 'w');165 $result_i = 0;
165 if (!$configfile) 166 $message = array('<td><span style="color:green">OK</span></td></tr>','<td><span style="color:red">Problem</span></td></tr>');
166 {167 foreach($files_to_check as $file)
167 $result[0] = "Brak uprawnień!<br />";168 {
168 } 169 if(substr($file, -8) == 'test.php')
169 else 170 {
170 {171 $file = substr($file, 0, -8);
171 $result[0] = "W porządku<br />";172 }
172 }173 $result[$result_i] = '<tr><td>Uprawnienia do <strong>'.substr($file, 3).'</strong> : ';
173 print "Plik includes/config.php...".$result[0];174 $result_i++;
174 @$templatescat = fopen('../templates_c/test.php', 'w');175 $result[$result_i] = '<em>'.substr(sprintf('%o', @fileperms($file)), -4).'</em></td>';
175 if (!$templatescat) 176 $result_i++;
176 {177 if(is_dir($file))
177 $result[1] = "Brak uprawnień!<br />";178 {
178 } 179 @$file_handle = fopen($file.'test.php', 'w');
179 else 180 }
180 {181 else
181 $result[1] = "W porządku<br />";182 {
182 unlink('../templates_c/test.php');183 @$file_handle = fopen($file, 'w');
183 }184 }
184 print "Katalog templates_c...".$result[1];185 if ($file_handle)
185 @$avatarscat = fopen('../avatars/test.php', 'w');186 {
186 if (!$avatarscat) 187 $result[$result_i] = $message[0];
187 {188 }
188 $result[2] = "Brak uprawnień!<br />";189 else
189 } 190 {
190 else 191 $result[$result_i] = $message[1];
191 {192 $result_i++;
192 $result[2] = "W porządku<br />";193 $result[$result_i] = '<tr><td>Próba nadania pełnych uprawnień do <strong>'.substr($file, 3).'</strong> : </td>';
193 unlink('../avatars/test.php');194 $result_i++;
194 }195 if (@chmod($file, 0777))
195 print "Katalog avatars...".$result[2];196 {
196 @$tribelogoscat = fopen('../images/tribes/test.php', 'w');197 $result[$result_i] = $message[0];
197 if (!$tribelogoscat) 198 }
198 {199 else
199 $result[3] = "Brak uprawnień!<br />";200 {
200 } 201 $result[$result_i] = $message[1];
201 else 202 }
202 {203 }
203 $result[3] = "W porządku<br />";204 $result_i++;
204 unlink('../images/tribes/test.php');205 }
205 }206 print '<table>';
206 print "Katalog images/tribes...".$result[3];207 foreach($result as $print_it) {
207 @$layout1cat = fopen('../templates_c/layout1/test.php', 'w');208 print $print_it;
208 if (!$layout1cat) 209 }
209 {210 print '</table>';
210 $result[4] = "Brak uprawnień!<br />";211
211 } 212 foreach($result as $this_result)
212 else 213 {
213 {214 if ($this_result == $message[1])
214 $result[4] = "W porządku<br />";
215 unlink('../templates_c/layout1/test.php');
216 }
217 print "Katalog templates_c/layout1...".$result[4];
218 @$cachecat = fopen('../cache/test.php', 'w');
219 if (!$cachecat)
220 {
221 $result[5] = "Brak uprawnień!<br />";
222 }
223 else
224 {
225 $result[5] = "W porządku<br />";
226 unlink('../cache/test.php');
227 }
228 print "Katalog cache...".$result[5];
229 @$mailerconf = fopen('../mailer/mailerconfig.php', 'w');
230 if (!$mailerconf)
231 {
232 $result[6] = "Brak uprawnień!<br />";
233 }
234 else
235 {
236 $result[6] = "W porządku<br />";
237 }
238 print "Plik mailer/mailerconfig.php...".$result[6];
239 $test = 0;
240 for ($i = 0; $i < 7; $i ++)
241 {
242 if ($result[$i] == "Brak uprawnień!<br />")
243 {215 {
244 print "Zanim rozpoczniesz instalację, nadaj odpowiednie uprawnienia a następnie ponownie odśwież stronę<br />216 print "Zanim rozpoczniesz instalację, nadaj odpowiednie uprawnienia a następnie ponownie odśwież stronę<br />
245 <form method=\"post\" action=\"install.php?step=install1\">217 <form method=\"post\" action=\"install.php?step=install1\">
246 <input type=\"submit\" value=\"Odśwież\"></form>";218 <input type=\"submit\" value=\"Odśwież\"></form>";
247 $test = 1;219 $test = false;
248 exit;220 exit;
249 }221 }
222 $test = true;
250 }223 }
251 if (!$test) 224 if ($test == true)
252 {225 {
253 print "<form method=\"post\" action=\"install.php?step=install2\">226 print "<form method=\"post\" action=\"install.php?step=install2\">
254 <input type=\"submit\" value=\"Dalej >>\"></form>";227 <input type=\"submit\" value=\"Dalej >>\"></form>";

Subscribers

People subscribed via source and target branches

to status/vote changes: