Ulrich Block 2013-08-31 09:24:21 +02:00
parent 68448b878f
commit 2c7027592e
14 changed files with 161 additions and 120 deletions

View File

@ -1,20 +1,51 @@
<?php
<?php
/**
* File: api_config.php.
* Author: Ulrich Block
* Copyright 2010-2012
* Contact: support@easy-wi.com
* Page: easy-wi.com
* 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/>.
*/
// 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['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']='webspell';

View File

@ -1,29 +1,41 @@
<?php
<?php
/**
* File: api_users.php.
* Author: Ulrich Block
* Copyright 2010-2013
* Contact: support@easy-wi.com
* Page: easy-wi.com
* 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/>.
*/
// 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
$error=array();
@ -32,9 +44,9 @@ $error=array();
// Start looking only for new IDs
$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
// 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
// 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'));
@ -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.
$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'])) {
$config['externalIP']=(string)$_SERVER['REMOTE_ADDR'];
} 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

View File

@ -1,8 +1,43 @@
<?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'])) {
//Verbindung
// Connection
$ssh2=ssh2_connect($_POST['ip'],$_POST['port']);
if ($ssh2==true) {
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'];
}
} 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('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('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('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('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_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 (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('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('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('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('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 function_exists('fopen')) ? 'fopen function can be used.<br />' : 'fopen function cannot be used) and isset( please enable it.<br />';
if (extension_loaded('ssh2')) {
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>';

View File

@ -1105,6 +1105,13 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
$orderby='g.`serverip` ASC,g.`port` ASC';
$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->execute(array($reseller_id));
$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);
}
$next=$start+$amount;
$query=$sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `gsswitch` WHERE `resellerid`=?");
$query->execute(array($reseller_id));
$colcount=$query->fetchColumn();
if ($colcount>$next) {
$vor=$start+$amount;
} else {
$vor=$start;
}
$vor=($colcount>$next) ? $start+$amount : $start;
$back=$start-$amount;
if ($back>=0){
$zur=$start-$amount;
} else {
$zur=$start;
}
$zur=($back>=0) ? $start-$amount : $start;
$pageamount=ceil($colcount/$amount);
$link='<a href="admin.php?w=gs&amp;d=md&amp;o='.$o.'&amp;a=';
if(!isset($amount)) {
$amount=20;
}
$link .=$amount;
if ($start==0) {
$link .='&amp;p=0" class="bold">1</a>';
} else {
$link .='&amp;p=0">1</a>';
}
$pages[]=$link;
$pages[]='<a href="admin.php?w=gs&amp;d=md&amp;a=' . (!isset($amount)) ? 20 : $amount . ($start==0) ? '&p=0" class="bold">1</a>' : '&p=0">1</a>';
$i=2;
while ($i<=$pageamount) {
$selectpage=($i-1)*$amount;
if ($start==$selectpage) {
$pages[]='<a href="admin.php?w=gs&amp;d=md&amp;o='.$o.'&amp;a='.$amount.'&amp;p='.$selectpage.'" class="bold">'.$i.'</a>';
} else {
$pages[]='<a href="admin.php?w=gs&amp;d=md&amp;o='.$o.'&amp;a='.$amount.'&amp;p='.$selectpage.'">'.$i.'</a>';
}
$pages[]=($start==$selectpage) ? '<a href="admin.php?w=gs&amp;d=md&amp;a='.$amount.'&p='.$selectpage.'" class="bold">'.$i.'</a>' : '<a href="admin.php?w=ro&amp;d=md&amp;a='.$amount.'&p='.$selectpage.'">'.$i.'</a>';
$i++;
}
$pages=implode(', ',$pages);

View File

@ -137,9 +137,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
$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 (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->execute(array($extension,$id,$reseller_id));
if($query->rowCount()>0) $changed=true;
}
}
}

View File

@ -51,9 +51,7 @@ if ($reseller_id==0) {
$logsubuser=(isset($_SESSION['oldid'])) ? $_SESSION['oldid'] : 0;
$logreseller=0;
}
if ($reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
if ($reseller_id!=0 and $admin_id!=$reseller_id) $reseller_id=$admin_id;
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} 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));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
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 $gsStatus=1;
else if ($row2['active']=='Y' and $row2['stopped']=='N' and $row2['queryName']!='OFFLINE') $gsStatus=1;
else $gsStatus=3;
$gs[]=array('id'=>$row2['id'],'address'=>$row2['address'],'shorten'=>$row2['shorten'],'name'=>$row2['queryName'],'status'=>$gsStatus);
$used+=$row2['queryNumplayers'];
$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);
}
$next=$start+$amount;
$colcount=$query->fetchColumn();
$vor=($colcount>$next) ? $start+$amount : $start;
$back=$start-$amount;
$zur=($back>=0) ? $start-$amount : $start;

View File

@ -79,7 +79,6 @@ if (!function_exists('ssh2_execute')) {
} else {
$error=true;
}
print_r($rSA['down_checks']);
if (isset($error)) $notified++;
else $notified=0;
if ($notified==$rSA['down_checks']) {

View File

@ -35,19 +35,17 @@
* 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;
$logusername=getusername($admin_id,$sql);
$sprache=getlanguagefile('licence',$user_language,$reseller_id,$sql);
$logusertype="admin";
$logreseller=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 (version_compare(PHP_VERSION,'5.3.0')>=0) {
$phpversion=53;
} else {
$phpversion=5;
}
if ($ui->st('d','get')=='ud' and $reseller_id==0 and $pa['updateEW'] and ($ewVersions['cVersion']<$ewVersions['version'] or $ewVersions['files']<$ewVersions['version'])) {
if (isset($action) and $action=='ud') {
$updateinclude=true;
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')) {
$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")));
$fp=@fopen('http://update.easy-wi.com/ew/'.$licenceDetails['v'].'/'.$phpversion.'.zip','rb',false,$opts);
$zip=@fopen(EASYWIDIR.'/tmp/'.$phpversion.'.zip','wb');
$fp=@fopen('http://update.easy-wi.com/ew/'.$licenceDetails['v'].'.zip','rb',false,$opts);
$zip=@fopen(EASYWIDIR.'/tmp/'.$licenceDetails['v'].'.zip','wb');
if ($fp==true and $zip==true) {
while (!feof($fp)){
fwrite($zip,fread($fp,8192));
}
fclose($fp);
fclose($zip);
$zo=@zip_open(EASYWIDIR.'/tmp/'.$phpversion.'.zip');
$zo=@zip_open(EASYWIDIR.'/tmp/'.$licenceDetails['v'].'.zip');
if (is_resource($zo)) {
while ($ze=zip_read($zo)) {
$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);
} 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);
if (!isset($alreadyRepaired)) {
$response->add('Adding tables if needed.');
include(EASYWIDIR.'/stuff/tables_add.php');
}
if ($ewVersions['cVersion']<$ewVersions['version']) {
include(EASYWIDIR.'/install/update.php');
}
if ($ewVersions['cVersion']<$ewVersions['version']) include(EASYWIDIR.'/install/update.php');
if (!isset($alreadyRepaired)) {
$response->add('Repairing tables if needed.');
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);
}
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->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());
else $template_file=$response->printresponse();
} else {
if (isset($ewVersions)) {
$template_file='admin_versioncheck_ud.tpl';
}
if (isset($ewVersions)) $template_file='admin_versioncheck_ud.tpl';
}
} else {
$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->execute();
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if ($row["$column"]!=null and $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&amp;d=ud">Update</a></div>';
} else {
$update='';
if ($row["$column"]!=null and $row["$column"]!='') $table[]=array('version'=>$row['version'],'text'=>$row["$column"]);
}
$update=($reseller_id==0 and isset($pa['updateEW']) and $pa['updateEW']==true) ? '<div class="right"><a href="admin.php?w=vc&amp;d=ud">Update</a></div>' : '';
if ($ewVersions['cVersion']<$ewVersions['version']) {
$state=1;
$class='versioncheckbad';

View File

@ -64,9 +64,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lVo']) and $licence
$table=array();
$query=$sql->prepare("SELECT `id`,`cname`,`vname`,`name` FROM `userdata` WHERE `resellerid`=? AND `accounttype`='u' ORDER BY `id` DESC");
$query->execute(array($reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$table[$row['id']]=trim($row['cname'].' '.$row['vname'].' '.$row['name']);
}
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) $table[$row['id']]=trim($row['cname'].' '.$row['vname'].' '.$row['name']);
$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->execute(array($reseller_id));

View File

@ -2,7 +2,7 @@
</div><!--/row-->
<hr>
<footer>
<p>&copy; Easy-WI 2013 - <?php echo date('Y'); ?></p>
<p>&copy; Easy-WI 2011 - <?php echo date('Y'); ?></p>
</footer>
</div><!--/.fluid-container-->
<!-- Placed at the end of the document so the pages load faster -->

View File

@ -43,7 +43,7 @@
</thead>
<tbody>
<?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><?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>

View File

@ -44,7 +44,7 @@
</thead>
<tbody>
<?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['id'];?></td>
<td><?php echo $table_row['virtualID'];?></td>

View File

@ -2,7 +2,7 @@
</div><!--/row-->
<hr>
<footer>
<p>&copy; 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>&copy; 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>
</div><!--/.fluid-container-->
</body>

View File

@ -2,7 +2,7 @@
</div><!--/row-->
<hr>
<footer>
<p>&copy; Easy-WI 2013 - <?php echo date('Y'); ?></p>
<p>&copy; Easy-WI 2011 - <?php echo date('Y'); ?></p>
</footer>
</div><!--/.fluid-container-->
<!-- Placed at the end of the document so the pages load faster -->