Index: src/perl/register-dataset.cgi
===================================================================
--- src/perl/register-dataset.cgi	(revision 2643)
+++ src/perl/register-dataset.cgi	(revision 2644)
@@ -84,6 +84,7 @@
 $config->define("hasMethod", { DEFAULT => 'true'} );
 $config->define("temporalRequired", { DEFAULT => 'true'} );
 $config->define("spatialRequired", { DEFAULT => 'true'} );
+$config->define("publicReadable", { DEFAULT => 'true'} );
 $config->define("mailhost");
 $config->define("sender");
 $config->define("recipient");
@@ -141,6 +142,7 @@
 my $hasMethod = $config->hasMethod();
 my $temporalRequired = $config->temporalRequired();
 my $spatialRequired = $config->spatialRequired();
+my $publicReadable = $config->publicReadable();
 my $mailhost = $config->mailhost();
 my $sender = $config->sender();
 my $recipient = $config->recipient();
@@ -599,33 +601,33 @@
     push(@invalidParams, "Geographic description is missing.")
         unless (hasContent($FORM::geogdesc) || $FORM::spatialRequired ne 'true');
 
-    if($FORM::beginningMonth eq "00"){
-	if (hasContent($FORM::beginningYear)){
-	    $FORM::beginningMonth = "01";
-	} else {
+    if($FORM::beginningMonth eq "MM"){
+	#if (hasContent($FORM::beginningYear)){
+	#    $FORM::beginningMonth = "01";
+	#} else {
 	    $FORM::beginningMonth = "";
-	}
+	#}
     }
-    if($FORM::beginningDay eq "00"){
-	if (hasContent($FORM::beginningYear)){
-	    $FORM::beginningDay = "01";
-	} else {
+    if($FORM::beginningDay eq "DD"){
+	#if (hasContent($FORM::beginningYear)){
+	#    $FORM::beginningDay = "01";
+	#} else {
 	    $FORM::beginningDay = "";
-	}
+	#}
     }
-    if($FORM::endingMonth eq "00"){
-	if (hasContent($FORM::endingYear)){
-	    $FORM::endingMonth = "01";
-	} else {
+    if($FORM::endingMonth eq "MM"){
+	#if (hasContent($FORM::endingYear)){
+	#    $FORM::endingMonth = "01";
+	#} else {
 	    $FORM::endingMonth = "";
-	}
+	#}
     }    
-    if($FORM::endingDay eq "00"){
-	if (hasContent($FORM::endingYear)){
-	    $FORM::endingDay = "01";
-	} else {
+    if($FORM::endingDay eq "DD"){
+	#if (hasContent($FORM::endingYear)){
+	#    $FORM::endingDay = "01";
+	#} else {
 	    $FORM::endingDay = "";
-	}
+	#}
     }
 
     if (hasContent($FORM::beginningYear) && !($FORM::beginningYear =~ /[0-9][0-9][0-9][0-9]/)){
@@ -1217,11 +1219,19 @@
 	    my $month = ("JAN","FEB","MAR","APR","MAY","JUN",
 			 "JUL","AUG","SEP","OCT","NOV","DEC")
 		[$FORM::beginningMonth - 1];
-	    $cov .= "<beginDate>\n";
-	    $cov .= "<calendarDate>";
-	    $cov .= normalize($FORM::beginningYear)."-".normalize($FORM::beginningMonth)."-".normalize($FORM::beginningDay);
-	    $cov .= "</calendarDate>\n";
-	    $cov .= "</beginDate>\n";
+	    if (hasContent($FORM::beginningDay)) {
+	    	$cov .= "<beginDate>\n";
+	    	$cov .= "<calendarDate>";
+	    	$cov .= normalize($FORM::beginningYear)."-".normalize($FORM::beginningMonth)."-".normalize($FORM::beginningDay);
+	    	$cov .= "</calendarDate>\n";
+	    	$cov .= "</beginDate>\n";
+	    } else {
+	    	$cov .= "<beginDate>\n";
+	    	$cov .= "<calendarDate>";
+	    	$cov .= normalize($FORM::beginningYear)."-".normalize($FORM::beginningMonth)."-01";
+	    	$cov .= "</calendarDate>\n";
+	    	$cov .= "</beginDate>\n";
+	    }
 	} else {
 	    $cov .= "<beginDate>\n";
 	    $cov .= "<calendarDate>";
@@ -1234,11 +1244,20 @@
 	    my $month = ("JAN","FEB","MAR","APR","MAY","JUN",
 			 "JUL","AUG","SEP","OCT","NOV","DEC")
 		[$FORM::endingMonth - 1];
-	    $cov .= "<endDate>\n";
-	    $cov .= "<calendarDate>";
-	    $cov .= normalize($FORM::endingYear)."-".normalize($FORM::endingMonth)."-".normalize($FORM::endingDay);
-	    $cov .= "</calendarDate>\n";
-	    $cov .= "</endDate>\n";
+	
+	    if (hasContent($FORM::endingDay)) {
+	    	$cov .= "<endDate>\n";
+	    	$cov .= "<calendarDate>";
+	    	$cov .= normalize($FORM::endingYear)."-".normalize($FORM::endingMonth)."-".normalize($FORM::endingDay);
+	    	$cov .= "</calendarDate>\n";
+	    	$cov .= "</endDate>\n";
+	    } else {
+	    	$cov .= "<endDate>\n";
+	    	$cov .= "<calendarDate>";
+	    	$cov .= normalize($FORM::endingYear)."-".normalize($FORM::endingMonth)."-01";
+	    	$cov .= "</calendarDate>\n";
+	    	$cov .= "</endDate>\n";
+	    }
 	} else {
 	    $cov .= "<endDate>\n";
 	    $cov .= "<calendarDate>";
@@ -1256,9 +1275,16 @@
 		my $month = ("JAN","FEB","MAR","APR","MAY","JUN",
 			     "JUL","AUG","SEP","OCT","NOV","DEC")
 		    [$FORM::beginningMonth - 1];
-		$cov .= "<calendarDate>";
-		$cov .= normalize($FORM::beginningYear)."-".normalize($FORM::beginningMonth)."-".normalize($FORM::beginningDay);
-		$cov .= "</calendarDate>\n";
+		
+	    	if (hasContent($FORM::beginningDay)) {
+		   $cov .= "<calendarDate>";
+		   $cov .= normalize($FORM::beginningYear)."-".normalize($FORM::beginningMonth)."-".normalize($FORM::beginningDay);
+		   $cov .= "</calendarDate>\n";
+		} else {
+		   $cov .= "<calendarDate>";
+		   $cov .= normalize($FORM::beginningYear)."-".normalize($FORM::beginningMonth)."-01";
+		   $cov .= "</calendarDate>\n";
+		}
 	    } else {
 		$cov .= "<calendarDate>";
 		$cov .= normalize($FORM::beginningYear);
@@ -1399,10 +1425,12 @@
     $doc .= "<principal>uid=$FORM::username,o=$FORM::organization,dc=ecoinformatics,dc=org</principal>\n";
     $doc .= "<permission>all</permission>\n";
     $doc .= "</allow>\n";
-    $doc .= "<allow>\n";
-    $doc .= "<principal>public</principal>\n";
-    $doc .= "<permission>read</permission>\n";
-    $doc .= "</allow>\n";
+    if($publicReadable eq "true"){
+    	$doc .= "<allow>\n";
+    	$doc .= "<principal>public</principal>\n";
+    	$doc .= "<permission>read</permission>\n";
+    	$doc .= "</allow>\n";
+    }
     $doc .= "</access>\n";
     
     $doc .= "</dataset>\n</eml:eml>\n";
