Revision 1543
Added by Luisehahne almost 14 years ago
| index.php | ||
|---|---|---|
| 194 | 194 |
$configFile = '/config.php'; |
| 195 | 195 |
if(!isset($_SESSION['config_rename']) ) |
| 196 | 196 |
{
|
| 197 |
|
|
| 197 |
// cnfig.php or config.php.new |
|
| 198 | 198 |
if( (file_exists($wb_path.$configFile)==true)) |
| 199 | 199 |
{
|
| 200 |
|
|
| 201 |
if ( filesize($wb_path.$configFile) > 128)
|
|
| 200 |
// next operation only if file is writeable |
|
| 201 |
if(is_writeable($wb_path.$configFile))
|
|
| 202 | 202 |
{
|
| 203 |
$installFlag = false; |
|
| 204 |
$config = '<font class="bad">Not empty!!?</font>'; |
|
| 205 |
} elseif(!$handle = fopen($wb_path.$configFile, 'w') ) |
|
| 206 |
{
|
|
| 207 |
$installFlag = false; |
|
| 208 |
$config = '<font class="bad">Not Writeable</font>'; |
|
| 209 |
} else {
|
|
| 210 |
if (fwrite($handle, $config_content) === FALSE) {
|
|
| 203 |
// already installed? it's not empty |
|
| 204 |
if ( filesize($wb_path.$configFile) > 128) |
|
| 205 |
{
|
|
| 211 | 206 |
$installFlag = false; |
| 207 |
$config = '<font class="bad">Not empty!!?</font>'; |
|
| 208 |
// try to open and to write |
|
| 209 |
} elseif( !$handle = fopen($wb_path.$configFile, 'w') ) |
|
| 210 |
{
|
|
| 211 |
$installFlag = false; |
|
| 212 | 212 |
$config = '<font class="bad">Not Writeable</font>'; |
| 213 | 213 |
} else {
|
| 214 |
$config = '<font class="good">Writeable</font>'; |
|
| 215 |
$_SESSION['config_rename'] = true; |
|
| 216 |
} |
|
| 217 |
// Close file |
|
| 218 |
fclose($handle); |
|
| 219 |
} |
|
| 220 |
|
|
| 214 |
if (fwrite($handle, $config_content) === FALSE) {
|
|
| 215 |
$installFlag = false; |
|
| 216 |
$config = '<font class="bad">Not Writeable</font>'; |
|
| 217 |
} else {
|
|
| 218 |
$config = '<font class="good">Writeable</font>'; |
|
| 219 |
$_SESSION['config_rename'] = true; |
|
| 220 |
} |
|
| 221 |
// Close file |
|
| 222 |
fclose($handle); |
|
| 223 |
} |
|
| 224 |
} else {
|
|
| 225 |
$installFlag = false; |
|
| 226 |
$config = '<font class="bad">Not Writeable</font>'; |
|
| 227 |
} |
|
| 228 |
// it's config.php.new |
|
| 221 | 229 |
} elseif((file_exists($wb_path.'/config.php.new')==true)) |
| 222 | 230 |
{
|
| 223 | 231 |
$configFile = '/config.php.new'; |
Also available in: Unified diff
fix droplet sectionPicker
fix install config.php not writeable
check table droplet if empty import examples