From 653f4966baed686e152b8a129e7c6100c9bd05e4 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 27 Oct 2007 19:44:11 +0000 Subject: Remove remsaint-subscription.php login.php logout.php remsaint.php.orig remsaint.php --- web/login.php | 56 ------------------- web/logout.php | 25 --------- web/remsaint-subscription.php | 126 ------------------------------------------ web/remsaint.php | 7 --- web/remsaint.php.orig | 76 ------------------------- 5 files changed, 290 deletions(-) delete mode 100644 web/login.php delete mode 100644 web/logout.php delete mode 100644 web/remsaint-subscription.php delete mode 100644 web/remsaint.php delete mode 100644 web/remsaint.php.orig (limited to 'web') diff --git a/web/login.php b/web/login.php deleted file mode 100644 index 691e26e..0000000 --- a/web/login.php +++ /dev/null @@ -1,56 +0,0 @@ - 1, - have_session => 1, - have_user => 1 ) -) or - die("Nobody loves me. I don't even have space for a name."); - -$rules = Array(); -$rules['auth']['password'] = array(type => 'string'); -$rules['auth']['username'] = array(type => 'string'); -$rules['auth']['goto'] = array(type => 'string', optional => 1); -$rules['login']['goto'] = array(type => 'string', optional => 1); -$rules['login']['username'] = array(type => 'string', optional => 1); -$rules['login']['message'] = array(type => 'string', optional => 1); -$arguments = param_check($GLOBALS, $rules, array(params_required=>false)); - -$message = $arguments['message']; -$logged_in = 0; - -if ( $arguments['form_id']=='auth' ) { - $namespace->session->set_id(); - $result = $namespace->user->do_login( $arguments['username'], $arguments['password']); - if ($result) - $logged_in = 1; - else - $message = 'Invalid username/password pair.'; -} - -if (! $logged_in ) { - $data = array(); - $data['goto'] = $arguments['goto']; - $data['message'] = $message; - $data['username'] = $namespace->session->data['user']['username']; - $data['username_field'] = $arguments['username']; - - $template = new Template('login.html', $namespace->config->template_path); - $template->parse($data); - print $template->output(); -} else { - if ($arguments['goto']) - redirect($namespace, $arguments['goto']); - else - redirect($namespace, './'); -} - -$namespace->stop(); - - -# vim:set ts=4: -# vim:set shiftwidth=4: -?> diff --git a/web/logout.php b/web/logout.php deleted file mode 100644 index 8069a39..0000000 --- a/web/logout.php +++ /dev/null @@ -1,25 +0,0 @@ - 1, - have_session => 1, - have_user => 1 ) -) or - die("Nobody loves me. I don't even have space for a name."); - -$namespace->user->do_logout(); - -$data = array(); - -$template = new Template('logout.html', $namespace->config->template_path); -$template->parse($data); -print $template->output(); - -$namespace->stop(); - -# vim:set ts=4: -# vim:set shiftwidth=4: -?> diff --git a/web/remsaint-subscription.php b/web/remsaint-subscription.php deleted file mode 100644 index 0c7bfb5..0000000 --- a/web/remsaint-subscription.php +++ /dev/null @@ -1,126 +0,0 @@ - - */ - -/** - * RemSaint - * - * @author Peter Palfrader/3node - * @version $Id$ - */ - -require_once("../include/Namespace.inc"); -require_once("../include/Tools.inc"); -require_once("../include/Template.inc"); - -$namespace = new Namespace( - array( have_database => 1, - have_session => 1, - have_user => 1 ) -) or - die("Nobody loves me. I don't even have space for a name."); - -$message = ''; -$username = ''; - -if (! $namespace->user->check_login()) { - $message = 'Not logged in. Nothing done.'; -} else { - $username = $namespace->session->data['user']['username']; - $rules = Array(); - $rules['subscription']['ref'] = array(type => 'anything'); - $refs = param_check($GLOBALS, $rules); - - $rules = Array(); - foreach ($refs['ref'] as $ref) { - if (! is_int($ref + 0) ) { - $message = 'Wrong refs'; - break; - } else { - $rules['subscription']['warning_'.$ref] = array(type => 'boolean'); - $rules['subscription']['critical_'.$ref] = array(type => 'boolean'); - $rules['subscription']['recovery_'.$ref] = array(type => 'boolean'); - }; - }; - if ($message == '') { - $arguments = param_check($GLOBALS, $rules); - $user_ref = $namespace->session->data['user']['ref']; - - foreach ($refs['ref'] as $ref) { - if ($arguments['warning_'.$ref] || - $arguments['critical_'.$ref] || - $arguments['recovery_'.$ref]) - $user_subs[$ref] = array ( - notify_warning => $arguments['warning_'.$ref], - notify_critical => $arguments['critical_'.$ref], - notify_recovery => $arguments['recovery_'.$ref], - ); - } - $db_subs = $namespace->database->query_all("SELECT remailer.nick, subscription.ref, subscription.remailer_ref, subscription.notify_warning, subscription.notify_critical, subscription.notify_recovery FROM remailer JOIN subscription ON remailer.ref=subscription.remailer_ref WHERE subscription.account_ref=?", array($user_ref)); - foreach ($db_subs as $sub) { - if (isset ($user_subs[$sub['remailer_ref']])) { - $user_sub = $user_subs[$sub['remailer_ref']]; - $sub['notify_warning'] = $sub['notify_warning'] == 't' ? 1 : false; - $sub['notify_critical'] = $sub['notify_critical'] == 't' ? 1 : false; - $sub['notify_recovery'] = $sub['notify_recovery'] == 't' ? 1 : false; - if (($sub['notify_warning'] == $user_sub['notify_warning']) && - ($sub['notify_critical'] == $user_sub['notify_critical']) && - ($sub['notify_recovery'] == $user_sub['notify_recovery'])) { - $message .= 'Not changing subscription to remailer '.$sub['nick'].".
\n"; - } else { - $user = ($user_sub['notify_warning'] ? 'W' : '_') . - ($user_sub['notify_critical'] ? 'C' : '_') . - ($user_sub['notify_recovery'] ? 'R' : '_'); - $db = ($sub['notify_warning'] ? 'W' : '_') . - ($sub['notify_critical'] ? 'C' : '_') . - ($sub['notify_recovery'] ? 'R' : '_'); - $message .= 'Changing subscription to remailer '.$sub['nick']." from $db to $user: "; - $s = array(); - $s['notify_warning'] = $user_sub['notify_warning'] ? 'T' : 'F'; - $s['notify_critical'] = $user_sub['notify_critical'] ? 'T' : 'F'; - $s['notify_recovery'] = $user_sub['notify_recovery'] ? 'T' : 'F'; - $res = $namespace->database->update('subscription', $sub['ref'], $s); - $message .= ($res ? 'OK' : 'FAILED')."
\n"; - } - } else { - $message .= 'Deleting subscription to remailer '.$sub['nick'].': '; - $res = $namespace->database->delete_row('subscription', $sub['ref']); - $message .= ($res ? 'OK' : 'FAILED')."
\n"; - }; - unset($user_subs[$sub['remailer_ref']]); - } - foreach ($user_subs as $ref => $sub) { - $rem = $namespace->database->query_row("SELECT remailer.nick FROM remailer WHERE ref=?", array($ref)); - if ($rem) { - $s = array(); - $s['remailer_ref'] = $ref; - $s['account_ref'] = $user_ref; - $s['notify_warning'] = $sub['notify_warning'] ? 'T' : 'F'; - $s['notify_critical'] = $sub['notify_critical'] ? 'T' : 'F'; - $s['notify_recovery'] = $sub['notify_recovery'] ? 'T' : 'F'; - $message .= 'Adding subscription to remailer '.$rem['nick'].': '; - $res = $namespace->database->insert('subscription', $s); - $message .= ($res ? 'OK' : 'FAILED')."
\n"; - } else { - $message .= 'Remailer '.$rem."does not exist.
\n"; - } - } - $message .= 'done.
'; - } -} - -$data = array(); -$data['message'] = $message; -$data['user'] = $username; - -$template = new Template('remsaint-subscription.html', $namespace->config->template_path); -$template->parse($data); -print $template->output(); - -$namespace->stop(); - -# vim:set ts=4: -# vim:set shiftwidth=4: -?> diff --git a/web/remsaint.php b/web/remsaint.php deleted file mode 100644 index c748531..0000000 --- a/web/remsaint.php +++ /dev/null @@ -1,7 +0,0 @@ - -Remsaint is dead - -Remsaint is no more. Maybe some day it will return, but probably not. -

-Go back to /. - diff --git a/web/remsaint.php.orig b/web/remsaint.php.orig deleted file mode 100644 index 91f3468..0000000 --- a/web/remsaint.php.orig +++ /dev/null @@ -1,76 +0,0 @@ - - */ - -/** - * RemSaint - * - * @author Peter Palfrader/3node - * @version $Id$ - */ - -require_once("../include/Namespace.inc"); -require_once("../include/Tools.inc"); -require_once("../include/Template.inc"); - -$namespace = new Namespace( - array( have_database => 1, - have_session => 1, - have_user => 1 ) -) or - die("Nobody loves me. I don't even have space for a name."); - -$rules = Array(); -$rules['list']['manage'] = array(type => 'integer', optional => 1); -$rules['list']['sort'] = array(type => 'string', optional => 1); -$arguments = param_check($GLOBALS, $rules, array(params_required=>false)); - -$user = false; -$userref = false; -$manage = $arguments['manage'] ? 1 : 0; - -if (! $namespace->user->check_login()) - $manage = 0; -else { - $user = $namespace->session->data['user']['username']; - $userref = $namespace->session->data['user']['ref']; -} - -$orderby='nick'; -$sort='nick'; -if ($arguments['sort'] == 'type1') { - $orderby='-reliability_type1'; - $sort='reliability_type1'; -}; -if ($arguments['sort'] == 'type2') { - $orderby='-reliability_type2'; - $sort='reliability_type2'; -}; -if ($arguments['sort'] == 'status') { - $orderby='in_critical, in_warning'; - $sort = 'status'; -}; - - -$data = array(); -# YYYY-MM-DD HH24:MI TZ -if ($manage) - $data['remailers'] = $namespace->database->query_all("SELECT subscription.ref, remailer.ref, remailer.in_warning, remailer.in_critical, remailer.nick, remailer.reliability_type1, remailer.reliability_type2, to_char(remailer.last_update, 'YYYY-MM-DD') AS last_update, listed1, listed2, subscription.notify_warning, subscription.notify_critical, subscription.notify_recovery, true AS t, false AS f FROM remailer LEFT OUTER JOIN (SELECT * FROM subscription WHERE subscription.account_ref=?) as subscription ON remailer.ref=subscription.remailer_ref ORDER BY $orderby", array($userref)); -else - $data['remailers'] = $namespace->database->query_all("SELECT ref, in_warning, in_critical, nick, reliability_type1, reliability_type2, to_char(last_update, 'YYYY-MM-DD') AS last_update, listed1, listed2, true AS t, false AS f FROM remailer ORDER BY $orderby"); -$data['manage'] = $manage; -$data['sort'] = $sort; -$data['user'] = $user; -$data['this'] = $PHP_SELF; - -$template = new Template('remsaint-status.html', $namespace->config->template_path); -$template->parse($data); -print $template->output(); - -$namespace->stop(); - -# vim:set ts=4: -# vim:set shiftwidth=4: -?> -- cgit v1.2.3