$ret .= admin_hitlist();
return $ret;
}
-
-?>
\ No newline at end of file
function dumpinfo()
{
- global $_SERVER;
- global $_POST;
- global $_GET;
$info = "\$_SERVER = " . var_export($_SERVER, true);
$info .= "\n\$_POST = " . var_export($_POST, true);
function ajax_process()
{
global $functions;
- global $_POST;
dumpinfo();
return false;
}
-
-?>
\ No newline at end of file
// Precondition: $body is already sanitised
function article_add($topic, $body)
{
- global $_SESSION;
- global $_SERVER;
-
$query = sprintf("INSERT INTO article (topic,uid,status,body,created,remote_addr) ".
"VALUES (%d,%d,%d,'%s',now(),'%s')",
$topic, $_SESSION['uid'], 1, pg_escape_string($body),
{
global $cfg;
global $zlist;
- global $_POST;
- global $_GET;
if (isset($_GET['zeitung']) && is_numeric($_GET['zeitung']))
$zid = $_GET['zeitung'];
{
global $cfg;
global $zlist;
- global $_GET;
- global $_POST;
if (isset($_GET['topic']) && is_numeric($_GET['topic']))
$topic = $_GET['topic'];
return $ret;
}
-
-?>
\ No newline at end of file
function format_bookmarks()
{
- global $_SESSION;
-
if (!isset($_SESSION['uid']))
return;
function bookmarks_manage()
{
- global $_SESSION;
-
if (!isset($_SESSION['uid']))
return notfound();
function process_bookmark()
{
- global $_SESSION;
- global $_SERVER;
- global $_GET;
global $zlist;
global $cfg;
function ajax_bookmark_check()
{
- global $_POST;
- global $_SESSION;
-
if (!isset($_POST['zeitung']) || !is_numeric($_POST['zeitung']) ||
!isset($_SESSION['uid']))
return false;
function ajax_bookmark_up()
{
- global $_POST;
- global $_SESSION;
-
if (!ajax_bookmark_check())
return false;
function ajax_bookmark_down()
{
- global $_POST;
- global $_SESSION;
-
if (!ajax_bookmark_check())
return false;
function ajax_bookmark_del()
{
- global $_POST;
- global $_SESSION;
-
if (!ajax_bookmark_check())
return false;
function ajax_bookmark_add()
{
- global $_POST;
- global $_SESSION;
-
if (!ajax_bookmark_check())
return false;
return format_info_bookmarks();
}
-
-
-?>
\ No newline at end of file
function basepath()
{
global $cfg;
- global $_SERVER;
$pos = strpos(strtolower($cfg['home']), strtolower($_SERVER['SERVER_NAME']));
$base = substr($cfg['home'], $pos+strlen($_SERVER['SERVER_NAME']));
function logged_in()
{
- global $_SESSION;
-
return isset($_SESSION['uid']);
}
function javascript_ok()
{
- global $_SESSION;
-
if (!logged_in())
return true;
function is_spider()
{
- global $_SERVER;
- global $_SESSION;
-
if (isset($_SESSION['uid']))
if (isset($_SESSION['robot']))
return $_SESSION['robot'];
function is_admin()
{
- global $_SESSION;
+ if (is_null($_SESSION)) return false;
if (!array_key_exists('nickname', $_SESSION))
return false;
function format_info_bookmarks()
{
- global $_SESSION;
global $cfg;
if (!isset($_SESSION['uid']))
return $ret;
}
-
-?>
function userstatus()
{
- global $_SESSION;
-
if (isset($_SESSION['uid']))
$info = array($_SESSION['online'], $_SESSION['users'], $_SESSION['zeitungen'],
$_SESSION['ztags'], $_SESSION['tags']);
function dispatch()
{
global $cfg;
- global $_SERVER;
- global $_SESSION;
- global $_GET;
- global $_POST;
global $zlist;
global $pages;
global $dirs;
function tag_class($count)
{
- global $_SESSION;
-
if (isset($_SESSION['uid'])) {
if (!isset($_SESSION['tagcloud_lastupdate']) ||
$_SESSION["tagcloud_lastupdate"] < time() - 60*60*12) {
{
global $cfg;
global $zlist;
- global $_SERVER;
$query = sprintf("SELECT topic,archived,zeitung FROM topics WHERE id = %d",
$topic);
function ajax_check_url()
{
- global $POST;
-
if (!empty($_POST['url']) && is_valid_url($_POST['url']))
return true;
function logbook($table,$refid,$column,$old,$new)
{
- global $_SESSION;
-
$query = sprintf("INSERT INTO logbook (uid,tab,refid,col,oldval,newval,modified) " .
"VALUES (%d,'%s',%d,'%s','%s','%s',now())",
$_SESSION['uid'], $table,$refid,$column,
function hits_inc($zeitung)
{
global $cfg;
- global $_SESSION;
if (is_spider())
return;
db_query($query);
}
-
-?>
function info_hitlist()
{
global $cfg;
- global $_SESSION;
if (!isset($_SESSION['uid']))
return info_topten();
{
global $cfg;
global $zlist;
- global $_SESSION;
if (!isset($zlist['zid']))
return;
{
global $cfg;
global $zlist;
- global $_SESSION;
$title = array('edit' => 'Stammdaten dieser Zeitung bearbeiten',
'tags' => 'Persönliche Tags zur Zeitung hinzufügen oder löschen',
function info_bookmarks()
{
global $cfg;
- global $_SESSION;
if (!isset($_SESSION['uid']))
return;
return $ret;
}
-
-
-?>
\ No newline at end of file
{
global $cfg;
global $zlist;
- global $_POST;
- global $_SERVER;
$ret .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
$ret .= '<html lang="de">';
*/
function layout_sitemap()
{
- global $_SESSION;
- global $_SERVER;
global $cfg;
if (!is_spider())
function layout_showpaper($archived=false)
{
- global $_GET;
global $zlist;
if (!isset($_GET['zeitung']) || !is_numeric($_GET['zeitung']))
function layout_archive()
{
global $zlist;
- global $_GET;
global $cfg;
if (!isset($_GET['archiv']) || !is_numeric($_GET['archiv']))
{
global $cfg;
global $zlist;
- global $_GET;
if (!isset($_GET['tag']))
$ret = warning('Keine derartiges Merkmal gefunden.');
function layout_topic()
{
global $zlist;
- global $_GET;
if (!isset($_GET['topic']) || !is_numeric($_GET['topic']))
$ret = warning('Keine passende Diskussion gefunden.');
function contact_send($topic, $email, $body)
{
global $cfg;
- global $_SESSION;
- global $_SERVER;
$header = array();
if (!empty($email)) {
function process_contact()
{
- global $_SERVER;
- global $_POST;
-
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (empty($_POST['topic']))
$ret = warning('Sie haben keinen Titel für die Nachricht angegeben!');
return load_javascript('contact.js') . load_template('contact.html', $replace);
}
-
-?>
\ No newline at end of file
function account_exists($login)
{
global $cfg;
- global $_SESSION;
$query = sprintf("SELECT id FROM users WHERE lower(nickname) = lower('%s')",
pg_escape_string($login));
function check_account_data()
{
- global $_POST;
global $zlist;
$zlist['replace'] = array('nickname' => $_POST['nickname'],
function check_passwd()
{
- global $_POST;
-
if (!strlen($_POST['passwd']) || !strlen($_POST['pwcopy']))
return 'Sie müssen alle Pflichtfelder ausfüllen! Siehe Beschreibung unten.';
function send_activation($email, $user, $code)
{
global $cfg;
- global $_SERVER;
$url = sprintf('%sactivate.html?code=%s', $cfg['home'], urlencode($code));
$subject = 'Aktivierung Account Zeitungsliste';
function process_activate()
{
- global $_GET;
-
if (($try = account_activate($_GET['code'])) !== true) {
$ret = warning($try);
} else {
function process_account_new()
{
global $cfg;
- global $_POST;
if (($try = check_account_data()) !== true)
return $try;
function update_account()
{
- global $_POST;
- global $_SESSION;
global $zlist;
$query = sprintf("UPDATE users SET nickname='%s',realname='%s',email='%s',url='%s' ".
function update_passwd()
{
- global $_POST;
- global $_SESSION;
-
$hash = passwd($_SESSION['nickname'], $_POST['passwd']);
$query = sprintf("UPDATE users SET passwd='%s' WHERE id = %d",
function login_user($nickname, $passwd)
{
global $cfg;
- global $_SERVER;
- global $_POST;
- global $_SESSION;
$query = sprintf("SELECT id,nickname,realname,email,url,passwd FROM users " .
"WHERE lower(nickname) = lower('%s') AND status = 1",
function process_login_request()
{
- global $_POST;
-
if (isset($_POST['new'])) {
$try = process_account_new();
if ($try === true)
function last_activity()
{
global $cfg;
- global $_SESSION;
$query = sprintf("SELECT DISTINCT topics.id,topics.topic FROM article " .
"JOIN topics ON article.topic=topics.id " .
function process_login()
{
- global $_GET;
- global $_SERVER;
- global $_SESSION;
-
if (isset($_GET['from'])) {
if ($_GET['from'] == 'article')
$ret .= warning('Um an einer Diskussion teilzunehmen, müssen Sie angemeldet sein.');
function process_passwd()
{
- global $_SESSION;
- global $_SERVER;
global $zlist;
global $cfg;
function process_options()
{
- global $_SESSION;
- global $_SERVER;
- global $_POST;
global $zlist;
global $cfg;
function ajax_passwd_check()
{
- global $_POST;
-
return checkpass($_POST['nickname'], $_POST['passwd']);
}
function ajax_nickname_check()
{
- global $_POST;
-
return account_exists($_POST['nickname']);
}
-
-?>
-<?
+<?php
function ajax_check_email()
{
- global $POST;
-
include_once('extern/rfc822.php');
if (!empty($_POST['email']) && is_valid_email_address($_POST['email']))
return false;
}
-
-?>
\ No newline at end of file
function process_search()
{
- global $_POST;
global $zlist;
if (!strlen($_POST['keyword']))
function ajax_search_check()
{
- global $_POST;
-
$keyword = $_POST['keyword'];
$query = sprintf("SELECT count(*) FROM zeitungen WHERE deleted IS false AND " .
return false;
}
-
-?>
\ No newline at end of file
function session_invalidate($dest='')
{
global $cfg;
- global $_SESSION;
db_query(sprintf('DELETE FROM online WHERE uid = %d', $_SESSION['uid']));
function session_update()
{
global $cfg;
- global $_SESSION;
$info = userstatus_info();
function session_init()
{
global $cfg;
- global $_COOKIE;
- global $_SERVER;
- global $_SESSION;
if (isset($_COOKIE[$cfg['session']])) {
session_name($cfg["session"]);
}
}
}
-
-?>
\ No newline at end of file
function format_tags($zid)
{
global $cfg;
- global $_SESSION;
$query = 'SELECT id,tagname FROM tags ORDER BY lower(tagname)';
if (($sth = db_query($query)) === false) return;
{
global $cfg;
global $zlist;
- global $_SESSION;
- global $_GET;
- global $_POST;
if (isset($_GET['zeitung']) && is_numeric($_GET['zeitung']))
$zid = $_GET['zeitung'];
function ajax_tag_check()
{
- global $_POST;
- global $_SESSION;
-
if (!isset($_POST['zeitung']) || !is_numeric($_POST['zeitung']) ||
!isset($_POST['tag']) || !is_numeric($_POST['tag']) ||
!isset($_SESSION['uid']))
function ajax_tag_add()
{
- global $_POST;
- global $_SESSION;
-
if (!ajax_tag_check())
return false;
function ajax_tag_del()
{
- global $_POST;
- global $_SESSION;
-
if (!ajax_tag_check())
return false;
function ajax_tag_new()
{
- global $_POST;
- global $_SESSION;
-
if (!isset($_POST['zeitung']) || !is_numeric($_POST['zeitung']) ||
!isset($_POST['tag']) ||
!isset($_SESSION['uid']))
function ajax_tag_exists()
{
- global $_POST;
-
if (!isset($_POST['tag']))
return true; // eigentlich false, aber da true=exists einen Fehler liefert...
return true;
}
-
-?>
\ No newline at end of file
function zeitung_check_data()
{
- global $_POST;
-
if (empty($_POST['name']) ||
empty($_POST['city']) ||
empty($_POST['url']) ||
function zeitung_reportnew($id)
{
- global $_SESSION;
- global $_SERVER;
- global $_POST;
global $cfg;
$url = sprintf('%szeitung/%d.html', $cfg['home'], $id);
function zeitung_update($zid)
{
- global $_POST;
-
$query = sprintf("UPDATE zeitungen SET name='%s',city='%s',url='%s',description='%s' " .
'WHERE id = %d',
pg_escape_string(htmlspecialchars(trim($_POST['name']))),
function zeitung_insert()
{
- global $_POST;
-
// Bei Problemen das Feld 'deleted' wieder rausnehmen und manuell approven
$query = sprintf("INSERT INTO zeitungen (name,city,url,description,deleted,changed) " .
"VALUES ('%s','%s','%s','%s',false,now())",
function process_edit()
{
- global $_SESSION;
- global $_SERVER;
- global $_POST;
- global $_GET;
global $zlist;
if (isset($_GET['zeitung']) && is_numeric($_GET['zeitung']))
function process_new()
{
- global $_SESSION;
- global $_SERVER;
- global $_POST;
- global $_GET;
global $zlist;
$ok = false;
function ajax_zeitung_check_url()
{
- global $_POST;
-
if (empty($_POST['url'])) return false;
return zeitung_check_url($_POST['url']);
}
-
-?>
\ No newline at end of file