function account_exists($login)
{
global $cfg;
- global $_SESSION;
$query = sprintf("SELECT id FROM users WHERE lower(nickname) = lower('%s')",
pg_escape_string($login));
if ($sth === false)
return true;
- return pg_NumRows ($sth) > 0;
+ return pg_num_rows ($sth) > 0;
}
function is_valid_passwd ($nickname, $passwd)
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.';
if ($sth === false)
return 'Es ist ein Datenbankfehler aufgetreten.';
- if (pg_NumRows($sth) != 1)
+ if (pg_num_rows($sth) != 1)
return 'Der angegebene Aktivierungscode ist ungültig!';
db_query('BEGIN TRANSACTION');
function send_activation($email, $user, $code)
{
global $cfg;
- global $_SERVER;
$url = sprintf('%sactivate.html?code=%s', $cfg['home'], urlencode($code));
$subject = 'Aktivierung Account Zeitungsliste';
+ $header = array('Bcc: ' . $cfg['mailto']);
$body = sprintf('Willkommen %s!
', $user, $url);
- sendmail($email, '', $subject, $body);
+ sendmail($email, '', $subject, $body, $header);
return true;
}
function process_activate()
{
- global $_GET;
-
if (($try = account_activate($_GET['code'])) !== true) {
$ret = warning($try);
} else {
$ret = information('Ihr Account ist aktiviert.');
$ret .= '<h3>Willkommen!</h3><p class="info">'.
- 'Sie werden automatisch zur <a href="login.html">Login-Seite</a> weitergeleitet. '.
+ 'Sie werden automatisch zur <a href="login.html"><span style="color: red;">Login-Seite</span></a> weitergeleitet. '.
'Bitte melden Sie sich dort an.</p>';
$zlist['redirect'] = 'login.html';
}
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",
if ($sth === false)
return false;
- if (pg_NumRows($sth) == 0)
+ if (pg_num_rows($sth) == 0)
return false;
$row = pg_fetch_array($sth, 0);
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",
if ($sth === false)
return false;
- if (pg_NumRows($sth) == 0)
+ if (pg_num_rows($sth) == 0)
return false;
$row = pg_fetch_array($sth, 0);
if ($sth === false)
return 'Es ist ein Datenbankfehler aufgetreten.';
- if (pg_NumRows($sth) == 0)
+ if (pg_num_rows($sth) == 0)
return 'Der angegebene Username ist im System nicht bekannt.';
$row = pg_fetch_array($sth, 0);
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 " .
$sth = db_query($query);
- if ($sth === false || pg_NumRows($sth) == 0)
+ if ($sth === false || pg_num_rows($sth) == 0)
return false;
$ret = '<h3>Sie haben an folgenden Diskussionen teilgenommen</h3>';
$ret .= '<p><ul class="gold">';
- for ($i=0; $i < pg_NumRows($sth); $i++) {
+ for ($i=0; $i < pg_num_rows($sth); $i++) {
$row = pg_fetch_array($sth, $i);
$ret .= sprintf('<li><a href="%stopic/%d.html">%s</a></li>',
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']);
}
-
-?>