Linux sagir-us1.hostever.us 5.14.0-570.51.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 8 09:41:34 EDT 2025 x86_64
LiteSpeed
Server IP : 104.247.108.91 & Your IP : 216.73.216.105
Domains : 74 Domain
User : georgeto
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
softaculous /
apps /
exim /
themes /
admin /
Delete
Unzip
Name
Size
Permission
Date
Action
country_email_filter_theme.php
5.99
KB
-rw-r--r--
2024-05-02 06:10
domain_email_filter_theme.php
4.52
KB
-rw-r--r--
2024-05-02 06:10
email_deliverability_theme.php
15.04
KB
-rw-r--r--
2025-08-13 08:32
email_delivery_report_theme.php
13.02
KB
-rw-r--r--
2025-08-29 09:11
email_disk_usage_theme.php
6.83
KB
-rw-r--r--
2024-04-17 09:30
email_greylisting_theme.php
14.12
KB
-rw-r--r--
2024-04-30 08:23
email_logs_theme.php
2.59
KB
-rw-r--r--
2025-10-09 09:48
email_queue_manager_theme.php
18.8
KB
-rw-r--r--
2024-05-02 06:10
email_queue_theme.php
4.58
KB
-rw-r--r--
2024-09-20 08:35
email_relayers_theme.php
4.37
KB
-rw-r--r--
2024-04-17 09:30
email_routing_config_theme.php
7.91
KB
-rw-r--r--
2024-05-02 06:10
email_sent_summary_theme.php
5.24
KB
-rw-r--r--
2024-04-17 09:30
email_split_delivery_theme.php
4.12
KB
-rw-r--r--
2024-09-20 08:35
email_troubleshooter_theme.php
2.01
KB
-rw-r--r--
2024-04-17 09:30
emails_theme.php
11.23
KB
-rw-r--r--
2026-01-22 06:40
emailstats_theme.php
2.24
KB
-rw-r--r--
2024-04-17 09:30
mail_settings_theme.php
31.64
KB
-rw-r--r--
2025-08-29 09:11
manage_rbl_theme.php
4.35
KB
-rw-r--r--
2024-04-17 09:30
mxentry_theme.php
11.15
KB
-rw-r--r--
2023-10-27 04:12
remote_smtp_servers_theme.php
7.74
KB
-rw-r--r--
2025-01-17 08:10
smtp_restrictions_theme.php
2.34
KB
-rw-r--r--
2024-04-17 09:30
system_mail_theme.php
5.43
KB
-rw-r--r--
2025-12-15 02:44
Save
Rename
<?php ////////////////////////////////////////////////////////////// //=========================================================== // WEBUZO CONTROL PANEL // Inspired by the DESIRE to be the BEST OF ALL // ---------------------------------------------------------- // Started by: Pulkit // Date: 10th Jan 2009 // Time: 21:00 hrs // Site: https://webuzo.com/ (WEBUZO) // ---------------------------------------------------------- // Please Read the Terms of Use at https://webuzo.com/terms // ---------------------------------------------------------- //=========================================================== // (c) Softaculous Ltd. //=========================================================== ////////////////////////////////////////////////////////////// if(!defined('SOFTACULOUS')){ die('Hacking Attempt'); } function exim_mail_settings_theme(){ global $globals, $theme, $ms_options, $ms_data, $ms_options_lang, $options_arr, $exim_status, $custom_codes, $conf, $domains; echo ' <div class="soft-smbox p-3"> <div class="sai_main_head"> <i class="far fa-envelope fa-xl"></i> '.__('Exim Configuration Manager').' </div> </div> <div class="soft-smbox p-4 mt-4">'; if(!empty($exim_status)){ echo ' <div class="alert alert-warning"> <center><h5>'.__('EXIM SERVICE IS NOT RUNNING.').'</h5></center> </div>'; } echo ' <div class="row mb-3 p-3"> <ul class="nav nav-tabs mb-3 webuzo-tabs" id="pills-tab" role="tablist"> <li class="nav-item" role="presentation"> <button class="nav-link active" id="b_mode_t" data-bs-toggle="tab" data-bs-target="#b_mode" type="button" role="tab" aria-controls="b_mode" aria-selected="true">'.__('Basic Editor').'</button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" href="#e_mode" id="e_mode_t" data-bs-toggle="tab" data-bs-target="#e_mode" type="button" role="tab" aria-controls="e_mode" aria-selected="false" >'.__('Custom Code').'</button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" href="#backup_config" id="backup" data-bs-toggle="tab" data-bs-target="#backup_config" type="button" role="tab" aria-controls="backup_config" aria-selected="false" >'.__('Backup').'</button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" href="#restore_config" id="restore" data-bs-toggle="tab" data-bs-target="#restore_config" type="button" role="tab" aria-controls="restore_config" aria-selected="false" >'.__('Restore').'</button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" href="#change_mailip" data-bs-toggle="tab" data-bs-target="#change_mailip" type="button" role="tab" aria-controls="change_mailip" aria-selected="false" >'.__('Change mail IP').'</button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" href="#reset_config" id="reset" data-bs-toggle="tab" data-bs-target="#reset_config" type="button" role="tab" aria-controls="reset_config" aria-selected="false" >'.__('Reset').'</button> </li> </ul> </div> <div class="tab-content" id="pills-tabContent"> <div class="tab-pane fade show active" id="b_mode" role="tabpanel" aria-labelledby="b_mode_t"> <div class="alert alert-warning"> <strong>NOTE : </strong> '.__('Please review all new options carefully before saving your changes.').' </div> <div class="row mb-3 p-3"> <ul class="nav nav-pills" id="pills-tab" role="tablist"> <li class="nav-item" role="presentation" data-tab="all" data-target_tab="all_tab" onclick="tabswicther(this)"> <button class="nav-link active" data-bs-toggle="tab" role="tab">'.__('All').'</button> </li>'; foreach(array_keys($ms_options) as $v){ echo ' <li class="nav-item" role="presentation" data-tab="'.$v.'" data-target_tab="'.$v.'_tab" onclick="tabswicther(this)"> <button class="nav-link" id="'.$v.'_btn" data-bs-toggle="tab" role="tab">'.$ms_options_lang[$v].'</button> </li>'; } echo ' </ul> </div> <form method="post" onsubmit="return submitit(this)" name="basic_options"> <div class="row"> <div class="table-responsive" id="all_tab_contain"> <div id="all_tab"> </div>'; foreach($ms_options as $mk => $mv){ echo ' <table class="table align-middle table-nowrap mb-0 webuzo-table" id="'.$mk.'_tab"> <thead class="sai_head2"> <tr> <th class="align-middle" style="width:65%">'.$ms_options_lang[$mk].'</th> <th style="text-align: right" style="width:35%"></th> </tr> <thead> <tbody>'; foreach($mv as $msk => $msv){ //$mv[$msv['child_of']]['parent_of'][$msk][$mv[$msv['child_of']]['selected']] == 'disabled' ? '#ded8d8' : '' echo ' <tr id="tr_'.$msk.'" style="background-color:'.(!empty($msv['child_of']) ? ($mv[$msv['child_of']]['parent_of'][$msk][$mv[$msv['child_of']]['selected']] == 'disabled' ? '#ded8d8' : '') : '').';"> <td> <label for="'.$msk.'" class="sai_head">'.$msv['lbl'].'</label>'.(!empty($msv['sublbl']) ? '<span class="sai_exp">'.$msv['sublbl'].'</span>' : '').' </td> <td>'; if($msv['type'] == 'unlimited'){ echo ' <input type="radio" name="'.$msk.'" value="'.(!empty($msv['unlimited_val']) ? $msv['unlimited_val'] : 'unlimited').'" '.($msv['selected'] == 'unlimited' ? 'checked' : '').' class="unlimited" data-section="'.$mk.'"> '.(!empty($msv['unlimited_text']) ? $msv['unlimited_text'] : __('Unlimited')).' '.($msv['default'] == 'unlimited' ? '<span class="badge bg-info">'.__('Default').'</span>' : '').'<br> <input type="radio" name="'.$msk.'" value="custom" '.($msv['selected'] != 'unlimited' ? 'checked' : '').' class="unlimited" data-section="'.$mk.'"> <input type="'.(!empty($msv['default_input_type']) ? $msv['default_input_type'] : 'text').'" name="'.$msk.'_val" '.(!empty($msv['step']) ? 'step="'.$msv['step'].'"' : '').' '.(!empty($msv['input_min']) ? 'step="0.01" min="'.$msv['input_min'].'"' : '').' '.(!empty($msv['input_max']) ? 'max="'.$msv['input_max'].'"' : '').' value="'.(!empty($msv['default_input_value']) ? $msv['default_input_value'] : '').'">'.($msv['default'] != 'unlimited' ? '<span class="badge bg-info">'.__('Default').'</span>' : ''); }elseif($msv['type'] == 'checkbox'){ echo ' <label class="switch"> <input type="checkbox" id="'.$msk.'" name="'.$msk.'" class="checkbox" '.(!empty($msv['selected']) ? 'checked' : '').' value="1" data-section="'.$mk.'"> <span class="slider"></span> </label> <span class="badge bg-info">'.__('Default'). ' "<b>'.(!empty($msv['default']) ? __('On') : __('Off')).'</b>"</span>'; }elseif($msv['type'] == 'textarea'){ echo (!empty($msv['input_lbl']) ? '<label class="sai_head">'.(!empty($msv['input_format']) ? '<span class="sai_exp">'.$msv['input_format'].'</span>' : '').$msv['input_lbl'].'</label>' : ''); echo ' <textarea name="'.$msk.'" rows="3" cols="50" data-section="'.$mk.'">'.(!empty($msv['default']) ? $msv['default'] : $msv['selected']).'</textarea>'; }elseif($msv['type'] == 'radio'){ foreach($msv['options'] as $ok => $ov){ if(!empty($ov['type'])){ echo ' <input type="radio" name="'.$msk.'" value="'.$ok.'" '.($msv['selected'] == $ok ? 'checked' : '').' class="radio" data-section="'.$mk.'"> <input type="'.$ov['type'].'" name="'.$msk.'_val" value="'.$ov['default'].'">'.($msv['default'] == $ok ? '<span class="badge bg-info">'.__('Default').'</span> ' : '').'<br>'; continue; } echo ' <input type="radio" name="'.$msk.'" value="'.$ok.'" '.($msv['selected'] == $ok ? 'checked' : '').' class="radio" data-section="'.$mk.'"> '.$ov['lbl'].' '.($msv['default'] == $ok ? '<span class="badge bg-info">'.__('Default').'</span> ' : '').'<br>'; } }elseif($msv['type'] == 'link'){ echo ' <p>'.$msv['value'].'</p>'; } echo ' </td> </tr>'; } echo ' </tbody> </table>'; } echo ' </div> <center> <input type="submit" class="btn btn-primary mt-3" id="save_basic_options" name="save_basic_options" value="'.__('Save').'"> </center> </div> </form> </div> <div class="tab-pane fade show" id="e_mode" role="tabpanel" aria-labelledby="e_mode"> <div class="row mt-3"> <div class="col-md-6"> <label class="sai_head" for="section_header">'.__('Section Header').'</label> <select class="form-select" name="section_header" id="section_header">'; foreach($options_arr as $k => $v){ echo '<option value="'.$k.'">'.$k.'</option>'; } echo ' </select> </div> <div class="col-md-6"> <label class="sai_head" for="rule">'.__('Rule').'</label> <select class="form-select" name="rule" id="rule">'; foreach($options_arr[array_key_first($options_arr)] as $key => $val){ echo '<option value="'.$val.'">'.($val != 'noRule' ? $val : 'Custom Code below selected section header').'</option>'; } echo ' </select> </div> <div class="my-5"> <label class="sai_head" for="custom_code" id="textarea_label" style="display:none">'.__('Custom Code before the selected rule').' <i class="fa fa-info-circle" data-bs-toggle="tooltip" data-bs-placement="top" title="'.__('Custom code will be added right above the selected rule in the exim.conf file').'"></i> :</label> <table class="table align-middle table-nowrap mb-0 webuzo-table"> <tbody id="tbody_advanced"> </tbody> </table> </div> </div> <center> <input type="submit" data-add_custom_code=1 value="'.__('Add Custom Code').'" class="btn btn-primary" onclick="add_custom_code(this)"> <input type="button" class="btn btn-primary" id="view_conf" value="'.__('View Exim Conf').'"> </center> </div> <div class="tab-pane fade show" id="backup_config" role="tabpanel" aria-labelledby="backup"> <div class="row"> <h4>'.__('Backup the Exim configuration').'</h4> <div class="alert alert-warning"> <strong>'.__('NOTE').' : </strong> '.__('You can save a backup file of the currently installed configuration for Exim. You can upload and restore the configuration later using the Restore tab.').' </div> <form method="post" name="bakup_form" onsubmit="return backup_form_submit(this)" data-donereload=1> <div> <div class="form-check"> <input class="form-check-input" type="radio" name="backup_type" id="download" value="download" checked> <label class="form-check-label" for="download"> <b>'.__('Download').'</b> - '.__('Download exim configuration as a JSON file and restore it using the restore tab').' </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="backup_type" id="save" value="save"> <label class="form-check-label" for="save"> <b>'.__('Save on Server').'</b> - '.__('Save on this server and restore using the restore tab').' </label> </div> <input type="submit" name="save_backup" value="'.__('Backup').'" class="btn btn-primary mt-3"> </div> </form> </div> </div> <div class="tab-pane fade show" id="restore_config" role="tabpanel" aria-labelledby="restore"> <h4>'.__('Restore the Exim Configuration').'</h4> <div class="alert alert-warning"> <strong>NOTE : </strong> '.__('You can restore the Exim configuration from an existing backup file.').' </div> <form method="post" name="restore_form" onsubmit="return submititwithdata(this)" enctype="multipart/form-data" data-donereload=1> <div class="mb-3"> <label for="formFile" class="form-label">'.__('Upload backup from local').'</label> <input name="back_file" class="form-control" type="file" id="formFile" accept="application/json"> </div> <input type="hidden" name="restore_from_local" value="1"> <input type="submit" name="restore_from_local" value="'.__('Upload').'" class="btn btn-primary"> </form> <h4 class="mt-3">'.__('Restore backup from the server').'</h4> <table class="table sai_form webuzo-table"> <thead> <tr> <th>'.__('File').'</th> <th>'.__('Created').'</th> <th width="10%">'.__('Actions').'</th> </tr> </thead> <tbody id="tbody_restore_file">'; if(empty($ms_data['restore_file_list'])){ echo ' <tr> <td colspan="100" class="text-center">'.__('No backup file was found on this server').'</td> </tr>'; } foreach($ms_data['restore_file_list'] as $k => $v){ // Extract Timestamp if(preg_match('/_(\d+)(?:\.\w+)?$/', $v['name'], $m)){ $timstamp = (int) $m[1]; $date = datify($timstamp); } echo ' <tr id="tr'.$v['name'].'"> <td>'.$v['name'].'</td> <td>'.$date.'</td> <td><i class="fas fa-sync" title="Restore" data-restore="1" data-name="'.$v['name'].'" onclick="restore_backup(this)"></i> <i class="fas fa-trash delete delete-icon ml-3" title="Delete" id="did'.$v['name'].'" onclick="delete_record(this)" data-name="'.$v['name'].'" data-delete_backup="1"></i></td> </tr>'; } echo ' </tbody> </table> </div> <div class="tab-pane fade" id="change_mailip" role="tabpanel" aria-labelledby="change_mailip">'; if(empty($globals['custom_mailips'])){ echo' <div class="alert alert-danger"> '.__('<center>Mail IPs Rebuilding is enabled Please disable setting from Mail setting > Basic Editor > General <strong>Disable Automatic Mail IPs Rebuilding</strong></center>',).' </div>'; } echo' <div class="row col-md-12 d-flex justify-content-center"> <div class="col-12 col-md-6"> <label class="sai_head">'.__('Search By User Name').'</label><br/> <select class="form-select make-select2" s2-placeholder="'.__('Select User').'" s2-ajaxurl="'.$globals['index'].'act=users&api=json" s2-query="search" s2-data-key="users" s2-data-subkey="user" s2-result-add="'.htmlentities(json_encode([['text' => 'All', 'id'=> 'all', 'value' => 'all']])).'" style="width: 100%" id="user_search" name="user_search"> <option value="'.optREQ('user_search').'" selected="selected">'.optREQ('user_search').'</option> </select> </div> <div class="col-12 col-md-6"> <label class="sai_head">'.__('Search By Domain Name').'</label> <select class="form-select make-select2" s2-placeholder="'.__('Select domain').'" s2-ajaxurl="'.$globals['index'].'act=domains&api=json" s2-query="dom_search" s2-data-key="domains" s2-data-subkey="domain" s2-result-add="'.htmlentities(json_encode([['text' => 'All', 'id'=> 'all', 'value' => 'all']])).'" style="width: 100%" name="dom_search" id="dom_search"> <option value="'.optREQ('dom_search').'" selected="selected">'.optREQ('dom_search').'</option> </select> </div> </div> <div class="row"> <div class="col-12 mt-4 col-sm-4"> <span class="form-label">'.__('Total Domains').': </span> <span class="tot_count">'.$globals['total_domains'].'</span> </div> <div class="col-12 col-sm-8"> <nav aria-label="Page navigation example"> <ul class="pagination pager myPager justify-content-end"> </ul> </nav> </div> </div>'; page_links(); echo ' <div class="row mt-3 mb-3 col-12 col-md-6"> <div class="col-10" style="display:flex; gap:1rem"> <input type="text" id="custom_ip" name="custom_ip" class="form-control" Placeholder="Enter a valid IP"> <input type="button" id="custom_ip_btn" class="btn btn-primary" value="Update IP" onclick="update_ips(this)" title="Click here to add New IP to selected domain(s)." disabled> <button type="button" class="btn btn-danger" data-reset="1" id="reset_ip_btn" data-bs-html="true" data-bs-toggle="tooltip" data-bs-original-title="Click here to reset All Domains IP" onclick="reset_ip(this)" disabled>'.__('Reset').'</button> </div> </div> <hr> <div id="showplanlist" class="table-responsive mt-2"> <table class="table table-hover sai_form webuzo-table"> <thead> <tr> <th><input type="checkbox" id="checkAll"></th> <th width="27%">'.__('Domain').'<i id="dom_order" class="fa fa-sort m-1" style="cursor:pointer;"></i></th> <th width="20%">'.__('Users').'<i id="user_order" class="fa fa-sort m-1" style="cursor:pointer;"></i></th> <th width="10%">'.__('Owner').'</th> <th width="20%">'.__('IP Address').'</th> <th width="10%">'.__('Type').'</th> <th colspan="3">'.__('Options').'</th> </tr> </thead> <tbody>'; if(empty($domains)){ echo ' <tr> <td colspan="100" class="text-center"> <span>'.__('No data found').'</span> </td> </tr>'; }else{ foreach($domains as $key => $value){ echo ' <tr id="tr'.$key.'"> <td> <input class="check_domain" name="check_domain" value="'.$value['domain'].'" data-domain="'.$value['domain'].'" type="checkbox"> </td> <td> <span id="domain'.$key.'" name="domain">'.$value['domain'].'</span> </td> <td> <span id="user'.$key.'" name="user">'.$value['user'].'</span> </td> <td> <span id="owner'.$key.'" name="owner">'.$value['owner'].'</span> </td> <td> <span id="record'.$key.'" value="'.$value['ip'].'">'.$value['ip'].'</span> <input type="text" name="record" id="ip_record'.$key.'" value="'.$value['ip'].'" style="display:none;"> </td> <td> <span id="type'.$key.'" name="type">'.$value['type'].'</span> </td> <td width="2%"> <i class="fas fa-times cancel cancel-icon" title="'.__('Cancel').'" id="cid'.$key.'" style="display:none;color:#DC3545"></i> </td> <td width="2%"> <i class="fas fa-pencil-alt edit edit-icon fa-edit" title="'.__('Edit').'" id="eid'.$key.'"></i> </td> <td width="2%"> <i class="fas fa-undo reset cancel-icon" title="'.__('Reset').'" id="rid'.$key.'" style="display:none;color:#0D6EFD" data-id="rid'.$key.'" data-domain='.$value['domain'].' onclick="reset_ip(this)"></i> </td> </tr>'; } } echo ' </tbody> </table> </div>'; page_links(); echo' </div> <div class="tab-pane fade" id="reset_config" role="tabpanel" aria-labelledby="reset"> <h4>'.__('Reset Configuration').'</h4> <div class="alert alert-warning"> <strong>'.__('NOTE').' : </strong> '.__('Reset Exim configuration to factory default settings').' </div> <center><button type="button" class="btn btn-danger" data-reset="1" onclick="reset_config(this)">'.__('Reset').'</button></center> </div> </div> </div> <div class="modal fade" id="view_conf_modal" tabindex="-1" aria-labelledby="view_zoneLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="view_confLabel">'.__('View Exim Configuration').'</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <textarea class="form-control" rows="15" disabled></textarea> </div> </div> </div> </div> <script> var custom_codes = '.json_encode($custom_codes).'; var options_arr = '.json_encode($options_arr).'; function handle_mail_ip(){ var url = window.location.href; var activeTab = localStorage.getItem("activeTab"); // To reload the domains list with mailIPs if(activeTab === "#change_mailip" && !url.includes("show_mailips=1")){ $(".loading").show(); window.location.href = "'.$globals['admin_url'].'act=mail_settings&show_mailips=1"; // To remove the show_mailips from URL, if any other tab is clicked }else if(activeTab != "#change_mailip" && url.indexOf("&show_mailips=") !== -1){ url = url.replace(/&show_mailips=[^&]*/g, ""); window.history.pushState({path: url}, "", url); } } $(document).ready(function(){ // Tab handling after page reload $(`button[data-bs-toggle="tab"]`).on("show.bs.tab", function(e){ localStorage.setItem("activeTab", $(e.target).attr("href")); }); var activeTab = localStorage.getItem("activeTab"); if(activeTab){ $(`#pills-tab button[href=\"${activeTab}\"]`).tab("show"); } handleTextContent(Object.keys(options_arr)[0]); handlelastrow(); // Display Domain Mail IP data only when swtiched to the \'Change Mail IP\' tab $(`button[data-bs-toggle="tab"]`).on("show.bs.tab", function(e){ handle_mail_ip(); }); $("#checkAll").change(function(){ $("input:checkbox").prop("checked", $(this).prop("checked")); }); $("input:checkbox").change(function(){ if($(".check_domain:checked").length){ $("#custom_ip_btn").removeAttr("disabled"); $("#reset_ip_btn").removeAttr("disabled"); }else{ $("#custom_ip_btn").prop("disabled", true); $("#reset_ip_btn").prop("disabled", true); } }); // For cancel $(".cancel").click(function(){ var id = $(this).attr("id"); id = id.substr(3); $("#cid"+id).hide(); $("#rid"+id).hide(); $("#record"+id).show(); $("#ip_record"+id).hide(); $("#eid"+id).removeClass("fa-save"); $("#ip_record"+id).val($("#record"+id).text()); $("#tr"+id).css("background-color",""); }); // For edit record $(".edit").click(function(){ var id = $(this).attr("id"); id = id.substr(3); $("#cid"+id).show(); $("#rid"+id).show(); $("#record"+id).hide(); $("#ip_record"+id).show(); $("#tr"+id).css("background-color","#d7edf9"); // Submit the form if($("#eid"+id).hasClass("fa-save")){ $("#tr"+id).css("background-color",""); var domain = $("#domain"+id).text(); var ip = $("#tr"+id).find("input[name=\'record\']").val(); var d = {"change_mailip":1, "domain":domain, "ip":ip}; submitit(d, { done: function(){ var tr = $("#tr"+id); var ip_record = $("#ip_record"+id).val(); $("#record"+id).html(ip_record); tr.find(".cancel").click(); } }); }else{ $("#eid"+id).addClass("fa-save"); } }); // Search by user name $("#user_search").on("select2:select", function(){ user = $("#user_search option:selected").val(); if(user == "all"){ window.location = "'.$globals['index'].'act='.$GLOBALS['act'].'"; }else{ window.location = "'.$globals['index'].'act='.$GLOBALS['act'].'&user_search="+user; } }); // Search by domain $("#dom_search").on("select2:select", function(){ user = $("#dom_search option:selected").val(); if(user == "all"){ window.location = "'.$globals['index'].'act='.$GLOBALS['act'].'"; }else{ window.location = "'.$globals['index'].'act='.$GLOBALS['act'].'&dom_search="+user; } }); handle_mail_ip(); }); // Sort the domain $("#dom_order").click(function(){ order_by = "ASC&by=domain"; if($("#dom_order").hasClass("fa-sort-up")){ order_by = "DESC&by=domain"; } url = window.location.toString(); url = url.replace(/[\?&]order=[^&]+/, "").replace(/[\?&]by=[^&]+/, ""); window.location = url+"&order="+order_by; }); // Sort the user $("#user_order").click(function(){ order_by = "ASC&by=user"; if($("#user_order").hasClass("fa-sort-up")){ order_by = "DESC&by=user"; } url = window.location.toString(); url = url.replace(/[\?&]order=[^&]+/, "").replace(/[\?&]by=[^&]+/, ""); window.location = url+"&order="+order_by; }); var order = "'.optGET('order').'"; var orderby = "'.optGET('by').'"; if(orderby == "user"){ $("#user_order").removeClass("fa-sort"); if(order == "ASC"){ $("#user_order").addClass("fa-sort-up"); }else{ $("#user_order").addClass("fa-sort-down"); } } if(orderby == "domain"){ $("#dom_order").removeClass("fa-sort"); if(order == "ASC"){ $("#dom_order").addClass("fa-sort-up"); }else{ $("#dom_order").addClass("fa-sort-down"); } } function update_ips(ele){ var arr = []; $("input:checkbox[name=check_domain]:checked").each(function(){ var domain = $(this).val(); arr.push(domain) }); var ip = $("#custom_ip").val(); if(empty(ip)){ var err = show_message_r("'.__js('Error').'", "'.__js('Please Enter the IP').'"); err.alert = "alert-danger"; show_message(err); return; } var a = show_message_r("'.__js('Warning').'", "'.__('Are your sure you want to modify the mail IP of selected domain(s)?').'"); a.alert = "alert-warning"; a.confirm.push(function(){ var d = {"change_mailip": 1, "domain": arr.join(), "ip": ip}; submitit(d, {done_reload : window.location.href}); }); show_message(a); } function reset_ip(ele){ var jEle = $(ele); var domain = jEle.data(\'domain\'); if(!empty(domain)){ var os_ip = "'.getIP().'"; var id = jEle.data(\'id\'); id = id.substr(3); var d = {"reset_mailip": 1, "domain": domain}; submitit(d, { done: function(){ var tr = $("#tr"+id); var ip_record = os_ip; $("#record"+id).html(ip_record) tr.find(".cancel").click(); } }); }else{ var arr = []; $("input:checkbox[name=check_domain]:checked").each(function(){ var domain = $(this).val(); arr.push(domain) }); var a = show_message_r("'.__js('Warning').'", "'.__('Are your sure you want to reset the mail IP of All Domain(s)?').'"); a.alert = "alert-warning"; a.confirm.push(function(){ var d = {"reset_mailip": 1, "domain": arr.join()}; submitit(d, {done_reload : window.location.href}); }); show_message(a); } } function handlelastrow(){ var jEle = $("#e_mode"); jEle.find("tr").each(function(i){ $(this).find(".rowremove").removeAttr("disabled"); }); var lastRow = jEle.find("#tbody_advanced tr").last(); var rowCount = jEle.find("#tbody_advanced tr").length; if(rowCount <=1 ){ lastRow.find(".rowremove").attr("disabled", ""); } } function addRow(ele){ var jEle = $(ele); var textrow = jEle.attr("name").replace("rowadd", ""); var trEle = jEle.closest("#textrow"+textrow); var lasttrEle = trEle.closest("#tbody_advanced").find("tr:last"); var lastrow = 0; $.each($(".rowprior"), function(){ let tmp = parseInt($(this).val()); if(tmp > lastrow){ lastrow = tmp; } }); var cloneEle = trEle.clone(); cloneEle.attr("id", "textrow"+(lastrow+1)); cloneEle.find(".custom_code").attr("name", "custom_code"+(lastrow+1)).val(""); cloneEle.find(".rowadd").attr("name", "rowadd"+(lastrow+1)); cloneEle.find(".rowremove").attr("name", "rowremove"+(lastrow+1)); cloneEle.find(".rowprior").attr("value", (lastrow+1)); cloneEle.insertAfter("#textrow"+textrow); handlelastrow(); } function removeRow(ele){ var jEle = $(ele); var textrow = jEle.attr("name").replace("rowremove", ""); jEle.closest("#textrow"+textrow).remove(); handlelastrow(); } function add_custom_code(el){ var jEle = $(el); jEle.data("section_header", $("#section_header").val()); jEle.data("rule", $("#rule").val()); $.each($(".rowprior"), function(){ let tmp = parseInt($(this).val()); jEle.data("custom_code"+tmp, $(`textarea[name="custom_code${tmp}"]`).val()); }); var d = jEle.data(); submitit(d,{ done_reload: window.location }); } function handleTextContent(header, rule="noRule"){ $("#tbody_advanced").empty(); if(!custom_codes || !custom_codes[header] || !custom_codes[header][rule]){ $("#tbody_advanced").append( `<tr id="textrow1"> <input type="hidden" class="rowprior" name="rowprior[]" value="1"> <td class="col-10"> <textarea class="form-control custom_code" type="text" name="custom_code1" style="width:100%;height:150px;"></textarea> </td> <td class="col-2"> <input type="button" value="-" name="rowremove1" class="btn btn-default rowremove" onclick="removeRow(this)"> <input type="button" value="+" name="rowadd1" class="btn btn-default rowadd" onclick="addRow(this)"> </td> </tr>` ); }else{ $.each(custom_codes[header][rule], function(index, value){ index = index + 1; $("#tbody_advanced").append( `<tr id="textrow${index}"> <input type="hidden" class="rowprior" name="rowprior[]" value="${index}"> <td class="col-10"> <textarea class="form-control custom_code" type="text" name="custom_code${index}" style="width:100%;height:150px;">${value}</textarea> </td> <td class="col-2"> <input type="button" value="-" name="rowremove${index}" class="btn btn-default rowremove" onclick="removeRow(this)"> <input type="button" value="+" name="rowadd${index}" class="btn btn-default rowadd" onclick="addRow(this)"> </td> </tr>` ); }); } handlelastrow(); } $("#section_header").change(function(){ var header = $(this).val(); $("#textarea_label").hide(); var text = ""; $.each(options_arr[header], function(index, value){ text += `<option value="${value}">${value != "noRule" ? value : "Custom Code below selected section header"}</option>`; }); $("#rule").html(text); handleTextContent(header); }); $("#rule").change(function(){ var rule = $(this).val(); var header = $("#section_header").val(); if(rule == "noRule"){ $("#textarea_label").hide(); }else{ $("#textarea_label").show(); } handleTextContent(header, rule); }); // View Exim Conf in modal $("#view_conf").click(function(){ var modal = $("#view_conf_modal"); modal.find("textarea").text('.json_encode($conf).'); var bm = bootstrap.Modal.getOrCreateInstance(modal); bm.show(); }); var ms_options = '.json_encode($ms_options).'; // console.log(ms_options); function tabswicther(ele){ // console.log(ele); var jEle = $(ele); // console.log(jEle.data("target_tab"));return; $.each($("#all_tab_contain").children(), function(){ if(jEle.data("target_tab") == "all_tab"){ $(this).show(); }else{ $(this).hide(); } }); $("#"+jEle.data("target_tab")).show(); $("#all_tab_contain").scrollTop(0); } $(".checkbox, .radio, .unlimited").click(function(){ // console.log(); // console.log($(this).data(), $(this).prop("name"));return; // console.log(ms_options[$(this).data("section")]);return; var opt = ms_options[$(this).data("section")][$(this).prop("name")], jEle = $(this); /* if(Object.keys(opt.parentof).length <= 0){ return; } */ if(!("parent_of" in opt)){ return; } // console.log(opt);return; $.each(opt.parent_of, function(key, val){ // console.log(key, val);return; var tmp; if(opt["type"] == "checkbox"){ tmp = jEle.is(":checked") ? 1 : 0 }else if(opt["type"] == "radio"){ tmp = jEle.val(); }else if(opt["type"] == "unlimited"){ tmp = jEle.val(); if(tmp != "custom" && "unlimited_val" in opt){ tmp = opt["unlimited_val"]; } } // console.log(tmp);return; if(val[tmp] === "disabled"){ $("#tr_"+key).css("background-color", "#ded8d8"); }else{ $("#tr_"+key).css("background-color", ""); } }); }); function backup_form_submit(ele){ var jEle = $(ele), type = $("input[name=backup_type]:checked").val(); // console.log(type);return false; if(type === "download"){ window.location = "'.$globals['index'].'act=mail_settings&save_backup=1&"+jEle.serialize() return false; } return submitit(ele); } function restore_backup(ele){ var jEle = $(ele); var a = show_message_r("'.__js('Warning').'", "'.__js('Are you sure you want to restore this Exim configuration ?').'"); a.alert = "alert-warning"; a.confirm.push(function(){ // Get the element data var d = jEle.data(); // console.log(d); submitit(d, { sm_done_onclose:function(){ location.reload(); } }); }); show_message(a); } function reset_config(ele){ var jEle = $(ele); var a = show_message_r("'.__js('Warning').'", "'.__js('Are you sure you want to reset the exim configuration to the default factory settings ?').'"); a.alert = "alert-warning"; a.confirm.push(function(){ // Get the element data var d = jEle.data(); // console.log(d); submitit(d, { sm_done_onclose:function(){ location.reload(); } }); }); show_message(a); } function restore_form_local(ele){ console.log(ele); return false; } </script>'; }