| <?php | |
| /** | |
| * Copyright (c) 2014, 2018 Eclipse Foundation. | |
| * | |
| * This program and the accompanying materials are made | |
| * available under the terms of the Eclipse Public License 2.0 | |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ | |
| * | |
| * Contributors: | |
| * Christopher Guindon (Eclipse Foundation) - Initial implementation | |
| * Eric Poirier (Eclipse Foundation) | |
| * | |
| * SPDX-License-Identifier: EPL-2.0 | |
| */ | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/friends/friend.class.php"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/friends/payment.class.php"); | |
| $App = new App(); | |
| $Nav = new Nav(); | |
| $Menu = new Menu(); | |
| $App->preventCaching(); | |
| // Begin: page-specific settings. Change these. | |
| $pageTitle = "Processing donation..."; | |
| $pageKeywords = "friends of eclipse, donation, contribution"; | |
| $pageAuthor = "Christopher Guindon"; | |
| $script_name = $App->getScriptName(); | |
| $domain = $App->getEclipseDomain(); | |
| $html = ""; | |
| $type = $App->getHTTPParameter('type'); | |
| switch ($type) { | |
| case 'newsletter': | |
| $pageTitle = 'Processing Eclipse Newsletter registration'; | |
| $query = array(); | |
| $query['EMAIL'] = filter_var($App->getHTTPParameter('email'), FILTER_SANITIZE_EMAIL); | |
| $query_string = http_build_query($query); | |
| $url = 'https://eclipsefdn.us6.list-manage.com/subscribe/post?u=eaf9e1f06f194eadc66788a85&id=46e57eacf1&' . $query_string; | |
| header('Location: ' . $url, TRUE, 302); | |
| break; | |
| default: | |
| $Payment = new PayPal(); | |
| $Payment->set_posted_donation_values(); | |
| header('Location: ' . $Payment->get_gateway_redirect(), TRUE, 302); | |
| break; | |
| } | |
| if (isset($Payment)) { | |
| $html = $Payment->get_process_html(); | |
| } | |
| # Generate the web page | |
| $App->AddExtraJSFooter('<script type="text/javascript" src="dist/js/donate.js"></script>'); | |
| $App->AddExtraHtmlHeader('<link rel="stylesheet" type="text/css" href="dist/css/donate.css" media="screen" />'); | |
| $App->generatePage(NULL, $Menu, NULL, $pageAuthor, $pageKeywords, $pageTitle, $html); |