forked from science-ation/science-ation
- For the first time probably ever, DELETE a config variable :O
- Rename the user/pass for fair type=ysc so it's more familiar (asks for YSC ID and pass) - Convert cwsfregister to use the fair entry data.
This commit is contained in:
parent
e141676259
commit
9e348d9b0c
@ -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 <a href=\"sciencefairs.php\">Science Fair Management</a> 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 <a href=\"sciencefairs.php\">Science Fair Management</a> 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
|
||||
)
|
||||
);
|
||||
|
@ -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';
|
||||
|
@ -144,10 +144,14 @@ if($_SESSION['embed'] == true) {
|
||||
if($f['url'] == '') $f['url'] = 'http://';
|
||||
echo "<input type=\"text\" name=\"url\" value=\"{$f['url']}\" size=\"40\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td class="left">'.i18n('Upstream Username').':</td><td class="right">';
|
||||
echo '<tr><td class="left">';
|
||||
echo i18n(($f['type'] == 'ysc') ? 'YSC Region ID' : 'Upstream Username');
|
||||
echo ':</td><td class="right">';
|
||||
echo "<input type=\"text\" name=\"username\" value=\"{$f['username']}\" size=\"20\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td class="left">'.i18n('Upstream Password').':</td><td class="right">';
|
||||
echo '<tr><td class="left">';
|
||||
echo i18n(($f['type'] == 'ysc') ? 'YSC Region Password' : 'Upstream Password');
|
||||
echo ':</td><td class="right">';
|
||||
echo "<input type=\"text\" name=\"password\" value=\"{$f['password']}\" size=\"15\" />";
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td class="left">'.i18n('Enable stats upload').':</td><td class="right">';
|
||||
|
Loading…
x
Reference in New Issue
Block a user