version 1.42, 2006/12/22 20:51:27
|
version 1.43, 2007/05/07 14:02:45
|
Line 32 use MIME::Lite;
|
Line 32 use MIME::Lite;
|
use CGI::Cookie(); |
use CGI::Cookie(); |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::loncommon(); |
use Apache::loncommon(); |
|
use Apache::lonhtmlcommon; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonacc(); |
use Apache::lonacc(); |
Line 138 function validate() {
|
Line 139 function validate() {
|
} |
} |
|
|
END |
END |
$scripttag .= <<'END'; |
$scripttag .= &Apache::lonhtmlcommon::javascript_valid_email(); |
function validmail(field) { |
|
var str = field.value; |
|
if (window.RegExp) { |
|
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)"; |
|
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; //" |
|
var reg1 = new RegExp(reg1str); |
|
var reg2 = new RegExp(reg2str); |
|
if (!reg1.test(str) && reg2.test(str)) { |
|
return true; |
|
} |
|
return false; |
|
} |
|
else |
|
{ |
|
if(str.indexOf("@") >= 0) { |
|
return true; |
|
} |
|
return false; |
|
} |
|
} |
|
END |
|
|
|
if ($cid =~ m/_/) { |
if ($cid =~ m/_/) { |
($cdom,$cnum) = split(/_/,$cid); |
($cdom,$cnum) = split(/_/,$cid); |
} |
} |