diff --git a/admin/cwsfregister.php b/admin/cwsfregister.php index d2257fac..baa84e88 100644 --- a/admin/cwsfregister.php +++ b/admin/cwsfregister.php @@ -165,16 +165,24 @@ include "xml.inc.php"; exit; } + /* Load the YSC fair */ + $q = mysql_query("SELECT * FROM fairs WHERE abbrv='YSC'"); + if(mysql_num_rows($q) < 1) { + echo error(i18n("You have not defined the YSC upstream fair in the Science Fair Management area.")); + $ok = false; + } else { + $f = mysql_fetch_assoc($q); + $ysc_region_id = $f['username']; + $ysc_region_password = $f['password']; + } $ok=true; - //make sure we have the ysf_region_id and ysf_region_password - if(!$config['ysf_region_id']) - { - echo error(i18n("You have not yet specified your YSF Region ID. Go to the Configuration Variables page to set it")); + //make sure we have the ysc_region_id and ysc_region_password + if($ysc_region_id == '') { + echo error(i18n("You have not yet specified a username for YSC (your Region ID). Go to the Science Fair Management page to set it")); $ok=false; } - if(!$config['ysf_region_password']) - { - echo error(i18n("You have not yet specified your YSF Region Password. Go to the Configuration Variables page to set it")); + if($ysc_region_password == '') { + echo error(i18n("You have not yet specified a password for YSC (your Region Password). Go to the Science Fair Management page to set it")); $ok=false; } @@ -285,8 +293,8 @@ include "xml.inc.php"; if(!$error) { $reg=array("registration"=>array( - "ysf_region_id"=>$config['ysf_region_id'], - "ysf_region_password"=>$config['ysf_region_password'], + "ysf_region_id"=>$ysc_region_id, + "ysf_region_password"=>$ysc_region_password, "projects"=>$winners ) ); diff --git a/db/db.update.136.sql b/db/db.update.136.sql index 391d6362..82a6ec6c 100644 --- a/db/db.update.136.sql +++ b/db/db.update.136.sql @@ -2,3 +2,5 @@ ALTER TABLE `fairs` CHANGE `type` `type` ENUM( 'feeder', 'sfiab', 'ysc' ) NOT NU UPDATE fairs SET `type`='ysc' WHERE `type`=''; +DELETE FROM config WHERE var='ysf_region_id'; +DELETE FROM config WHERE var='ysf_region_password'; diff --git a/fair_info.php b/fair_info.php index 84bcebe3..73045f61 100644 --- a/fair_info.php +++ b/fair_info.php @@ -144,10 +144,14 @@ if($_SESSION['embed'] == true) { if($f['url'] == '') $f['url'] = 'http://'; echo ""; echo ''; - echo '