blob: 0bfdc2a8c337913b4f7904c069ec53caf3e12833 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2014 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://eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christopher Guindon (Eclipse Foundation) - Initial implementation
* Edouard Poitras (Eclipse Foundation) - Some modifications
*******************************************************************************/
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); $App = new App();
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/friends/friend.class.php");
if (!isset($_GET['v2'])) {
// delete this once site_login is updated
$bugzillaLogin = filter_var($_GET['bugzillaLogin'], FILTER_SANITIZE_EMAIL);
$friend = new Friend();
$bugzillaID = $friend->getBugzillaIDFromEmail($bugzillaLogin);
if ($bugzillaID != 0)
echo "Verified!";
else
echo "Invalid Login";
} else {
// Basic validation for testing
$valid = TRUE;
if (isset($_POST['email']) && !empty($_POST['email'])) {
$valid = FALSE;
$id = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
$friend = new Friend();
$bugzilla_id = $friend->getBugzillaIDFromEmail($id);
if ($bugzilla_id != 0) {
$valid = TRUE;
}
}
echo json_encode(array(
'valid' => $valid,
));
}