Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/backups/cpanel_p...
File: settings.php
<?php
[0] Fix | Delete
if ( empty(get_included_files()) ) die("Direct access forbidden");
[1] Fix | Delete
//sort custom items largest to smallest
[2] Fix | Delete
arsort($conf['sizes'][$conf_key]);
[3] Fix | Delete
if ($conf['bak_conf'][$conf_key]['hour'] == 0) {
[4] Fix | Delete
// midnight
[5] Fix | Delete
$hour = 12;
[6] Fix | Delete
$meridiem = 'AM';
[7] Fix | Delete
} else if ($conf['bak_conf'][$conf_key]['hour'] == 12) {
[8] Fix | Delete
// noon
[9] Fix | Delete
$hour = 12;
[10] Fix | Delete
$meridiem = 'PM';
[11] Fix | Delete
} else if ($conf['bak_conf'][$conf_key]['hour'] > 12) {
[12] Fix | Delete
// past noon
[13] Fix | Delete
$hour = $conf['bak_conf'][$conf_key]['hour'] - 12;
[14] Fix | Delete
$meridiem = 'PM';
[15] Fix | Delete
} else {
[16] Fix | Delete
// after midnight, before noon
[17] Fix | Delete
$hour = $conf['bak_conf'][$conf_key]['hour'];
[18] Fix | Delete
$meridiem = 'AM';
[19] Fix | Delete
}
[20] Fix | Delete
?>
[21] Fix | Delete
<div class="panel panel-default"> <!-- settings tab <?php echo($section); ?> section -->
[22] Fix | Delete
<div class="panel-heading">
[23] Fix | Delete
<div class="row">
[24] Fix | Delete
<div class="col-sm-3"> <!-- backup type col -->
[25] Fix | Delete
<h4 class="panel-title">
[26] Fix | Delete
<a
[27] Fix | Delete
data-toggle="collapse"
[28] Fix | Delete
data-parent="#settings_accordion"
[29] Fix | Delete
href="#settings_<?php echo($conf_key); ?>_collapse">
[30] Fix | Delete
<span class="arw">&#9658;</span> <?php echo($section); ?>
[31] Fix | Delete
</a>
[32] Fix | Delete
</h4>
[33] Fix | Delete
</div>
[34] Fix | Delete
<div class="col-sm-3 text-center"> <!-- schedule col -->
[35] Fix | Delete
<h4 class="panel-title" id="sched_descr_<?php echo($conf_key); ?>">?</h4>
[36] Fix | Delete
</div>
[37] Fix | Delete
<div class="col-sm-3 text-center"> <!-- data backed up col -->
[38] Fix | Delete
<h4 class="panel-title" id="mode_descr_<?php echo($conf_key); ?>">?</h4>
[39] Fix | Delete
</div>
[40] Fix | Delete
<div class="col-sm-3 text-right"> <!-- current usage in GB -->
[41] Fix | Delete
<span class="usage_gb_<?php echo($conf_key); ?>">?</span>GB
[42] Fix | Delete
</div>
[43] Fix | Delete
</div>
[44] Fix | Delete
</div>
[45] Fix | Delete
<div id="settings_<?php echo($conf_key); ?>_collapse" class="panel-collapse collapse">
[46] Fix | Delete
<?php if (array_key_exists($conf_key, $conf['completed']) && $conf['completed'][$conf_key]): ?>
[47] Fix | Delete
<p><strong>Backups Available</strong></p>
[48] Fix | Delete
<div class="well backups-available">
[49] Fix | Delete
<?php foreach($conf['completed'][$conf_key] as $snap): ?>
[50] Fix | Delete
<p>
[51] Fix | Delete
<span class="fix-locale-stamp"><?= $snap['time'] ?></span>
[52] Fix | Delete
<?php if ($conf_key == 'homedir'): ?>
[53] Fix | Delete
<a onclick="goto_restore(this);" data-geo="<?= $snap['geo'] ?>" data-baktype="<?= $conf_key ?>" data-snap="<?= $snap['snap'] ?>" href="#">Restore</a>
[54] Fix | Delete
<?php else: ?>
[55] Fix | Delete
<a onclick="goto_restore(this);" data-geo="<?= $snap['geo'] ?>" data-baktype="<?= $conf_key ?>" data-snap="<?= $snap['time'] ?>" href="#">Restore</a>
[56] Fix | Delete
<?php endif; ?>
[57] Fix | Delete
</p>
[58] Fix | Delete
<?php endforeach; ?>
[59] Fix | Delete
</div>
[60] Fix | Delete
<?php endif; ?>
[61] Fix | Delete
<p><strong>Enable or Disable Backups</strong></p>
[62] Fix | Delete
<span
[63] Fix | Delete
class="hidden oldval-enable"
[64] Fix | Delete
data-oldval="<?php echo($conf['bak_conf'][$conf_key]['enable'] ? 'y' : 'n'); ?>"
[65] Fix | Delete
data-enableid="<?php echo("{$conf_key}_enabled"); ?>"
[66] Fix | Delete
></span>
[67] Fix | Delete
<?php show_switch("{$conf_key}_enabled", $conf['bak_conf'][$conf_key]['enable']);
[68] Fix | Delete
if($conf['is_child']){
[69] Fix | Delete
help_popover(<<<EOF
[70] Fix | Delete
Once Disabled, your "Backups Available" that are 30 days old or older will eventually be deleted.
[71] Fix | Delete
If you'd like to keep your available backups, then before disabling, we recommend
[72] Fix | Delete
restoring them to an alternate folder and downloading those files.
[73] Fix | Delete
EOF
[74] Fix | Delete
);
[75] Fix | Delete
}
[76] Fix | Delete
else {
[77] Fix | Delete
help_popover(<<<EOF
[78] Fix | Delete
Once Disabled, your "Backups Available" that are 30 days old or older will eventually be deleted.
[79] Fix | Delete
If you'd like to keep your available backups, then before disabling, we recommend
[80] Fix | Delete
<a href="{$article_alt_folder}" target="_blank">restoring them to an alternate folder</a>
[81] Fix | Delete
and downloading those files.
[82] Fix | Delete
EOF
[83] Fix | Delete
);
[84] Fix | Delete
}
[85] Fix | Delete
?>
[86] Fix | Delete
<div id="settings_form_alert_<?php echo($conf_key); ?>" class="alert alert-warning">
[87] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>Any <?php echo($section); ?> backups older than 30 days will be deleted.</p>
[88] Fix | Delete
</div>
[89] Fix | Delete
<div id="settings_form_<?php echo($conf_key); ?>" class="settings-form">
[90] Fix | Delete
<p><strong>Schedule Backups</strong></p>
[91] Fix | Delete
<div class="well"> <!-- schedule backups section -->
[92] Fix | Delete
<p>How often do you want your backups queued? We maintain the
[93] Fix | Delete
<strong><?php echo($conf['retention']); ?> most recent</strong>
[94] Fix | Delete
backups, and the oldest copy gets replaced when each scheduled backup performs. Once queued,
[95] Fix | Delete
the backups will be performed as soon as server workload allows.
[96] Fix | Delete
<?php
[97] Fix | Delete
if (! $conf['is_child']) {
[98] Fix | Delete
$msg = "The number of retained backups is based on unused space";
[99] Fix | Delete
if (! $conf['is_shared']) {
[100] Fix | Delete
$msg = $msg . " on the server";
[101] Fix | Delete
}
[102] Fix | Delete
$msg = $msg . " and will be between 2 and 10.";
[103] Fix | Delete
help_popover($msg);
[104] Fix | Delete
}
[105] Fix | Delete
?>
[106] Fix | Delete
</p>
[107] Fix | Delete
<div class="radio"> <!-- by interval -->
[108] Fix | Delete
<label><input
[109] Fix | Delete
type="radio" class="sched_radio" value="interval" name="scheduling_<?php echo($conf_key); ?>"
[110] Fix | Delete
<?php if ($conf['bak_conf'][$conf_key]['use_interval']) { echo('data-oldval="y" checked="checked"');} ?>
[111] Fix | Delete
>By Interval</label>
[112] Fix | Delete
</div>
[113] Fix | Delete
<div class="form-group row indent-sched" id="sched_interval_form_<?php echo($conf_key); ?>">
[114] Fix | Delete
Backup every
[115] Fix | Delete
<input id="sched_interval_<?php echo($conf_key); ?>" type="number" min="1" max="30" value="<?php echo($conf['bak_conf'][$conf_key]['interval']); ?>"
[116] Fix | Delete
class="form-control input-sm frm-sm sched_interval_input" data-error-id="#interval-error-<?php echo($conf_key); ?>" />
[117] Fix | Delete
Days
[118] Fix | Delete
<div class="alert alert-danger interval-error" id="interval-error-<?php echo($conf_key); ?>">
[119] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i> <p>The Backup Interval needs to be 1 Day or longer.</p>
[120] Fix | Delete
</div>
[121] Fix | Delete
</div>
[122] Fix | Delete
<div class="radio"> <!-- by day/time -->
[123] Fix | Delete
<label><input
[124] Fix | Delete
type="radio" class="sched_radio" value="daily" name="scheduling_<?php echo($conf_key); ?>"
[125] Fix | Delete
<?php if (! $conf['bak_conf'][$conf_key]['use_interval']) { echo('data-oldval="y" checked="checked"');} ?>
[126] Fix | Delete
>By Day/Time</label>
[127] Fix | Delete
</div>
[128] Fix | Delete
<div id="sched_daytime_form_<?php echo($conf_key); ?>">
[129] Fix | Delete
<div class="row indent-sched" id="scheduling_days_<?php echo($conf_key); ?>">
[130] Fix | Delete
<?php $days = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
[131] Fix | Delete
$day_short = array('M', 'Tu', 'W', 'Th', 'F', 'Sa', 'Su');
[132] Fix | Delete
foreach(array_values($days) as $index => $day): ?>
[133] Fix | Delete
<label class="checkbox-inline">
[134] Fix | Delete
<input type="checkbox" <?php
[135] Fix | Delete
if (in_array($index, $conf['bak_conf'][$conf_key]['days'])) {
[136] Fix | Delete
echo ('checked="checked" data-oldval="y"');
[137] Fix | Delete
} else {
[138] Fix | Delete
echo ('data-oldval="n"');
[139] Fix | Delete
}
[140] Fix | Delete
?> value="<?php echo($index); ?>"
[141] Fix | Delete
data-short="<?php echo($day_short[$index]); ?>" class="sched_days_checkbox"
[142] Fix | Delete
><?php echo($day); ?></input>
[143] Fix | Delete
</label>
[144] Fix | Delete
<?php endforeach; ?>
[145] Fix | Delete
</div>
[146] Fix | Delete
<div class="row indent-sched sched-time">
[147] Fix | Delete
After
[148] Fix | Delete
<input
[149] Fix | Delete
id="scheduling_hour_<?php echo($conf_key); ?>"
[150] Fix | Delete
type="number" value="<?php echo($hour); ?>"
[151] Fix | Delete
min="1" max="12" data-oldval="<?php echo($hour); ?>"
[152] Fix | Delete
class="form-control input-sm frm-sm sched_hour"
[153] Fix | Delete
/>
[154] Fix | Delete
<select class="form-control input-sm frm-sm sched_meridiem" id="scheduling_meridiem_<?php echo($conf_key); ?>">
[155] Fix | Delete
<option<?php if ($meridiem == 'AM'){ echo(' data-oldval="y" selected="selected"'); } ?>>AM</option>
[156] Fix | Delete
<option<?php if ($meridiem == 'PM'){ echo(' data-oldval="y" selected="selected"'); } ?>>PM</option>
[157] Fix | Delete
</select>
[158] Fix | Delete
</div>
[159] Fix | Delete
</div>
[160] Fix | Delete
</div>
[161] Fix | Delete
<p><strong>Data Included in Backup</strong></p>
[162] Fix | Delete
<div class="well"> <!-- custom backups section -->
[163] Fix | Delete
<p>What data do you want included in your backups?</p>
[164] Fix | Delete
<div class="radio">
[165] Fix | Delete
<label><input
[166] Fix | Delete
type="radio" class="custom_radio" value="all" name="mode_<?php echo($conf_key); ?>"
[167] Fix | Delete
<?php if (is_null($conf['bak_conf'][$conf_key]['mode'])){ echo('data-oldval="y" checked="checked"'); } ?>>
[168] Fix | Delete
<?php if ($conf_key == 'homedir'): ?>
[169] Fix | Delete
All home directory folders
[170] Fix | Delete
<?php elseif (array_keys(['pgsql', 'mysql'], $conf_key)): ?>
[171] Fix | Delete
<?php echo("All {$section} databases"); ?>
[172] Fix | Delete
<?php else : ?>
[173] Fix | Delete
All Data
[174] Fix | Delete
<?php endif; ?>
[175] Fix | Delete
</label>
[176] Fix | Delete
</div>
[177] Fix | Delete
<?php if ($conf_key == 'homedir'): ?>
[178] Fix | Delete
<div class="radio">
[179] Fix | Delete
<label><input
[180] Fix | Delete
type="radio" class="custom_radio" value="whitelist" name="mode_<?php echo($conf_key); ?>"
[181] Fix | Delete
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'whitelist'){ echo('data-oldval="y" checked="checked"'); } ?>>
[182] Fix | Delete
Backup selected folders - When you create new folders they <strong><em>will not be</em></strong>
[183] Fix | Delete
backed up until also selected.</label>
[184] Fix | Delete
<?php help_popover("If you're not active in the root directory, choose backup selected folders."); ?>
[185] Fix | Delete
<div id="custom_hide_whitelist_homedir">
[186] Fix | Delete
<?php
[187] Fix | Delete
if ($conf['bak_conf'][$conf_key]['mode'] == 'whitelist') {
[188] Fix | Delete
$browser_selected = $conf['bak_conf'][$conf_key]['custom'];
[189] Fix | Delete
} else {
[190] Fix | Delete
$browser_selected = [];
[191] Fix | Delete
}
[192] Fix | Delete
?>
[193] Fix | Delete
<?php browser_widget('homedir-include-browser', $conf['home_path'], 'recalculate_usage', 'listdir', false, $browser_selected); ?>
[194] Fix | Delete
<?php selected_total_widget('homedir', $amp_url, $conf['is_child']) ?>
[195] Fix | Delete
</div>
[196] Fix | Delete
</div>
[197] Fix | Delete
<?php else: ?>
[198] Fix | Delete
<div class="radio">
[199] Fix | Delete
<label><input
[200] Fix | Delete
type="radio" class="custom_radio" value="whitelist" name="mode_<?php echo($conf_key); ?>"
[201] Fix | Delete
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'whitelist'){ echo('data-oldval="y" checked="checked"'); } ?>>
[202] Fix | Delete
Backup selected databases - When you create new databases they <strong><em>will not be</em></strong> backed up until also selected.</label>
[203] Fix | Delete
</div>
[204] Fix | Delete
<div id="custom_hide_whitelist_<?php echo($conf_key); ?>">
[205] Fix | Delete
<?php db_custom_select_widget('whitelist', $conf_key, $conf['sizes'][$conf_key], $conf['bak_conf'][$conf_key], $amp_url); ?>
[206] Fix | Delete
<?php selected_total_widget($conf_key, $amp_url, $conf['is_child']) ?>
[207] Fix | Delete
</div>
[208] Fix | Delete
<?php endif; ?>
[209] Fix | Delete
<?php if ($conf_key == 'homedir'): ?>
[210] Fix | Delete
<div class="radio">
[211] Fix | Delete
<label><input type="radio" class="custom_radio" value="blacklist" name="mode_homedir"
[212] Fix | Delete
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'blacklist'){ echo('data-oldval="y" checked="checked"'); } ?>>
[213] Fix | Delete
Exclude selected folders - When you create new folders they <strong><em>will be</em></strong>
[214] Fix | Delete
backed up.</label>
[215] Fix | Delete
<?php help_popover('If you are active in the root directory, we recommend excluding the selected folders.'); ?>
[216] Fix | Delete
<div id="custom_hide_blacklist_homedir">
[217] Fix | Delete
<?php
[218] Fix | Delete
if ($conf['bak_conf'][$conf_key]['mode'] == 'blacklist') {
[219] Fix | Delete
$browser_selected = $conf['bak_conf'][$conf_key]['custom'];
[220] Fix | Delete
} else {
[221] Fix | Delete
$browser_selected = [];
[222] Fix | Delete
}
[223] Fix | Delete
?>
[224] Fix | Delete
<?php browser_widget('homedir-exclude-browser', $conf['home_path'], 'recalculate_usage', 'listdir', false, $browser_selected); ?>
[225] Fix | Delete
<?php selected_total_widget('homedir', $amp_url, $conf['is_child']) ?>
[226] Fix | Delete
</div>
[227] Fix | Delete
</div>
[228] Fix | Delete
<?php else: ?>
[229] Fix | Delete
<div class="radio">
[230] Fix | Delete
<label><input
[231] Fix | Delete
type="radio" class="custom_radio" value="blacklist" name="mode_<?php echo($conf_key); ?>"
[232] Fix | Delete
<?php if ($conf['bak_conf'][$conf_key]['mode'] == 'blacklist'){ echo('data-oldval="y" checked="checked"'); } ?>>
[233] Fix | Delete
Exclude selected databases - When you create new databases they <strong><em>will be</em></strong> backed up.</label>
[234] Fix | Delete
</div>
[235] Fix | Delete
<div id="custom_hide_blacklist_<?php echo($conf_key); ?>">
[236] Fix | Delete
<?php db_custom_select_widget('blacklist', $conf_key, $conf['sizes'][$conf_key], $conf['bak_conf'][$conf_key], $amp_url); ?>
[237] Fix | Delete
<?php selected_total_widget($conf_key, $amp_url, $conf['is_child']) ?>
[238] Fix | Delete
</div>
[239] Fix | Delete
<?php endif; ?>
[240] Fix | Delete
</div>
[241] Fix | Delete
<div class="row settings-btn-row">
[242] Fix | Delete
<button id="<?php echo($conf_key); ?>-apply-btn" onclick="apply_settings('<?php echo($conf_key); ?>', this);" class="col-sm-2 btn btn-primary">Apply Changes</button>
[243] Fix | Delete
<div class="col-sm-1">
[244] Fix | Delete
<span class="cancel-link"><a onclick="cancel_settings(this);" href="#">Cancel</a></span>
[245] Fix | Delete
</div>
[246] Fix | Delete
<div class="col-sm-9">
[247] Fix | Delete
<?php error_box("{$conf_key}-apply-msg", "alert error-msg apply-msg"); ?>
[248] Fix | Delete
</div>
[249] Fix | Delete
</div>
[250] Fix | Delete
</div>
[251] Fix | Delete
</div>
[252] Fix | Delete
</div>
[253] Fix | Delete
[254] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function