mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 15:45:34 +02:00
- Make it impossible to open/delete/download files that don't exist :P
git-svn-id: file:///svn/phpbb/trunk@5891 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
830f1fdab7
commit
6d3a8bd107
@ -14,11 +14,13 @@
|
|||||||
<dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_LAST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd>
|
<dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_LAST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<!-- IF EXISTS -->
|
||||||
<fieldset class="submit-buttons">
|
<fieldset class="submit-buttons">
|
||||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_START_RESTORE}" />
|
<input class="button1" type="submit" id="submit" name="submit" value="{L_START_RESTORE}" />
|
||||||
<input class="button2" type="submit" id="delete" name="delete" value="{L_DELETE_BACKUP}" />
|
<input class="button2" type="submit" id="delete" name="delete" value="{L_DELETE_BACKUP}" />
|
||||||
<input class="button2" type="submit" id="download" name="download" value="{L_DOWNLOAD_BACKUP}" />
|
<input class="button2" type="submit" id="download" name="download" value="{L_DOWNLOAD_BACKUP}" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<!-- ENDIF -->
|
||||||
</form>
|
</form>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<h1>{L_ACP_BACKUP}</h1>
|
<h1>{L_ACP_BACKUP}</h1>
|
||||||
|
@ -1023,11 +1023,7 @@ class acp_database
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$methods[] = $type;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($methods as $type)
|
|
||||||
{
|
|
||||||
$template->assign_block_vars('methods', array(
|
$template->assign_block_vars('methods', array(
|
||||||
'TYPE' => $type
|
'TYPE' => $type
|
||||||
));
|
));
|
||||||
@ -1041,16 +1037,19 @@ class acp_database
|
|||||||
{
|
{
|
||||||
case 'submit':
|
case 'submit':
|
||||||
$delete = request_var('delete', '');
|
$delete = request_var('delete', '');
|
||||||
|
$file = request_var('file', '');
|
||||||
|
|
||||||
|
if (!(file_exists($file) && is_readable($file)))
|
||||||
|
{
|
||||||
|
trigger_error($lang['BACKUP_INVALID']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($delete)
|
if ($delete)
|
||||||
{
|
{
|
||||||
$file = request_var('file', '');
|
|
||||||
unlink($phpbb_root_path . 'store/' . $file);
|
unlink($phpbb_root_path . 'store/' . $file);
|
||||||
trigger_error($user->lang['BACKUP_SUCCESS']);
|
trigger_error($user->lang['BACKUP_SUCCESS']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$file = request_var('file', '');
|
|
||||||
|
|
||||||
preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches);
|
preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches);
|
||||||
|
|
||||||
$data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]);
|
$data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]);
|
||||||
@ -1113,7 +1112,7 @@ class acp_database
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$selected = $stop = false;
|
$selected = false;
|
||||||
$methods = array('sql');
|
$methods = array('sql');
|
||||||
$available_methods = array('sql.gz' => 'zlib', 'sql.bz2' => 'bz2');
|
$available_methods = array('sql.gz' => 'zlib', 'sql.bz2' => 'bz2');
|
||||||
|
|
||||||
@ -1141,11 +1140,17 @@ class acp_database
|
|||||||
'NAME' => gmdate("d-m-Y H:i:s", $matches[1]),
|
'NAME' => gmdate("d-m-Y H:i:s", $matches[1]),
|
||||||
'SUPPORTED' => $supported
|
'SUPPORTED' => $supported
|
||||||
));
|
));
|
||||||
|
$selected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
|
|
||||||
|
if ($selected === true)
|
||||||
|
{
|
||||||
|
$template->assign_var('EXISTS', true);
|
||||||
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $this->u_action . '&action=submit'
|
'U_ACTION' => $this->u_action . '&action=submit'
|
||||||
));
|
));
|
||||||
|
@ -34,6 +34,7 @@ $lang = array_merge($lang, array(
|
|||||||
'ACP_BACKUP_EXPLAIN' => 'Here you can backup all your phpBB related data. You may store the resulting archive in your store/ folder or download it directly. Depending on your server configuration you be able to compress the file in a number of formats. If you wish to include any additional "custom" tables please list them in the additional tables field, separated by commas. ',
|
'ACP_BACKUP_EXPLAIN' => 'Here you can backup all your phpBB related data. You may store the resulting archive in your store/ folder or download it directly. Depending on your server configuration you be able to compress the file in a number of formats. If you wish to include any additional "custom" tables please list them in the additional tables field, separated by commas. ',
|
||||||
'BACKUP_OPTIONS' => 'Backup options',
|
'BACKUP_OPTIONS' => 'Backup options',
|
||||||
'BACKUP_TYPE' => 'Backup type',
|
'BACKUP_TYPE' => 'Backup type',
|
||||||
|
'BACKUP_INVALID' => 'The selected file to backup is invalid',
|
||||||
'START_BACKUP' => 'Start Backup',
|
'START_BACKUP' => 'Start Backup',
|
||||||
'FULL_BACKUP' => 'Full',
|
'FULL_BACKUP' => 'Full',
|
||||||
'STRUCTURE_ONLY' => 'Structure Only',
|
'STRUCTURE_ONLY' => 'Structure Only',
|
||||||
@ -43,7 +44,7 @@ $lang = array_merge($lang, array(
|
|||||||
'STORE_LOCAL' => 'Store file locally',
|
'STORE_LOCAL' => 'Store file locally',
|
||||||
'SELECT_ALL' => 'Select all',
|
'SELECT_ALL' => 'Select all',
|
||||||
'DESELECT_ALL' => 'Deselect all',
|
'DESELECT_ALL' => 'Deselect all',
|
||||||
'BACKUP_SUCCESS' => 'The backup file has been created successfully in the location you specified',
|
'BACKUP_SUCCESS' => 'The backup file has been created successfully',
|
||||||
|
|
||||||
'STORE_AND_DOWNLOAD' => 'Store and Download',
|
'STORE_AND_DOWNLOAD' => 'Store and Download',
|
||||||
'ACP_RESTORE' => 'Restore',
|
'ACP_RESTORE' => 'Restore',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user