summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2005-11-15 09:50:50 +0000
committerPeter Palfrader <peter@palfrader.org>2005-11-15 09:50:50 +0000
commitc3d26dffd667eb368084a53dbf6472e2fccce142 (patch)
treed1149cbe203d527dacbb15d63a8e2e16588a2b32 /web
parent23f3dd7c34d571ab0bb17a76b276e46c6d8aaad5 (diff)
Move remsaint away
Diffstat (limited to 'web')
-rw-r--r--web/Makefile.am3
-rw-r--r--web/remsaint.php.orig76
2 files changed, 78 insertions, 1 deletions
diff --git a/web/Makefile.am b/web/Makefile.am
index 9da9c08..2484392 100644
--- a/web/Makefile.am
+++ b/web/Makefile.am
@@ -14,4 +14,5 @@ SUBDIRS = \
based_in = htdocs
include $(top_srcdir)/Makefile.common
-doc_DATA = account-create.php account-edit.php index.php login.php logout.php remsaint-subscription.php remsaint.php resources.html favicon.ico
+doc_DATA = account-create.php account-edit.php index.php login.php logout.php resources.html favicon.ico
+#doc_DATA = account-create.php account-edit.php index.php login.php logout.php remsaint-subscription.php remsaint.php resources.html favicon.ico
diff --git a/web/remsaint.php.orig b/web/remsaint.php.orig
new file mode 100644
index 0000000..91f3468
--- /dev/null
+++ b/web/remsaint.php.orig
@@ -0,0 +1,76 @@
+<?
+/* RemSaint
+ *
+ * (c) 2002 Peter Palfrader <pp@3node.com>
+ */
+
+/**
+ * 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:
+?>