File: C:/xampp/htdocs/wordpress0612/wp-content/pluginsBK/myeasybackup/meb_settings.php
<?php
/**
* Plugin Settings
*
* @package myEASYbackup
* @author Ugo Grandolini
* @since 0.0.5
* @version 0.0.9
*
*/
if(defined('mebak_DEBUG') && mebak_DEBUG==true)
{
require_once(MEBAK_PATH . 'inc/myDEBUG.php');
}
switch($_POST['btn'])
{
#----------------
case SAVE_BTN:
#----------------
#
# save the posted value in the database
#
if(isset($_POST['meb_isPRODUCTION']))
{
update_option( 'meb_isPRODUCTION', 1 );
}
else
{
update_option( 'meb_isPRODUCTION', 0 );
}
if(isset($_POST['meb_isDEBUG']))
{
update_option( 'meb_isDEBUG', 1 );
}
else
{
update_option( 'meb_isDEBUG', 0 );
}
if(isset($_POST['meb_compression']))
{
update_option( 'meb_compression', $_POST['meb_compression'] );
}
else
{
update_option( 'meb_compression', 6 );
}
if(isset($_POST['meb_ftp_server']))
{
update_option( 'meb_ftp_server', $_POST['meb_ftp_server'] );
}
if(isset($_POST['meb_ftp_user_name']))
{
update_option( 'meb_ftp_user_name', $_POST['meb_ftp_user_name'] );
}
//if(isset($_POST['meb_ftp_user_pass']))
//{
// update_option( 'meb_ftp_user_pass', $_POST['meb_ftp_user_pass'] );
//}
if(isset($_POST['meb_force_phpcode']))
{
update_option( 'meb_force_phpcode', 1 );
}
else
{
update_option( 'meb_force_phpcode', 0 );
}
?><div class="updated">
<p><strong><?php _e('Options saved!', MEBAK_LOCALE ); ?></strong></p>
<p><?php _e('This page will be reloaded in a while...', MEBAK_LOCALE ); ?></p>
</div>
<script type="text/javascript">setTimeout("window.location='?page=myEASYbackup_options';", 1500);</script><?php
break;
#
default:
}
#
# populate the input fields when the page is loaded
#
if(!isset($_POST['meb_isPRODUCTION'])) { $_POST['meb_isPRODUCTION'] = get_option('meb_isPRODUCTION'); }
if(!isset($_POST['meb_isDEBUG'])) { $_POST['meb_isDEBUG'] = get_option('meb_isDEBUG'); }
if(!isset($_POST['meb_compression'])) { $_POST['meb_compression'] = get_option('meb_compression'); }
if(!isset($_POST['meb_ftp_server'])) { $_POST['meb_ftp_server'] = get_option('meb_ftp_server'); }
if(!isset($_POST['meb_ftp_user_name'])) { $_POST['meb_ftp_user_name'] = get_option('meb_ftp_user_name'); }
//if(!isset($_POST['meb_ftp_user_pass'])) { $_POST['meb_ftp_user_pass'] = get_option('meb_ftp_user_pass'); }
#
# 0.0.9: BEG
#-------------
# if(!isset($_POST['meb_force_phpcode'])) { $_POST['meb_force_phpcode'] = get_option('meb_force_phpcode'); }
$tmp = get_option( 'meb_force_phpcode' );
if($tmp=='') { $tmp = true; } # 0.0.9
if(!isset($_POST['meb_force_phpcode'])) { $_POST['meb_force_phpcode'] = $tmp; }
#-------------
# 0.0.9: END
#
?>
<form name="meb_settings" method="post" action="">
<table cellpadding="4" cellspacing="8">
<tr>
<td nowrap><?php
#
# debug toggler
#
_e('Check this to show debug code:', MEBAK_LOCALE );
?></td>
<td valign="bottom"><?php
$checked ='';
if($_POST['meb_isDEBUG']==1) { $checked = ' checked="checked"'; }
?><input type="checkbox" name="meb_isDEBUG" value="1"<?php echo $checked; ?> />
</td>
</tr>
<tr>
<td nowrap><?php
#
# production server toggler
#
_e('Check if this is a production server:', MEBAK_LOCALE );
?></td>
<td valign="bottom"><?php
$checked ='';
if($_POST['meb_isPRODUCTION']==1) { $checked = ' checked="checked"'; }
?><input type="checkbox" name="meb_isPRODUCTION" value="1"<?php echo $checked; ?> />
</td>
</tr>
<?php
if(isSYSTEM==true)
{
?><tr>
<td nowrap valign="top"><?php
#
# compression for the zip file, used only on system() enabled servers
#
_e('Data set compression level:', MEBAK_LOCALE );
?></td>
<td valign="bottom"><?php
$checked_1 ='';
$checked_2 ='';
$checked_3 ='';
$checked_4 ='';
$checked_5 ='';
$checked_6 ='';
$checked_7 ='';
$checked_8 ='';
$checked_9 ='';
switch($_POST['meb_compression'])
{
case 1: $checked_1 = ' checked="checked"'; break;
case 2: $checked_2 = ' checked="checked"'; break;
case 3: $checked_3 = ' checked="checked"'; break;
case 4: $checked_4 = ' checked="checked"'; break;
case 5: $checked_5 = ' checked="checked"'; break;
case 7: $checked_7 = ' checked="checked"'; break;
case 8: $checked_8 = ' checked="checked"'; break;
case 9: $checked_9 = ' checked="checked"'; break;
#
default:
$checked_6 = ' checked="checked"';
}
?><input type="radio" name="meb_compression" id="comp1" value="1"<?php echo $checked_1; ?> />
<label for="comp1"> 1 <?php _e('Minimal compression, faster execution speed', MEBAK_LOCALE ); ?> </label>
<br /><input type="radio" name="meb_compression" id="comp2" value="2"<?php echo $checked_2; ?> />
<label for="comp2"> 2 </label>
<br /><input type="radio" name="meb_compression" id="comp3" value="3"<?php echo $checked_3; ?> />
<label for="comp3"> 3 </label>
<br /><input type="radio" name="meb_compression" id="comp4" value="4"<?php echo $checked_4; ?> />
<label for="comp4"> 4 </label>
<br /><input type="radio" name="meb_compression" id="comp5" value="5"<?php echo $checked_5; ?> />
<label for="comp5"> 5 </label>
<br /><input type="radio" name="meb_compression" id="comp6" value="6"<?php echo $checked_6; ?> />
<label for="comp6"> 6 <?php _e('Default compression', MEBAK_LOCALE ); ?> </label>
<br /><input type="radio" name="meb_compression" id="comp7" value="7"<?php echo $checked_7; ?> />
<label for="comp7"> 7 </label>
<br /><input type="radio" name="meb_compression" id="comp8" value="8"<?php echo $checked_8; ?> />
<label for="comp8"> 8 </label>
<br /><input type="radio" name="meb_compression" id="comp9" value="9"<?php echo $checked_9; ?> />
<label for="comp9"> 9 <?php _e('Maximum compression, slower execution speed', MEBAK_LOCALE ); ?> </label>
</td>
</tr><?php
}
?>
<tr>
<td nowrap colspan="99"><?php
#
# FTP server
#
_e('Settings about the FTP server where to send the data set', MEBAK_LOCALE );
echo '<br /><i>'
. __('Note: for security reasons the password is not saved in the options database', MEBAK_LOCALE )
.'</i>';
?></td>
</tr>
<tr>
<td nowrap><?php
#
# FTP server
#
_e('FTP server name:', MEBAK_LOCALE );
?></td>
<td>
<input type="text" name="meb_ftp_server" value="<?php echo $_POST['meb_ftp_server']; ?>" size="40" maxlength="128" />
</td>
</tr>
<tr>
<td nowrap><?php
#
# FTP user
#
_e('FTP user name:', MEBAK_LOCALE );
?></td>
<td>
<input type="text" name="meb_ftp_user_name" value="<?php echo $_POST['meb_ftp_user_name']; ?>" size="40" maxlength="128" />
</td>
</tr>
<?php
/*
<tr>
<td nowrap><?php
#
# FTP password
#
_e('FTP password:', MEBAK_LOCALE );
?></td>
<td>
<input type="password" name="meb_ftp_user_pass" value="<?php echo $_POST['meb_ftp_user_pass']; ?>" size="40" maxlength="128" />
</td>
</tr>
*/
?>
<tr>
<td nowrap><?php
#
# Use PHP code rather than system() commands
#
_e('Use PHP code rather than system() commands:', MEBAK_LOCALE );
?></td>
<td><?php
$checked ='';
if($_POST['meb_force_phpcode']==1) { $checked = ' checked="checked"'; }
?><input type="checkbox" name="meb_force_phpcode" value="1"<?php echo $checked; ?> />
</td>
</tr>
</table>
<hr class="line" />
<div align="right">
<input class="button-primary" type="submit" name="btn" value="<?php echo SAVE_BTN; ?>" />
</div>
</form>