require_once path::file("classes") . "revision_class.php"; $revisions = new revision_history(); $rev = $rows[0]['cont_revision']; $new_rev = $revisions->get_next_revision($rev, (bool) vars::post('change_major', 'wikiedit')); $history = $revisions->get_revision_history($rows[0]['cont_ident']); $history = $revisions->add_revision_history($history, $new_rev, $store, trim(vars::post('change_desc', 'wikiedit'))); $revisions->store_revision_history($item, $history); // attempt the update $query = "UPDATE {$db_prefix}content SET\n cont_title = " . $db->quote(vars::post('page_title', 'wikiedit'), 'text') . ",\n cont_ident = " . $db->quote(vars::post('page_tag', 'wikiedit'), 'text') . ",\n cont_revision = " . $db->quote($new_rev, 'text') . ",\n cont_timestamp = " . $db->quote(time(), 'integer') . ",\n cont_content = " . $db->quote(trim(vars::post('page_content', 'wikiedit')), 'text') . ",\n cont_parent_id = " . $db->quote(trim(vars::post('parent_ident', 'wikiedit')), 'integer') . "\n WHERE cont_ident = " . $db->quote(vars::post('old_tag', 'wikiedit'), 'text'); $db->query($query); } else { $cont_id = $db->nextId('cont_id '); $query = "INSERT INTO {$db_prefix}content (cont_id, cont_ident, cont_timestamp, cont_content, cont_title, cont_parent_id) VALUES ({$cont_id}, " . $db->quote(vars::post('page_tag', 'wikiedit'), 'text') . ", " . $db->quote(time(), 'integer') . ", " . $db->quote(vars::post('page_content', 'wikiedit'), 'text') . ", " . $db->quote(vars::post('page_title', 'wikiedit'), 'text') . ", " . $db->quote(vars::post('parent_ident', 'wikiedit'), 'integer') . ")"; $db->query($query); } $tag = vars::post('page_tag', 'wikiedit'); $page = rewrite("?page={$tag}"); $cache->clear("wcontent_"); $cache->clear("content_pages_"); // header("Location: {$page}"); } $query = "SELECT cont_id, cont_ident, cont_title FROM {$db_prefix}content ORDER BY cont_ident"; $result = $db->query($query); $rows = $result->fetchAll(MDB2_FETCHMODE_ASSOC); $result->free(); foreach ($rows as $tag_item) { $pages[] = array('value' => $tag_item['cont_id'], 'title' => $tag_item['cont_ident']); if ($tag_item['cont_ident'] == "home_page") { $home_id = $tag_item['cont_id']; } }
die("Schema Update Error."); } $cache->set("schema_modified", filemtime("{$input_file}.xml")); } require_once path::file("classes") . "content_class.php"; $content = new content_handling(); require_once path::file("classes") . "page_handling_class.php"; $page_handler = new page_hander(); require_once path::file("classes") . "users_class.php"; // Initiate session handler class $session_options = array('db_object' => &$db); require_once path::file("classes") . "session_class.php"; $sessions =& new session_handler($session_options); if ($_POST['login']) { $user_password = md5(vars::post('userpass', 'login')); $user_name = preg_replace("#\\W#", "", vars::post('username', 'login')); $query = "SELECT * FROM {$db_prefix}users\n\t\t\t\tWHERE name = " . $db->quote($user_name, 'text') . "\n\t\t\t\tAND user_password = "******"Location: {$_SERVER['PHP_SELF']}" . ($_SERVER['QUERY_STRING'] ? "?{$_SERVER['QUERY_STRING']}" : "")); exit; }