C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\heimam\phpmyserver\image.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php

//----------------------------------//
//    Copyright by Matthias Speer   //
//----------------------------------//

include('./config.inc.php');

include(
'./auth.php');

$path=isset($_GET['path'])?DecodeGET($_GET['path']):'';

$pathdata pathinfo($path);
$err=true;
if (isset(
$pathdata["extension"]))
{
    
$err=false;
    
$ext=strtolower($pathdata["extension"]);
    switch (
$ext)
    {
        case 
'gif':        header ("Content-type: image/gif");
                        break;

        case 
'jpg':        header ("Content-type: image/jpeg");
                        break;

        case 
'jpeg':    header ("Content-type: image/jpeg");
                        break;

        case 
'jpe':        header ("Content-type: image/jpeg");
                        break;

        case 
'png':        header ("Content-type: image/png");
                        break;

        case 
'swf':        header ("Content-type: x-shockwave-flash");
                        break;

        default:        
$err=true;
    }

    if (!
$err)
    {
        if (@
readfile($path) === false)        // PHP
        
{
            switch (
$PMS['os'].'|'.$PMS['modus'])
            {
                case 
'linux|PHPsys':
                case 
'linux|Python':
                case 
'linux|PerlCGI':         
                case 
'linux|Perl_htaccess':    
                case 
'linux|SSI':            $mod=new PMSMod();
                                            if (
$mod->Copy2Temp("cp $path"))
                                            {                            
                                                
$err=!$mod->TempFile2Stdout();
                                            }
                                            
$mod->Destructor();    
                                            break;
                                                                                            
                default:                    if (
$ext=='swf')
                                            {
                                                
header ("Content-type: x-shockwave-flash");
                                                @
readfile('./img/func_na.swf');
                                            } else
                                            {
                                                
header ("Content-type: image/gif");
                                                @
readfile('./img/func_na.gif');
                                            }                
            }                                                                                        
        }
    }
}
if (
$err)
{
    
header ("Content-type: image/gif");
    
readfile('./img/error.gif');
}
?>