diff --git a/library/Scores/Mappy.php b/library/Scores/Mappy.php index 6c726afaa..593f313d6 100644 --- a/library/Scores/Mappy.php +++ b/library/Scores/Mappy.php @@ -1,39 +1,39 @@ login."@".$this->password."@".$timestamp); $preToken = $this->login."@".$timestamp."@".$hash; $urlGetToken = $ACCESSOR_URL . 'token/generate.aspx?auth=' . urlencode($preToken) . '&ip=' . urlencode($_SERVER["REMOTE_ADDR"]); - $fh = @fopen($urlGetToken, 'rb'); - + $fh = @fopen($urlGetToken, 'rb'); + if ($fh == false) return false; $token = ''; while (!feof($fh))$token .= fread($fh, 8192); fclose($fh); return ($token); } - + protected function cleanAdress($ville) { $ville = ' '.trim(preg_replace('/([0-9]|ARRONDISSEMENT|_)/i', ' ', $ville)).' '; $ville = trim(strtr($ville, array(' EME ' => '', ' ER ' => ''))); return (ucwords(strtolower($ville))); } - + public function villeCouverte($ville) { $ville = $this->cleanAdress($ville); - if (in_array(strtoupper($ville),$this->villes)){ + /*if (in_array(strtoupper($ville),$this->villes)){ return true; - } - return false; - } - + }*/ + return false; + } + public function getJs() { $token = $this->getToken(); $href = 'http://axe.mappy.com/1v1/init/get.aspx?auth='.$token.'&version=2.16&solution=ajax'; - return $href; + return $href; } - + } \ No newline at end of file