| 45 | | |
| 46 | | /* |
| 47 | | * Conf function by Robert Hopson |
| 48 | | * call it with a $parm name to retrieve |
| 49 | | * a var, pass it a array to set them |
| 50 | | * to reset a var pass the array plus |
| 51 | | * Clobber! replaces global $conf; |
| 52 | | */ |
| 53 | | /*function conf($param,$clobber=0) |
| 54 | | { |
| 55 | | static $params = array(); |
| 56 | | |
| 57 | | if(is_array($param)) |
| 58 | | //meaning we are setting values |
| 59 | | { |
| 60 | | foreach ($param as $key=>$val) |
| 61 | | { |
| 62 | | if(!$clobber && isset($params[$key])) |
| 63 | | { |
| 64 | | echo "Error: attempting to clobber $key = $val\n"; |
| 65 | | exit(); |
| 66 | | } |
| 67 | | $params[$key] = $val; |
| 68 | | } |
| 69 | | return true; |
| 70 | | } |
| 71 | | else |
| 72 | | //meaning we are trying to retrieve a parameter |
| 73 | | { |
| 74 | | if($params[$param]) return $params[$param]; |
| 75 | | else return; |
| 76 | | } |
| 77 | | } //conf |
| 78 | | |
| 79 | | function error_results($param,$clobber=0) |
| 80 | | { |
| 81 | | static $params = array(); |
| 82 | | |
| 83 | | if(is_array($param)) |
| 84 | | //meaning we are setting values |
| 85 | | { |
| 86 | | foreach ($param as $key=>$val) |
| 87 | | { |
| 88 | | if(!$clobber && isset($params[$key])) |
| 89 | | { |
| 90 | | echo "Error: attempting to clobber $key = $val\n"; |
| 91 | | exit(); |
| 92 | | } |
| 93 | | $params[$key] = $val; |
| 94 | | } |
| 95 | | return true; |
| 96 | | } |
| 97 | | else |
| 98 | | //meaning we are trying to retrieve a parameter |
| 99 | | { |
| 100 | | if($params[$param]) return $params[$param]; |
| 101 | | else return; |
| 102 | | } |
| 103 | | } //error_results |
| 104 | | */ |
| 527 | | $_SESSION['iframe']['target'] = Config::get('web_path') . '/login.php'; |
| 528 | | $results['rfc3514'] = '<script type="text/javascript">reload_util("'.$_SESSION['iframe']['target'].'")</script>'; |
| | 467 | ob_end_clean(); |
| | 468 | ob_start(); |
| | 469 | |
| | 470 | /* Set the correct headers */ |
| | 471 | header("Content-type: text/xml; charset=" . Config::get('site_charset')); |
| | 472 | header("Content-Disposition: attachment; filename=ajax.xml"); |
| | 473 | header("Expires: Tuesday, 27 Mar 1984 05:00:00 GMT"); |
| | 474 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
| | 475 | header("Cache-Control: no-store, no-cache, must-revalidate"); |
| | 476 | header("Pragma: no-cache"); |
| | 477 | |
| | 478 | $target = Config::get('web_path') . '/login.php'; |
| | 479 | $results['rfc3514'] = '<script type="text/javascript">reload_logout("'.$target.'")</script>'; |