Project

General

Profile

« Previous | Next » 

Revision 8181

Added by Jing Tao about 11 years ago

Send the verification email.

View differences:

ldapweb.cgi
85 85
my @errorMessages;
86 86
my $error = 0;
87 87

  
88
my $emailVerification= 'emailverification';
89

  
88 90
# Import all of the HTML form fields as variables
89 91
import_names('FORM');
90 92

  
......
991 993
    
992 994
    
993 995
    ####################send the verification email to the user
996
    my $link = $cgiUrl . 'cfg=' . $skinName . '&' . 'stage=' . $emailVerification . '&' . 'dn=' . $dn . '&' . 'hash=' . $randomStr;
994 997
    
995
    #$query->param('o','tmp');
996
    #$query->param('o',$org);
997
    #constrct url
998
    #my $link =
999
    #print "Content-type: text/html\n\n";
1000
    #print $query->param('o');
998
    my $mailhost = $properties->getProperty('email.mailhost');
999
    my $sender =  $properties->getProperty('email.sender');
1000
    my $recipient = $query->param('mail');
1001
    # Send the email message to them
1002
    my $smtp = Net::SMTP->new($mailhost);
1003
    $smtp->mail($sender);
1004
    $smtp->to($recipient);
1005

  
1006
    my $message = <<"     ENDOFMESSAGE";
1007
    To: $recipient
1008
    From: $sender
1009
    Subject: KNB Password Reset
1010
        
1011
    Somebody (hopefully you) registered a KNB account.  
1012
    Please click the following link to activate your account.
1013
    If the link doesn't work, please copy the link to your browser:
1014
    
1015
    $link
1016

  
1017
    Thanks,
1018
        The KNB Development Team
1019
    
1020
     ENDOFMESSAGE
1021
     $message =~ s/^[ \t\r\f]+//gm;
1022
    
1023
     $smtp->data($message);
1024
     $smtp->quit;
1025
    
1026
    fullTemplate( ['success'] );
1027
    
1001 1028
}
1002 1029

  
1003 1030
#
......
1040 1067
                #                     allParams => $allParams });
1041 1068
                #$template->process( $templates->{'register'}, $templateVars);
1042 1069
            } else {
1043
                fullTemplate( ['success'] );
1070
                #fullTemplate( ['success'] );
1044 1071
            }
1045 1072
            $ldap->unbind;   # take down session
1046 1073
            

Also available in: Unified diff