Файловый менеджер - Редактировать - /usr/src/rmw/whm/remotemxwizard/data/manageproviders.php
Ðазад
<?php ################################################## # # # GK~root - Creating a better web # # Copyright (c) GK~root. All Rights Reserved. # # Software: Remote Mx Wizard # # Version: 1.0.3 # # Create Date: Jan 07 2015 # # Website: http://www.gk-root.com # # # ################################################## # # # This software is released under a license. # # You cannot transfer it to any other person, # # resell it or claim any code as your own. # # By using the software you agree to this terms. # # # ################################################## if (getenv('REMOTE_USER') != 'root') die('Access Denied.'); require_once("/usr/local/cpanel/base/3rdparty/RemoteMxWizard/php/whm.func.php"); require_once("/usr/local/cpanel/base/3rdparty/RemoteMxWizard/php/shared.func.php"); if (isset($_GET['setproviderstatus'])) { if (ChangeProviderStatus($_ENV['cp_security_token'],$_GET['setproviderstatus'],$_GET['providerfile'])) { echo $start_notice_success.fileToProviderName($_GET['providerfile']).' status has been updated'.$end_notice; } else { echo $start_notice_error.'Error updating '.fileToProviderName($_GET['providerfile']).' status'.$end_notice; } } if (isset($_GET['removeprovider'])) { if (RemoveMailProviderConf($_ENV['cp_security_token'],$_GET['removeprovider'])) { echo $start_notice_success.'The mail provider '.fileToProviderName($_GET['providerfile']).' removed successfully'.$end_notice; } else { echo $start_notice_error.'Error removing mail provider '.fileToProviderName($_GET['providerfile']).$end_notice; } } $pageStatus = 'list'; if (isset($_POST['addnewprovider'])) { $addResult = addNewMailProvider($_ENV['cp_security_token']); if ($addResult['newfile']) { $EditProviderFile = $addResult['newfile']; $pageStatus = 'edit'; } else { echo $start_notice_error.$addResult['error'].$end_notice; } } elseif (isset($_GET['editprovider']) && !isset($_POST['Pconffile'])) { if (validateConfFileName($_GET['editprovider'])) { $EditProviderFile = $_GET['editprovider']; $pageStatus = 'edit'; } else { echo $start_notice_error.'Please use the GUI only if you do not want to face any problems with the plugin...'.$end_notice; } } elseif (isset($_POST['Pconffile'])) { $saveResult = SaveMailProviderConf($_ENV['cp_security_token']); if ($saveResult['status']) { echo $start_notice_success.'The mail provider '.fileToProviderName($_POST['Pconffile']).' updated successfully'.$end_notice; } else { $errorMsg = ''; foreach ($saveResult['errors'] as $error) { $errorMsg .= $error.'<br>'; } $errorMsg = rtrim($errorMsg, '<br>'); echo $start_notice_error.$errorMsg.$end_notice; $EditProviderFile = $_POST['Pconffile']; $pageStatus = 'edit'; } } if ($pageStatus == 'list') { // Start Mail Providers list foreach (GetMailProviders(true) as $ProviderConfig) { if ($ProviderConfig['STATUS'] == "1") {$checked='checked="checked"';$ToStatus=0;} else {$checked='';$ToStatus=1;} $testValidConf = ValidateProviderConf($_ENV['cp_security_token'],$ProviderConfig['CONFFILENAME']); if ($testValidConf['status']) { $ConfFileIntegrity = '<span class="Active">VALID</span><br><br>'; } else { if ($ProviderConfig['STATUS'] == "1") { if (ChangeProviderStatus($_ENV['cp_security_token'],'0',$ProviderConfig['CONFFILENAME'])) { echo $start_notice_error.fileToProviderName($ProviderConfig['CONFFILENAME']).' status updated to off since you have an error with your configuration'.$end_notice; $checked=''; $ToStatus=1; } else { echo $start_notice_error.'Error updating '.fileToProviderName($_GET['providerfile']).' status to off'.$end_notice; } } $ConfFileIntegrity = '<span class="UnActive">MISSING CONFIGURATION</span><br><br>'; foreach ($testValidConf['errors'] as $error) { $ConfFileIntegrity .= $error.'<br>'; } } if ($testValidConf['warning']) { foreach ($testValidConf['warning'] as $Warning) { $ConfFileIntegrity .= 'Warning: '.$Warning.'<br>'; } } $fileToProviderName = fileToProviderName($ProviderConfig['CONFFILENAME']); $ProviderNameTD = ( !empty($ProviderConfig['NAME']) && ($fileToProviderName != $ProviderConfig['NAME']) ) ? $fileToProviderName.'<br>('.$ProviderConfig['NAME'].')' : $fileToProviderName; $trOutput .= ' <tr> <td class="text_cell"><a href="'.$cptoken.'/cgi/remotemxwizard/index.php?plgaction=manageproviders&editprovider='.$ProviderConfig['CONFFILENAME'].'">'.$ProviderNameTD.'</a></td> <td class="text_cell">'.$ConfFileIntegrity.'</td> <td class="selector" onclick="ChangeProviderStatus(\''.$ToStatus.'\',\''.$ProviderConfig['CONFFILENAME'].'\')"><input type="checkbox" '.$checked.' /></td> <td class="text_cell"><a href="'.$cptoken.'/cgi/remotemxwizard/index.php?plgaction=manageproviders&editprovider='.$ProviderConfig['CONFFILENAME'].'" class="btn">Edit</a> <a href="'.$cptoken.'/cgi/remotemxwizard/index.php?plgaction=manageproviders&removeprovider='.$ProviderConfig['CONFFILENAME'].'" onclick="return confirm(\'Are you sure you want to remove '.$fileToProviderName.'?\')" class="btn">Remove</a></td> </tr> '; } ?> <script src="jquery/iphone-style-checkboxes.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="css/iphone-style-checkboxes.css" type="text/css" media="screen" charset="utf-8" /> <script type="text/javascript"> $(document).ready(function() { $(':checkbox').iphoneStyle(); }); function ChangeProviderStatus(Pstatus,Pfile) { if (Pfile != "") { window.location.href="<?php echo $cptoken; ?>/cgi/remotemxwizard/index.php?plgaction=manageproviders&setproviderstatus="+Pstatus+"&providerfile="+Pfile; } } function AddNewProviderForm() {$("#PFORMITEM").fadeToggle("slow");} </script> <div> <form method="post" action="index.php?plgaction=manageproviders" style="padding:15px;"> <a id="AddNewP" onclick="AddNewProviderForm();" class="btn btn-primary" style="color:#fff">Add New Mail Provider</a> <span style="margin-left: 15px; display:none;" id="PFORMITEM"><strong>Provider Name:</strong> <input type="text" name="addnewprovider" style="width:300px;margin-left:10px;" value="" required /> <input type="submit" value="Add Provider" class="btn btn-primary" /></span> <br> </form> </div> <div class="option_box"> <div class="top-heading"><h4>Manage Mail Providers</h4></div> <div class="option_contents"> <table id="user_selection_table" class="table table-striped table-bordered table-condensed"> <thead> <tr> <th class="sortable_row">Provider name</th> <th class="sortable_row">Configuration File Integrity</th> <th class="sortable_row">Status</th> <th class="sortable_row">Actions</th> </tr> </thead> <tbody> <?php echo $trOutput;?> </tbody> </table> </div> </div> <?php } elseif ($pageStatus == 'edit') { // Start Edit Provider Form $ProviderConf = GetMailProviderConf($EditProviderFile); if (!empty($ProviderConf['NAME'])) {$Pname = $ProviderConf['NAME'];} else {$Pname = '';} if (!empty($ProviderConf['DESCRIPTION'])) {$Pdescription = $ProviderConf['DESCRIPTION'];} else {$Pdescription = '';} if (!empty($ProviderConf['BACKUPMX'])) {$Pbackupmx = $ProviderConf['BACKUPMX'];} else {$Pbackupmx = '';} if (!empty($ProviderConf['SPFR'])) {$Pspf = $ProviderConf['SPFR'];} else {$Pspf = '';} if (!empty($ProviderConf['STATUS'])) {$Pstatus = $ProviderConf['STATUS'];} else {$Pstatus = '';} if (isset($ProviderConf['MXs']) && is_array($ProviderConf['MXs'])) {$Pmxs = $ProviderConf['MXs'];} else {$Pmxs = array();} if (isset($ProviderConf['SERVICERS'])) {if (is_array($ProviderConf['SERVICERS'])) {$Pservices = $ProviderConf['SERVICERS'];} else {$Pservices = array();}} else {$Pservices = array();} ?> <script type="text/javascript"> $(document).ready(function() { var max_fields = 20; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 1; //initlal text box count $(add_button).click(function(e){ //on add input button click e.preventDefault(); if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper).append('<br><div>Type:<select style="width:10px;margin-left:10px;" name="additional[type][]"><option value="A">A</option><option value="CNAME">CNAME</option><option value="TXT">TXT</option></select></selsec> <span style="margin-left:5px">Record: <input type="text" name="additional[record][]" style="width:200px;" /></span> <span style="margin-left:5px">Destination: <input type="text" name="additional[destination][]" style="width:200px;" /></span> <span style="margin-left:5px">Set as optional: <input type="hidden" value="no" name="additional[settoselect][]" /><input type="checkbox" id="additional[settoselect][]" name="additional[settoselect][]" value="yes" /></span> <a href="#" class="remove_field">Remove</a></div>'); //add input box } }); $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) }); </script> <div class="option_box"> <div class="top-heading"><h4>Edit Mail Provider: <?php echo fileToProviderName($EditProviderFile); ?></h4></div> <div class="option_contents"> <form method="post" action="" style="padding:15px;"> <h4>Provider Name</h4> <p>Enter the mail provider name to display at cPanel side:</p> <input type="text" name="providername" style="width:450px;margin-left:10px;" value="<?php echo $Pname; ?>" /> <hr> <h4>Provider Additional Information</h4> <p>Appears to users in the provider setting stage:</p> <textarea name="Pdescription" rows="4" style="width:450px;margin-left:10px;"><?php echo $Pdescription; ?></textarea> <hr> <h4>Provider MXs</h4> <p>Enter each MX record in a separate line using this structure, Exchange Address:Priority: e.g mxserver.yourproviderdomain.com:0</p> <textarea name="MXS" rows="8" style="width:450px;margin-left:10px;"><?php if(isset($saveResult['MXR'])) {echo $saveResult['MXR'];} else {foreach ($Pmxs as $mx=>$pri) {echo $mx.':'.$pri;}} ?></textarea> <hr> <h4>MX Backup</h4> <p>Add local backup MX record in the event that none of the mx servers are not available. (Leave this field blank to disable)</p> <input type="text" name="backupmx" style="width:30px;margin-left:10px; padding:5px;" value="<?php echo $Pbackupmx; ?>" /> <hr> <h4>Provider SPF</h4> <p>Adding SPF record to the domain zone will prevent outgoing emails to be considered as spam in most cases.</p> <input type="text" name="spfrecord" style="width:450px;margin-left:10px;" value="<?php echo $Pspf; ?>" /> <hr> <input type="hidden" name="Pstatus" value="<?php echo $Pstatus; ?>" /> <input type="hidden" name="Pconffile" value="<?php echo $EditProviderFile; ?>" /> <h4>Provider Additional Records</h4> <p>Additional records entries for completion of setting or use as an extra service.</p> <?php $i=0; foreach ($Pservices as $serv) { if ($serv[0] == "A") {$aSelected = 'selected="selected"';} else {$aSelected = '';} if ($serv[0] == "CNAME") {$cSelected = 'selected="selected"';} else {$cSelected = '';} if ($serv[0] == "TXT") {$tSelected = 'selected="selected"';} else {$tSelected = '';} if ($serv[3] == 1) {$sChecked = 'checked="checked"';} else {$sChecked = '';} echo '<div>Type:<select style="width:10px;margin-left:10px;" name="additional[type]['.$i.']"><option value="A" '.$aSelected.'>A</option><option value="CNAME" '.$cSelected.'>CNAME</option><option value="TXT" '.$tSelected.'>TXT</option></select></selsec> <span style="margin-left:5px">Record: <input type="text" name="additional[record]['.$i.']" style="width:200px;" value="'.$serv[1].'" /></span><span style="margin-left:5px"> Destination: <input type="text" name="additional[destination]['.$i.']" style="width:200px;" value="'.$serv[2].'" /></span> <span style="margin-left:5px">Set as optional: <input type="hidden" value="no" name="additional[settoselect]['.$i.']" /><input type="checkbox" id="additional[settoselect]['.$i.']" name="additional[settoselect]['.$i.']" value="yes" '.$sChecked.' /></span></div><br>'; $i++; } ?> <div class="input_fields_wrap"> <br><button class="add_field_button btn">Add More Fields</button><br> </div> <hr> <input type="submit" value="Save Changes" class="btn btn-primary" /> </form> </div> </div> <?php } ?>
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка