Changeset 57 for trunk/www/index.php
- Timestamp:
- Aug 4, 2009, 5:32:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/index.php
r55 r57 2 2 3 3 include('include.php'); 4 5 chdir(substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], '/')));6 7 $ScriptTimeStart = GetMicrotime();8 // SQL injection hack protection9 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);10 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);11 12 if(isset($_SERVER['REMOTE_ADDR'])) session_start();13 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);14 $Database->Prefix = $Config['Database']['Prefix'];15 $Database->charset($Config['Database']['Charset']);16 17 $System = new System($Database, null);18 $System->Config = $Config;19 $System->AddModule(new Log($Database, $System));20 $System->AddModule(new User($Database, $System));21 if(isset($_SERVER['REMOTE_ADDR'])) $System->Modules['User']->Check();22 else $System->Modules['User']->User['Id'] = 0;23 4 24 5 class Index extends Page … … 116 97 $Output .= $ServerView->Save(); 117 98 } else 118 if($_GET['Action'] == 'ServerEditDetailed')119 {120 $ServerView = new ServerView($this->Database, $this->System);121 $Output .= $ServerView->EditDetailed();122 } else123 if($_GET['Action'] == 'ServerSaveDetailed')124 {125 $ServerView = new ServerView($this->Database, $this->System);126 $Output .= $ServerView->SaveDetailed();127 } else128 99 if($_GET['Action'] == 'ServerStart') 129 100 { … … 161 132 $Output .= $EmulatorView->Download(); 162 133 } else 134 if($_GET['Action'] == 'EmulatorAdd') 135 { 136 $EmulatorView = new EmulatorView($this->Database, $this->System); 137 $Output .= $EmulatorView->Add(); 138 } else 139 if($_GET['Action'] == 'EmulatorAdd2') 140 { 141 $EmulatorView = new EmulatorView($this->Database, $this->System); 142 $Output .= $EmulatorView->AddFinish(); 143 } else 163 144 if($_GET['Action'] == 'ServerDebug') 164 145 { … … 196 177 $Output .= $ServerView->AccountCreateFinish(); 197 178 } else 198 if($_GET['Action'] == 'EmulatorAdd')199 {200 $EmulatorView = new EmulatorView($this->Database, $this->System);201 $Output .= $EmulatorView->Add();202 } else203 if($_GET['Action'] == 'EmulatorAdd2')204 {205 $EmulatorView = new EmulatorView($this->Database, $this->System);206 $Output .= $EmulatorView->AddFinish();207 } else208 179 if($_GET['Action'] == 'Info') 209 180 { … … 265 236 $RealmView = new RealmView($this->Database, $this->System); 266 237 $Output .= $RealmView->ItemList(); 238 } else 239 if($_GET['Action'] == 'RealmShow') 240 { 241 $RealmView = new RealmView($this->Database, $this->System); 242 $Output .= $RealmView->Item(); 243 } else 244 if($_GET['Action'] == 'RealmAdd') 245 { 246 $RealmView = new RealmView($this->Database, $this->System); 247 $Output .= $RealmView->Add(); 248 } else 249 if($_GET['Action'] == 'RealmCreate') 250 { 251 $RealmView = new RealmView($this->Database, $this->System); 252 $Output .= $RealmView->Create(); 253 } else 254 if($_GET['Action'] == 'RealmEdit') 255 { 256 $RealmView = new RealmView($this->Database, $this->System); 257 $Output .= $RealmView->Edit(); 258 } else 259 if($_GET['Action'] == 'RealmSave') 260 { 261 $RealmView = new RealmView($this->Database, $this->System); 262 $Output .= $RealmView->Save(); 263 } else 264 if($_GET['Action'] == 'RealmEditDetailed') 265 { 266 $RealmView = new RealmView($this->Database, $this->System); 267 $Output .= $RealmView->EditDetailed(); 268 } else 269 if($_GET['Action'] == 'RealmSaveDetailed') 270 { 271 $RealmView = new RealmView($this->Database, $this->System); 272 $Output .= $RealmView->SaveDetailed(); 273 } else 274 if($_GET['Action'] == 'RealmStart') 275 { 276 $RealmView = new RealmView($this->Database, $this->System); 277 $Output .= $RealmView->Start(); 278 } else 279 if($_GET['Action'] == 'RealmStop') 280 { 281 $RealmView = new RealmView($this->Database, $this->System); 282 $Output .= $RealmView->Stop(); 267 283 } else 268 284 if($_GET['Action'] == 'Test')
Note:
See TracChangeset
for help on using the changeset viewer.