C:\$Recycle.Bin\S-1-5-21-3967099092-2644009230-141905953-500\$RC7O0L9\classes\PHPsys.class.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php

class PMSMod
{
    var 
$status;
    var 
$tempname;
    var 
$output;
    var 
$ret;
    
    function 
Copy2Temp($arg)
    {
        global 
$PMS;
        
$this->status=false;
        
$this->tempname='';
        
$this->output=Array();
        
$this->ret=0;
        
$rndcode=RandomCode();
        
$timestamp=time();
        
$this->tempname=$rndcode.'_'.$timestamp;
        switch (
$PMS['os'])
        {
            case 
'linux':    exec($arg.' ./work/'.$this->tempname.'.tmp 2>&1'$this->output$this->ret);
                            break;
                            
            case 
'win':        exec($arg.' ".\work\\'.$this->tempname.'.tmp'$this->output$this->ret);
        }
        if ((
$dh=opendir("./work")) !== false)
        {
            while ((
$element readdir($dh)) !== false
            {
                if ((
$element!=$this->tempname.'.tmp')&&(preg_match('/^([A-Z]*)_([0-9]*)\./'$element$match)))
                {
                    if ((
$match[1]==$rndcode)||(($timestamp-$match[2])>60))
                    {
                        
unlink("./work/$element");                
                    }
                }
            }
        }
        if (
file_exists('./work/'.$this->tempname.'.tmp'))
        {
                
$this->status=true;
        } else
        {
            
$this->output=Array();            
            
$this->tempname='';
            return 
false;
        }
        return 
true;
    }
        
    function 
Execute($arg)
    {
        global 
$PMS;
        
$this->status=false;
        
$this->tempname='';
        
$this->output=Array();
        
$this->ret=0;
        switch (
$PMS['os'])
        {
            case 
'linux':    exec($arg.' 2>&1'$this->output$this->ret);
                            break;
                            
            case 
'win':        exec($arg.' 2>&1'$this->output$this->ret);
        }        
        
$this->status=true;
        return 
true;
    }
    
    function 
Destructor()
    {
        if ((
$this->tempname!='')&&file_exists('./work/'.$this->tempname.'.tmp'))
        {
            
unlink('./work/'.$this->tempname.'.tmp');
        }
    }
    
    function 
Output2Array()
    {
        return (array)
$this->output;
    }
    
    function 
Output2Stdout()
    {
        
reset($this->output);
        while (list(
$key,$val)=each($this->output))
        {
            echo 
$val;
        }
        return 
true;
    }

    function 
FormatOutput2Stdout()
    {
        
reset($this->output);
        while (list(
$key,$val)=each($this->output))
        {
            echo 
htmlentities(rtrim($val))."\n";
        }
        return 
true;
    }
    
    function 
TempFile2Stdout()
    {
        if ((
$this->tempname!='')&&file_exists('./work/'.$this->tempname.'.tmp'))
        {
            return (
readfile('./work/'.$this->tempname.'.tmp') === false)?false:true;
        }
        return 
false;
    }    

    function 
FormatTempFile2Stdout($hl=false$br=true)
    {
        if ((
$this->tempname!='')&&file_exists('./work/'.$this->tempname.'.tmp'))
        {
            return 
FormatFile('./work/'.$this->tempname.'.tmp'$hl$br);
        }
        return 
false;
    }

    function 
TempFilename()
    {
        return 
'./work/'.$this->tempname.'.tmp';
    }
    
    function 
GetExecuteStatus()
    {
        return 
$this->ret;
    }
}

?>