Esempio n. 1
0
function b1n_doLogin($sql, &$ret_msgs, &$logging)
{
    $ret_msgs = array();
    session_unset();
    if (!b1n_getVar("page0", $page0) || !b1n_getVar("action0", $action0) || !b1n_getVar("login", $login) || !b1n_getVar("passwd", $passwd) || $page0 != "login" || $action0 != "login") {
        return false;
    }
    $query = "\n        SELECT\n            usr_id,\n            usr_name,\n            usr_start_page,\n            usr_email\n        FROM\n            view_active_usr\n        WHERE\n            usr_login = '******'\n            AND usr_passwd = '" . b1n_inBd(b1n_crypt($passwd)) . "'";
    $rs = $sql->singleQuery($query);
    if (!is_array($rs)) {
        b1n_retMsg($ret_msgs, b1n_FIZZLES, "Login incorrect");
        return false;
    }
    $user = array("usr_id" => $rs["usr_id"], "usr_name" => ucfirst(strtok($rs["usr_name"], " ")), "usr_email" => $rs["usr_email"]);
    if (!empty($rs['usr_start_page'])) {
        $aux = explode(': ', $rs['usr_start_page']);
        if (sizeof($aux)) {
            $user += array("usr_toc" => $aux[0]);
            if (isset($aux[1])) {
            }
            $user += array("usr_content" => $aux[1]);
        }
    }
    $user["permission"] = b1n_getPermissions($sql, $user["usr_id"]);
    $user["bookmark"] = b1n_getBookmarks($sql, $user["usr_id"]);
    $_SESSION["user"] = $user;
    $logging = 1;
    return true;
}
Esempio n. 2
0
File: index.php Progetto: mmr/b1n
<?php

// $Id: index.php,v 1.6 2004/04/12 00:34:26 mmr Exp $
// This page will build the player page
require b1n_PATH_LIB . '/player.lib.php';
// Checking actions
switch ($data['action']) {
    case 'chagepasswd':
        b1n_getVar('curpasswd', $data['curpasswd']);
        b1n_getVar('newpasswd', $data['newpasswd']);
        b1n_getVar('newpasswd2', $data['newpasswd2']);
        b1n_playerChangePasswd($data);
        break;
}
// Current Position
$player['position'] = b1n_playerGetPosition();
// Lineage
$player['lineage'] = b1n_playerGetLineage();
// Siblings
$player['siblings'] = b1n_playerGetSiblings();
// Seeing if there are messages to be written
if (sizeof($ret_msgs)) {
    require b1n_PATH_INC . '/ret.inc.php';
}
?>
<center>
<table class='extbox' cellpadding='0' cellspacing='0'>
  <tr>
    <td>
      <table class='intbox' cellspacing='5' cellpadding='2'>
<?php 
Esempio n. 3
0
File: index.php Progetto: mmr/b1n
            break;
        case 'logout':
            b1n_logOut();
            $inc = array(b1n_PATH_INC . '/login.inc.php');
            break;
        default:
            // None was asked, show map
            $data['page'] = 'map';
            $inc[] = $data['page'] . '/index.php';
    }
} else {
    b1n_getVar('login', $data['login']);
    b1n_getVar('passwd', $data['passwd']);
    b1n_getVar('seccode', $data['seccode']);
    b1n_getVar('master', $data['master']);
    b1n_getVar('email', $data['email']);
    // The player is not logged
    if (b1n_cmp($data['page'], 'login')) {
        if (b1n_cmp($data['action'], 'login')) {
            if (b1n_doLogin($data['login'], $data['passwd'], $data['seccode'])) {
                header('Location: ' . b1n_URL);
                exit;
            }
        } elseif (b1n_cmp($data['action'], 'newplayer')) {
            if (b1n_permNewPlayer($data['login'], $data['passwd'], $data['email'], $data['seccode'], $data['master'])) {
                if (b1n_doLogin($data['login'], $data['passwd'], $data['seccode'])) {
                    header('Location: ' . b1n_URL);
                    exit;
                }
            }
        }
Esempio n. 4
0
File: list.inc.php Progetto: mmr/b1n
    } else {
        $v = array($t => $r['db']);
    }
    if ($r['search']) {
        $search_config['possible_fields'] += $v;
    }
    if ($r['select']) {
        $search_config['select_fields'] += $v;
    }
}
b1n_getVar('search_text', $search['search_text']);
b1n_getVar('search_field', $search['search_field']);
b1n_getVar('search_order', $search['search_order']);
b1n_getVar('search_order_type', $search['search_order_type']);
b1n_getVar('search_quantity', $search['search_quantity']);
b1n_getVar('pg_actual', $search['pg_actual']);
$search = b1n_search($sql, $search_config, $search);
?>
<center>
    <br />
    <br />
    <table cellspacing="0" cellpadding="0" class="maintable">
        <tr>
            <td>
                <table cellspacing="1" cellpadding="5" class="inttable">
                    <tr>
                        <td class="box" colspan="2"><?php 
echo $page1_title;
?>
 - Search</td>
                    </tr>
Esempio n. 5
0
        }
        <?php 
if (!empty($_SESSION['user']['usr_name'])) {
    $aux = "<a href='" . b1n_URL . "' target='_top' class='menu'>" . $_SESSION['user']['usr_name'] . "</a> &gt;&gt; ";
} else {
    $aux = "";
}
if (isset($_SESSION['user']['bookmark'][$page0])) {
    $aux .= "<a href='" . $_SESSION['user']['bookmark'][$page0] . "' target='_blank' class='menu' style='text-decoration: underline'>";
} else {
    $aux .= "<a href='" . b1n_URL . '?page0=' . $page0 . "' target='toc' class='menu'>";
}
$aux .= $page0_title . "</a>";
echo 'o.innerHTML = "' . $aux . "\";\n";
unset($aux);
b1n_getVar("frame", $frame);
if (empty($frame)) {
    echo 'parent.content.location = "' . b1n_URL . '?page0=init&text=' . urlencode($page0_title) . "\"\n";
}
unset($frame);
?>
    }
    </script>
</head>
<body onLoad='changeTitles();'>
<div class='back'>
    <div class='section'>
        <span align="center" class="toctitle">
        <?php 
if (isset($_SESSION['user']['bookmark'][$page0])) {
    echo "<a href='" . $_SESSION['user']['bookmark'][$page0] . "' target='_blank' class='menu' style='text-decoration: underline'>" . $page0_title . "</a>";
Esempio n. 6
0
File: inf.php Progetto: mmr/b1n
<?php

// $Id: inf.php,v 1.1 2004/05/09 23:29:47 mmr Exp $
if (!b1n_calcCheck($d['ini'], $d['fin'])) {
    if (!b1n_calcGetMinMax($d['ini'], $d['fin'])) {
        die('Danou-se...');
    }
}
b1n_getVar('n', $d['n']);
if ($d['n'] < 1 && $d['n'] >= 60) {
    die('Danou-se...');
}
$ret = b1n_calcGetNumberInfo($d['n']);
?>
<img src='<?php 
echo b1n_URL . "?p=graph&amp;ini=" . $d['ini'] . "&amp;fin=" . $d['fin'] . "&amp;n=" . $d['n'];
?>
' width='800' height='600' />
<hr />
Esempio n. 7
0
File: init.inc.php Progetto: mmr/b1n
<?php

/* $Id: init.inc.php,v 1.11 2003/07/06 05:52:59 mmr Exp $ */
if (!ini_get('safe_mode') && is_executable("/usr/games/fortune")) {
    $quote = `/usr/games/fortune -s`;
}
b1n_getVar("text", $text);
if ($text == "welcome") {
    if (strlen(trim($_SESSION['user']['usr_name'])) > 0) {
        $text = $_SESSION['user']['usr_name'] . ",";
    }
    $text .= "<br/>Welcome to <i><b>FlyWatch</b> " . b1n_VERSION . "</i> !";
}
if (isset($quote) && !empty($quote)) {
    $text .= "<br /><i>" . b1n_inHtml($quote) . "</i><br />";
}
?>
<html>
<head>
    <title>FlyWatch <?php 
echo b1n_VERSION;
?>
</title>
    <link rel='stylesheet' href='<?php 
echo b1n_CSS;
?>
' />
</head>

<body>
Esempio n. 8
0
File: add.php Progetto: mmr/b1n
<?php

/* $Id: add.php,v 1.26 2004/09/28 22:35:22 mmr Exp $ */
if (isset($reg_data['ids']) && is_array($reg_data['ids'])) {
    $reg_data['last_leg_id'] = $reg_data['ids'][sizeof($reg_data['ids']) - 1];
} else {
    b1n_getVar("last_leg_id", $reg_data['last_leg_id']);
    if (!b1n_checkNumeric($reg_data['last_leg_id'], true)) {
        $query = "SELECT leg_id FROM \"leg\" ORDER BY leg_keeptrack_dt DESC";
        $rs = $sql->singleQuery($query);
        if ($rs && is_array($rs)) {
            $reg_data['last_leg_id'] = $rs['leg_id'];
        } else {
            // Prolly very first leg, so, ETD is mandatory
            $reg_config['ETD']['mand'] = true;
        }
    }
}
$colspan = 3;
$disable_etd_dt = false;
if (!empty($reg_data['last_leg_id']) && b1n_checkNumeric($reg_data['last_leg_id'])) {
    $query = "\n        SELECT\n            acf_id,\n            apt_id_depart,\n            apt_id_arrive,\n\n            leg_groundtime_i IS NOT NULL AS leg_groundtime_i,\n            leg_keeptrack_dt::timestamp\n            +\n                CASE WHEN (leg_ete_i IS NULL) THEN\n                    '00:00'::interval\n                ELSE\n                    leg_ete_i::interval\n                END\n            +\n                CASE WHEN (leg_groundtime_i IS NULL) THEN\n                    '00:00'::interval\n                ELSE\n                    leg_groundtime_i::interval\n                END AS leg_keeptrack_dt,\n\n            cmb_id_pic,\n            cmb_id_sic,\n            cmb_id_extra1,\n            cmb_id_extra2\n        FROM\n            \"leg\" \n        WHERE\n            leg_id = '" . b1n_inBd($reg_data['last_leg_id']) . "'";
    $rs = $sql->singleQuery($query);
    switch ($action0) {
        case 'getdefaults':
            // Pax List from Last Leg
            $reg_data['paxs'] = b1n_regDefaultLegPaxList($sql, $reg_data['last_leg_id']);
            if ($rs && is_array($rs)) {
                // Default depart airport is the Last Arrive Airport
                $reg_data['apt_id_depart'] = $rs['apt_id_arrive'];
                // Default arrive airport is the Last Depart Airport
Esempio n. 9
0
File: index.php Progetto: mmr/b1n
<?php

// $Id: index.php,v 1.2 2004/01/02 19:27:13 mmr Exp $
require b1n_PATH_LIB . '/historic.lib.php';
$data['show_move'] = false;
$data['show_asknpc'] = true;
$data['show_bank'] = true;
$data['show_login'] = true;
$data['show_drink'] = true;
// Checking actions
switch ($data['action']) {
    case 'prefs':
        b1n_getVar('show_move', $data['show_move'], $data['show_move']);
        b1n_getVar('show_login', $data['show_login'], $data['show_login']);
        b1n_getVar('show_asknpc', $data['show_asknpc'], $data['show_asknpc']);
        b1n_getVar('show_bank', $data['show_bank'], $data['show_bank']);
        b1n_getVar('show_drink', $data['show_drink'], $data['show_drink']);
        break;
}
$historic = b1n_historicGet($data);
?>
<table>
  <tr>
    <td>
<?php 
require $data['page'] . '/' . $data['page'] . '.php';
?>
    </td>
  </tr>
</table>
Esempio n. 10
0
File: calc.php Progetto: mmr/b1n
<?php

b1n_getVar('o', $d['o']);
b1n_getVar('ot', $d['ot']);
if (!b1n_calcCheck($d['ini'], $d['fin'])) {
    if (!b1n_calcGetMinMax($d['ini'], $d['fin'])) {
        die('Danou-se...');
    }
}
$s = b1n_calcGetStatus($d['ini'], $d['fin'], $d['o'], $d['ot']);
?>
<form name='f' method='get' action='<?php 
b1n_URL;
?>
'>
<input type='hidden' name='p' value='calc' />
<table border='1'>
  <tr>
    <td>
      De
      <input type='text' name='ini' value='<?php 
echo $d['ini'];
?>
' /> &agrave;
      <input type='text' name='fin' value='<?php 
echo $d['fin'];
?>
' />
      <input type='submit' value='Ok' />
    </td>
  </tr>
Esempio n. 11
0
File: index.php Progetto: mmr/b1n
<?php

// $Id: index.php,v 1.11 2003/02/19 22:51:13 binary Exp $
$ret_msgs = array();
b1n_getVar("action2", $action2);
b1n_getVar("ids", $ids);
if (!is_array($ids)) {
    $ids = explode(':', $ids);
}
$leg_id = $ids[sizeof($ids) - 1];
if (!b1n_checkNumeric($leg_id, true)) {
    b1n_regGoBackExit('Could not get ID of last leg Checked.\\nAborting PDF Generation.' . $leg_id);
}
switch ($action1) {
    case 'config':
        // Config PDF Generation
        switch ($action0) {
            case 'handler':
            case 'permit':
            case 'gedec':
                $page1_title = '';
                // This require defines the $reg_config hash
                // And the beginning of the $page1_title
                require $page0 . '/' . $page1 . '/' . $action0 . '.php';
                $page1_title .= ' PDF Configuration';
                if ($action2 == 'generate') {
                    $func_check = 'b1n_regPdfCheck' . ucfirst($action0);
                    $reg_data = b1n_regExtract($reg_config);
                    if ($func_check($sql, $ret_msgs, $reg_data, $reg_config)) {
                        // Everything is fine, Generate PDF
                        $action2 = 'GO';
Esempio n. 12
0
File: index.php Progetto: mmr/b1n
require b1n_LIBPATH . '/select.lib.php';
// <SELECT> Build
require b1n_LIBPATH . '/reg.lib.php';
// Registries Magic
require b1n_LIBPATH . '/debug.lib.php';
// Debug System
$sql = new sqlLink();
$inc = '';
$ret_msgs = array();
$logging = false;
$page0_title = '';
$page1_title = '';
b1n_getVar('page0', $page0);
b1n_getVar('page1', $page1);
b1n_getVar('action0', $action0);
b1n_getVar('action1', $action1);
session_start();
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
if (!b1n_isLogged() && !b1n_doLogin($sql, $ret_msgs, $logging)) {
    $inc = b1n_INCPATH . '/login.inc.php';
} else {
    switch ($page0) {
        case 'admin':
        case 'itinerary':
        case 'agent':
        case 'pax':
        case 'data':
        case 'bookmark':
        case 'docs':
            $inc = $page0 . '/index.php';
Esempio n. 13
0
File: reg.lib.php Progetto: mmr/b1n
function b1n_regExtract($reg_config)
{
    $reg_data = array();
    foreach ($reg_config as $r) {
        b1n_getVar($r["reg_data"], $reg_data[$r["reg_data"]]);
    }
    return $reg_data;
}
Esempio n. 14
0
File: chart.php Progetto: mmr/b1n
require b1n_PATH_LIB . '/sqllink.lib.php';
require b1n_PATH_LIB . '/data.lib.php';
require b1n_PATH_LIB . '/calc.lib.php';
require b1n_PATH_LIB . '/panachart.php';
// Headers
header('Expires: Wed, 06 Aug 2003 15:50:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
// HTTP/1.1
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Cache-Control: private');
// HTTP/1.0
header('Pragma: no-cache');
$sql = new b1n_sqlLink(b1n_PATH_LIB . '/db_conf.lib.php');
b1n_getVar('ini', $d['ini']);
b1n_getVar('fin', $d['fin']);
if (!b1n_calcCheck($d['ini'], $d['fin'])) {
    if (!b1n_calcGetMinMax($d['ini'], $d['fin'])) {
        die('Danou-se...');
    }
}
$dates = b1n_calcGetDates($d['ini'], $d['fin']);
$values = b1n_calcGetValues($d['ini'], $d['fin'], $dates);
$c = new chart(800, 600, 5, '#eeeeee');
$c->setTitle('MegaSena', '#000000', 4);
$c->setPlotArea(SOLID, '#444444', '#dddddd');
$c->setXAxis('#000000', SOLID, 1, '');
$c->setYAxis('#000000', SOLID, 2, '');
$c->setFormat(0, ',', '.');
$c->setLabels($dates, '#000000', 1, VERTICAL);
$i = 0;
Esempio n. 15
0
File: index.php Progetto: mmr/b1n
        if (isset($_SESSION['show_more_commands'])) {
            unset($_SESSION['show_more_commands']);
        }
        break;
    case 'deposit_money':
        b1n_getVar('money', $data['money']);
        b1n_mapDeposit($data['money']);
        break;
    case 'withdraw_money':
        b1n_getVar('money', $data['money']);
        b1n_mapWithdraw($data['money']);
        break;
    case 'move_city':
        b1n_getVar('cit_id', $data['cit_id']);
        b1n_getVar('x', $data['x']);
        b1n_getVar('y', $data['y']);
        b1n_mapMoveCityPlayer($data['cit_id'], $data['x'], $data['y']);
}
$cur_x = $_SESSION['player']['pla_pos_x'];
$cur_y = $_SESSION['player']['pla_pos_y'];
/*
That is what the map looks like:
 
 ---------.---------.---------
|         |         |         |
| X-1,Y-1 |  X,Y-1  | X+1,Y-1 |
|         |         |         |
|---------|---------|---------|
|         |         |         |
|  X-1,Y  |   X,Y   |  X+1,Y  |
|         |         |         |
Esempio n. 16
0
File: index.php Progetto: mmr/b1n
<?php

/* $Id: index.php,v 1.3 2002/12/23 13:57:53 binary Exp $ */
b1n_getVar("id", $id);
if (!b1n_checkNumeric($id)) {
    ?>
    <script language='JavaScript'>
        history.go(-1);
        window.alert('ID is missing.\nDownload aborted.');
    </script>
    <?php 
    exit;
}
$query = "SELECT fil_fake_name FROM \"file\" WHERE fil_id = '" . b1n_inBd($id) . "'";
$rs = $sql->singleQuery($query);
if (!$rs) {
    ?>
    <script language='JavaScript'>
        history.go(-1);
        window.alert('ID Not Registered.\nDownload Aborted.');
    </script>
    <?php 
    exit;
}
$fil_fake = $rs['fil_fake_name'];
$fil_real = b1n_UPLOAD_DIR . "/fil_" . $id;
if (is_readable($fil_real)) {
    header("Content-Type: octet/stream");
    //header("Content-Length: ...");
    header("Content-Disposition: attachment; filename=" . $fil_fake);
    readfile($fil_real);