C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\webboard\admin\dynx.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?php
/* $Id: dynx.php,v 1.2 2003/01/02 18:07:42 thetinysteini Exp $ */
/*
          ThWboard - PHP/MySQL Bulletin Board System
        ==============================================
            (c) 2000, 2001 by
               Paul Baecher         <paul@thewall.de>
               Felix Gonschorek   <funner@thewall.de>

          download the latest version:
            http://www.thwboard.de

          This  program is  free  software;  you can
          redistribute it and/or modify it under the
          terms of the GNU General Public License as
          published by the Free Software Foundation;
          either  version 2 of  the License,  or (at
          your option) any later version.

        ==============================================
*/

error_reporting(7); // E_ERROR | E_WARNING | E_PARSE
set_magic_quotes_runtime(0);

if( isset(
$HTTP_GET_VARS) )
    
extract($HTTP_GET_VARS);
if( isset(
$HTTP_PUT_VARS) )
    
extract($HTTP_PUT_VARS);
if( isset(
$HTTP_POST_VARS) )
    
extract($HTTP_POST_VARS);

include 
'dynx_class.php';
include 
'../inc/config.inc.php';

$DB_Stream = new DB_Connection($mysql_h.','.$mysql_u.','.$mysql_p.','.$mysql_db);

// ===================================================
// ===================================================
// ===================================================

if( !$pref )
{
    
$pref 'thwb_';
}

$r_user $DB_Stream->query("SELECT userpassword FROM $pref"."user WHERE username='$l_username' AND userisadmin=1");

if( 
mysql_num_rows($r_user) )
{
    
$user mysql_fetch_array($r_user);
    if( 
$user['userpassword'] != md5($l_userpassword) )
    {
        
$action 'login';
    }
}
else
{
    
$action 'login';
}

// Oeffne mal bereits die Master-Server Connection
if( isset($action) )
{
    
$servermastercon = new server("www.thwbxtra.kremedia.de"1);
}


// ===================================================
// ===================================================
// ===================================================

switch($action)
{
    case 
'addstyles':
        
style_top("Styles werden installiert...");
        print 
"<p>Script Status</p>";
        
        if( !isset(
$addstyle_sql) && !isset($addstyle_dat) )
        {
            
ERROR_Handler(5);
        }
        
        
// ===================================================
        // Bei SQL-Eintraegen
        
        
if( isset($addstyle_sql) )
        {
            while( list(
$styleid$value) = each($addstyle_sql) )
            {
                if( 
intval($value) == )
                {
                    
$style_data $servermastercon->getAnswer('get_style^'.$styleid.'&ip='.$_SERVER['REMOTE_ADDR']);
                    if( 
substr($style_data016) == 'style_data_start' && substr($style_data, -14) == "style_data_end" )
                    {
                        
$style_data_final substrstrstr($style_data"\n"), 1, -15);
                        
$DB_Stream->querystyle2sql$style_data_final$pref ) );
                        print 
"Style Nummer $styleid wurde erfolgreich in die MySQL Datenbank importiert!<br>\n";
                        
flush();
                    }
                    else
                    {
                        
ERROR_Handler(6);
                    }
                }
            }
        }
        
        
// ===================================================
        // Bei .style-Eintraegen
        
        
if( isset($addstyle_dat) )
        {
            while( list(
$styleid$value) = each($addstyle_dat) )
            {
                if( 
intval($value) == )
                {
                    
$style_data $servermastercon->getAnswer('get_style^'.$styleid.'&ip='.$_SERVER['REMOTE_ADDR']);
                    if( 
substr($style_data016) == 'style_data_start' && substr($style_data, -14) == "style_data_end" )
                    {
                        
$style_data_name =  substr$style_data17strpos$style_data"\n" ) - 17);
                        
$style_data_final substrstrstr($style_data"\n"), 1, -15);
                        print 
"Style Nummer $styleid wird geschrieben, bitte warten...<br>";
                        
flush();
                        
FILEFUNC::writefile('../templates/'.$style_data_name.'.style'$style_data_final);
                        print 
"Style Nummer $styleid wurde erfolgreich erstellt!<br>\n";
                    }
                    else
                    {
                        
ERROR_Handler(6);
                    }
                }
            }
        }

        print 
'<b>Alle Styles wurden erfolgreich eingef&uuml;gt, vielen Dank das Sie Dyn<i>X</i> benutzt haben!';
        
style_bottom('login''Ausloggen');
    break;
    
    
// ===================================================
    // ===================================================
    // ===================================================
    
    
case 'liststyles':
        
style_top("Styleauswahl");
        print 
'<p>Folgende Styles stehen zur Verf&uuml;gung:</p><img src="./images/dynx_desc2.gif" border="0">';
        print 
'<table width="100%" cellpadding="2" cellspacing="1">';
        print 
"\n<tr>\n<td><input type=\"checkbox\" name=\"selectall\" onclick=\"return SelectAll(0)\"></td><td><input type=\"checkbox\" name=\"selell\" onclick=\"return SelectAll(1)\"></td><td><b>Name</b></td>\n<td><b>Author</b></td>\n<td><b>Beschreibung</b></td>\n</tr>\n";

        
$style_overview $servermastercon->getAnswer('style_overview');
        if( 
substr($style_overview016) == 'start_style_list' && substr($style_overview, -14) == "end_style_list" )
        {
            
$stylearray explode("\n"$style_overview);
            for( 
$i 1$i <= ( sizeof($stylearray) - 2); $i++)
            {
                list(
$styleid$stylename$styleautor$styledesc) = explode("|"$stylearray[$i]);
                
$q_avatar $DB_Stream->query('SELECT styletemplate FROM '.$pref.'style WHERE stylename =\''.$stylename.'\'');
                
                if( 
mysql_fetch_array($q_avatar) )
                {
                    
$checkformsql '<input type="checkbox" name="disable" readonly="readonly" disabled>';
                }
                else
                {
                    
$checkformsql "<input type=\"checkbox\" name=\"addstyle_sql[$styleid]\" value=\"1\">";
                }
                
                if( 
file_exists("../templates/".$stylename.".style") )
                {
                    
$checkformdat '<input type="checkbox" name="disable" readonly="readonly" disabled>';
                }
                else
                {
                    
$checkformdat "<input type=\"checkbox\" name=\"addstyle_dat[$styleid]\" value=\"1\">";
                }
                
                print 
"<tr bgcolor=\"".($i == '#EFEFEF' '#DADADA')."\"><td>$checkformdat</td><td>$checkformsql</td><td>$stylename</td><td>$styleautor</td><td>$styledesc</td></tr>\n";
            }
        }
        print 
'</table><img src="./images/dynx_desc.gif" border="0"><br><br>';
        print 
'<input type="checkbox" name="disable" readonly="readonly" disabled> = Style wurde bereits installiert.';
        
style_bottom('addstyles''Weiter &raquo;');
    break;
    
    
// ===================================================
    // ===================================================
    // ===================================================
    
    
case 'login':
    default:
        
style_top("Anmeldung");
        print 
'<p>Willkommen bei Dyn<i>X</i>, dem dynamischen Extra-Scripts des ThWboards.</p>';
        print 
'<p>Mit Dyn<i>X</i> haben Sie die M&ouml;glichkeit, einfach und schnell neue Styles (Farb-Pakete) herunterzuladen und zu installieren.</p>';
        print 
'<p><b>Bitte stellen Sie vor der Anwendung des Scripts sicher, dass Schreibrechte (chmod 777) auf folgenden Verzeichnissen bestehen:</b></p>';
        print 
'<ul><li><i>&lt;ThWb-Verzeichnis&gt;</i>/templates</li></ul>';
        print 
'<b>Bitte geben Sie hier ihre Zugangsdaten ein um fortzufahren:</b><br> 
<table cellspacing="0" cellpadding="2" border="0">
  <tr>
    <td>Benutzername</td>
    <td width="10">&nbsp;</td>
    <td><input type="text" name="l_username"></td>
  </tr>
  <tr>
    <td>Passwort</td>
    <td width="10">&nbsp;</td>
    <td><input type="password" name="l_userpassword"></td>
  </tr>
</table>'
;
        
style_bottom('liststyles''Weiter &raquo;'1);
    break;
}
?>