2005-02-07 20:00:18 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// "web service" for verifying that a user CPID matches an account key
|
|
|
|
|
|
|
|
require_once("../inc/db.inc");
|
2005-02-07 20:47:45 +00:00
|
|
|
require_once("../inc/xml.inc");
|
2005-02-07 20:00:18 +00:00
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
2005-02-07 20:47:45 +00:00
|
|
|
xml_header();
|
|
|
|
|
|
|
|
function reply($x) {
|
|
|
|
echo "<reply>\n$x</reply>\n";
|
|
|
|
}
|
|
|
|
|
2005-02-07 20:00:18 +00:00
|
|
|
$cpid = process_user_text($_GET["cpid"]);;
|
|
|
|
$authenticator = process_user_text($_GET["authenticator"]);;
|
|
|
|
|
|
|
|
if (!$cpid || !$authenticator) {
|
2005-02-07 20:47:45 +00:00
|
|
|
reply("<error>missing argument</error>\n");
|
2005-02-07 20:00:18 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$user = lookup_user_auth($authenticator);
|
|
|
|
|
|
|
|
if (!$user) {
|
2005-02-07 20:47:45 +00:00
|
|
|
reply("<error>bad authenticator</error>\n");
|
2005-02-07 20:00:18 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$x = $user->cross_project_id.$user->email_addr;
|
|
|
|
if (md5($x) == $cpid) {
|
2005-02-07 20:47:45 +00:00
|
|
|
reply( "<success></success>\n");
|
2005-02-07 20:00:18 +00:00
|
|
|
} else {
|
2005-02-07 20:47:45 +00:00
|
|
|
reply( "<error>bad CPID</error>\n");
|
2005-02-07 20:00:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|