mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
Tickets 31 and 32
https://github.com/easy-wi/developer/issues/31 https://github.com/easy-wi/developer/issues/32
This commit is contained in:
parent
68448b878f
commit
2c7027592e
51
external/api_config.php
vendored
51
external/api_config.php
vendored
@ -1,20 +1,51 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* File: api_config.php.
|
* File: api_config.php.
|
||||||
* Author: Ulrich Block
|
* Author: Ulrich Block
|
||||||
* Copyright 2010-2012
|
* Contact: <ulrich.block@easy-wi.com>
|
||||||
* Contact: support@easy-wi.com
|
*
|
||||||
* Page: easy-wi.com
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Configuring the API. Should be placed in another file and included
|
|
||||||
|
|
||||||
// The database access
|
// The database access
|
||||||
$config['dbHost']='localhost';
|
$config['dbHost']='localhost';
|
||||||
$config['dbName']='database';
|
$config['dbName']='database';
|
||||||
$config['dbUser']='databaseUser';
|
$config['dbUser']='databaseUser';
|
||||||
$config['dbPwd']='securePassword';
|
$config['dbPwd']='securePassword';
|
||||||
|
$config['sourceSystem']='securePassword';
|
||||||
|
|
||||||
// Access to the file
|
// Access to the file
|
||||||
$config['passwordToken']='myPasswordToken';
|
$config['passwordToken']='myPasswordToken';
|
||||||
$config['allowedIPs']=array('1.1.1.1','1.1.1.2');
|
$config['allowedIPs']=array('1.1.1.1','1.1.1.2');
|
||||||
|
|
||||||
|
// Type of System allowed are:
|
||||||
|
// webspell,teklab
|
||||||
|
$config['sourceType']='webspell';
|
62
external/api_users.php
vendored
62
external/api_users.php
vendored
@ -1,29 +1,41 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* File: api_users.php.
|
* File: api_users.php.
|
||||||
* Author: Ulrich Block
|
* Author: Ulrich Block
|
||||||
* Copyright 2010-2013
|
* Contact: <ulrich.block@easy-wi.com>
|
||||||
* Contact: support@easy-wi.com
|
*
|
||||||
* Page: easy-wi.com
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Configuring the API. Should be placed in another file and included
|
|
||||||
|
|
||||||
// The database access
|
|
||||||
$config['dbHost']='localhost';
|
|
||||||
$config['dbName']='database';
|
|
||||||
$config['dbUser']='databaseUser';
|
|
||||||
$config['dbPwd']='securePassword';
|
|
||||||
$config['sourceSystem']='securePassword';
|
|
||||||
|
|
||||||
// Access to the file
|
|
||||||
$config['passwordToken']='myPasswordToken';
|
|
||||||
$config['allowedIPs']=array('1.1.1.1','1.1.1.2');
|
|
||||||
|
|
||||||
// Type of System allowed are:
|
|
||||||
// webspell,teklab
|
|
||||||
$config['sourceType']='teklab';
|
|
||||||
|
|
||||||
|
require_once 'api_config.php';
|
||||||
|
|
||||||
// Initial parameters
|
// Initial parameters
|
||||||
$error=array();
|
$error=array();
|
||||||
@ -32,9 +44,9 @@ $error=array();
|
|||||||
// Start looking only for new IDs
|
// Start looking only for new IDs
|
||||||
$lastID=(isset($_GET['lastID']) and is_numeric($_GET['lastID'])) ? (int)$_GET['lastID'] : 0;
|
$lastID=(isset($_GET['lastID']) and is_numeric($_GET['lastID'])) ? (int)$_GET['lastID'] : 0;
|
||||||
|
|
||||||
// this requieres that a column exists which is updated every time the account gets an update:
|
// this requires that a column exists which is updated every time the account gets an update:
|
||||||
// ALTER TABLE `yourUserTable` ADD COLUMN `updatetime` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
// ALTER TABLE `yourUserTable` ADD COLUMN `updatetime` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
// This might lead to false posivives if data like the logintime is stored in that table.
|
// This might lead to false positives if data like the login time is stored in that table.
|
||||||
// The more accurate way would be to fill/update the column only in wanted cases
|
// The more accurate way would be to fill/update the column only in wanted cases
|
||||||
// convert to string and back to date so proper format is ensured
|
// convert to string and back to date so proper format is ensured
|
||||||
$updateTime=date('Y-m-d H:i:s',strtotime((isset($_GET['updateTime']) and @strtotime($_GET['updateTime'])) ? $_GET['updateTime'] : '0000-00-00 00:00:00'));
|
$updateTime=date('Y-m-d H:i:s',strtotime((isset($_GET['updateTime']) and @strtotime($_GET['updateTime'])) ? $_GET['updateTime'] : '0000-00-00 00:00:00'));
|
||||||
@ -45,11 +57,11 @@ $chunkSize=(isset($_GET['chunkSize']) and is_numeric($_GET['chunkSize'])) ? (int
|
|||||||
// To be able to properly get data in chunks the starting point needs to be defined.
|
// To be able to properly get data in chunks the starting point needs to be defined.
|
||||||
$start=(isset($_GET['start']) and is_numeric($_GET['start'])) ? (int)$_GET['start'] : 0;
|
$start=(isset($_GET['start']) and is_numeric($_GET['start'])) ? (int)$_GET['start'] : 0;
|
||||||
|
|
||||||
// Check if the IP is whitelisted
|
// Check if the IP is white listed
|
||||||
if(isset($_SERVER['REMOTE_ADDR']) and in_array($_SERVER['REMOTE_ADDR'],$config['allowedIPs'])) {
|
if(isset($_SERVER['REMOTE_ADDR']) and in_array($_SERVER['REMOTE_ADDR'],$config['allowedIPs'])) {
|
||||||
$config['externalIP']=(string)$_SERVER['REMOTE_ADDR'];
|
$config['externalIP']=(string)$_SERVER['REMOTE_ADDR'];
|
||||||
} else {
|
} else {
|
||||||
$error[]='Scipt called locally or IP is not whitelisted.';
|
$error[]='Script called locally or IP is not white listed.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if access token was send and is correct
|
// Check if access token was send and is correct
|
||||||
|
62
external/easywitester.php
vendored
62
external/easywitester.php
vendored
@ -1,8 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* File: easywitester.php.
|
||||||
|
* Author: Ulrich Block
|
||||||
|
* Contact: <ulrich.block@easy-wi.com>
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
if (isset($_POST['ip']) and isset($_POST['port']) and isset($_POST['submit']) and !empty($_POST['ip']) and !empty($_POST['port'])) {
|
if (isset($_POST['ip']) and isset($_POST['port']) and isset($_POST['submit']) and !empty($_POST['ip']) and !empty($_POST['port'])) {
|
||||||
|
|
||||||
//Verbindung
|
// Connection
|
||||||
$ssh2=ssh2_connect($_POST['ip'],$_POST['port']);
|
$ssh2=ssh2_connect($_POST['ip'],$_POST['port']);
|
||||||
if ($ssh2==true) {
|
if ($ssh2==true) {
|
||||||
echo 'Connect to: '.$_POST['ip'].':'.$_POST['port'].'<br />';
|
echo 'Connect to: '.$_POST['ip'].':'.$_POST['port'].'<br />';
|
||||||
@ -22,18 +57,17 @@ if (isset($_POST['ip']) and isset($_POST['port']) and isset($_POST['submit']) an
|
|||||||
echo 'could not connect to: '.$_POST['ip'].':'.$_POST['port'];
|
echo 'could not connect to: '.$_POST['ip'].':'.$_POST['port'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo extension_loaded('ionCube Loader') ? 'Ioncube extension is installed<br />' : 'Ioncube extension is not installed, please install it.<br />';
|
echo (extension_loaded('ssh2')) ? 'SSH2 extension is installed.<br />' : 'SSH2 extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('ssh2') ? 'SSH2 extension is installed.<br />' : 'SSH2 extension is not installed, please install it.<br />';
|
echo (extension_loaded('openssl') ? 'openssl extension is installed.<br />' : 'openssl extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('openssl') ? 'openssl extension is installed.<br />' : 'openssl extension is not installed, please install it.<br />';
|
echo (extension_loaded('json')) ? 'json extension is installed.<br />' : 'json extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('json') ? 'json extension is installed.<br />' : 'json extension is not installed, please install it.<br />';
|
echo (extension_loaded('hash')) ? 'hash extension is installed.<br />' : 'hash extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('hash') ? 'hash extension is installed.<br />' : 'hash extension is not installed, please install it.<br />';
|
echo (extension_loaded('ftp')) ? 'openssl extension is installed.<br />' : 'ftp extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('ftp') ? 'openssl extension is installed.<br />' : 'ftp extension is not installed, please install it.<br />';
|
echo (extension_loaded('SimpleXML')) ? 'session SimpleXMLis installed.<br />' : 'SimpleXML extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('SimpleXML') ? 'session SimpleXMLis installed.<br />' : 'SimpleXML extension is not installed, please install it.<br />';
|
echo (extension_loaded('curl')) ? 'curl extension is installed.<br />' : 'curl extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('curl') ? 'curl extension is installed.<br />' : 'curl extension is not installed, please install it.<br />';
|
echo (extension_loaded('gd')) ? 'gd extension is installed.<br />' : 'gd extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('gd') ? 'gd extension is installed.<br />' : 'gd extension is not installed, please install it.<br />';
|
echo (extension_loaded('PDO')) ? 'PDO extension is installed.<br />' : 'PDO extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('PDO') ? 'PDO extension is installed.<br />' : 'PDO extension is not installed, please install it.<br />';
|
echo (extension_loaded('pdo_mysql')) ? 'pdo_mysql extension is installed.<br />' : 'pdo_mysql extension is not installed, please install it.<br />';
|
||||||
echo extension_loaded('pdo_mysql') ? 'pdo_mysql extension is installed.<br />' : 'pdo_mysql extension is not installed, please install it.<br />';
|
echo function_exists('fopen')) ? 'fopen function can be used.<br />' : 'fopen function cannot be used) and isset( please enable it.<br />';
|
||||||
echo function_exists('fopen') ? 'fopen function can be used.<br />' : 'fopen function cannot be used) and isset( please enable it.<br />';
|
|
||||||
if (extension_loaded('ssh2')) {
|
if (extension_loaded('ssh2')) {
|
||||||
echo 'SSH2 extension is installed.<br />';
|
echo 'SSH2 extension is installed.<br />';
|
||||||
echo '<h1>Test SSH2 connection</h1><form method=post action='.$_SERVER['PHP_SELF'].' >IP: <input type=text name=ip required /><br />Port: <input type=text name=port required /><br />User: <input type=text name=user required /><br />Password: <input type=text name=password required /><br /><input type=submit name=submit value=Test /><br /></form>';
|
echo '<h1>Test SSH2 connection</h1><form method=post action='.$_SERVER['PHP_SELF'].' >IP: <input type=text name=ip required /><br />Port: <input type=text name=port required /><br />User: <input type=text name=user required /><br />Password: <input type=text name=password required /><br /><input type=submit name=submit value=Test /><br /></form>';
|
||||||
|
@ -1105,6 +1105,13 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
|
|||||||
$orderby='g.`serverip` ASC,g.`port` ASC';
|
$orderby='g.`serverip` ASC,g.`port` ASC';
|
||||||
$o='as';
|
$o='as';
|
||||||
}
|
}
|
||||||
|
$query=$sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `gsswitch` WHERE `resellerid`=?");
|
||||||
|
$query->execute(array($reseller_id));
|
||||||
|
$colcount=$query->fetchColumn();
|
||||||
|
if ($start>$colcount) {
|
||||||
|
$start=$colcount-$amount;
|
||||||
|
if ($start<0)$start=0;
|
||||||
|
}
|
||||||
$query=$sql->prepare("SELECT g.*,CONCAT(g.`serverip`,':',g.`port`) AS `server`,t.`shorten`,u.`cname`,u.`name`,u.`vname`,u.`active` AS `useractive` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` LEFT JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`resellerid`=? ORDER BY $orderby LIMIT $start,$amount");
|
$query=$sql->prepare("SELECT g.*,CONCAT(g.`serverip`,':',g.`port`) AS `server`,t.`shorten`,u.`cname`,u.`name`,u.`vname`,u.`active` AS `useractive` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` LEFT JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`resellerid`=? ORDER BY $orderby LIMIT $start,$amount");
|
||||||
$query->execute(array($reseller_id));
|
$query->execute(array($reseller_id));
|
||||||
$table = array();
|
$table = array();
|
||||||
@ -1173,40 +1180,15 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
|
|||||||
$table[]=array('serveractive'=>$serveractive,'shorten'=>$row['shorten'],'useractive'=>$row['useractive'],'cname'=>$row['cname'],'names'=>trim($row['name'].' '.$row['vname']),'img'=>$imgName,'alt'=>$imgAlt,'premoved'=>$premoved,'nameremoved'=>$nameremoved,'server'=>$server,'serverid'=>$serverid,'name'=>$name,'type'=>$type,'map'=>$map,'numplayers'=>$numplayers,'maxplayers'=>$maxplayers,'id'=>$userid,'lendserver'=>$lendserver,'active'=>$row['active'],'jobPending'=>$jobPending);
|
$table[]=array('serveractive'=>$serveractive,'shorten'=>$row['shorten'],'useractive'=>$row['useractive'],'cname'=>$row['cname'],'names'=>trim($row['name'].' '.$row['vname']),'img'=>$imgName,'alt'=>$imgAlt,'premoved'=>$premoved,'nameremoved'=>$nameremoved,'server'=>$server,'serverid'=>$serverid,'name'=>$name,'type'=>$type,'map'=>$map,'numplayers'=>$numplayers,'maxplayers'=>$maxplayers,'id'=>$userid,'lendserver'=>$lendserver,'active'=>$row['active'],'jobPending'=>$jobPending);
|
||||||
}
|
}
|
||||||
$next=$start+$amount;
|
$next=$start+$amount;
|
||||||
$query=$sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `gsswitch` WHERE `resellerid`=?");
|
$vor=($colcount>$next) ? $start+$amount : $start;
|
||||||
$query->execute(array($reseller_id));
|
|
||||||
$colcount=$query->fetchColumn();
|
|
||||||
if ($colcount>$next) {
|
|
||||||
$vor=$start+$amount;
|
|
||||||
} else {
|
|
||||||
$vor=$start;
|
|
||||||
}
|
|
||||||
$back=$start-$amount;
|
$back=$start-$amount;
|
||||||
if ($back>=0){
|
$zur=($back>=0) ? $start-$amount : $start;
|
||||||
$zur=$start-$amount;
|
|
||||||
} else {
|
|
||||||
$zur=$start;
|
|
||||||
}
|
|
||||||
$pageamount=ceil($colcount/$amount);
|
$pageamount=ceil($colcount/$amount);
|
||||||
$link='<a href="admin.php?w=gs&d=md&o='.$o.'&a=';
|
$pages[]='<a href="admin.php?w=gs&d=md&a=' . (!isset($amount)) ? 20 : $amount . ($start==0) ? '&p=0" class="bold">1</a>' : '&p=0">1</a>';
|
||||||
if(!isset($amount)) {
|
|
||||||
$amount=20;
|
|
||||||
}
|
|
||||||
$link .=$amount;
|
|
||||||
if ($start==0) {
|
|
||||||
$link .='&p=0" class="bold">1</a>';
|
|
||||||
} else {
|
|
||||||
$link .='&p=0">1</a>';
|
|
||||||
}
|
|
||||||
$pages[]=$link;
|
|
||||||
$i=2;
|
$i=2;
|
||||||
while ($i<=$pageamount) {
|
while ($i<=$pageamount) {
|
||||||
$selectpage=($i-1)*$amount;
|
$selectpage=($i-1)*$amount;
|
||||||
if ($start==$selectpage) {
|
$pages[]=($start==$selectpage) ? '<a href="admin.php?w=gs&d=md&a='.$amount.'&p='.$selectpage.'" class="bold">'.$i.'</a>' : '<a href="admin.php?w=ro&d=md&a='.$amount.'&p='.$selectpage.'">'.$i.'</a>';
|
||||||
$pages[]='<a href="admin.php?w=gs&d=md&o='.$o.'&a='.$amount.'&p='.$selectpage.'" class="bold">'.$i.'</a>';
|
|
||||||
} else {
|
|
||||||
$pages[]='<a href="admin.php?w=gs&d=md&o='.$o.'&a='.$amount.'&p='.$selectpage.'">'.$i.'</a>';
|
|
||||||
}
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$pages=implode(', ',$pages);
|
$pages=implode(', ',$pages);
|
||||||
|
@ -137,9 +137,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
|
|||||||
$extension=$exploded[count($exploded)-1];
|
$extension=$exploded[count($exploded)-1];
|
||||||
if(isset($allowedTypes[$extension]) and ((is_array($allowedTypes[$extension]) and in_array($_FILES["upload"]["type"],$allowedTypes[$extension])) or (!is_array($allowedTypes[$extension]) and $_FILES["upload"]["type"]==$allowedTypes[$extension])) ) {
|
if(isset($allowedTypes[$extension]) and ((is_array($allowedTypes[$extension]) and in_array($_FILES["upload"]["type"],$allowedTypes[$extension])) or (!is_array($allowedTypes[$extension]) and $_FILES["upload"]["type"]==$allowedTypes[$extension])) ) {
|
||||||
if (move_uploaded_file($_FILES["upload"]["tmp_name"],EASYWIDIR.'/downloads/'.$id.'.'.$extension)) {
|
if (move_uploaded_file($_FILES["upload"]["tmp_name"],EASYWIDIR.'/downloads/'.$id.'.'.$extension)) {
|
||||||
|
$changed=true;
|
||||||
$query=$sql->prepare("UPDATE `page_downloads` SET `fileExtension`=? WHERE `fileID`=? AND `resellerID`=?");
|
$query=$sql->prepare("UPDATE `page_downloads` SET `fileExtension`=? WHERE `fileID`=? AND `resellerID`=?");
|
||||||
$query->execute(array($extension,$id,$reseller_id));
|
$query->execute(array($extension,$id,$reseller_id));
|
||||||
if($query->rowCount()>0) $changed=true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,7 @@ if ($reseller_id==0) {
|
|||||||
$logsubuser=(isset($_SESSION['oldid'])) ? $_SESSION['oldid'] : 0;
|
$logsubuser=(isset($_SESSION['oldid'])) ? $_SESSION['oldid'] : 0;
|
||||||
$logreseller=0;
|
$logreseller=0;
|
||||||
}
|
}
|
||||||
if ($reseller_id!=0 and $admin_id!=$reseller_id) {
|
if ($reseller_id!=0 and $admin_id!=$reseller_id) $reseller_id=$admin_id;
|
||||||
$reseller_id=$admin_id;
|
|
||||||
}
|
|
||||||
if ($ui->w('action',4,'post') and !token(true)) {
|
if ($ui->w('action',4,'post') and !token(true)) {
|
||||||
$template_file=$spracheResponse->token;
|
$template_file=$spracheResponse->token;
|
||||||
} else if ($ui->st('d','get')=='ad' and $reseller_id==0) {
|
} else if ($ui->st('d','get')=='ad' and $reseller_id==0) {
|
||||||
@ -299,8 +297,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
|
|||||||
$query2->execute(array($id,$reseller_id));
|
$query2->execute(array($id,$reseller_id));
|
||||||
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
|
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
|
||||||
if ($row2['active']=='N' or $row2['stopped']=='Y') $gsStatus=2;
|
if ($row2['active']=='N' or $row2['stopped']=='Y') $gsStatus=2;
|
||||||
else if ($row2['active']=='Y' and $row2['stopped']=='N' and $row2['queryName']!='OFFLINE') $gsStatus=3;
|
else if ($row2['active']=='Y' and $row2['stopped']=='N' and $row2['queryName']!='OFFLINE') $gsStatus=1;
|
||||||
else $gsStatus=1;
|
else $gsStatus=3;
|
||||||
$gs[]=array('id'=>$row2['id'],'address'=>$row2['address'],'shorten'=>$row2['shorten'],'name'=>$row2['queryName'],'status'=>$gsStatus);
|
$gs[]=array('id'=>$row2['id'],'address'=>$row2['address'],'shorten'=>$row2['shorten'],'name'=>$row2['queryName'],'status'=>$gsStatus);
|
||||||
$used+=$row2['queryNumplayers'];
|
$used+=$row2['queryNumplayers'];
|
||||||
$available+=$row2['slots'];
|
$available+=$row2['slots'];
|
||||||
@ -319,7 +317,6 @@ if ($ui->w('action',4,'post') and !token(true)) {
|
|||||||
$table[]=array('id'=>$id,'names'=>$names,'deleteAllowed'=>$deleteAllowed,'img'=>$imgName,'alt'=>$imgAlt,'ip'=>$row['ip'],'active'=>$row['active'],'os'=>$row['os'],'bit'=>$row['bitversion'],'description'=>$row['description'],'used'=>$used,'max'=>$available,'maxslots'=>$maxslots,'maxserver'=>$maxserver,'installedserver'=>$i,'server'=>$gs);
|
$table[]=array('id'=>$id,'names'=>$names,'deleteAllowed'=>$deleteAllowed,'img'=>$imgName,'alt'=>$imgAlt,'ip'=>$row['ip'],'active'=>$row['active'],'os'=>$row['os'],'bit'=>$row['bitversion'],'description'=>$row['description'],'used'=>$used,'max'=>$available,'maxslots'=>$maxslots,'maxserver'=>$maxserver,'installedserver'=>$i,'server'=>$gs);
|
||||||
}
|
}
|
||||||
$next=$start+$amount;
|
$next=$start+$amount;
|
||||||
$colcount=$query->fetchColumn();
|
|
||||||
$vor=($colcount>$next) ? $start+$amount : $start;
|
$vor=($colcount>$next) ? $start+$amount : $start;
|
||||||
$back=$start-$amount;
|
$back=$start-$amount;
|
||||||
$zur=($back>=0) ? $start-$amount : $start;
|
$zur=($back>=0) ? $start-$amount : $start;
|
||||||
|
@ -79,7 +79,6 @@ if (!function_exists('ssh2_execute')) {
|
|||||||
} else {
|
} else {
|
||||||
$error=true;
|
$error=true;
|
||||||
}
|
}
|
||||||
print_r($rSA['down_checks']);
|
|
||||||
if (isset($error)) $notified++;
|
if (isset($error)) $notified++;
|
||||||
else $notified=0;
|
else $notified=0;
|
||||||
if ($notified==$rSA['down_checks']) {
|
if ($notified==$rSA['down_checks']) {
|
||||||
|
@ -35,19 +35,17 @@
|
|||||||
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
|
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((!isset($admin_id) or $main!=1) or $reseller_id!=0 or !$pa['updateEW']) redirect('admin.php');
|
if ((!isset($admin_id) or $main!=1) or $reseller_id!=0 or !$pa['updateEW']) {
|
||||||
|
header('Location: admin.php');
|
||||||
|
die;
|
||||||
|
}
|
||||||
$loguserid=$admin_id;
|
$loguserid=$admin_id;
|
||||||
$logusername=getusername($admin_id,$sql);
|
$logusername=getusername($admin_id,$sql);
|
||||||
$sprache=getlanguagefile('licence',$user_language,$reseller_id,$sql);
|
$sprache=getlanguagefile('licence',$user_language,$reseller_id,$sql);
|
||||||
$logusertype="admin";
|
$logusertype="admin";
|
||||||
$logreseller=0;
|
$logreseller=0;
|
||||||
$logsubuser=0;
|
$logsubuser=0;
|
||||||
if ($ui->st('d','get')=='ud' and $reseller_id=='0' and $pa['updateEW'] and ($ewVersions['cVersion']<$ewVersions['version'] or $ewVersions['files']<$ewVersions['version'])) {
|
if ($ui->st('d','get')=='ud' and $reseller_id==0 and $pa['updateEW'] and ($ewVersions['cVersion']<$ewVersions['version'] or $ewVersions['files']<$ewVersions['version'])) {
|
||||||
if (version_compare(PHP_VERSION,'5.3.0')>=0) {
|
|
||||||
$phpversion=53;
|
|
||||||
} else {
|
|
||||||
$phpversion=5;
|
|
||||||
}
|
|
||||||
if (isset($action) and $action=='ud') {
|
if (isset($action) and $action=='ud') {
|
||||||
$updateinclude=true;
|
$updateinclude=true;
|
||||||
class UpdateResponse {
|
class UpdateResponse {
|
||||||
@ -93,15 +91,15 @@ if ($ui->st('d','get')=='ud' and $reseller_id=='0' and $pa['updateEW'] and ($ewV
|
|||||||
if (is_dir(EASYWIDIR.'/tmp')) {
|
if (is_dir(EASYWIDIR.'/tmp')) {
|
||||||
$response->add('Creating tempfolder <b>tmp/</b>');
|
$response->add('Creating tempfolder <b>tmp/</b>');
|
||||||
$opts=stream_context_create(array('http'=>array('method'=>'GET','header'=>"Accept-language: en\r\nUser-Agent: ".$ui->server['HTTP_HOST']."\r\n")));
|
$opts=stream_context_create(array('http'=>array('method'=>'GET','header'=>"Accept-language: en\r\nUser-Agent: ".$ui->server['HTTP_HOST']."\r\n")));
|
||||||
$fp=@fopen('http://update.easy-wi.com/ew/'.$licenceDetails['v'].'/'.$phpversion.'.zip','rb',false,$opts);
|
$fp=@fopen('http://update.easy-wi.com/ew/'.$licenceDetails['v'].'.zip','rb',false,$opts);
|
||||||
$zip=@fopen(EASYWIDIR.'/tmp/'.$phpversion.'.zip','wb');
|
$zip=@fopen(EASYWIDIR.'/tmp/'.$licenceDetails['v'].'.zip','wb');
|
||||||
if ($fp==true and $zip==true) {
|
if ($fp==true and $zip==true) {
|
||||||
while (!feof($fp)){
|
while (!feof($fp)){
|
||||||
fwrite($zip,fread($fp,8192));
|
fwrite($zip,fread($fp,8192));
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
fclose($zip);
|
fclose($zip);
|
||||||
$zo=@zip_open(EASYWIDIR.'/tmp/'.$phpversion.'.zip');
|
$zo=@zip_open(EASYWIDIR.'/tmp/'.$licenceDetails['v'].'.zip');
|
||||||
if (is_resource($zo)) {
|
if (is_resource($zo)) {
|
||||||
while ($ze=zip_read($zo)) {
|
while ($ze=zip_read($zo)) {
|
||||||
$name=zip_entry_name($ze);
|
$name=zip_entry_name($ze);
|
||||||
@ -142,16 +140,14 @@ if ($ui->st('d','get')=='ud' and $reseller_id=='0' and $pa['updateEW'] and ($ewV
|
|||||||
}
|
}
|
||||||
zip_close($zo);
|
zip_close($zo);
|
||||||
} else {
|
} else {
|
||||||
$response->addError('Cannot open the update archive <b>'.$phpversion.'.zip</b>');
|
$response->addError('Cannot open the update archive <b>'.$licenceDetails['v'].'.zip</b>');
|
||||||
}
|
}
|
||||||
$sql->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING);
|
$sql->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_WARNING);
|
||||||
if (!isset($alreadyRepaired)) {
|
if (!isset($alreadyRepaired)) {
|
||||||
$response->add('Adding tables if needed.');
|
$response->add('Adding tables if needed.');
|
||||||
include(EASYWIDIR.'/stuff/tables_add.php');
|
include(EASYWIDIR.'/stuff/tables_add.php');
|
||||||
}
|
}
|
||||||
if ($ewVersions['cVersion']<$ewVersions['version']) {
|
if ($ewVersions['cVersion']<$ewVersions['version']) include(EASYWIDIR.'/install/update.php');
|
||||||
include(EASYWIDIR.'/install/update.php');
|
|
||||||
}
|
|
||||||
if (!isset($alreadyRepaired)) {
|
if (!isset($alreadyRepaired)) {
|
||||||
$response->add('Repairing tables if needed.');
|
$response->add('Repairing tables if needed.');
|
||||||
include(EASYWIDIR.'/stuff/tables_repair.php');
|
include(EASYWIDIR.'/stuff/tables_repair.php');
|
||||||
@ -164,7 +160,7 @@ if ($ui->st('d','get')=='ud' and $reseller_id=='0' and $pa['updateEW'] and ($ewV
|
|||||||
if ($c!='.' and $c!='..') rmr(EASYWIDIR.'/tmp/'.$c);
|
if ($c!='.' and $c!='..') rmr(EASYWIDIR.'/tmp/'.$c);
|
||||||
}
|
}
|
||||||
rmr(EASYWIDIR.'/install/');
|
rmr(EASYWIDIR.'/install/');
|
||||||
if (is_file(EASYWIDIR.'/tmp/'.$phpversion.'.zip')) $response->addError('Cannot remove the content from tempfolder <b>tmp/</b>');
|
if (is_file(EASYWIDIR.'/tmp/'.$licenceDetails['v'].'.zip')) $response->addError('Cannot remove the content from tempfolder <b>tmp/</b>');
|
||||||
else $response->add('Removed temporary files from tempfolder');
|
else $response->add('Removed temporary files from tempfolder');
|
||||||
} else {
|
} else {
|
||||||
$response->addError('Cannot create the tempfolder <b>tmp/</b>');
|
$response->addError('Cannot create the tempfolder <b>tmp/</b>');
|
||||||
@ -173,9 +169,7 @@ if ($ui->st('d','get')=='ud' and $reseller_id=='0' and $pa['updateEW'] and ($ewV
|
|||||||
if (isset($template_file)) $template_file.=' <br/>'.implode('<br />',$response->printresponse());
|
if (isset($template_file)) $template_file.=' <br/>'.implode('<br />',$response->printresponse());
|
||||||
else $template_file=$response->printresponse();
|
else $template_file=$response->printresponse();
|
||||||
} else {
|
} else {
|
||||||
if (isset($ewVersions)) {
|
if (isset($ewVersions)) $template_file='admin_versioncheck_ud.tpl';
|
||||||
$template_file='admin_versioncheck_ud.tpl';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$table=array();
|
$table=array();
|
||||||
@ -190,15 +184,9 @@ if ($ui->st('d','get')=='ud' and $reseller_id=='0' and $pa['updateEW'] and ($ewV
|
|||||||
$query=$sql->prepare("SELECT `version`,`$column` FROM `easywi_version` ORDER BY `id` DESC");
|
$query=$sql->prepare("SELECT `version`,`$column` FROM `easywi_version` ORDER BY `id` DESC");
|
||||||
$query->execute();
|
$query->execute();
|
||||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||||
if ($row["$column"]!=null and $row["$column"]!='') {
|
if ($row["$column"]!=null and $row["$column"]!='') $table[]=array('version'=>$row['version'],'text'=>$row["$column"]);
|
||||||
$table[]=array('version'=>$row['version'],'text'=>$row["$column"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($reseller_id==0 and isset($pa['updateEW']) and $pa['updateEW']==true) {
|
|
||||||
$update='<div class="right"><a href="admin.php?w=vc&d=ud">Update</a></div>';
|
|
||||||
} else {
|
|
||||||
$update='';
|
|
||||||
}
|
}
|
||||||
|
$update=($reseller_id==0 and isset($pa['updateEW']) and $pa['updateEW']==true) ? '<div class="right"><a href="admin.php?w=vc&d=ud">Update</a></div>' : '';
|
||||||
if ($ewVersions['cVersion']<$ewVersions['version']) {
|
if ($ewVersions['cVersion']<$ewVersions['version']) {
|
||||||
$state=1;
|
$state=1;
|
||||||
$class='versioncheckbad';
|
$class='versioncheckbad';
|
||||||
|
@ -64,9 +64,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lVo']) and $licence
|
|||||||
$table=array();
|
$table=array();
|
||||||
$query=$sql->prepare("SELECT `id`,`cname`,`vname`,`name` FROM `userdata` WHERE `resellerid`=? AND `accounttype`='u' ORDER BY `id` DESC");
|
$query=$sql->prepare("SELECT `id`,`cname`,`vname`,`name` FROM `userdata` WHERE `resellerid`=? AND `accounttype`='u' ORDER BY `id` DESC");
|
||||||
$query->execute(array($reseller_id));
|
$query->execute(array($reseller_id));
|
||||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) $table[$row['id']]=trim($row['cname'].' '.$row['vname'].' '.$row['name']);
|
||||||
$table[$row['id']]=trim($row['cname'].' '.$row['vname'].' '.$row['name']);
|
|
||||||
}
|
|
||||||
$table2=array();
|
$table2=array();
|
||||||
$query=$sql->prepare("SELECT m.`id`,m.`ssh2ip`,m.`ips`,m.`usedns`,m.`defaultdns`,m.`type`,m.`rootid`,m.`maxserver`,m.`maxslots`,m.`active`,m.`resellerid`,COUNT(v.`id`)*(100/m.`maxserver`) AS `serverpercent`,SUM(v.`slots`)*(100/m.`maxslots`) AS `slotpercent`,COUNT(v.`id`) AS `installedserver`,SUM(v.`slots`) AS `installedslots`,SUM(v.`usedslots`) AS `uslots`,r.`ip` FROM `voice_masterserver` m LEFT JOIN `rserverdata` r ON m.`rootid`=r.`id` LEFT JOIN `voice_server` v ON m.`id`=v.`masterserver` GROUP BY m.`id` HAVING (`installedserver`<`maxserver` AND (`installedslots`<`maxslots` OR `installedslots` IS NULL) AND `active`='Y' AND `resellerid`=?) ORDER BY `slotpercent`,`serverpercent` ASC");
|
$query=$sql->prepare("SELECT m.`id`,m.`ssh2ip`,m.`ips`,m.`usedns`,m.`defaultdns`,m.`type`,m.`rootid`,m.`maxserver`,m.`maxslots`,m.`active`,m.`resellerid`,COUNT(v.`id`)*(100/m.`maxserver`) AS `serverpercent`,SUM(v.`slots`)*(100/m.`maxslots`) AS `slotpercent`,COUNT(v.`id`) AS `installedserver`,SUM(v.`slots`) AS `installedslots`,SUM(v.`usedslots`) AS `uslots`,r.`ip` FROM `voice_masterserver` m LEFT JOIN `rserverdata` r ON m.`rootid`=r.`id` LEFT JOIN `voice_server` v ON m.`id`=v.`masterserver` GROUP BY m.`id` HAVING (`installedserver`<`maxserver` AND (`installedslots`<`maxslots` OR `installedslots` IS NULL) AND `active`='Y' AND `resellerid`=?) ORDER BY `slotpercent`,`serverpercent` ASC");
|
||||||
$query->execute(array($reseller_id));
|
$query->execute(array($reseller_id));
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
</div><!--/row-->
|
</div><!--/row-->
|
||||||
<hr>
|
<hr>
|
||||||
<footer>
|
<footer>
|
||||||
<p>© Easy-WI 2013 - <?php echo date('Y'); ?></p>
|
<p>© Easy-WI 2011 - <?php echo date('Y'); ?></p>
|
||||||
</footer>
|
</footer>
|
||||||
</div><!--/.fluid-container-->
|
</div><!--/.fluid-container-->
|
||||||
<!-- Placed at the end of the document so the pages load faster -->
|
<!-- Placed at the end of the document so the pages load faster -->
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($table as $table_row) { ?>
|
<?php foreach ($table as $table_row) { ?>
|
||||||
<tr>
|
<tr class="<?php if($table_row['img']=='16_ok') echo 'success'; else if($table_row['img']=='16_bad') echo 'warning'; else echo 'error';?>">
|
||||||
<td><img src="images/games/icons/<?php echo $table_row['shorten'];?>.png" alt="<?php echo $table_row['shorten'];?>" width="16"/> <?php echo $table_row['server'];?><?php echo $table_row['premoved']." ".$table_row['nameremoved'];?></td>
|
<td><img src="images/games/icons/<?php echo $table_row['shorten'];?>.png" alt="<?php echo $table_row['shorten'];?>" width="16"/> <?php echo $table_row['server'];?><?php echo $table_row['premoved']." ".$table_row['nameremoved'];?></td>
|
||||||
<td><?php echo $table_row['serverid'];?></td>
|
<td><?php echo $table_row['serverid'];?></td>
|
||||||
<td><i class="<?php if($table_row['img']=='16_ok') echo 'icon-ok'; else if($table_row['img']=='16_bad') echo 'icon-stop'; else echo 'icon-warning-sign';?>"></i></td>
|
<td><i class="<?php if($table_row['img']=='16_ok') echo 'icon-ok'; else if($table_row['img']=='16_bad') echo 'icon-stop'; else echo 'icon-warning-sign';?>"></i></td>
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($table as $table_row) { ?>
|
<?php foreach ($table as $table_row) { ?>
|
||||||
<tr>
|
<tr class="<?php if($table_row['img']=='16_ok') echo 'success'; else if($table_row['img']=='16_bad') echo 'warning'; else echo 'error';?>">
|
||||||
<td><?php echo $table_row['server'];?></td>
|
<td><?php echo $table_row['server'];?></td>
|
||||||
<td><?php echo $table_row['id'];?></td>
|
<td><?php echo $table_row['id'];?></td>
|
||||||
<td><?php echo $table_row['virtualID'];?></td>
|
<td><?php echo $table_row['virtualID'];?></td>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
</div><!--/row-->
|
</div><!--/row-->
|
||||||
<hr>
|
<hr>
|
||||||
<footer>
|
<footer>
|
||||||
<p>© Easy-WI 2013 - <?php echo date('Y'); ?> <a href="<?php echo $page_data->pages['sitemap']['link'];?>" class="pull-right"><?php echo $page_data->pages['sitemap']['linkname'];?></a></p>
|
<p>© Easy-WI 2011 - <?php echo date('Y'); ?> <a href="<?php echo $page_data->pages['sitemap']['link'];?>" class="pull-right"><?php echo $page_data->pages['sitemap']['linkname'];?></a></p>
|
||||||
</footer>
|
</footer>
|
||||||
</div><!--/.fluid-container-->
|
</div><!--/.fluid-container-->
|
||||||
</body>
|
</body>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
</div><!--/row-->
|
</div><!--/row-->
|
||||||
<hr>
|
<hr>
|
||||||
<footer>
|
<footer>
|
||||||
<p>© Easy-WI 2013 - <?php echo date('Y'); ?></p>
|
<p>© Easy-WI 2011 - <?php echo date('Y'); ?></p>
|
||||||
</footer>
|
</footer>
|
||||||
</div><!--/.fluid-container-->
|
</div><!--/.fluid-container-->
|
||||||
<!-- Placed at the end of the document so the pages load faster -->
|
<!-- Placed at the end of the document so the pages load faster -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user