Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / htdocs / epack / check.php @ 1c14bcc4

Historique | Voir | Annoter | Télécharger (951 octets)

1
<?php
2
//Vite une session
3
session_start();
4
if(trim($_GET['reset']) != "") {
5
  // Finalement, on détruit la session.
6
  session_destroy();
7
  header('Location: http://abuledu.net/epack/check/');
8
 }
9
//print_r($_SESSION);
10
//recupration des variables de l'url
11
$g_http_request = $_SERVER['REQUEST_URI'];
12
ereg(".*pass=(.*).code=(.*)",$_SERVER['REQUEST_URI'],$regs);
13
$pass = addslashes($regs[1]);
14
$code = addslashes($regs[2]);
15
//Ou du POST
16
if(trim($pass) == "" || trim($code) == "") {
17
  $pass = addslashes($_POST['pass']);
18
  $code = addslashes($_POST['code']);
19
 }
20

    
21
$_SERVER['REQUEST_URI'] = "";
22
$_SERVER['HTTP_REFERER'] = "";
23
define('GLPI_ROOT', '..');
24
include (GLPI_ROOT . "/inc/includes.php");
25

    
26
$query = "SELECT * FROM glpi_plugin_anet_epacks WHERE code='$code' AND password='$pass'";
27
$result = $DB->query($query);
28
if($DB->numrows($result)>0) {
29
  $data=$DB->fetch_assoc($result);
30
 }
31

    
32
$message = implode(',',$data);
33

    
34
print $message;
35

    
36
//print_r($_SERVER);
37

    
38
?>
Redmine Appliance - Powered by TurnKey Linux