示例#1
0
function analyze_database()
{
    $result = mysql_query('SHOW TABLES');
    $i = 0;
    while ($table = mysql_fetch_row($result)) {
        if (preg_match("#^" . DBPREFIX . "#", $table[0])) {
            $analysis[$i] = query_fetch_assoc('ANALYZE TABLE ' . $table[0]);
            $i++;
        }
    }
    unset($result);
    if (isset($analysis)) {
        return $analysis;
    }
}
示例#2
0
/**
 * Retrieve all Client's groups in an array
 *
 * Return FALSE if the specified Client is NOT linked to a Group OR if the GROUPID is invalid OR if the Client doesn't exists
 */
function getClientGroups($clientid)
{
    if (query_numrows("SELECT `username` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "'") != 0 && query_numrows("SELECT `id` FROM `" . DBPREFIX . "groupMember` WHERE `clientid` = '" . $clientid . "'") != 0) {
        // The specified client exists
        $groupids = query_fetch_assoc("SELECT `groupids` FROM `" . DBPREFIX . "groupMember` WHERE `clientid` = '" . $clientid . "'");
        $groupidsTable = explode(';', $groupids['groupids']);
        // CSV
        $i = 0;
        foreach ($groupidsTable as $value) {
            if (!empty($value)) {
                $groups[$i] = $value;
                $i++;
            }
        }
        if (isset($groups)) {
            return $groups;
        }
    }
    return FALSE;
}
示例#3
0
 $email = mysql_real_escape_string($_POST['email']);
 ###
 /**
  * Securimage - A PHP class for creating captcha images.
  *
  * VERSION: 3.0
  * AUTHOR: Drew Phillips <*****@*****.**>
  */
 require "../libs/securimage/securimage.php";
 $securimage = new Securimage();
 ###
 if ($securimage->check($_POST['captcha_code']) == TRUE) {
     if (!empty($username) && !empty($email)) {
         $numrows = query_numrows("SELECT `adminid` FROM `" . DBPREFIX . "admin` WHERE `username` = '" . $username . "' && `email` = '" . $email . "'");
         if ($numrows == 1) {
             $rows = query_fetch_assoc("SELECT `adminid`, `email` FROM `" . DBPREFIX . "admin` WHERE `username` = '" . $username . "'");
             ###
             //Processing the password
             $password = createRandomPassword(8);
             $password2 = $password;
             //Temp var for the email
             $salt = hash('sha512', $username);
             //Salt
             $password = hash('sha512', $salt . $password);
             //Hashed password with salt
             query_basic("UPDATE `" . DBPREFIX . "admin` SET `password` = '" . $password . "' WHERE `adminid` = '" . $rows['adminid'] . "'");
             ###
             $to = htmlentities($rows['email'], ENT_QUOTES);
             $subject = T_('Reset Password');
             $message = T_('Your password has been reset to:');
             $message .= "<br /><br />{$password2}<br /><br />";
示例#4
0
文件: boxip.php 项目: 404rq/bgpanel
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $boxid = $_GET['id'];
} else {
    exit('Error: BoxID error.');
}
###
$return = 'boxip.php?id=' . urlencode($boxid);
require "../configuration.php";
require "./include.php";
$title = T_('Box IP Adresses');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "'") == 0) {
    exit('Error: BoxID is invalid.');
}
$rows = query_fetch_assoc("SELECT `name`, `sshport` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "' LIMIT 1");
$ips = mysql_query("SELECT * FROM `" . DBPREFIX . "boxIp` WHERE `boxid` = '" . $boxid . "' ORDER BY `ipid`");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<ul class="nav nav-tabs">
				<li><a href="boxsummary.php?id=<?php 
echo $boxid;
?>
"><?php 
echo T_('Summary');
?>
</a></li>
示例#5
0
         $_SESSION['msg-type'] = 'error';
         unset($error);
         header("Location: configgameedit.php?id=" . urlencode($gameid));
         die;
     }
     ###
     //Security
     $maxSlots = abs($maxSlots);
     $defaultPort = abs($defaultPort);
     $queryPort = abs($queryPort);
     ###
     //Update
     query_basic("UPDATE `" . DBPREFIX . "game` SET\n\t\t\t`game` = '" . $gameName . "',\n\t\t\t`status` = '" . $status . "',\n\t\t\t`maxslots` = '" . $maxSlots . "',\n\t\t\t`defaultport` = '" . $defaultPort . "',\n\t\t\t`cfg1name` = '" . $cfg1Name . "',\n\t\t\t`cfg1` = '" . $cfg1 . "',\n\t\t\t`cfg2name` = '" . $cfg2Name . "',\n\t\t\t`cfg2` = '" . $cfg2 . "',\n\t\t\t`cfg3name` = '" . $cfg3Name . "',\n\t\t\t`cfg3` = '" . $cfg3 . "',\n\t\t\t`cfg4name` = '" . $cfg4Name . "',\n\t\t\t`cfg4` = '" . $cfg4 . "',\n\t\t\t`cfg5name` = '" . $cfg5Name . "',\n\t\t\t`cfg5` = '" . $cfg5 . "',\n\t\t\t`cfg6name` = '" . $cfg6Name . "',\n\t\t\t`cfg6` = '" . $cfg6 . "',\n\t\t\t`cfg7name` = '" . $cfg7Name . "',\n\t\t\t`cfg7` = '" . $cfg7 . "',\n\t\t\t`cfg8name` = '" . $cfg8Name . "',\n\t\t\t`cfg8` = '" . $cfg8 . "',\n\t\t\t`cfg9name` = '" . $cfg9Name . "',\n\t\t\t`cfg9` = '" . $cfg9 . "',\n\t\t\t`startline` = '" . $startLine . "',\n\t\t\t`querytype` = '" . $queryType . "',\n\t\t\t`queryport` = '" . $queryPort . "',\n\t\t\t`cachedir` = '" . $cacheDir . "' WHERE `gameid` = '" . $gameid . "'");
     ###
     //Update LGSL and servers
     $servers = query_fetch_assoc("SELECT `serverid` FROM `" . DBPREFIX . "server` WHERE `gameid` = '" . $gameid . "'");
     ###
     query_basic("UPDATE `" . DBPREFIX . "server` SET\n\t\t\t`game` = '" . $gameName . "' WHERE `serverid` = '" . $servers['serverid'] . "'");
     ###
     query_basic("UPDATE `" . DBPREFIX . "lgsl` SET `type` = '" . $queryType . "' WHERE `id` = '" . $servers['serverid'] . "'");
     ###
     unset($servers);
     ###
     $_SESSION['msg1'] = T_('Game Updated Successfully!');
     $_SESSION['msg2'] = T_('Your changes to the game have been saved.');
     $_SESSION['msg-type'] = 'success';
     header("Location: configgame.php");
     die;
     break;
 case 'configgamedelete':
     $gameid = $_GET['id'];
     if (!is_numeric($position)) {
         $error .= 'Nieprawidłowy odnośnik. ';
     }
     if (query_numrows("SELECT `name` FROM `menu` WHERE `position` = '" . $position . "'") == 0) {
         $error .= 'Taki odnośnik nie istnieje. ';
     }
     ###
     if (!empty($error)) {
         $_SESSION['msg1'] = $error;
         $_SESSION['msg-type'] = 'danger';
         unset($error);
         header("Location: admin.php?page=3");
         die;
     }
     ###
     query_fetch_assoc("DELETE FROM `menu` WHERE `position` = '" . $position . "'");
     ###
     $_SESSION['msg1'] = 'Pomyślnie usunięto odnośnik!';
     $_SESSION['msg-type'] = 'success';
     header("Location: admin.php?page=3");
     die;
     break;
     //----------------------------------------------------
 //----------------------------------------------------
 case 'smsadd':
     $csms = mysql_real_escape_string($_POST['csms']);
     $nsms = mysql_real_escape_string($_POST['nsms']);
     $asms = mysql_real_escape_string($_POST['asms']);
     $assms = mysql_real_escape_string($_POST['assms']);
     ###
     $error = '';
示例#7
0
    $boxid = $_GET['id'];
} else {
    exit('Error: BoxID error.');
}
###
$return = 'boxgamefile.php?id=' . urlencode($boxid);
require "../configuration.php";
require "./include.php";
require_once "../includes/func.ssh2.inc.php";
require_once "../libs/phpseclib/Crypt/AES.php";
require_once "../libs/gameinstaller/gameinstaller.php";
$title = T_('Box Game File Repositories');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "'") == 0) {
    exit('Error: BoxID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "' LIMIT 1");
$games = mysql_query("SELECT * FROM `" . DBPREFIX . "game` ORDER BY `game`");
$aes = new Crypt_AES();
$aes->setKeyLength(256);
$aes->setKey(CRYPT_KEY);
// Get SSH2 Object OR ERROR String
$ssh = newNetSSH2($rows['ip'], $rows['sshport'], $rows['login'], $aes->decrypt($rows['password']));
if (!is_object($ssh)) {
    $_SESSION['msg1'] = T_('Connection Error!');
    $_SESSION['msg2'] = $ssh;
    $_SESSION['msg-type'] = 'error';
}
$gameInstaller = new GameInstaller($ssh);
include "./bootstrap/header.php";
/**
 * Notifications
示例#8
0
</th>
										<th><?php 
echo T_('Username');
?>
</th>
										<th><?php 
echo T_('Actions');
?>
</th>
									</tr>
								</thead>
								<tbody>
<?php 
if (!isset($error)) {
    foreach ($clients as $key => $value) {
        $client = query_fetch_assoc("SELECT `firstname`, `lastname`, `username` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $value . "'");
        ?>
									<tr>
										<td><?php 
        echo $key + 1;
        ?>
</td>
										<td><?php 
        echo htmlspecialchars($client['firstname'], ENT_QUOTES);
        ?>
</td>
										<td><?php 
        echo htmlspecialchars($client['lastname'], ENT_QUOTES);
        ?>
</td>
										<td><?php 
示例#9
0
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $catid = $_GET['id'];
} else {
    exit('Error: CatID error.');
}
###
$return = 'scriptcatedit.php?id=' . urlencode($catid);
require "../configuration.php";
require "./include.php";
$title = T_('Edit Script Category');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "scriptCat` WHERE `id` = '" . $catid . "'") == 0) {
    exit('Error: CatID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "scriptCat` WHERE `id` = '" . $catid . "' LIMIT 1");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<div class="well">
				<form method="post" action="scriptprocess.php">
					<input type="hidden" name="task" value="scriptcatedit" />
					<input type="hidden" name="catid" value="<?php 
echo $catid;
?>
" />
					<label><?php 
echo T_('Category Name');
示例#10
0
文件: include.php 项目: 404rq/bgpanel
        die;
    }
    /**
     * Define Language Using 'php gettext'
     */
    defineLanguage($_SESSION['clientlang']);
    query_basic("UPDATE `" . DBPREFIX . "client` SET `lastactivity` = '" . $_SERVER['REQUEST_TIME'] . "' WHERE `clientid` = '" . $_SESSION['clientid'] . "'");
}
/**
 * GET BrightGamePanel Database INFORMATION
 * Load 'values' from `config` Table
 */
$panelName = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'panelname' LIMIT 1");
$panelVersion = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'panelversion' LIMIT 1");
$template = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'clienttemplate' LIMIT 1");
$maintenance = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'maintenance' LIMIT 1");
/**
 * GET BGP CORE FILES INFORMATION
 * Load version.xml (ROOT/.version/version.xml)
 */
$bgpCoreInfo = simplexml_load_file('./.version/version.xml');
/**
 * VERSION CONTROL
 * Check that core files are compatible with the current BrightGamePanel Database
 */
if ($panelVersion['value'] != $bgpCoreInfo->{'version'}) {
    die;
}
/**
 * CONSTANTS
 */
示例#11
0
        $id = mysql_real_escape_string($_GET['id']);
    }
}
###
if (isset($_POST['payment'])) {
    $payment = mysql_real_escape_string($_POST['payment']);
} else {
    if (isset($_GET['payment'])) {
        $payment = mysql_real_escape_string($_GET['payment']);
    }
}
//----------------------------------------------------+
if (!empty($id) && !empty($payment)) {
    if (query_numrows("SELECT `name` FROM `offerts` WHERE `id` = '" . $id . "'") == 1) {
        $offerts = query_fetch_assoc("SELECT * FROM `offerts` WHERE `id` = '" . $id . "' LIMIT 150");
        $sms = query_fetch_assoc("SELECT `csms`, `nsms`, `asms` FROM `sms` WHERE `id` = '" . $offerts['amount'] . "' LIMIT 1");
        ?>
		<p style="font-size: 25px">Wybrałeś Ofertę: <b><?php 
        echo $offerts['name'];
        ?>
</b>, jej koszt wynosi <b><?php 
        echo $sms['asms'];
        ?>
</b> zł.</p>
		</hr>
        <?php 
        if ($payment == 'sms') {
            echo "<p>Wyślij smsa o treści: <b>" . $sms['csms'] . "</b> na numer: <b>" . $sms['nsms'] . "</b>.</p>";
        }
        ?>
		<br />
示例#12
0
     $error .= 'Kod jest za krótki. ';
 }
 if (query_numrows("SELECT `name` FROM `offerts` WHERE `id` = '" . $id . "'") != 1) {
     $error .= 'Taka oferta nie istnieje. ';
 }
 ###
 if (!empty($error)) {
     notifications($error, 'danger');
     unset($error);
     header("Location: product.php?id=" . $id . "&payment=" . $payment . "");
     die;
 }
 ###
 $offert = query_fetch_assoc("SELECT `amount` FROM `offerts` WHERE `id` = '" . $id . "'");
 $config = query_fetch_assoc("SELECT * FROM `config`");
 $voucher = query_fetch_assoc("SELECT `amount`, `id` FROM `voucher` WHERE `code` = '" . $code . "' LIMIT 1");
 ###
 if (query_numrows("SELECT `amount` FROM `voucher` WHERE `code` = '" . $code . "'") == 1 && $voucher['amount'] != 0) {
     $amount = $voucher['amount'] - 1;
     ###
     query_basic("UPDATE `voucher` SET `amount`='" . $amount . "' WHERE `id` = '" . $voucher['id'] . "'");
 } else {
     notifications('Ten kod jest błędny lub został już wykorzystany!', 'danger');
     unset($error);
     header("Location: product.php?id=" . $id . "&payment=" . $payment . "");
     die;
 }
 ###
 define('MQ_SERVER_ADDR', $config['ip']);
 define('MQ_SERVER_PORT', $config['port_rcon']);
 define('MQ_SERVER_PASS', $config['password_rcon']);
示例#13
0
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $adminid = $_GET['id'];
} else {
    exit('Error: AdminID error.');
}
###
$return = 'configadminedit.php?id=' . urlencode($adminid);
require "../configuration.php";
require "./include.php";
$title = T_('Edit Administrator');
if (query_numrows("SELECT `username` FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $adminid . "'") == 0) {
    exit('Error: AdminID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $adminid . "' LIMIT 1");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<div class="well">
				<form method="post" action="configadminprocess.php">
					<input type="hidden" name="task" value="configadminedit" />
					<input type="hidden" name="adminid" value="<?php 
echo $adminid;
?>
" />
					<label><?php 
echo T_('Username');
示例#14
0
								</tr>
							</thead>
							<tbody>
<?php 
if ($groups == FALSE) {
    ?>
								<tr>
									<td colspan="3"><div style="text-align: center;"><span class="label label-warning"><?php 
    echo T_("This client doesn't belong to any groups.");
    ?>
</span></div></td>
								</tr>
<?php 
} else {
    foreach ($groups as $key => $value) {
        $group = query_fetch_assoc("SELECT `name`, `description` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $value . "' LIMIT 1");
        ###
        ?>
								<tr>
									<td><?php 
        echo $key + 1;
        ?>
</td>
									<td><?php 
        echo htmlspecialchars($group['name'], ENT_QUOTES);
        ?>
</td>
									<td><?php 
        echo htmlspecialchars($group['description'], ENT_QUOTES);
        ?>
</td>
示例#15
0
 * @categories	Games/Entertainment, Systems Administration
 * @package		Bright Game Panel
 * @author		warhawk3407 <*****@*****.**> @NOSPAM
 * @copyleft	2013
 * @license		GNU General Public License version 3.0 (GPLv3)
 * @version		(Release 0) DEVELOPER BETA 8
 * @link		http://www.bgpanel.net/
 */
$page = 'myaccount';
$tab = 9;
$isSummary = TRUE;
$return = 'myaccount.php';
require "../configuration.php";
require "./include.php";
$title = T_('My Account');
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $_SESSION['adminid'] . "' LIMIT 1");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<ul class="nav nav-tabs">
				<li class="active"><a href="#"><?php 
echo T_('Profile');
?>
</a></li>
			</ul>
			<div class="well">
				<form method="post" action="process.php">
					<input type="hidden" name="task" value="myaccount" />
示例#16
0
文件: script.php 项目: 404rq/bgpanel
    echo T_('No scripts found.');
    ?>
 <a href="scriptadd.php"><?php 
    echo T_('Click here');
    ?>
</a> <?php 
    echo T_('to add a new script.');
    ?>
</div></td>
						</tr>
<?php 
}
while ($rowsScripts = mysql_fetch_assoc($scripts)) {
    $cat = query_fetch_assoc("SELECT `name` FROM `" . DBPREFIX . "scriptCat` WHERE `id` = '" . $rowsScripts['catid'] . "' LIMIT 1");
    $group = query_fetch_assoc("SELECT `name` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $rowsScripts['groupid'] . "' LIMIT 1");
    $box = query_fetch_assoc("SELECT `name` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $rowsScripts['boxid'] . "' LIMIT 1");
    ###
    if (!empty($rowsScripts['panelstatus'])) {
        $pstatus = formatStatus($rowsScripts['panelstatus']);
    } else {
        $pstatus = "<span class=\"label\"><em>" . T_('None') . "</em></span>";
    }
    ?>
						<tr>
							<td><?php 
    echo htmlspecialchars($rowsScripts['name'], ENT_QUOTES);
    ?>
</td>
							<td><?php 
    echo htmlspecialchars($cat['name'], ENT_QUOTES);
    ?>
示例#17
0
$return = 'serversummary.php?id=' . urlencode($serverid);
require "../configuration.php";
require "./include.php";
require_once "../includes/func.ssh2.inc.php";
require_once "../libs/phpseclib/Crypt/AES.php";
require_once "../libs/gameinstaller/gameinstaller.php";
$title = T_('Server Summary');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "'") == 0) {
    exit('Error: ServerID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1");
$box = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $rows['boxid'] . "' LIMIT 1");
$serverIp = query_fetch_assoc("SELECT `ip` FROM `" . DBPREFIX . "boxIp` WHERE `ipid` = '" . $rows['ipid'] . "' LIMIT 1");
$type = query_fetch_assoc("SELECT `querytype` FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $rows['gameid'] . "' LIMIT 1");
$game = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $rows['gameid'] . "' LIMIT 1");
$group = query_fetch_assoc("SELECT `name` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $rows['groupid'] . "' LIMIT 1");
$logs = mysql_query("SELECT * FROM `" . DBPREFIX . "log` WHERE `serverid` = '" . $serverid . "' ORDER BY `logid` DESC LIMIT 5");
$aes = new Crypt_AES();
$aes->setKeyLength(256);
$aes->setKey(CRYPT_KEY);
// Get SSH2 Object OR ERROR String
$ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password']));
if (!is_object($ssh)) {
    $_SESSION['msg1'] = T_('Connection Error!');
    $_SESSION['msg2'] = $ssh;
    $_SESSION['msg-type'] = 'error';
}
$gameInstaller = new GameInstaller($ssh);
$gameCacheInfo = $gameInstaller->getCacheInfo(dirname($rows['path']));
$boxGameCacheInfo = $gameInstaller->getCacheInfo($game['cachedir']);
$gameExists = $gameInstaller->gameExists($game['game']);
示例#18
0
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $clientid = $_GET['id'];
} else {
    exit('Error: ClientID error.');
}
###
$return = 'clientlog.php?id=' . urlencode($clientid);
require "../configuration.php";
require "./include.php";
$title = T_('Client Activity Logs');
if (query_numrows("SELECT `username` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "'") == 0) {
    exit('Error: ClientID is invalid.');
}
$rows = query_fetch_assoc("SELECT `firstname`, `lastname`, `status` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "' LIMIT 1");
//---------------------------------------------------------+
//Num Pages Process:
$numLogs = query_numrows("SELECT * FROM `" . DBPREFIX . "log` WHERE `clientid` = '" . $clientid . "' ORDER BY `logid` LIMIT 750");
$numPages = ceil($numLogs / 50);
//---------------------------------------------------------+
//Pages Process:
if (isset($_GET['page'])) {
    $page = mysql_real_escape_string($_GET['page']);
} else {
    $page = 1;
}
//Security
if ($page > 15 || !is_numeric($page)) {
    exit('Page error!');
}
示例#19
0
 $email = mysql_real_escape_string($_POST['email']);
 ###
 /**
  * Securimage - A PHP class for creating captcha images.
  *
  * VERSION: 3.0
  * AUTHOR: Drew Phillips <*****@*****.**>
  */
 require "./libs/securimage/securimage.php";
 $securimage = new Securimage();
 ###
 if ($securimage->check($_POST['captcha_code']) == TRUE) {
     if (!empty($username) && !empty($email)) {
         $numrows = query_numrows("SELECT `clientid` FROM `" . DBPREFIX . "client` WHERE `username` = '" . $username . "' && `email` = '" . $email . "'");
         if ($numrows == 1) {
             $rows = query_fetch_assoc("SELECT `clientid`, `email` FROM `" . DBPREFIX . "client` WHERE `username` = '" . $username . "'");
             ###
             //Processing the password
             $password = createRandomPassword(8);
             $password2 = $password;
             //Temp var for the email
             $salt = hash('sha512', $username);
             //Salt
             $password = hash('sha512', $salt . $password);
             //Hashed password with salt
             query_basic("UPDATE `" . DBPREFIX . "client` SET `password` = '" . $password . "' WHERE `clientid` = '" . $rows['clientid'] . "'");
             ###
             $to = htmlentities($rows['email'], ENT_QUOTES);
             $subject = T_('Reset Password');
             $message = T_('Your password has been reset to:');
             $message .= "<br /><br />{$password2}<br /><br />";
示例#20
0
Udostępnianie bez zgody właściciela
jest naruszeniem zasad licencji.
*/
require "./config.php";
require "./include.php";
require STYLE_DIR . "header.php";
if (isset($_POST['id'])) {
    $id = mysql_real_escape_string($_POST['id']);
} else {
    if (isset($_GET['id'])) {
        $id = mysql_real_escape_string($_GET['id']);
    }
}
//----------------------------------------------------+
if (!empty($id)) {
    $offerts = query_fetch_assoc("SELECT `sms`, `voucher` FROM `offerts` WHERE `id` = '" . $id . "' LIMIT 150");
    ?>
    <p style="font-size: 25px">Wybierz sposób płatności:</p>
	</hr>
    <?php 
    if ($offerts['sms'] == 1) {
        echo "<a href=\"product.php?id={$id}&payment=sms\" class=\"btn btn-primary\" style=\"margin-bottom: 10px;\">Sms</a><br />";
    }
    if ($offerts['voucher'] == 1) {
        echo "<a href=\"product.php?id={$id}&payment=voucher\" class=\"btn btn-primary\">Voucher</a>";
    }
    if ($offerts['sms'] == 0 && $offerts['sms'] == 0) {
        echo "<div class=\"alert alert-dismissable alert-danger\">Tej oferty nie można kupić!</div>";
    }
}
require STYLE_DIR . "footer.php";
示例#21
0
 // Status Check
 $status = query_fetch_assoc("SELECT `status`, `panelstatus` FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "'");
 if ($status['status'] == 'Inactive') {
     continue;
 } else {
     if ($status['status'] == 'Pending') {
         continue;
     } else {
         if ($status['panelstatus'] == 'Started') {
             continue;
         }
     }
 }
 $server = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1");
 $box = query_fetch_assoc("SELECT `ip`, `login`, `password`, `sshport` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $server['boxid'] . "' LIMIT 1");
 $game = query_fetch_assoc("SELECT `game`, `cachedir` FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $server['gameid'] . "' LIMIT 1");
 $aes = new Crypt_AES();
 $aes->setKeyLength(256);
 $aes->setKey(CRYPT_KEY);
 // Get SSH2 Object OR ERROR String
 $ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password']));
 if (!is_object($ssh)) {
     continue;
 }
 $gameInstaller = new GameInstaller($ssh);
 ###
 $setGame = $gameInstaller->setGame($game['game']);
 if ($setGame == FALSE) {
     continue;
 }
 $setRepoPath = $gameInstaller->setRepoPath($game['cachedir']);
示例#22
0
###
$return = 'servermanage.php?id=' . urlencode($serverid);
require "../configuration.php";
require "./include.php";
require_once "../includes/func.ssh2.inc.php";
require_once "../libs/phpseclib/Crypt/AES.php";
require_once "../libs/gameinstaller/gameinstaller.php";
$title = T_('Server Control Panel');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "'") == 0) {
    exit('Error: ServerID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1");
$type = query_fetch_assoc("SELECT `querytype` FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $rows['gameid'] . "' LIMIT 1");
$game = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $rows['gameid'] . "' LIMIT 1");
$box = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $rows['boxid'] . "' LIMIT 1");
$ip = query_fetch_assoc("SELECT `ip` FROM `" . DBPREFIX . "boxIp` WHERE `ipid` = '" . $rows['ipid'] . "' LIMIT 1");
$aes = new Crypt_AES();
$aes->setKeyLength(256);
$aes->setKey(CRYPT_KEY);
// Get SSH2 Object OR ERROR String
$ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password']));
if (!is_object($ssh)) {
    $_SESSION['msg1'] = T_('Connection Error!');
    $_SESSION['msg2'] = $ssh;
    $_SESSION['msg-type'] = 'error';
}
$gameInstaller = new GameInstaller($ssh);
$gameCacheInfo = $gameInstaller->getCacheInfo(dirname($rows['path']));
$boxGameCacheInfo = $gameInstaller->getCacheInfo($game['cachedir']);
$gameExists = $gameInstaller->gameExists($game['game']);
include "./bootstrap/header.php";
示例#23
0
    $boxid = $_GET['id'];
} else {
    exit('Error: BoxID error.');
}
###
$return = 'boxsummary.php?id=' . urlencode($boxid);
require "../configuration.php";
require "./include.php";
$title = T_('Box Summary');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "'") == 0) {
    exit('Error: BoxID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "' LIMIT 1");
$ips = mysql_query("SELECT * FROM `" . DBPREFIX . "boxIp` WHERE `boxid` = '" . $boxid . "' ORDER BY `ipid`");
$cache = unserialize(gzuncompress($rows['cache']));
$cron = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'lastcronrun' LIMIT 1");
$logs = mysql_query("SELECT * FROM `" . DBPREFIX . "log` WHERE `boxid` = '" . $boxid . "' ORDER BY `logid` DESC LIMIT 5");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<ul class="nav nav-tabs">
				<li class="active"><a href="boxsummary.php?id=<?php 
echo $boxid;
?>
"><?php 
echo T_('Summary');
?>
</a></li>
示例#24
0
 * @author		warhawk3407 <*****@*****.**> @NOSPAM
 * @copyleft	2013
 * @license		GNU General Public License version 3.0 (GPLv3)
 * @version		(Release 0) DEVELOPER BETA 8
 * @link		http://www.bgpanel.net/
 */
$page = 'configgeneral';
$tab = 5;
$return = 'configgeneral.php';
require "../configuration.php";
require "./include.php";
require "../includes/templates.php";
$title = T_('General Settings');
$systemUrl = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'systemurl' LIMIT 1");
$adminTemplate = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'admintemplate' LIMIT 1");
$clientTemplate = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'clienttemplate' LIMIT 1");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<ul class="nav nav-tabs">
				<li class="active"><a href="#"><?php 
echo T_('General');
?>
</a></li>
			</ul>
			<div class="well">
				<form method="post" action="configgeneralprocess.php">
					<input type="hidden" name="task" value="generaledit" />
示例#25
0
     $_SESSION['msg-type'] = 'error';
     header('Location: index.php');
     die;
 }
 ###
 $status = query_fetch_assoc("SELECT `status` FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1");
 if ($status['status'] != 'Active') {
     $_SESSION['msg1'] = T_('Validation Error!');
     $_SESSION['msg2'] = T_('The server is disabled or pending!');
     $_SESSION['msg-type'] = 'error';
     header('Location: index.php');
     die;
 }
 ###
 $server = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1");
 $box = query_fetch_assoc("SELECT `ip`, `login`, `password`, `sshport` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $server['boxid'] . "' LIMIT 1");
 ###
 $aes = new Crypt_AES();
 $aes->setKeyLength(256);
 $aes->setKey(CRYPT_KEY);
 ###
 // Get SSH2 Object OR ERROR String
 $ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password']));
 if (!is_object($ssh)) {
     $_SESSION['msg1'] = T_('Connection Error!');
     $_SESSION['msg2'] = $ssh;
     $_SESSION['msg-type'] = 'error';
     header('Location: index.php');
     die;
 }
 $ansi = new File_ANSI();
示例#26
0
     header("Location: configgroup.php");
     die;
 }
 ###
 if (getGroupClients($groupid) != FALSE) {
     $clients = getGroupClients($groupid);
     foreach ($clients as $key => $value) {
         $removeids[] = $value;
     }
     unset($clients);
 }
 ###
 if (isset($removeids)) {
     // Remove groupID from groupMember table
     foreach ($removeids as $key => $value) {
         $groupids = query_fetch_assoc("SELECT `groupids` FROM `" . DBPREFIX . "groupMember` WHERE `clientid` = '" . $value . "'");
         ###
         $groupids['groupids'] = str_replace($groupid . ';', '', $groupids['groupids']);
         ###
         if (empty($groupids['groupids'])) {
             query_basic("DELETE FROM `" . DBPREFIX . "groupMember` WHERE `clientid` = '" . $value . "' LIMIT 1");
         } else {
             query_basic("UPDATE `" . DBPREFIX . "groupMember` SET `groupids` = '" . $groupids['groupids'] . "' WHERE `clientid` = '" . $value . "'");
         }
         unset($groupids);
     }
 }
 ###
 query_basic("DELETE FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "' LIMIT 1");
 ###
 $_SESSION['msg1'] = T_('Group Deleted Successfully!');
示例#27
0
}
###
$return = 'serverprofile.php?id=' . urlencode($serverid);
require "../configuration.php";
require "./include.php";
require_once "../includes/func.ssh2.inc.php";
require_once "../libs/phpseclib/Crypt/AES.php";
require_once "../libs/gameinstaller/gameinstaller.php";
$title = T_('Server Settings');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "'") == 0) {
    exit('Error: ServerID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1");
$box = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $rows['boxid'] . "' LIMIT 1");
$ip = query_fetch_assoc("SELECT `ip`, `boxid` FROM `" . DBPREFIX . "boxIp` WHERE `ipid` = '" . $rows['ipid'] . "' LIMIT 1");
$game = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $rows['gameid'] . "' LIMIT 1");
$boxes = mysql_query("SELECT `boxid`, `name` FROM `" . DBPREFIX . "box` ORDER BY `boxid`");
$groups = mysql_query("SELECT `groupid`, `name` FROM `" . DBPREFIX . "group` ORDER BY `groupid`");
$aes = new Crypt_AES();
$aes->setKeyLength(256);
$aes->setKey(CRYPT_KEY);
// Get SSH2 Object OR ERROR String
$ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password']));
if (!is_object($ssh)) {
    $_SESSION['msg1'] = T_('Connection Error!');
    $_SESSION['msg2'] = $ssh;
    $_SESSION['msg-type'] = 'error';
}
$gameInstaller = new GameInstaller($ssh);
$gameCacheInfo = $gameInstaller->getCacheInfo(dirname($rows['path']));
$gameExists = $gameInstaller->gameExists($game['game']);
示例#28
0
Udostępnianie bez zgody właściciela
jest naruszeniem zasad licencji.
*/
session_start();
ob_start();
//----------------------------------------------------+
/**
 * Folder instalacyjny
 */
if (is_dir("../install/")) {
    header("Location: ../install/");
    die;
}
//----------------------------------------------------+
require INCLUDES_DIR . "mysql.php";
require INCLUDES_DIR . "check.php";
require INCLUDES_DIR . "func.php";
require INCLUDES_DIR . "auth.php";
//----------------------------------------------------+
if (isLoggedIn() == TRUE) {
    $verify = query_fetch_assoc("SELECT * FROM `user` WHERE `id` = '" . $_SESSION['id'] . "'");
    if ($verify['username'] != $_SESSION['username'] || $verify['session'] != session_id()) {
        logout();
        header("Location: login.php");
        die;
    }
} else {
    logout();
    header("Location: login.php");
    die;
}
示例#29
0
 * @categories	Games/Entertainment, Systems Administration
 * @package		Bright Game Panel
 * @author		warhawk3407 <*****@*****.**> @NOSPAM
 * @copyleft	2013
 * @license		GNU General Public License version 3.0 (GPLv3)
 * @version		(Release 0) DEVELOPER BETA 8
 * @link		http://www.bgpanel.net/
 */
$page = 'myaccount';
$tab = 9;
$isSummary = TRUE;
$return = 'myaccount.php';
require "configuration.php";
require "include.php";
$title = T_('My Account');
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $_SESSION['clientid'] . "' LIMIT 1");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<ul class="nav nav-tabs">
				<li class="active"><a href="#"><?php 
echo T_('Profile');
?>
</a></li>
			</ul>
			<div class="well">
				<form method="post" action="process.php">
					<input type="hidden" name="task" value="myaccount" />
 case 'processlogin':
     if (isLoggedIn() == TRUE) {
         $_SESSION = array();
         session_destroy();
     }
     $username = mysql_real_escape_string($_POST['username']);
     $password = mysql_real_escape_string($_POST['password']);
     ###
     if (!empty($username) && !empty($password)) {
         ###
         $salt = hash('sha512', $username);
         $password = hash('sha512', $salt . $password);
         ###
         $numrows = query_numrows("SELECT * FROM `user` WHERE `username` = '" . $username . "' AND `password` = '" . $password . "'");
         if ($numrows == 1) {
             $rows = query_fetch_assoc("SELECT * FROM `user` WHERE `username` = '" . $username . "' AND `password` = '" . $password . "'");
             ###
             $_SESSION['id'] = $rows['id'];
             $_SESSION['username'] = $rows['username'];
             ###
             validate();
             ###
             $_SESSION['msg1'] = 'Zostałeś poprawnie zalogowany!';
             $_SESSION['msg-type'] = 'success';
             header("Location: admin.php?page=1");
             die;
         }
     }
     $_SESSION['msg1'] = 'Błędny login lub złe hasło!';
     $_SESSION['msg-type'] = 'danger';
     header("Location: login.php");