<?php /** * MuDoCo - A Multi Domain Cookie * * Client side server beacon script. * * It will set a cookie in the client domain with a client nonce and the hashed server nonce. * This hashed nonce is then used from the user navigator to authenticate MuDoCo requests. * * @author berliozdavid@gmail.com * */ include_once __DIR__ . '/etc/config.php'; include_once 'MuDoCo/Client.php'; $client = new MuDoCo_Client(); $client->cookieAndBeacon();
/** * Check if the given cnonce+hnonce is correct. * * @param string $cnonce * @param string $hnonce * * @return boolean */ public function checkNonce($cnonce, $hnonce) { global $mudoco_conf; require_once "MuDoCo/Client.php"; if ($nonce = $this->getNonceStorage()->get($cnonce, $mudoco_conf['MUDOCO_SERVER_CHECK_FINGERPRINT'] ? MuDoCo_Client::get_finger_print() : null)) { return md5($cnonce . $nonce) == $hnonce; } return false; }