Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/backups/cpanel_p...
File: funcs.php
<?php
[0] Fix | Delete
if ( empty(get_included_files()) ) die("Direct access forbidden");
[1] Fix | Delete
[2] Fix | Delete
/* echo JSON data in a way jquery will understand when found in an HTML5 data-* attribute */
[3] Fix | Delete
function echo_json_attrib($data){
[4] Fix | Delete
echo(str_replace('"', '&quot;', json_encode($data)));
[5] Fix | Delete
}
[6] Fix | Delete
[7] Fix | Delete
function label_size($item, $size_mb){
[8] Fix | Delete
echo($item);
[9] Fix | Delete
if (is_numeric($size_mb)) {
[10] Fix | Delete
echo(' (');
[11] Fix | Delete
echo(round($size_mb / 1024, 2));
[12] Fix | Delete
echo('GB)');
[13] Fix | Delete
}
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
function show_switch($id, $enabled, $enabled_text = "Enabled", $disabled_text = "Disabled") {
[17] Fix | Delete
$text = ($enabled ? $enabled_text : $disabled_text);
[18] Fix | Delete
$state = ($enabled ? 'on' : 'off');
[19] Fix | Delete
echo <<<EOF
[20] Fix | Delete
<span>
[21] Fix | Delete
<div id="triggerswitch-{$id}"
[22] Fix | Delete
class="switchdiv_{$id} cjt2-toggle-switch switch-{$state}"
[23] Fix | Delete
onclick="toggle_switch_state('{$id}');"
[24] Fix | Delete
data-switch-id="{$id}">
[25] Fix | Delete
<span id="switchlabel_{$id}" data-enabled-text="{$enabled_text}" data-disabled-text="{$disabled_text}" class="toggle-switch-label toggle-switch-label-left">{$text}</span>
[26] Fix | Delete
<div class="toggle-switch">
[27] Fix | Delete
<div id="{$id}" class="switchdiv_{$id} toggle-switch-animate switch-{$state}">
[28] Fix | Delete
<span class="switch-left"></span>
[29] Fix | Delete
<span class="knob"></span>
[30] Fix | Delete
<span class="switch-right"></span>
[31] Fix | Delete
</div>
[32] Fix | Delete
</div>
[33] Fix | Delete
</div>
[34] Fix | Delete
</span>
[35] Fix | Delete
EOF;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
function help_popover($content){
[39] Fix | Delete
$content_fixed = str_replace('"', '&quot;' , $content);
[40] Fix | Delete
echo <<<EOF
[41] Fix | Delete
[42] Fix | Delete
<a tabindex="0"
[43] Fix | Delete
class="help"
[44] Fix | Delete
role="button"
[45] Fix | Delete
data-toggle="popover"
[46] Fix | Delete
data-trigger="focus"
[47] Fix | Delete
data-html="true"
[48] Fix | Delete
data-content="{$content_fixed}">
[49] Fix | Delete
<i class="fa fa-info-circle"></i>
[50] Fix | Delete
</a>
[51] Fix | Delete
EOF;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
/* echo a child account's limit or the default if none is set */
[55] Fix | Delete
function child_limit($conf, $child){
[56] Fix | Delete
if (is_null($conf['children']['limits'][$child])){
[57] Fix | Delete
echo(round($conf['children']['default_limit'] / 1024, 2));
[58] Fix | Delete
} else {
[59] Fix | Delete
echo(round($conf['children']['limits'][$child] / 1024, 2));
[60] Fix | Delete
}
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
/* show a hidden div that can be later shown to display an error */
[64] Fix | Delete
function error_box($id, $class = "alert error-msg"){
[65] Fix | Delete
echo <<<EOF
[66] Fix | Delete
<div id="{$id}" class="{$class}"><i class="glyphicon glyphicon-exclamation-sign"></i><span></span></div>
[67] Fix | Delete
EOF;
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
function browser_widget($browser_id, $home_path, $has_items_func, $post_action, $is_restore, $selections){
[71] Fix | Delete
if ($is_restore) {
[72] Fix | Delete
echo <<<EOF
[73] Fix | Delete
<div class="form-group row">
[74] Fix | Delete
<label class="col-sm-2 col-form-label text-right pad-top-6">Select Files</label>
[75] Fix | Delete
<div class="col-sm-10">
[76] Fix | Delete
EOF;
[77] Fix | Delete
} else {
[78] Fix | Delete
echo <<<EOF
[79] Fix | Delete
<div class="form-group row">
[80] Fix | Delete
<div class="col-sm-12">
[81] Fix | Delete
EOF;
[82] Fix | Delete
}
[83] Fix | Delete
$selections_encoded = htmlspecialchars(json_encode($selections));
[84] Fix | Delete
echo <<<EOF
[85] Fix | Delete
<div class="filebrowser-selectall">
[86] Fix | Delete
<button class="btn btn-sm" onclick="filebrowser_selectall('#{$browser_id}', true);">Select All</button>
[87] Fix | Delete
<button class="btn btn-sm" onclick="filebrowser_selectall('#{$browser_id}', false);">Deselect All</button>
[88] Fix | Delete
<div class="alert alert-danger browser-error hidden" id="{$browser_id}-errors">
[89] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i> <span></span>
[90] Fix | Delete
</div>
[91] Fix | Delete
</div>
[92] Fix | Delete
<p>Click folders to expand them. Click checkboxes to select them to be restored.</p>
[93] Fix | Delete
<div id="{$browser_id}" data-errors="#{$browser_id}-errors" data-orig-selections="{$selections_encoded}" data-post-uri="./post.live.php" data-post-action="{$post_action}" data-home-path="{$home_path}" class="file_browse"></div>
[94] Fix | Delete
</div>
[95] Fix | Delete
<div class="row">
[96] Fix | Delete
EOF;
[97] Fix | Delete
if ($is_restore) {
[98] Fix | Delete
echo <<<EOF
[99] Fix | Delete
<div class="col-sm-2"></div>
[100] Fix | Delete
<div class="col-sm-10">
[101] Fix | Delete
EOF;
[102] Fix | Delete
} else {
[103] Fix | Delete
echo <<<EOF
[104] Fix | Delete
<div class="col-sm-12">
[105] Fix | Delete
EOF;
[106] Fix | Delete
}
[107] Fix | Delete
echo <<<EOF
[108] Fix | Delete
<span class="count-zero"><span class="filebrowser-count" data-browser="#{$browser_id}" data-has-items-func="{$has_items_func}">0</span> items selected.</span>
[109] Fix | Delete
</div>
[110] Fix | Delete
</div>
[111] Fix | Delete
</div>
[112] Fix | Delete
EOF;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
function db_custom_select_widget($this_mode, $dbtype, $db_sizes, $db_conf){
[116] Fix | Delete
// Select all buttons
[117] Fix | Delete
echo <<<EOF
[118] Fix | Delete
<div class="custom-selectall">
[119] Fix | Delete
<button class="btn btn-sm" onclick="custom_db_selectall('#custom_items_{$this_mode}_{$dbtype}', true);">Select All</button>
[120] Fix | Delete
<button class="btn btn-sm" onclick="custom_db_selectall('#custom_items_{$this_mode}_{$dbtype}', false);">Deselect All</button>
[121] Fix | Delete
</div>
[122] Fix | Delete
EOF;
[123] Fix | Delete
// Selection checkboxes
[124] Fix | Delete
echo("<div class=\"custom_items\" id=\"custom_items_{$this_mode}_{$dbtype}\">\n");
[125] Fix | Delete
foreach($db_sizes as $item => $size_mb) {
[126] Fix | Delete
if (is_null($size_mb)){
[127] Fix | Delete
$size_mb = '?';
[128] Fix | Delete
}
[129] Fix | Delete
echo("<div class=\"checkbox\">\n");
[130] Fix | Delete
if ( !is_null($db_conf['custom']) && in_array($item, $db_conf['custom']) ){ // item checked
[131] Fix | Delete
echo("<label><input type=\"checkbox\" class=\"custom_checkbox\" value=\"{$item}\" data-size=\"{$size_mb}\" data-oldval=\"y\" checked=\"checked\">");
[132] Fix | Delete
} else { // item unchecked
[133] Fix | Delete
echo("<label><input type=\"checkbox\" class=\"custom_checkbox\" value=\"{$item}\" data-size=\"{$size_mb}\" data-oldval=\"n\">");
[134] Fix | Delete
}
[135] Fix | Delete
label_size($item, $size_mb);
[136] Fix | Delete
echo("</label>\n</div>\n");
[137] Fix | Delete
}
[138] Fix | Delete
echo("</div>\n");
[139] Fix | Delete
}
[140] Fix | Delete
[141] Fix | Delete
function selected_total_widget($baktype, $amp_url, $is_child){
[142] Fix | Delete
if ($is_child){
[143] Fix | Delete
$space_err_msg = "<p>The selected items cannot be backed up without additional space</p>";
[144] Fix | Delete
} else {
[145] Fix | Delete
$space_err_msg = "<p>The selected items won't be backed up unless you <a href=\"{$amp_url}\" target=\"_blank\">purchase more backup space</a>.</p>";
[146] Fix | Delete
}
[147] Fix | Delete
echo <<<EOF
[148] Fix | Delete
<div class="custom-total">
[149] Fix | Delete
<div class="row">
[150] Fix | Delete
<div class="col-sm-2">
[151] Fix | Delete
<strong>Total From Selected:</strong>
[152] Fix | Delete
<span class="total-selected-{$baktype}">0</span>GB
[153] Fix | Delete
</div>
[154] Fix | Delete
<div class="col-sm-2">
[155] Fix | Delete
<div class="progress">
[156] Fix | Delete
<div class="total-selected-bar progress-bar" role="progressbar" style="width: 0%"></div>
[157] Fix | Delete
</div>
[158] Fix | Delete
</div>
[159] Fix | Delete
<div class="col-sm-6">
[160] Fix | Delete
<div class="alert alert-danger total-selected-warning">
[161] Fix | Delete
<i class="glyphicon glyphicon-exclamation-sign"></i>
[162] Fix | Delete
{$space_err_msg}
[163] Fix | Delete
</div>
[164] Fix | Delete
</div>
[165] Fix | Delete
</div>
[166] Fix | Delete
</div>
[167] Fix | Delete
EOF;
[168] Fix | Delete
}
[169] Fix | Delete
[170] Fix | Delete
function date_select_label($conf, $geo, $time){
[171] Fix | Delete
if ($conf['show_geo']){
[172] Fix | Delete
if ($geo) {
[173] Fix | Delete
$name = $conf['geo_info']['name'];
[174] Fix | Delete
} else {
[175] Fix | Delete
$name = $conf['cluster_info']['name'];
[176] Fix | Delete
}
[177] Fix | Delete
return "$name - $time";
[178] Fix | Delete
} else {
[179] Fix | Delete
return "$time";
[180] Fix | Delete
}
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
?>
[184] Fix | Delete
[185] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function