Documentation is available at reg-policies.php
- <?php
- /**
- * Updated catch-all registration email for a team.
- *
- * This file is part of CompInaBox.
- * @copyright Copyright 2001-2005. Eric D. Nielsen, All rights reserverd.
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @author Eric D. Nielsen <nielsene@alum.mit.edu>
- *
- * @package WebPages
- * @subpackage Team-Admin
- * @internal This file is called from within the admin script up on-level
- * in the directory, the admin script handles all the setup tasks needed.
- */
- // {{{ Variable Importation
- $valid=TRUE;
- if (isset($_POST["reg_email"]) && $_POST["reg_email"]!="")
- {
- $regEmail = htmlspecialchars(trim($_POST["reg_email"]));
- if (strpos($regEmail,'@'))
- $_SESSION["formVars"]["RegEmail_msg"]="";
- else
- {
- $valid=FALSE;
- $_SESSION["formVars"]["RegEmail_msg"]="Please enter a valid email address.";
- }
- }
- else
- {
- $regEmail="";
- }
- $_SESSION["formVars"]["RegEmail"]=$regEmail;
- // }}}
- if (!$valid)
- {
- localRedirect("Location: {$CIB_BASE_URL}team/admin/$teamID/Overview");
- exit();
- }
- $query="SELECT email FROM team_registration_emails WHERE teamid=$teamID;";
- $result=$db->query($query);
- if ($result->numrows())
- list($curEmail)=$result->getRowAt(0);
- else
- $curEmail="";
- // Get Possible Sets of Matches
- $db->startTransaction();
- if ($regEmail=="")
- {
- if ($curEmail!="")
- {
- $query="DELETE FROM team_registration_emails WHERE teamid=$teamID;";
- $_SESSION["formVars"]["RegEmail_msg"]="Registration email removed.";
- }
- }
- else
- {
- if ($curEmail=="")
- {
- $query="INSERT INTO team_registration_emails (teamid,email) VALUES ($teamID,'$regEmail');";
- $_SESSION["formVars"]["RegEmail_msg"]="Registration email added.";
- }
- else if ($curEmail!=$regEmail)
- {
- $query="UPDATE team_registration_emails SET email='$regEmail';";
- $_SESSION["formVars"]["RegEmail_msg"]="Registration email changed.";
- }
- }
- $db->query($query);
- $db->commit();
- localRedirect("Location: {$CIB_BASE_URL}team/admin/$teamID/Overview");
- exit();
- ?>
Documentation generated on Tue, 25 Apr 2006 13:08:48 -0400 by phpDocumentor 1.3.0RC3