X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=update.cgi;h=676d2d7e47b59777ae41a5341b4287485f64e272;hb=b6d2744f934a1a6349be7a7ade1b4831e6eab2bd;hp=7dd776b5672a43e6548ea2e51367828a90ba8f15;hpb=632ec5349cd7921ebb17a4693a27d36424e64d74;p=mirror%2Fuserdir-ldap-cgi.git diff --git a/update.cgi b/update.cgi index 7dd776b..676d2d7 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. @@ -36,6 +36,7 @@ sub DieHandler { $SIG{__DIE__} = \&DieHandler; $ldap = Net::LDAP->new($config{ldaphost}); +&Util::UpgradeConnection($ldap) unless $config{usessl} eq 'False'; my $auth = 0; my $mesg; $mesg = $ldap->bind($editdn, password => $password); @@ -80,6 +81,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 +175,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); @@ -171,6 +195,7 @@ if (!($query->param('doupdate'))) { &Util::LDAPUpdate($ldap, $editdn, 'postalCode', $query->param('postalcode')); &Util::LDAPUpdate($ldap, $editdn, 'telephoneNumber', $query->param('telephonenumber')); &Util::LDAPUpdate($ldap, $editdn, 'facsimileTelephoneNumber', $query->param('facsimiletelephonenumber')); + &Util::LDAPUpdate($ldap, $editdn, 'VoIP', $query->param('VoIP')); &Util::LDAPUpdate($ldap, $editdn, 'loginShell', $query->param('loginshell')); &Util::LDAPUpdate($ldap, $editdn, 'emailForward', $query->param('email')); &Util::LDAPUpdate($ldap, $editdn, 'privateSub', $query->param('privatesub')); @@ -182,6 +207,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=";