From 7f1fadc57026957fd2ea1c0e520a22b047f2aa24 Mon Sep 17 00:00:00 2001 From: rmurray <> Date: Thu, 28 Dec 2006 01:44:02 +0000 Subject: [PATCH] Add support for setting mailGreylisting and mailCallout --- debian/changelog | 4 +++- update.cgi | 29 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7c61cb3..d863368 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,10 @@ userdir-ldap-cgi (0.3.9) unstable; urgency=low - Reimplement ssh fingerprint without using temp files and external programs. - Remove access-restricted date fields. + * update.cgi + - Add support for mailGreylisting and mailCallout - -- Ryan Murray Wed, 27 Dec 2006 15:59:34 -0700 + -- Ryan Murray Wed, 27 Dec 2006 19:42:28 -0700 userdir-ldap-cgi (0.3.8) unstable; urgency=low diff --git a/update.cgi b/update.cgi index 7dd776b..d1aa73a 100755 --- a/update.cgi +++ b/update.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: update.cgi,v 1.12 2006/12/22 08:58:50 rmurray Exp $ +# $Id: update.cgi,v 1.13 2006/12/28 02:44:02 rmurray Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. # (c) 2006 Ryan Murray. Licensed under the GPL. @@ -80,6 +80,18 @@ if (!($query->param('doupdate'))) { $data{staddress} = $entry->{postaladdress}->[0]; $data{staddress} =~ s/\$/\n/; $data{countryname} = &Util::LookupCountry($data{c}); + + if ($data{mailgreylisting} eq "TRUE") { + $data{mailgreylisting} = " checked"; + } else { + $data{mailgreylisting} = ""; + } + + if ($data{mailcallout} eq "TRUE") { + $data{mailcallout} = " checked"; + } else { + $data{mailcallout} = ""; + } $data{email} = join(", ", @{$entry->{emailforward}}); @@ -162,7 +174,18 @@ if (!($query->param('doupdate'))) { my ($lat, $long); ($lat, $long) = &Util::CheckLatLong($query->param('latitude'), $query->param('longitude')); - + my ($greylisting, $callout); + + $greylisting = $query->param('mailgreylisting'); + if (!$greylisting or $greylisting ne "TRUE") { + $greylisting = "FALSE"; + } + + $callout = $query->param('mailcallout'); + if (!$callout or $callout ne "TRUE") { + $callout = "FALSE"; + } + &Util::LDAPUpdate($ldap, $editdn, 'postalAddress', $newstaddress); &Util::LDAPUpdate($ldap, $editdn, 'l', $query->param('l')); &Util::LDAPUpdate($ldap, $editdn, 'latitude', $lat); @@ -182,6 +205,8 @@ if (!($query->param('doupdate'))) { &Util::LDAPUpdate($ldap, $editdn, 'gender', $gender); &Util::LDAPUpdate($ldap, $editdn, 'birthDate', $query->param('birthdate')) if $bd_ok; &Util::LDAPUpdate($ldap, $editdn, 'mailDisableMessage', $query->param('maildisablemessage')); + &Util::LDAPUpdate($ldap, $editdn, 'mailCallout', $callout); + &Util::LDAPUpdate($ldap, $editdn, 'mailGreylisting', $greylisting); # when we are done, reload the page with the updated details. my $url = "https://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$id&authtoken=$authtoken&editdn="; -- 2.20.1