Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 38 lines (29 sloc) 729 Bytes
#!/usr/bin/env php
$COMMAND = 'serve.php';
$cert = file_get_contents('php://stdin');
$user = null;
if ($cert) {
$user = lookup_cert_in_database($cert);
if (!$user) {
// Couldn't find a user for this cert. Exit nonzero.
$options = array(
'command="'.$COMMAND.' '.$user.'"',
// Echo options and exit zero.
echo implode(',', $options);
function lookup_cert_in_database($cert) {
// Go lookup the cert in a database or whatever, and figure out which user
// it belongs to. Return that user's name or some other identifier, or null
// if the cert is invalid.
$user = 'example';
return $user;