Exemple #1
0
 /**
  *Fukcnja zapisująca podane dane z tabelii składania zamówień jeśli zalogowano, jeśli nie zwraca kod 401
  */
 function zapis()
 {
     $data = $_POST['data'];
     $dane = json_decode($data, $assoc = true);
     session_start();
     $wynik = '';
     if (isset($_SESSION['ident'])) {
         $login = trim($_SESSION['ident']);
         $db = new BazaDanych($login, 1);
         $wynik = $db->zapis($dane['nazwa'], $dane['ilosc'], $dane['wersja']);
     } else {
         $wynik = isset($_SESSION['ident']) ? 'true' : 'false';
         http_response_code(401);
     }
     print $wynik;
 }
Exemple #2
0
 /**
  * Zmienia widok na tabelę z złożonymi zamowieniami, jeśli zalogowany. Jeśli użytkownik nie jest zalogowany wypisuje komunikat.
  * @return view
  */
 function wypisywanie()
 {
     session_start();
     $tablica = '<p class="start">Ostatnio zamówiłeś:</p>';
     $tablica .= '<table class="zamowienia">';
     if (isset($_SESSION['ident'])) {
         $login = trim($_SESSION['ident']);
         $db = new BazaDanych($login, 1);
         $tablica .= $db->wypisywanie($login);
     } else {
         $this->layout->content = "<p>Musisz się zalogować</p>";
         return $this->layout;
     }
     $tablica .= "</table>";
     $this->layout->content = $tablica;
     return $this->layout;
 }
Exemple #3
0
}
$hash = md5($pid);
$filename = "tmp/dynbar2-" . $hash . ".png";
if (file_exists($filename)) {
    $ctime = filectime($filename);
    if (time() - $ctime < 60 * 60 * 12) {
        // 12h
        header('Content-Type: image/png');
        readfile($filename);
        exit;
    }
    @unlink($filename);
}
require_once "p/libs/BazaDanych.class.php";
require_once "p/__config.php";
$RDB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass);
$pd = $RDB->pobierz_wyniki("SELECT p.nick,p.level,p.levelAddition,p.last_skin,p.respect,p.skill,p.vip>NOW() vip,pig.id_gang, g.color gangcolor, g.name gangname,pig.rank gangrank FROM fs_players p LEFT JOIN fs_players_in_gangs pig ON pig.id_player=p.id AND pig.rank!='suspended' LEFT JOIN fs_gangs g ON pig.id_gang=g.id WHERE p.id={$pid} LIMIT 1");
$im = imagecreatefrompng("s/i/fsavatar.png");
if (file_exists("s/i/skins2/gtam_skin" . intval($pd['last_skin']) . ".jpg")) {
    $is = imagecreatefromjpeg("s/i/skins2/gtam_skin" . intval($pd['last_skin']) . ".jpg");
    imagecopy($im, $is, 10, 30, 0, 0, 119, 186);
    imagedestroy($is);
}
imagesavealpha($im, false);
$white = imagecolorallocate($im, 255, 255, 255);
$gray = imagecolorallocate($im, 67, 67, 67);
$red = imagecolorallocate($im, 255, 60, 60);
$yellow = imagecolorallocate($im, 0xef, 0xc7, 0x0);
$black = imagecolorallocate($im, 0x0, 0x0, 0x0);
$black50 = imagecolorallocatealpha($im, 0x0, 0x0, 0x0, 0x70);
$orange = imagecolorallocate($im, 0xff, 0x66, 0x0);
Exemple #4
0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

require_once("/home/fullserv/public_html/fsutil.i32.pl/checkin/__libs/BazaDanych.class.php");
require_once("/home/fullserv/public_html/fsutil.i32.pl/checkin/__libs/__config.php");
$RDB=new BazaDanych($__dbHost,$__dbName,$__dbUser,$__dbPass);

if(!isset($_GET['id'])) die();

$d=$RDB->wynik("SELECT gamep FROM fs_players WHERE id=".$_GET['id']." LIMIT 1");

echo "<br/>";
echo "Obecnie " . $d ."<br/>";

$RDB->zapytanie("UPDATE fs_players SET gamep = gamep+".$_GET['gp']." WHERE id=".$_GET['id']." LIMIT 1");

$d=$RDB->wynik("SELECT gamep FROM fs_players WHERE id=".$_GET['id']." LIMIT 1");
	 
echo "Po zmianie " . $d ."<br/>";

?>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
require_once "p/libs/BazaDanych.class.php";
require_once "p/__config.php";
$DB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass);
$nick = mysql_real_escape_string($_REQUEST['q']);
if (strlen($nick) < 2) {
    exit;
}
$dane = $DB->pobierz_tabele_wynikow("SELECT id,nick FROM fs_players WHERE nick like '%{$nick}%' AND respect>25 AND respect<=1000 LIMIT 10");
foreach ($dane as $d) {
    print $d['nick'] . "|" . $d['id'] . "\n";
}
// EOF
Exemple #6
0
}
$hash = md5($pid);
$filename = "tmp/dynbar-" . $hash . ".png";
if (file_exists($filename)) {
    $ctime = filectime($filename);
    if (time() - $ctime < 60 * 60 * 6) {
        // 12h
        header('Content-Type: image/png');
        readfile($filename);
        exit;
    }
    @unlink($filename);
}
require_once "p/libs/BazaDanych.class.php";
require_once "p/__config.php";
$RDB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass);
$pd = $RDB->pobierz_wyniki("SELECT p.nick,p.level,p.last_skin,p.respect,p.skill,p.vip>NOW() vip,pig.id_gang, g.color gangcolor, g.name gangname,pig.rank gangrank FROM fs_players p LEFT JOIN fs_players_in_gangs pig ON pig.id_player=p.id AND pig.rank!='suspended' LEFT JOIN fs_gangs g ON pig.id_gang=g.id WHERE p.id={$pid} LIMIT 1");
$ban = $RDB->pobierz_wyniki("SELECT TIMESTAMPDIFF(SECOND, NOW(), date_end) pozostalo FROM fs_bans WHERE player_banned = {$pid} AND date_end > NOW() AND date_created < NOW() LIMIT 1");
$im = imagecreatefrompng("s/i/2.png");
imagesavealpha($im, true);
$white = imagecolorallocate($im, 255, 255, 255);
$gray = imagecolorallocate($im, 67, 67, 67);
$red = imagecolorallocate($im, 255, 60, 60);
$yellow = imagecolorallocate($im, 0xff, 0xd7, 0x0);
$black = imagecolorallocate($im, 0x0, 0x0, 0x0);
$orange = imagecolorallocate($im, 0xff, 0x66, 0x0);
$blue = imagecolorallocate($im, 0x2b, 0x7c, 0xd5);
$courier = 's/fonts/cour.ttf';
$veramobd = 's/fonts/VeraMoBd.ttf';
$arial = 's/fonts/arial.ttf';
$arialb = 's/fonts/arialb.ttf';
Exemple #7
0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
require_once "p/config.php";
require_once "p/init.php";
global $pakiety;
$DB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass);
$Szablon = new Szablon();
$GFS = new FSPlayer();
$GFSdom = new FSDom(intval($_REQUEST['domid']));
if (!$GFSdom->ok) {
    $Szablon->assign('html_title', "Domy na FullServerze");
    $Szablon->assign('domy', $GFSdom);
    $Szablon->display('index.tpl');
    exit;
}
$ht = htmlspecialchars($GFSdom->descr);
if (!$GFSdom->wolny) {
    $ht .= " - " . $GFSdom->owner_nick;
}
$ht .= " - " . $GFSdom->zone_name;
$Szablon->assign('html_title', $ht);
Exemple #8
0
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
session_start('fsadm2');
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Cloudflare addition
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
function sendmail($rcpt, $subj, $txt, $html = false)
{
    $headers = 'From: hostmaster@fullserver.eu' . "\r\n" . 'Reply-To: hostmaster@fullserver.eu' . "\r\n" . 'X-Mailer: FSADM v2';
    return mail($rcpt, $subj, $txt, $headers);
}
require_once "./p/libs/BazaDanych.class.php";
$RDB = new BazaDanych("dbhost", "dbname", "dbuser", "dbpass");
$LVL = 0;
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['login'] && $_POST['haslo'] && !$_POST['token']) {
    $autentykacja = $RDB->wynik("SELECT 1 FROM fs_players WHERE level>=1 AND nick='" . $RDB->e($_POST['login']) . "' AND password='******'login'] . "nhugdij89^Dhcd" . $_POST['haslo'])) . "' AND IFNULL(TIMESTAMPDIFF(MINUTE,NOW(),suspendedTo),0)<1");
    if ($autentykacja != 1) {
        $txt = $_POST['login'] . "\r\n" . print_r($_SERVER, 1) . "\r\n" . "\r\n" . print_r($_SESSION, 1) . "\r\n" . mysql_error() . "\r\n";
        sendmail("*****@*****.**", "[FSADM] fail", $txt);
        die("Podano nieprawidlowe dane logowania!");
    }
    $txt = $_POST['login'] . "\r\n" . print_r($_SERVER, 1) . "\r\n" . "\r\n" . print_r($_SESSION, 1) . "\r\n" . mysql_error() . "\r\n";
    sendmail("*****@*****.**", "[FSADM] login (step1)", $txt);
    $_SESSION['authkey'] = md5($_POST['login'] . strtoupper(md5($_POST['login'] . "nhugdij89^Dhcd" . $_POST['haslo'])));
    $_SESSION['login'] = $_POST['login'];
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && !$_POST['login'] && !$_POST['haslo'] && $_POST['token'] && $_SESSION['authkey']) {
    if (!isset($_SESSION['authkey'])) {
Exemple #9
0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

require_once("/home/fullserv/public_html/fsutil.i32.pl/checkin/__libs/BazaDanych.class.php");
require_once("/home/fullserv/public_html/fsutil.i32.pl/checkin/__libs/__config.php");
$RDB=new BazaDanych($__dbHost,$__dbName,$__dbUser,$__dbPass);

$donagrodzenia=$RDB->pobierz_tabele_wynikow("SELECT po.polecil,p2.nick polecil_nick,po.polecona,p1.nick polecona_nick,p1.active_server polecona_active,p2.active_server polecil_active
         FROM fs_polecenia po JOIN fs_players p1 ON p1.id=po.polecona JOIN fs_players p2 ON p2.id=po.polecil WHERE p1.respect>=2000 AND uniewazniony=0 AND rewarded=0");
	 
foreach ($donagrodzenia as $d){ 
	print "\n";
	print "Polecona: " . $d['polecona_nick'] . " ".  $d['polecona']." a: ".$d['polecona_active']."\n";
	print "Polecil: " . $d['polecil_nick'] . " " . $d['polecil']." a: ".$d['polecil_active']."\n";


	if (intval($d['polecona_active'])==0 && intval($d['polecil_active'])==0) {
	    $q1="UPDATE fs_players SET respect=respect+1000,vip=IF(vip>NOW(),vip,NOW())+INTERVAL 11 DAY WHERE id IN (".intval($d['polecil']).",".intval($d['polecona']).")";
		$RDB->zapytanie($q1);
	    print $q1."\n";
Exemple #10
0
 /**
  * funkcja oblugujaca rejestracje do bazy danych
  * @param $login
  * @param $pass
  * @param $pass2
  * @return bool
  */
 function rejestracja($login, $pass, $pass2)
 {
     $dbH = new BazaDanych($login, 0);
     return $dbH->dodaj($login, $pass, $pass2);
 }
Exemple #11
0
function user_row_lss($username, $password)
{
    global $db, $config, $user;
    // first retrieve default group id
    $sql = 'SELECT group_id
        FROM ' . GROUPS_TABLE . "\n        WHERE group_name = '" . $db->sql_escape('REGISTERED') . "'\n            AND group_type = " . GROUP_SPECIAL;
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $db->sql_freeresult($result);
    if (!$row) {
        trigger_error('NO_GROUP');
    }
    $username_clean = utf8_clean_string($username);
    $rdb = new BazaDanych();
    $r_login = $rdb->e($username_clean);
    $r_hash = md5(strtolower($username_clean) . "MRFX_01" . $password);
    $auth = $rdb->wynik("SELECT email FROM lss_users WHERE login='******' AND hash='{$r_hash}';");
    // generate user account data
    return array('username' => $username, 'user_password' => phpbb_hash($password), 'user_email' => $auth, 'group_id' => (int) $row['group_id'], 'user_type' => USER_NORMAL, 'user_ip' => $user->ip, 'user_new' => $config['new_member_post_limit'] ? 1 : 0);
}
Exemple #12
0
if ($_SERVER['REQUEST_METHOD'] != "POST") {
    header("HTTP/1.0 405 Method Not Allowed");
    exit;
}
if (!isset($_POST['authId']) || !isset($_POST['action']) || !isset($_POST['prm'])) {
    header("HTTP/1.0 400 Bad Request");
    exit;
}
// authId (na razie hardcoded, pozniej w bazie)
if ($_POST['authId'] != 'df2214d5a64757184fdfeeccce' && $_POST['authId'] != 'hu876sdy8s7gdyuist83bhvdvv') {
    header("HTTP/1.0 401 Unauthorized");
    exit;
}
require_once "/home/fullserv/public_html/fs.i32.pl/p/libs/BazaDanych.class.php";
require_once "/home/fullserv/public_html/fs.i32.pl/p/__config.php";
$RDB = new BazaDanych($__dbHost, $__dbName, $__dbUser, $__dbPass);
if ($_POST['action'] == 'player') {
    $pid = intval($_POST['prm']);
    if ($pid < 32) {
        header("HTTP/1.0 420 Method Failure");
        exit;
    }
    $result = $RDB->pobierz_wyniki("select p.id,p.nick,p.last_skin,p.respect,p.skill,p.gamep,p.datetime_last,p.datetime_registered,p.ban_count,p.kick_count,p.login_count,p.kill_count,p.teamkill_count,p.death_count,p.suicide_count,p.bank_money,p.wallet_money,p.hitman_prize,IF(p.level>4,0,p.level) level,(p.vip>=NOW()) vip, (select id from fs_houses where ownerid={$pid} and paidTo>=DATE(NOW())) dom, (select g.id from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_id, (select g.color from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_color, (select g.name from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_name, (select g.tag from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_tag, (select pig.rank from fs_players_in_gangs pig JOIN fs_gangs g ON g.id=pig.id_gang where id_player={$pid}) gang_rank, (SELECT date_end FROM fs_bans WHERE player_banned = {$pid} AND date_end > NOW() AND date_created < NOW() LIMIT 1) ban_datetime FROM fs_players p WHERE p.id={$pid}");
    if ($_POST['opt'] == 'json' || !isset($_POST['opt'])) {
        print json_encode($result);
        exit;
    } else {
        if ($_POST['opt'] == 'xml') {
            /*header('Content-type: application/xml; charset="utf-8"');*/
            print "ERR: NOT IMPLEMENTED";
            exit;
Exemple #13
0
<?php

/**
The MIT License (MIT)

Copyright (c) 2014 Mateusz Cichon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
require_once "./p/libs/BazaDanych.class.php";
$RDB = new BazaDanych("?", "?", "?", "?");
$RDB->zapytanie("TRUNCATE `fs_races_records`");
$RDB->zapytanie("TRUNCATE `fs_drift_records`");
// EOF