Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/backups/cpanel_p...
File: restore.php
<?php
[0] Fix | Delete
if ( empty(get_included_files()) ) die("Direct access forbidden");
[1] Fix | Delete
$is_db_section = ($conf_key != 'homedir' ? true : false);
[2] Fix | Delete
?>
[3] Fix | Delete
<div class="panel panel-default"> <!-- restore tab <?= $section ?> section -->
[4] Fix | Delete
<div class="panel-heading">
[5] Fix | Delete
<div class="row">
[6] Fix | Delete
<div class="col-sm-3"> <!-- backup type col -->
[7] Fix | Delete
<h4 class="panel-title">
[8] Fix | Delete
<a
[9] Fix | Delete
data-toggle="collapse"
[10] Fix | Delete
data-parent="#restore_accordion"
[11] Fix | Delete
href="#restore_<?= $conf_key ?>_collapse">
[12] Fix | Delete
<span class="arw">&#9658;</span> <?= $section ?>
[13] Fix | Delete
</a>
[14] Fix | Delete
</h4>
[15] Fix | Delete
</div>
[16] Fix | Delete
</div>
[17] Fix | Delete
</div>
[18] Fix | Delete
<div id="restore_<?= $conf_key ?>_collapse" class="panel-collapse collapse">
[19] Fix | Delete
<div class="panel-body">
[20] Fix | Delete
<p><strong>Restore Options</strong></p>
[21] Fix | Delete
<div class="well">
[22] Fix | Delete
<?php if (array_key_exists($conf_key, $conf['completed']) && $conf['completed'][$conf_key]): ?>
[23] Fix | Delete
<div class="form-group row">
[24] Fix | Delete
<?php if ($conf['show_geo']): ?>
[25] Fix | Delete
<label class="col-sm-2 col-form-label text-right pad-top-6" for="restore_date_<?= $conf_key ?>">From Cluster &amp; Date</label>
[26] Fix | Delete
<?php else: ?>
[27] Fix | Delete
<label class="col-sm-2 col-form-label text-right pad-top-6" for="restore_date_<?= $conf_key ?>">Restore From Date</label>
[28] Fix | Delete
<?php endif; ?>
[29] Fix | Delete
<div class="col-sm-3">
[30] Fix | Delete
<?php if ($is_db_section): ?>
[31] Fix | Delete
<select id="restore_date_<?= $conf_key ?>" class="restore-date-select form-control restore_db_date" data-baktype="<?= $conf_key ?>">
[32] Fix | Delete
<?php else: ?>
[33] Fix | Delete
<select id="restore_date_<?= $conf_key ?>" class="restore-date-select form-control" data-baktype="<?= $conf_key ?>">
[34] Fix | Delete
<?php endif; ?>
[35] Fix | Delete
<?php if ($is_db_section): // for databases, populate the date dropdown with data-dbnames in <options> ?>
[36] Fix | Delete
<?php foreach($conf['completed'][$conf_key] as $snap): ?>
[37] Fix | Delete
<option class="fix-opt-locale-stamp" data-geo="<?= $snap['geo'] ?>" data-snap="<?= $snap['snap'] ?>" value="<?= $snap['geo'] ?>:<?= $snap['time'] ?>" data-dbsnaps="<?php echo_json_attrib($snap['dbs']); ?>">
[38] Fix | Delete
<?= date_select_label($conf, $snap['geo'], $snap['time']) ?>
[39] Fix | Delete
</option>
[40] Fix | Delete
<?php endforeach; ?>
[41] Fix | Delete
<?php else: // for homedirs, just add the date in <options> ?>
[42] Fix | Delete
<?php foreach($conf['completed'][$conf_key] as $snap): ?>
[43] Fix | Delete
<option class="fix-opt-locale-stamp" data-geo="<?= $snap['geo'] ?>" data-snap="<?= $snap['snap'] ?>" data-stamp="<?= $snap['time'] ?>" value="<?= $snap['geo'] ?>:<?= $snap['snap'] ?>">
[44] Fix | Delete
<?= date_select_label($conf, $snap['geo'], $snap['time']) ?>
[45] Fix | Delete
</option>
[46] Fix | Delete
<?php endforeach; ?>
[47] Fix | Delete
<?php endif; ?>
[48] Fix | Delete
</select>
[49] Fix | Delete
</div>
[50] Fix | Delete
<?php if ($conf['show_geo']): ?>
[51] Fix | Delete
<div class="col-sm-7 text-right">
[52] Fix | Delete
Selected cluster is in <span id="geo-dest-<?= $conf_key ?>"></span>
[53] Fix | Delete
</div>
[54] Fix | Delete
<?php endif; ?>
[55] Fix | Delete
</div>
[56] Fix | Delete
<?php if ($is_db_section): // for databases, they also get a select for the database to restore ?>
[57] Fix | Delete
<div class="form-group row"> <!-- select database -->
[58] Fix | Delete
<label class="col-sm-2 col-form-label text-right pad-top-6" for="restore_dbname_<?= $conf_key ?>">Database</label>
[59] Fix | Delete
<div class="col-sm-3">
[60] Fix | Delete
<select
[61] Fix | Delete
class="form-control restore_dbname_select" data-no-db="#no_db_<?= $conf_key ?>"
[62] Fix | Delete
id="restore_dbname_<?= $conf_key ?>"
[63] Fix | Delete
>
[64] Fix | Delete
<option value="">select</option>
[65] Fix | Delete
</select>
[66] Fix | Delete
</div>
[67] Fix | Delete
<div class="col-sm-3 alert alert-danger no-db-alert" id="no_db_<?= $conf_key ?>">
[68] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>No database selected.</p>
[69] Fix | Delete
</div>
[70] Fix | Delete
</div>
[71] Fix | Delete
<?php else: // homedirs get a jquery widget instead ?>
[72] Fix | Delete
<?php browser_widget('homedir_filebrowser', $conf['home_path'], 'enable_home_restore', 'browse', true, []); ?>
[73] Fix | Delete
<?php endif; ?>
[74] Fix | Delete
<?php if ($is_db_section): // for databases, show a dump path field ?>
[75] Fix | Delete
<div class="form-group row"> <!-- enter dump path -->
[76] Fix | Delete
<label class="col-sm-2 col-form-label text-right pad-top-6" for="dump_path_<?= $conf_key ?>">Dump Path</label>
[77] Fix | Delete
<div class="col-sm-6">
[78] Fix | Delete
<div class="input-group">
[79] Fix | Delete
<span class="input-group-addon"><?= $conf['home_path'] ?>/</span>
[80] Fix | Delete
<input
[81] Fix | Delete
type="text" value="restored" class="form-control path-check"
[82] Fix | Delete
id="dump_path_<?= $conf_key ?>" data-check-error="#path_error_<?= $conf_key ?>"
[83] Fix | Delete
/>
[84] Fix | Delete
</div>
[85] Fix | Delete
</div>
[86] Fix | Delete
<div class="col-sm-4 alert alert-danger path-error" id="path_error_<?= $conf_key ?>">
[87] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>This folder cannot be accessed.</p>
[88] Fix | Delete
</div>
[89] Fix | Delete
</div>
[90] Fix | Delete
<?php endif; ?>
[91] Fix | Delete
<div class="form-group row"> <!-- select how to restore -->
[92] Fix | Delete
<div class="col-sm-2 text-right">
[93] Fix | Delete
<label class="col-form-label pad-top-6">Restore Method</label>
[94] Fix | Delete
</div>
[95] Fix | Delete
<div class="col-sm-10">
[96] Fix | Delete
<?php if ($is_db_section): // for databases, they have 3 options on how to restore ?>
[97] Fix | Delete
<div class="radio">
[98] Fix | Delete
<label><input
[99] Fix | Delete
type="radio" checked="checked" value="target" name="restore_method_<?= $conf_key ?>"
[100] Fix | Delete
>Dump backup to path above</label>
[101] Fix | Delete
</div>
[102] Fix | Delete
<div class="radio">
[103] Fix | Delete
<label>
[104] Fix | Delete
<input type="radio" value="dump_import" name="restore_method_<?= $conf_key ?>">
[105] Fix | Delete
Dump current database to path above and overwrite current database with the backup
[106] Fix | Delete
</label>
[107] Fix | Delete
</div>
[108] Fix | Delete
<div class="radio">
[109] Fix | Delete
<label>
[110] Fix | Delete
<input
[111] Fix | Delete
type="radio" value="import" name="restore_method_<?= $conf_key ?>">
[112] Fix | Delete
Overwrite current database without dumping first <em>(not recommended)</em>
[113] Fix | Delete
</label>
[114] Fix | Delete
</div>
[115] Fix | Delete
<?php else: // for homedirs, they have 2 options on how to restore, and a path that hides when unchecked ?>
[116] Fix | Delete
<div class="row">
[117] Fix | Delete
<div class="col-sm-12">
[118] Fix | Delete
<div class="radio">
[119] Fix | Delete
<label>
[120] Fix | Delete
<input type="radio" value="merge" checked="checked" name="restore_method_<?= $conf_key ?>">
[121] Fix | Delete
Restore to the original path: this replaces the files that are different and keeps files not found in the backup
[122] Fix | Delete
</label>
[123] Fix | Delete
</div>
[124] Fix | Delete
</div>
[125] Fix | Delete
</div>
[126] Fix | Delete
<div class="row">
[127] Fix | Delete
<div class="col-sm-3">
[128] Fix | Delete
<div class="radio">
[129] Fix | Delete
<label><input
[130] Fix | Delete
type="radio" value="target" name="restore_method_<?= $conf_key ?>"
[131] Fix | Delete
>Restore to a different folder</label>
[132] Fix | Delete
</div>
[133] Fix | Delete
</div>
[134] Fix | Delete
<div class="col-sm-6">
[135] Fix | Delete
<div class="input-group" id="homedir_restore_path">
[136] Fix | Delete
<span class="input-group-addon"><?= $conf['home_path'] ?>/</span>
[137] Fix | Delete
<input type="text" value="restored" class="form-control path-check"
[138] Fix | Delete
id="dump_path_<?= $conf_key ?>" data-check-error="#path_error_<?= $conf_key ?>" />
[139] Fix | Delete
</div>
[140] Fix | Delete
</div>
[141] Fix | Delete
<div class="col-sm-3 alert alert-danger path-error" id="path_error_<?= $conf_key ?>">
[142] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>This folder cannot be accessed.</p>
[143] Fix | Delete
</div>
[144] Fix | Delete
</div>
[145] Fix | Delete
<?php endif; ?>
[146] Fix | Delete
</div> <!-- end col-sm-10 -->
[147] Fix | Delete
</div> <!-- end row -->
[148] Fix | Delete
<div class="row">
[149] Fix | Delete
<div class="col-sm-2 text-right">
[150] Fix | Delete
<label>Email to notify on completion (optional)</label>
[151] Fix | Delete
</div>
[152] Fix | Delete
<div class="col-sm-6">
[153] Fix | Delete
<input id="<?= $conf_key ?>-restore-email" class="form-control validate-email" type="email" data-err="#<?= $conf_key ?>-invalid-email" />
[154] Fix | Delete
</div>
[155] Fix | Delete
<div class="col-sm-4 alert alert-danger error-msg" id="<?= $conf_key ?>-invalid-email">
[156] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>Invalid email address</p>
[157] Fix | Delete
</div>
[158] Fix | Delete
</div>
[159] Fix | Delete
<div class="row">
[160] Fix | Delete
<div class="col-sm-2"></div>
[161] Fix | Delete
<div class="col-sm-10 restore_alert" id="restore_alert_<?= $conf_key ?>"> <!-- alert div -->
[162] Fix | Delete
<div class="col-sm-12">
[163] Fix | Delete
<p>Clicking Restore will queue the restoration immediately, and restoring a backup is irreversible.</p>
[164] Fix | Delete
<p>If restoring a website which relies on a database such as a WordPress website, you may need to restore both website files and SQL data.</p>
[165] Fix | Delete
<p class="restore_alert_msg hidden" id="restore_alert_msg_<?= $conf_key ?>">Are you sure you want to proceed with the restore?</p>
[166] Fix | Delete
</div>
[167] Fix | Delete
<div class="col-sm-12 row restore-alert-btns">
[168] Fix | Delete
<div class="col-sm-2 btn-restore-col">
[169] Fix | Delete
<button id="restore-btn-<?= $conf_key ?>" onclick="do_restore('<?= $conf_key ?>', this);" class="btn btn-primary btn-block btn-restore">Restore</button>
[170] Fix | Delete
</div>
[171] Fix | Delete
<div class="col-sm-2">
[172] Fix | Delete
<span class="cancel-link"><a onclick="cancel_restore_form(this);" href="#">Cancel</a></span>
[173] Fix | Delete
</div>
[174] Fix | Delete
<div class="col-sm-6">
[175] Fix | Delete
<?php error_box("{$conf_key}-restore-msg"); ?>
[176] Fix | Delete
</div>
[177] Fix | Delete
</div>
[178] Fix | Delete
</div>
[179] Fix | Delete
</div>
[180] Fix | Delete
<?php else: ?>
[181] Fix | Delete
<p>No backups available to restore</p>
[182] Fix | Delete
<?php endif; ?>
[183] Fix | Delete
</div> <!-- end well -->
[184] Fix | Delete
</div> <!-- end panel-body -->
[185] Fix | Delete
</div> <!-- end collapse -->
[186] Fix | Delete
</div> <!-- end panel -->
[187] Fix | Delete
[188] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function