Update wrt update.cgi
[mirror/userdir-ldap-cgi.git] / update.cgi
index 1a92dce..a8e7ba0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: update.cgi,v 1.7 2000/05/06 06:10:05 tausq Exp $
+# $Id: update.cgi,v 1.11 2004/11/18 19:17:00 joey Exp $
 # (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
 
 use lib '.';
@@ -43,7 +43,7 @@ $auth = ($mesg->code == LDAP_SUCCESS);
 
 if (!$auth) {
   $ldap->unbind;
-  &Util::HTMLError("You have not been authenticated. Please <a href=\"$proto://$ENV{SERVER_NAME}/$config{webloginurl}\">Login</a>");
+  &Util::HTMLError("You have not been authenticated. Please <a href=\"https://$ENV{SERVER_NAME}/$config{webloginurl}\">Login</a>");
 }
 
 # Authenticated....
@@ -94,8 +94,10 @@ if (!($query->param('doupdate'))) {
   # Actually update stuff...
   my ($newpassword, $newstaddress);
   
-  if (($query->param('labeledurl')) && 
-      ($query->param('labeledurl') !~ /^https?:\/\//i)) {
+  &Util::FixParams($query);
+
+  if (($query->param('labeleduri')) && 
+      ($query->param('labeleduri') !~ /^https?:\/\//i)) {
     &Util::HTMLError("Your homepage URL is invalid");
   }
   
@@ -123,16 +125,17 @@ if (!($query->param('doupdate'))) {
   &Util::LDAPUpdate($ldap, $editdn, 'latitude', $lat);
   &Util::LDAPUpdate($ldap, $editdn, 'longitude', $long);
   &Util::LDAPUpdate($ldap, $editdn, 'c', $query->param('country'));
-  &Util::LDAPUpdate($ldap, $editdn, 'postalcode', $query->param('postalcode'));
+  &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, 'loginShell', $query->param('loginshell'));
   &Util::LDAPUpdate($ldap, $editdn, 'emailForward', $query->param('email'));
-  &Util::LDAPUpdate($ldap, $editdn, 'privatesub', $query->param('privatesub'));
+  &Util::LDAPUpdate($ldap, $editdn, 'privateSub', $query->param('privatesub'));
   &Util::LDAPUpdate($ldap, $editdn, 'ircNick', $query->param('ircnick'));
-  &Util::LDAPUpdate($ldap, $editdn, 'icquin', $query->param('icquin'));
-  &Util::LDAPUpdate($ldap, $editdn, 'labeledUrl', $query->param('labeledurl'));
-  &Util::LDAPUpdate($ldap, $editdn, 'onvacation', $query->param('onvacation'));
+  &Util::LDAPUpdate($ldap, $editdn, 'icqUin', $query->param('icquin'));
+  &Util::LDAPUpdate($ldap, $editdn, 'jabberJID', $query->param('jabberjid'));
+  &Util::LDAPUpdate($ldap, $editdn, 'labeledURI', $query->param('labeleduri'));
+  &Util::LDAPUpdate($ldap, $editdn, 'onVacation', $query->param('onvacation'));
 
   # when we are done, reload the page with the updated details.
   my $url = "$proto://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$id&authtoken=$authtoken&editdn=";