Subversion Repositories Applications.wikini

Rev

Rev 65 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 65 Rev 66
Line 1... Line 1...
1
<?php
1
<?php
-
 
2
 
-
 
3
// Remplacement de apache_request_headers pour les vieux serveurs
-
 
4
// http://stackoverflow.com/questions/2916232/call-to-undefined-function-apache-request-headers
-
 
5
if(!function_exists('apache_request_headers')) {
-
 
6
	function apache_request_headers() {
-
 
7
		// Based on: http://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers
-
 
8
		$arrCasedHeaders = array(
-
 
9
				// HTTP
-
 
10
				'Dasl'             => 'DASL',
-
 
11
				'Dav'              => 'DAV',
-
 
12
				'Etag'             => 'ETag',
-
 
13
				'Mime-Version'     => 'MIME-Version',
-
 
14
				'Slug'             => 'SLUG',
-
 
15
				'Te'               => 'TE',
-
 
16
				'Www-Authenticate' => 'WWW-Authenticate',
-
 
17
				// MIME
-
 
18
				'Content-Md5'      => 'Content-MD5',
-
 
19
				'Content-Id'       => 'Content-ID',
-
 
20
				'Content-Features' => 'Content-features',
-
 
21
		);
-
 
22
		$arrHttpHeaders = array();
-
 
23
 
-
 
24
		foreach($_SERVER as $strKey => $mixValue) {
-
 
25
			if('HTTP_' !== substr($strKey, 0, 5)) {
-
 
26
				continue;
-
 
27
			}
-
 
28
 
-
 
29
			$strHeaderKey = strtolower(substr($strKey, 5));
-
 
30
 
-
 
31
			if(0 < substr_count($strHeaderKey, '_')) {
-
 
32
				$arrHeaderKey = explode('_', $strHeaderKey);
-
 
33
				$arrHeaderKey = array_map('ucfirst', $arrHeaderKey);
-
 
34
				$strHeaderKey = implode('-', $arrHeaderKey);
-
 
35
			}
-
 
36
			else {
-
 
37
				$strHeaderKey = ucfirst($strHeaderKey);
-
 
38
			}
-
 
39
 
-
 
40
			if(array_key_exists($strHeaderKey, $arrCasedHeaders)) {
-
 
41
				$strHeaderKey = $arrCasedHeaders[$strHeaderKey];
-
 
42
			}
-
 
43
 
-
 
44
			$arrHttpHeaders[$strHeaderKey] = $mixValue;
-
 
45
		}
-
 
46
		return $arrHttpHeaders;
-
 
47
	}
-
 
48
}
-
 
49
 
2
class identificationSso {
50
class identificationSso {
Line 3... Line 51...
3
 
51
 
4
	private $wiki = null;
52
	private $wiki = null;