Révision 7c12ea40 htdocs/mac/contract.php
htdocs/mac/contract.php | ||
---|---|---|
7 | 7 |
timestampfincontrat:CODE:nom du contrat:texte informatif:hashcode pour mise a jour(tabuledu): |
8 | 8 |
*/ |
9 | 9 |
|
10 |
$conf_wpkg_remote_server_propagate_auth = "http://wpkg.abuledu.net/tabuledu/newauth2/"; |
|
11 |
|
|
10 | 12 |
$g_http_request = $_SERVER['REQUEST_URI']; |
11 | 13 |
preg_match("/.*mac=(.*)/",$_SERVER['REQUEST_URI'],$regs); |
12 | 14 |
$mac = addslashes(strtoupper($regs[1])); |
... | ... | |
19 | 21 |
//print "on a $mac et $view"; |
20 | 22 |
|
21 | 23 |
function insert_hash_allow_upgrade() { |
22 |
global $hash, $DB; |
|
24 |
global $hash, $DB, $conf_wpkg_remote_server_propagate_auth;
|
|
23 | 25 |
$version = "0.0"; |
24 | 26 |
$ip = $_SERVER['REMOTE_ADDR']; |
25 | 27 |
//Insere le hash dans la table |
26 | 28 |
$query = "INSERT INTO glpi_plugin_anet_upgrade_hash VALUES('',NOW(),'$ip','$hash','$version')"; |
27 | 29 |
$result = $DB->query($query); |
30 |
|
|
31 |
//Et ensuite une petite requete distante :) |
|
32 |
$code = urlencode("$ip:$hash"); |
|
33 |
readfile($conf_wpkg_remote_server_propagate_auth . $code); |
|
28 | 34 |
} |
29 | 35 |
|
30 | 36 |
//Ou du POST |
Formats disponibles : Unified diff