* * This file is part of Easy-WI. * * Easy-WI 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 3 of the License, or * (at your option) any later version. * * Easy-WI is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Easy-WI. If not, see . * * Diese Datei ist Teil von Easy-WI. * * Easy-WI ist Freie Software: Sie koennen es unter den Bedingungen * der GNU General Public License, wie von der Free Software Foundation, * Version 3 der Lizenz oder (nach Ihrer Wahl) jeder spaeteren * veroeffentlichten Version, weiterverbreiten und/oder modifizieren. * * Easy-WI wird in der Hoffnung, dass es nuetzlich sein wird, aber * OHNE JEDE GEWAEHELEISTUNG, bereitgestellt; sogar ohne die implizite * Gewaehrleistung der MARKTFAEHIGKEIT oder EIGNUNG FUER EINEN BESTIMMTEN ZWECK. * Siehe die GNU General Public License fuer weitere Details. * * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem * Programm erhalten haben. Wenn nicht, siehe . */ if (isset($include) and $include == true) { if (!isset($displayToUser)) { $displayToUser = ''; } include(EASYWIDIR . '/stuff/keyphrasefile.php'); $query = $sql->prepare("DROP TABLE IF EXISTS `voice_stats_settings`"); $query->execute(); $query = $sql->prepare("DELETE FROM `easywi_statistics`"); $query->execute(); // move email related stuff from global settings into own table $query2 = $sql->prepare("INSERT INTO `settings_email` (`reseller_id`,`email_setting_name`,`email_setting_value`) VALUES (?,?,?) ON DUPLICATE KEY UPDATE `email_setting_value`=VALUES(`email_setting_value`)"); $query = $sql->prepare("SELECT *,AES_DECRYPT(`email_settings_password`,?) AS `decryptedpassword` FROM `settings`"); $query->execute(array($aeskey)); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $query2->execute(array($row['resellerid'], 'emailbackup', @gzuncompress($row['emailbackup']))); $query2->execute(array($row['resellerid'], 'emailbackuprestore', @gzuncompress($row['emailbackuprestore']))); $query2->execute(array($row['resellerid'], 'emaildown', @gzuncompress($row['emaildown']))); $query2->execute(array($row['resellerid'], 'emaildownrestart', @gzuncompress($row['emaildownrestart']))); $query2->execute(array($row['resellerid'], 'emailgserverupdate', @gzuncompress($row['emailgserverupdate']))); $query2->execute(array($row['resellerid'], 'emailpwrecovery', @gzuncompress($row['emailpwrecovery']))); $query2->execute(array($row['resellerid'], 'emailsecuritybreach', @gzuncompress($row['emailsecuritybreach']))); $query2->execute(array($row['resellerid'], 'emailnewticket', @gzuncompress($row['emailnewticket']))); $query2->execute(array($row['resellerid'], 'emailuseradd', @gzuncompress($row['emailuseradd']))); $query2->execute(array($row['resellerid'], 'emailvinstall', @gzuncompress($row['emailvinstall']))); $query2->execute(array($row['resellerid'], 'emailvrescue', @gzuncompress($row['emailvrescue']))); $query2->execute(array($row['resellerid'], 'emailregister', @gzuncompress($row['emailregister']))); $query2->execute(array($row['resellerid'], 'email', $row['email'])); $query2->execute(array($row['resellerid'], 'emailregards', $row['emailregards'])); $query2->execute(array($row['resellerid'], 'emailfooter', $row['emailfooter'])); $query2->execute(array($row['resellerid'], 'email_settings_host', $row['email_settings_host'])); $query2->execute(array($row['resellerid'], 'email_settings_password', $row['decryptedpassword'])); $query2->execute(array($row['resellerid'], 'email_settings_port', $row['email_settings_port'])); $query2->execute(array($row['resellerid'], 'email_settings_ssl', $row['email_settings_ssl'])); $query2->execute(array($row['resellerid'], 'email_settings_type', $row['email_settings_type'])); $query2->execute(array($row['resellerid'], 'email_settings_user', $row['email_settings_user'])); } // Try catch as some admins upgrade vom DEV to stable try { $query = $sql->prepare("SELECT `webVhostID`,`userID`,`resellerID`,`dns`,`ownVhost`,`vhostTemplate` FROM `webVhost`"); $query->execute(); $query2 = $sql->prepare("INSERT INTO `webVhostDomain` (`webVhostID`,`userID`,`resellerID`,`domain`,`path`,`ownVhost`,`vhostTemplate`) VALUES (?,?,?,?,'',?,?)"); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { // Try catch as some admins might have maintained domains not be so unique try { $query2->execute(array($row['webVhostID'], $row['userID'], $row['resellerID'], $row['dns'], $row['ownVhost'], $row['vhostTemplate'])); $response->add('Migrated ' . $row['dns'] . ' to new table.'); } catch(PDOException $error) { $response->add($error->getMessage()); } } } catch (PDOException $error) { $response->add($error->getMessage()); } $query = $sql->prepare("SELECT `id` FROM `modules` WHERE `get`='ro' LIMIT 1"); $query->execute(); $rootModuleId = (int) $query->fetchColumn(); if ($rootModuleId > 0) { $query = $sql->prepare("UPDATE `modules` SET `active`='N' WHERE `id`=? LIMIT 1"); $query->execute(array($rootModuleId)); } else { $query = $sql->prepare("INSERT INTO `modules` (`get`,`sub`,`file`,`active`,`type`) VALUES ('ro','ro','','N','C')"); $query->execute(); } $response->add('Repairing tables if needed.'); $tables->correctExistingTables(); $query = $sql->prepare("UPDATE `servertypes` SET `useQueryPort`=2 WHERE `gameq` IN ('armedassault2', 'armedassault2oa', 'armedassault3', 'bf2', 'cube2', 'mta', 'ut', 'ut2004', 'ut3')"); $query->execute(); $query = $sql->prepare("UPDATE `servertypes` SET `cmd`='./%binary% -n' WHERE `shorten`='mtasa' AND `cmd`='./%binary%'"); $query->execute(); // Add new games if not existing include(EASYWIDIR . '/stuff/data/gameslist.php'); $addGames = array('nmrih', 'projectcars'); $query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `servertypes` WHERE `shorten`=? AND `resellerid`=0 LIMIT 1"); $query2 = $sql->prepare("INSERT INTO `servertypes` (`steamgame`,`appID`,`updates`,`shorten`,`description`,`gamebinary`,`gamebinaryWin`,`binarydir`,`modfolder`,`fps`,`slots`,`map`,`cmd`,`modcmds`,`tic`,`gameq`,`gamemod`,`gamemod2`,`configs`,`configedit`,`portStep`,`portMax`,`portOne`,`portTwo`,`portThree`,`portFour`,`portFive`,`useQueryPort`,`mapGroup`,`protected`,`protectedSaveCFGs`,`ramLimited`,`os`,`resellerid`) VALUES (:steamgame,:appID,:updates,:shorten,:description,:gamebinary,:gamebinaryWin,:binarydir,:modfolder,:fps,:slots,:map,:cmd,:modcmds,:tic,:gameq,:gamemod,:gamemod2,:configs,:configedit,:portStep,:portMax,:portOne,:portTwo,:portThree,:portFour,:portFive,:useQueryPort,:mapGroup,:protected,:protectedSaveCFGs,:ramLimited,:os,:resellerid)"); foreach ($gameImages as $image) { if (in_array($image[':shorten'], $addGames) and count($image) == 33) { $image[':resellerid'] = 0; $query->execute(array($image[':shorten'])); $imageExists = (int) $query->fetchColumn(); if ($imageExists == 0) { $query2->execute($image); if ($query2->rowCount() > 0) { $response->add('Added : ' . $image[':description']); } } } } $query = $sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES ('5.00','
31.05.2015
Änderungen:


Bugfixes:
','
05.31.2015
Changes:


Bugfixes:
')"); $query->execute(); $response->add('Action: insert_easywi_version done: '); $query->closecursor(); } else { echo "Error: this file needs to be included by the updater!
"; }