コード例 #1
0
ファイル: login.php プロジェクト: jefffederman/pokersource
// 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>";
}
?>
<!-- LOGIN FORM <?php 
コード例 #2
0
ファイル: cash_out.php プロジェクト: jefffederman/pokersource
// 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'];
        }
        $packet = $poker->cashOut($currency_one_private, $amount, $currency);
        $poker->cashOutCommit($packet['name']);
        $url = $currency_one_public . "?command=put_note&serial=" . $packet['bserial'] . "&name=" . $packet['name'] . "&value=" . $packet['value'];
コード例 #3
0
// 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 <*****@*****.**>
//  Loic Dachary <*****@*****.**>
//
require_once 'common.php';
require_once 'birthday.php';
$birthday = new birthday();
if (_post_string('submit')) {
    $account = array('name' => _post_string('name'), 'password' => _post_string('password'), 'password2' => _post_string('password2'), 'email' => _post_string('email'), 'firstname' => _post_string('firstname'), 'lastname' => _post_string('lastname'), 'addr_street' => _post_string('addr_street'), 'addr_street2' => _post_string('addr_street2'), 'addr_zip' => _post_string('addr_zip'), 'addr_town' => _post_string('addr_town'), 'addr_state' => _post_string('addr_state'), 'addr_country' => _post_string('addr_country'), 'phone' => _post_string('phone'), 'gender' => _post_string('gender'), 'birthdate' => $birthday->as_string());
    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 {