// // This program 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 Affero // General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program in a file in the toplevel directory called // "AGPLv3". If not, see <http://www.gnu.org/licenses/>. // // Authors: // Loic Dachary <*****@*****.**> // require_once 'common.php'; if (!($user_info = $poker->isLoggedin())) { no_auth_handler(_get_string('name'), $_SERVER['REQUEST_URI']); } if (_post_string('submit')) { try { $amount = _post_string('amount'); if (!is_numeric($amount)) { throw new Exception("amount must be numeric"); } if ($amount == '' or $amount < 0) { throw new Exception("amount must be greater than zero"); } $amount *= 100; $currency_one_public = ereg("^http", _cst_currency_one_public) ? _cst_currency_one_public : dirname(_me()) . "/" . _cst_currency_one_public; $currency_one_private = ereg("^http", _cst_currency_one_private) ? _cst_currency_one_private : dirname(_me()) . "/" . _cst_currency_one_private; if (isset($_POST['currency']) && $_POST['currency'] != '') { $currency = $_POST['currency'];
try { if ($account['password'] != $account['password2']) { throw new Exception('Password and confirmation must be the same.'); } if ($account['email'] == '') { throw new Exception('Email is mandatory'); } $poker->send(array('type' => 'PacketPokerCreateAccount', 'name' => $account['name'], 'password' => $account['password'], 'email' => $account['email'], 'firstname' => $account['firstname'], 'lastname' => $account['lastname'], 'addr_street' => $account['addr_street'], 'addr_street2' => $account['addr_street2'], 'addr_zip' => $account['addr_zip'], 'addr_town' => $account['addr_town'], 'addr_state' => $account['addr_state'], 'addr_country' => $account['addr_country'], 'phone' => $account['phone'], 'gender' => $account['gender'], 'birthdate' => $account['birthdate'], 'affiliate' => 4242)); $poker->login($account['name'], $account['password']); header('Location: index.php?comment=Account%20created.'); die; } catch (Exception $e) { $poker_error = $e->getMessage(); } } else { $account = array('name' => _get_string('name')); } hci_header(); if ($poker_error) { print "<!-- CREATE ACCOUNT ERROR PAGE " . $login . " -->"; print "<h3>" . $poker_error . "</h3>"; } ?> <!-- CREATE ACCOUNT <?php echo $login; ?> --> <form method="post"> <table> <tr>
// This program 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 Affero // General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program in a file in the toplevel directory called // "AGPLv3". If not, see <http://www.gnu.org/licenses/>. // // Authors: // Morgan Manach <*****@*****.**> (2006) // Loic Dachary <*****@*****.**> // require_once 'common.php'; $name = _get_string('name', _post_string('login')); $referer = _post_string('referer', _get_string('referer', './')); if (_post_string('submit')) { $login = _post_string('login'); $password = _post_string('password'); try { $poker->login($login, $password); header('Location: ' . $referer); die; } catch (Exception $e) { $poker_error = $e->getMessage(); } } hci_header(); if ($poker_error) { print "<!-- LOGIN ERROR PAGE " . $name . " -->"; print "<h3>" . $poker_error . "</h3>";
// Authors: // Loic Dachary <*****@*****.**> // Morgan Manach <*****@*****.**> (2006) // require_once 'common.php'; try { $user_info = $poker->isLoggedin(); } catch (Exception $e) { print "<h3>" . $e->getMessage() . "</h3>"; die; } if ($poker_error) { print "<h3>" . $poker_error . "</h3>"; } hci_header(); print "<h3>" . _get_string('comment') . "</h3>"; if ($user_info) { if ($poker_error) { print "<h3>" . $poker_error . "</h3>"; } echo '<h2>' . $user_info['name'] . '</h2>'; echo '<!-- HOME IS LOGGED IN -->'; if (is_array($user_info['money'])) { foreach ($user_info['money'] as $currency => $state) { print _('bankroll') . " " . substr($state[0], 0, -2) . "." . substr($state[0], -2) . ", " . _('in game') . " " . $state[1] . ", " . _('point') . " " . $state[2] . " (" . _('currency') . " " . $currency . ")<p>"; } } echo '<a href="logout.php" id="logout">' . _('Log out') . '</a><br>'; echo '<a href="edit_account.php" id="edit_account">' . _('Edit Account') . '</a><br>'; echo '<a href="cash_in.php" id="cash_in">' . _('Cash-In') . '</a><br>'; echo '<a href="cash_out.php" id="cash_out">' . _('Cash-Out') . '</a><br>';