[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS Update: gleipnir



Log Message:
-----------
Add email picker.  jdew@ didn't check it in and I need to start working on it so check it in now.

Added Files:
-----------
    gleipnir/public_html/webmail:
        emailpicker.pl

Revision Data
-------------
--- /dev/null
+++ public_html/webmail/emailpicker.pl
@@ -0,0 +1,76 @@
+#!/usr/bin/perl -w
+###############################################################################
+# emailpicker.pl email address picker tool
+# $Id: emailpicker.pl,v 1.1 2008/07/13 13:04:00 odin Exp $
+#
+# Copyright (C) 2005-2006 Jim Dew <jdew@yggdrasil.ca>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. The name of the author may not be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+###############################################################################
+
+use strict;
+use Gleipnir;
+
+my $gleipnir = new Gleipnir;
+my $cgi = $gleipnir->cgi;
+
+unless ($gleipnir->access('validuser'))
+	{
+	$gleipnir->url('/auth.pl');
+	print $gleipnir->output;
+	exit;
+	}
+
+$gleipnir->showheader(0);
+$gleipnir = ShowPage(-gleipnir => $gleipnir);
+print $gleipnir->output;
+exit;
+
+sub ShowPage 
+	{
+	my %options = @_;
+	my $gleipnir = $options{-gleipnir};
+	my $cgi = $gleipnir->cgi;
+	my $dbh = $gleipnir->dbh;
+
+	my $form = $cgi->param('form')||undef;
+	my $field = $cgi->param('field')||undef;
+
+	my $call = $gleipnir->rpc('addressbook_list');
+
+	#this is horrible
+	my @data = @$call;
+	for (my $i = 0; $i <= $#data; $i++)
+		{
+		$call->[$i]{form} = $form;
+		$call->[$i]{field} = $field;
+		}
+
+	#use Data::Dump;
+	#Data::Dump::dump($call);
+
+	my $template=$gleipnir->template('webmail/emailpicker');
+	$template->param(
+									 call => $call,
+									);
+	return $gleipnir->body($template->output);
+	}


Main Menu:

Site Tools:


Here, spammer, have some addresses.