| <?php |
| |
| require_once("/home/data/httpd/eclipse-php-classes/system/dbconnection_portal_rw.class.php"); |
| |
| #***************************************************************************** |
| # |
| # portal_lib.php |
| # |
| # Author: Karl Matthias |
| # Date: 2007-05-11 |
| # |
| # Description: Functions and modules related to the myFoundation Portal |
| # |
| # HISTORY: |
| # |
| #***************************************************************************** |
| |
| |
| /* |
| * Name: mysql_error_check |
| * Function: Verify and report MySQL errors |
| * Date: May 11, 2007 |
| * By: Karl Matthias |
| */ |
| function mysql_error_check($msg) { |
| if(mysql_errno() != 0) { |
| echo "$msg"; |
| return true; |
| } |
| return false; |
| } |
| |
| /* |
| * Name: notify_portal |
| * Function: Notify the myFoundation Portal that the ICQ/MCQ has been filled out and that the committer |
| * is an individual or member. This will later be reviewed by emolegal before provisioning. |
| * Date: May 11, 2007 |
| * By: Karl Matthias |
| */ |
| function notify_portal($email, $cq, $legalcategory) { |
| $dbconnect = new DBConnectionPortalRW(); |
| $dbh = $dbconnect->connect(); |
| |
| $notify_msg = 'Please notify emo@eclipse.org'; |
| |
| if(!$dbh) { |
| return "Error verifying information in portal database. $notify_msg."; |
| } |
| |
| $result = mysql_query("SELECT voteid FROM committer_votes WHERE candidateemail = '$email'", $dbh); |
| if(mysql_error_check("Error contacting the portal database. $notify_msg.")) { |
| return false; |
| } |
| |
| $row = mysql_fetch_assoc($result); |
| |
| if(!isset($row['voteid'])) { |
| return true; // there wasn't any record in the portal but that's ok -- election conducted via email |
| } |
| |
| $voteid = $row['voteid']; |
| $result = mysql_query("UPDATE committer_votes SET $cq = now(), legalcategory = '$legalcategory' WHERE voteid = $voteid"); |
| if(mysql_error_check("Error updating the portal election record. $notify_msg.")) { |
| return false; |
| } |
| return true; |
| } |
| |
| ?> |