diff --git a/register_judges.php b/register_judges.php index 1153f3f..c3c0519 100644 --- a/register_judges.php +++ b/register_judges.php @@ -132,24 +132,83 @@ } else { - echo i18n("Please choose a password in order to create your judges account"); - echo "
"; - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
"; - echo i18n("Enter Password:"); - echo ""; - echo ""; - echo "
"; - echo i18n("Confirm Password:"); - echo ""; - echo ""; - echo "
"; - echo "
"; - echo ""; + $allownew=true; + + if($config['judge_registration_type']=="invite") + { + $allownew=false; + + echo i18n("Judge registration is by invite only. You can not create a new account. If you have been invited already, you need to use the same email address that you were invited with. If you need an invitation, please contact the science fair committee."); + echo "
"; + echo "
"; + echo "Back to Judges Registration"; + + } + else if($config['judge_registration_type']=="singlepassword") + { + $showsinglepasswordform=true; + if($_POST['singlepassword']) + { + if($_POST['singlepassword']==$config['judge_registration_singlepassword']) + { + $allownew=true; + $showsinglepasswordform=false; + } + else + { + echo error(i18n("Invalid registration password, please try again")); + $allownew=false; + } + } + + if($showsinglepasswordform) + { + echo i18n("Judge registration is protected by a password. You must know the judge registration password in order to create an account."); + echo "
"; + echo "
"; + echo ""; + echo i18n("Email Address:")." ".$_SESSION['email']."
"; + echo i18n("Judge Registration Password:"); + echo ""; + echo "
"; + echo "
"; + echo ""; + echo ""; + $allownew=false; + } + } + else if($config['judge_registration_type']=="open") + { + //thats fine, continue on and create them the account. + + } + else + { + echo error(i18n("There is an error with the SFIAB configuration. judge_registration_type is not defined. Contact the fair organizers to get this fixed.")); + $allownew=false; + } + + if($allownew) + { + echo i18n("Please choose a password in order to create your judges account"); + echo "
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo i18n("Choose Password:"); + echo ""; + echo ""; + echo "
"; + echo i18n("Confirm Password:"); + echo ""; + echo ""; + echo "
"; + echo "
"; + echo ""; + } } echo ""; @@ -164,10 +223,22 @@ //this will return 1 if its between the dates, 0 otherwise. if($r->datecheck==1) { - - echo i18n("Please enter your email address to :"); - echo "