/admin/settings.php
PHP | 1 lines | 1 code | 0 blank | 0 comment | 17 complexity | d2ccb0400dc88737e89311c42ee3c4ae MD5 | raw file
- <?php require('../data/dbcon.php'); ?>
<?php require('../data/functions.php'); ?>
<?php
session_start();
$showerror = null;
$UserChk = checkUser($_COOKIE['winnguestbook_u'], $_COOKIE['winnguestbook_auth']);
if( $UserChk == FALSE ) {
header("location: index.php");
}
?>
<?php
if(isset($_GET['air'])) {
if($_GET['air'] == 'off') {
activateAir($_COOKIE['winnguestbook_u'], $_COOKIE['winnguestbook_auth'],false);
header("location: settings.php");
}else{
activateAir($_COOKIE['winnguestbook_u'], $_COOKIE['winnguestbook_auth'],true);
header("location: settings.php");
}
}
if( isset($_POST['save']) ) {
if( empty($_POST['cpass']) ) {
$error = "12";
}
if( empty($_POST['newpass']) ) {
$error = "12";
}
if( empty($_POST['newpass2']) ) {
$error = "12";
}
if( $_POST['newpass'] != $_POST['newpass2'] ) {
$error = "12";
}
if( empty($error) ) {
$change = passwordUpdate($_COOKIE['winnguestbook_u'], $_COOKIE['winnguestbook_auth'], $_POST['newpass'], $_POST['cpass']);
if( $change == TRUE ) {
setcookie('winnguestbook_auth', md5($_POST['newpass']), time()+3600);
header("location: settings.php?saved=true");
}else{
header("location: settings.php?error=1");
}
}else{
$showerror = "<p class=\"red\">Sorry we could not update this record, try again.</p>";
}
}
if(isset($_GET['saved'])) {
if ($_GET['saved'] == true) {
$showerror = "<p style=\"text-align:center;\" class=\"highlight\">Settings saved.</p>";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">@import url('css/admin.css'); </style>
<link rel="stylesheet" href="../css/ui-lightness/jquery-ui-1.7.2.custom.css"/>
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="js/Winnjs.js"></script>
<title>Winn Guestbook <?php echo $version; ?></title>
</head>
<body>
<div id="adminheader">
<?php include('inc/sitename.php'); ?>
<ul id="dash">
<?php include('inc/header.php'); ?>
<div class="content" id="settingspage">
<?php echo $showerror; ?>
<h3>Change your password</h3>
<table>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<tr>
<td style="width:230px; text-align:right;">Current Password:</td>
<td><input type="password" name="cpass" /></td>
</tr>
<tr>
<td style="width:230px; text-align:right;">New Password:</td>
<td><input type="password" onblur="WinnJS.CheckPasswordSt(this.value);" id="newpassword" name="newpass" /></td>
</tr>
<tr>
<td style="width:230px; text-align:right;">Password Strength:</td>
<td style="width:230px;"><div id="showin"></div></td>
</tr>
<tr>
<td style="width:230px; text-align:right;">Retype Password:</td>
<td><input type="password" name="newpass2" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Save »" name="save" /></td>
</tr>
</form>
</table>
<h3>Approved Posters</h3>
<p>The approved posters list will allow select users to post on your guestbook with out approval. You may add and delete from this menu below.</p>
<table>
<tr>
<td>Approved email:</td>
<td><input type="text" name="approvedEmail" id="approvedEmail" /></td>
<td><input type="button" value="Save" id="approvedEmailSave" onclick="WinnJS.AddapprovedEmail($('#approvedEmail').val());" /></td>
</tr>
</table>
<p style="display:none;" id="savingStatus"><span class="highlight">Saving...</span></p>
<script type="text/javascript">
$(document).ready(function(){
$("#approved_list_loader").load('inc/approvedPosters.php');
});
</script>
<div id="approved_list_loader">
<p>loading...</p>
</div>
<?php if(DELETE_SPAM == true) { ?>
<h3>Akismet API Key Check</h3>
<p><a href="javascript://" onclick="WinnJS.APIKeyCheck()">Check my key now!</a></p>
<?php } ?>
<h3>Disapproved Posters (by domain)</h3>
<p>If you add a domain to this list a user with an email address from it will no longer be able to post. (If you add "google.com" then any user from that domain can not post on the Guestbook: user@google.com will be blocked.)</p>
<div class="ui-widget" id="disapproveddomains">
<div style="padding: 0pt 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span>
<strong>WARNING: </strong> Only put domains in this list that you want to block.</p>
</div>
</div>
<table>
<tr>
<td>Disapproved domain:</td>
<td><input type="text" name="disapprovedEmail" id="disapprovedEmail" /></td>
<td><input type="button" value="Save" id="disapprovedEmailSave" onclick="WinnJS.AdddisapprovedEmail($('#disapprovedEmail').val());" /></td>
</tr>
</table>
<script type="text/javascript">
$(document).ready(function(){
$("#disapproved_list_loader").load('inc/disapprovedPosters.php');
});
</script>
<div id="disapproved_list_loader">
<p>loading...</p>
</div>
<h3>Site Information</h3>
<p>To edit the information below click the "<em>edit</em>" next to the title of the page above the navigation.</p>
<ul>
<li><strong>Guestbook Version:</strong> <?php echo LONG_VERSION;?></li>
<li><strong>Site Name:</strong> <?php echo SiteName();?></li>
<li><strong>Site Address:</strong> <?php echo SiteAddress();?></li>
</ul>
<h3>Support</h3>
<p>Have questions or need support for this product? Below are some helpful links to use.</p>
<ul>
<li><strong>Support Wiki:</strong> <a href="http://code.google.com/p/winn-guestbook/w/list">http://code.google.com/p/winn-guestbook/w/list</a></li>
<li><strong>Support Issues:</strong> <a href="http://code.google.com/p/winn-guestbook/issues/list">http://code.google.com/p/winn-guestbook/issues/list</a></li>
<li><strong>Developers Website:</strong> <a href="http://winn.ws">http://winn.ws</a></li>
</ul>
</div>
<?php include('inc/footer.php');?>
</body>
</html>