Location: PHPKode > projects > Wiki Web Help > wwh/handlers/editable.php
<?php
require_once("../config.php");

$page = $_POST['id'];
if(!is_numeric($page)) exit;

$admin = $_POST['admin'];
$loggedon = $_POST['loggedon'];

$sql = "SELECT locked FROM node WHERE node_id=$page";
$result = mysql_query($sql,$con) or die("Database Error - Unable to retrive locked status. ".mysql_error());
$locked = mysql_result($result, 0, 'locked');

$ip=$_SERVER['REMOTE_ADDR'];

$sql = "SELECT ip_address FROM blocked WHERE ip_address='$ip'";
$result = mysql_query($sql,$con) or die("Database Error - Unable to retrive blocked status.");
$blocked = mysql_numrows($result) > 0;

$registered = ($CFG_REGISTERED_ONLY && $loggedon) || !$CFG_REGISTERED_ONLY;

$edit = ($locked == 0 && !$blocked && $registered) || $admin=='true';

echo $edit;

?>
Return current item: Wiki Web Help