Add enabled and website (for help) to external sources

Update source editor
Make downloader only check enabled source
Make downloader check for username/password before attempting
Add extra instructions
This commit is contained in:
james 2007-11-29 18:38:06 +00:00
parent 75669d9c08
commit fab18eb0c7
4 changed files with 27 additions and 5 deletions

View File

@ -42,8 +42,13 @@
require_once("xml.inc.php");
foreach($_GET['check'] AS $checksource) {
$checksource=intval($checksource);
$q=mysql_query("SELECT * FROM award_sources WHERE id='$checksource'");
$q=mysql_query("SELECT * FROM award_sources WHERE id='$checksource' AND enabled='yes'");
$r=mysql_fetch_object($q);
if(!($r->username && $r->password)) {
echo error(i18n("Username and Password are not set for source '%1'. Please set them in the SFIAB Configuration/External Award Sources editor first",array($r->name)));
continue;
}
echo i18n("Checking %1 for awards...",array($r->name));
echo "<br />";
@ -313,7 +318,7 @@ echo mysql_error();
else
$links=true;
$q=mysql_query("SELECT * FROM award_sources ORDER BY name");
$q=mysql_query("SELECT * FROM award_sources WHERE enabled='yes' ORDER BY name");
echo "<table class=\"tableview\">";
echo "<tr><th>".i18n("Source Name")."</th>";
echo "<th>".i18n("Source Location URL")."</th>";

View File

@ -32,8 +32,18 @@
$editor=new TableEditor("award_sources",
array("name"=>"Name",
"url"=>"URL",
array(
"enabled"=>"Enabled?",
"name"=>"Name",
"website"=>"Help URL",
"username"=>"Username",
)
,
array(
"enabled"=>"Enabled?",
"name"=>"Name",
"url"=>"Source URL",
"website"=>"Help URL",
"username"=>"Username",
"password"=>"Password"
)
@ -44,5 +54,8 @@
$editor->setRecordType("Award Source");
$editor->execute();
echo "<br />";
echo i18n("Open the 'Help URL' in your browser to see if the award source applies to your fair and to obtain the username/password for the source if it does.");
send_footer();
?>

View File

@ -1 +1 @@
70
71

4
db/db.update.71.sql Normal file
View File

@ -0,0 +1,4 @@
ALTER TABLE `award_sources` ADD `enabled` ENUM( 'no', 'yes' ) DEFAULT 'no' NOT NULL ;
ALTER TABLE `award_sources` ADD `website` VARCHAR( 255 ) NOT NULL AFTER `url` ;
INSERT INTO `award_sources` VALUES ('', 'Sci-Tech Ontario', 'http://www.scitechontario.org/awarddownloader/index.php', 'http://www.scitechontario.org/awarddownloader/help.php', '', '', 'no');
INSERT INTO `award_sources` VALUES ('', 'Youth Science Foundation', 'https://secure.ysf-fsj.ca/awarddownloader/index.php', 'http://apps.ysf-fsj.ca/awarddownloader/help.php', '', '', 'no');