diff options
author | Olivier Goulet | 2024-03-28 18:51:20 +0000 |
---|---|---|
committer | Olivier Goulet | 2024-03-28 18:51:20 +0000 |
commit | 2a60494c6482f24185faf8d1e10a6a1209f64bc7 (patch) | |
tree | a3fa11ea9c2e9792356ae7d081cc9e27103c3b49 | |
parent | 3dc6f13526049ac18f99447b347499d084e144c7 (diff) | |
download | membership-staging.tar.gz membership-staging.tar.xz membership-staging.zip |
revert: get_image requiredstaging
Change-Id: I82031f71441cd61cc77b7d9bdc971e1f8b81b2d2
-rw-r--r-- | scripts/get_image.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/scripts/get_image.php b/scripts/get_image.php new file mode 100644 index 0000000..a698ba6 --- /dev/null +++ b/scripts/get_image.php @@ -0,0 +1,45 @@ +<?php +/******************************************************************************* +* Copyright (c) 2006-2013 Eclipse Foundation and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +* +* Contributors: +* (Eclipse Foundation)- initial API and implementation +*******************************************************************************/ + +require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); +$App = new App(); + +$_input_id = $App->getHTTPParameter('id', 'GET'); +$_input_size = $App->getHTTPParameter('size', 'GET'); +$is_error = false; + +if(!preg_match('/^[0-9]+$/', $_input_id)) { + $is_error = true; +} + +$validSizes = array("large", "small"); +if(!in_array($_input_size, $validSizes)) { + $is_error = true; +} + +if(!$is_error) { + $query = "SELECT ". $_input_size . "_logo, ". $_input_size . "_mime FROM OrganizationInformation WHERE OrganizationID = " . $App->sqlSanitize($_input_id); + $result = $App->eclipse_sql($query); + if ($imageIterator = mysql_fetch_array($result)) { + $imageData = $imageIterator[0]; + $imageMime = $imageIterator[1]; + + header("Content-type: " . $imageMime . "\n"); + echo $imageData; + } else { + header("Location:https://www.eclipse.org/membership/images/eclipse-mp-member-144x69.png"); + } +} +else { + header("Location:https://www.eclipse.org/membership/images/eclipse-mp-member-144x69.png"); +} +?> |