Dont display anything for volunteer registration if its complete disabled

Tweak setting school id when inviting participants when an account is both a teacher AND an admin (still need to set the school!)
Disable registration_list for now, so Alison doesnt try it and see it broken and get frustrated
This commit is contained in:
james 2011-03-03 05:03:44 +00:00
parent 002704889b
commit a5eeefa195
4 changed files with 22 additions and 3 deletions

View File

@ -307,7 +307,11 @@ $(document).ready(function() {
}); });
</script> </script>
<b>THIS PAGE IS NOT YET UPDATED TO THE NEW SYSTEM. PLEASE DO NOT USE IT</b>
<?
send_footer();
exit;
?>
<br /> <br />
<table style="width: 500px;"> <table style="width: 500px;">
<tr><td> <tr><td>

View File

@ -474,7 +474,7 @@ function output_page_text($textname) {
$r=mysql_fetch_object($q); $r=mysql_fetch_object($q);
else { else {
//not defined, lets grab the default text //not defined, lets grab the default text
$q=mysql_query("SELECT * FROM pagetext WHERE textname='$textname' AND year='-1' AND lang='".$config['default_language']."'"); $q=mysql_query("SELECT * FROM pagetext WHERE textname='$textname' AND (year='-1' OR conferences_id='-1') AND lang='".$config['default_language']."'");
$r=mysql_fetch_object($q); $r=mysql_fetch_object($q);
} }

View File

@ -1328,6 +1328,8 @@ function api_user_auth_required($all_required = array(), $one_required = array()
function user_volunteer_registration_status() function user_volunteer_registration_status()
{ {
global $config; global $config;
if($config['volunteer_enable']=="no")
return "closed";
// $now = date('Y-m-d H:i:s'); // $now = date('Y-m-d H:i:s');
// if($now < $config['dates']['judgeregopen']) return "notopenyet"; // if($now < $config['dates']['judgeregopen']) return "notopenyet";
// if($now > $config['dates']['judgeregclose']) return "closed"; // if($now > $config['dates']['judgeregclose']) return "closed";
@ -1689,10 +1691,22 @@ function user_invite($username, $password, $email, $roles_id){
if($myRole == 'teacher'){ if($myRole == 'teacher'){
// we already know that this is a teacher inviting a student // we already know that this is a teacher inviting a student
$testquery = mysql_fetch_assoc(mysql_query("SELECT schools_id FROM users WHERE id = {$newUser['id']}")); $testquery = mysql_fetch_assoc(mysql_query("SELECT schools_id FROM users WHERE id = {$newUser['id']}"));
if(!(is_array($testquery) && $testquery['schools_id'] == $u['schools_id'])){ //if they dont have a schools_id, set it to be that of the teacher
if(!$testquery['schools_id']) {
mysql_query("UPDATE users SET schools_id = {$u['schools_id']} WHERE id = " . $newUser['id']);
}
else if($testquery['schools_id']==$u['schools_id']) {
//they already match, do nothing
}
else {
//they dont match, crappy buzz, you cant just take them over, sorry
$returnval = 'This user is not a member of your school'; $returnval = 'This user is not a member of your school';
} }
} }
else if($myRole=='admin') {
//well, we still need to set the school, but we dont need all the checks that a teacher would
mysql_query("UPDATE users SET schools_id = {$u['schools_id']} WHERE id = " . $newUser['id']);
}
} }
} }
else { else {

View File

@ -299,6 +299,7 @@ function draw_signup_form($type){
echo "\"$reg_mode\" registration is not yet handled"; echo "\"$reg_mode\" registration is not yet handled";
break; break;
case 'invite': case 'invite':
echo i18n("Registration is by invite only");
output_page_text("register_{$type}_invite"); output_page_text("register_{$type}_invite");
break; break;
default: default: