X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=blobdiff_plain;f=update.cgi;h=3cf1900f1ac8e1cd01bac60dc08fc6077ee4cf61;hp=d109bf77fb09013009c7a9ed44c725de1c077819;hb=HEAD;hpb=b33011c65aeb65e4b06b127077d6a225f764d042 diff --git a/update.cgi b/update.cgi index d109bf7..3cf1900 100755 --- a/update.cgi +++ b/update.cgi @@ -3,6 +3,7 @@ # $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. +# Copyright (c) 2008, 2011, 2012, 2014, 2015 Peter Palfrader use lib '.'; use strict vars; @@ -39,7 +40,7 @@ if ($authtoken || $id) { if ($proto eq "http" || !($id && $password)) { print "Location: https://$ENV{SERVER_NAME}/$config{webloginhtml}\n\n"; exit; -} +} my $ldap; @@ -73,7 +74,7 @@ if (!$auth) { $mesg = $ldap->search(base => $editdn, filter => "uid=*"); $mesg->code && &Util::HTMLError($mesg->error); - + my $entries = $mesg->as_struct; if ($mesg->count != 1) { # complain and quit @@ -89,7 +90,7 @@ my $entry = $entries->{$dns[0]}; if (!($query->param('doupdate'))) { # Not yet update, just fill in the form with the current values my %data; - + # Fill in %data # First do the easy stuff - this catches most of the cases foreach (keys(%$entry)) { @@ -97,8 +98,6 @@ if (!($query->param('doupdate'))) { $data{$_} = CGI::escapeHTML($data{$_}) if defined $data{$_}; } - $data{gender} = 9 if not $data{gender}; - # Now we have to fill in the rest that needs some processing... $data{id} = $id; $data{authtoken} = $authtoken; @@ -129,18 +128,9 @@ if (!($query->param('doupdate'))) { } $data{mailcontentinspectionaction} ||= 'reject'; - + $data{email} = CGI::escapeHTML(join(", ", @{$entry->{emailforward}})); - my $genderselect = ''; my $mailcontentselect = '