Пример #1
0
    $s->SetSetting('default_exp_h', $_POST['h']);
    $s->SetSetting('default_exp_m', $_POST['m']);
    $s->SetSetting('force_exp', $_POST['force_exp']);
    $s->SetSetting('default_start_exp', $_POST['start_exp']);
    $s->SetSetting('force_start_exp', $_POST['force_start_exp']);
}
if ($_GET['do'] == 'logo') {
    move_uploaded_file($_FILES['logo']['tmp_name'], '../graphics/' . trim($_FILES['logo']['name']));
    if (!preg_match("/image/i", $_FILES['logo']['type'])) {
        unlink('../graphics/' . trim($_FILES['logo']['name']));
        die('The file doesn\'t seem to be a picture.');
    }
    $s->SetSetting('logo', trim($_FILES['logo']['name']));
}
if ($_GET['do'] == 'del_logo') {
    $logo = $s->GetSetting('logo');
    if (file_exists('../graphics/' . $logo) && !is_dir('../graphics/' . $logo)) {
        @unlink('../graphics/' . $logo);
        $s->SetSetting('logo', '');
    }
}
echo '<table border="0" cellspacing="1">
<tr class="tableheader"><td colspan="2">General Settings</td></tr>
<tr class="darkbg">
<form action="' . $_SERVER['PHP_SELF'] . '?do=update_general" method="post">
<td valign="top">Voucher information text 1:<br>
<small>First line of info text shown in the voucher.</small>
</td><td><input type="text" class="formstyle" name="vouchertext1" size="50" value="' . $s->GetSetting('vouchertext1') . '"></td></tr>
<tr class="lightbg">
<td valign="top">Voucher information text 2:<br>
<small>Second line of info text shown in the voucher.</small>
Пример #2
0
} else {
    $auth_error = 'no-auth-method';
}
if ($auth_error != '') {
    include '../includes/header.php';
    echo 'There has been a Problem authenticating your device.<br><br>';
    if ($auth_error == 'no-mac') {
        echo 'I wasn\'t able to read your device\'n network address. Please contact an administrator.';
    }
    if ($auth_error == 'no-auth-method') {
        echo 'I wasn\'t able to read the authentication method from the config. Please contact an administrator.';
    }
    if ($auth_error == 'not-found-exceeded') {
        echo 'The voucher ID you have entered was not found, or the voucher has expired. Please check the voucher numer or request a new one.';
    }
    if ($auth_error == 'maxnumber-reached') {
        echo 'You are not allowed to use more devices with this voucher.';
        if ($s->GetSetting('deny_drop_devices') != 'y') {
            echo 'You can <a href="drop.php">drop</a> the internet access for a device that you don\'t need 
			anymore, then try again.';
        }
    }
    if ($auth_error == 'db-error') {
        echo 'We have a database error. Please contact an administrator.';
    }
    if ($auth_error == 'verification-failed') {
        echo 'The verification of your voucher failed. Please check your verification key.';
    }
} else {
    header('Location: index.php');
}
Пример #3
0
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
require '../classes/vouchermanager.php';
require '../classes/systemmanager.php';
$v = new vouchermanager();
$clientdata = $v->ClientAuthenticated();
$s = new systemmanager();
require '../includes/header.php';
// Must be included after creating instance of systemmanager
if ($clientdata != 'noauth') {
    echo 'You are online and can now browse the internet.<br><br>
	Your voucher ID is: ' . $clientdata[2] . '<br>';
    $vinfo = $v->GetVoucherInfo($clientdata[2]);
    echo 'Your voucher is valid until ' . date('Y-m-d H:i', $vinfo['valid_until']) . ' and you can register ' . $vinfo['remain'] . ' more device(s) with this voucher.';
} else {
    echo $s->GetSetting('pre-form-text') . '<br><br>
	<form action="auth.php" method="post">
	Voucher code: <input type="text" name="vid" size="20" class="formstyle">';
    if ($s->GetSetting('use_verification') == 'y') {
        echo '<br>Verification key: <input type="text" name="verification_key" size="20" class="formstyle">';
    }
    echo '<br><br>
	<input type="submit" value="OK" class="formstyle">
	</form><br><br>' . $s->GetSetting('post-form-text');
}
?>
</body>
</html>
Пример #4
0
<?php

if (!class_exists('systemmanager')) {
    require '../classes/systemmanager.php';
}
if (!isset($s)) {
    $s = new systemmanager();
}
$logo = $s->GetSetting('logo');
if (file_exists('../graphics/' . $logo) && !is_dir('../graphics/' . $logo)) {
    $img_inc = '../graphics/' . $logo;
} else {
    $img_inc = '../graphics/logo-small.png';
}
?>
<html>
<head>
<link rel="stylesheet" href="../style/style.css">
<script language="javascript" src="functions.js"></script>
<title>OpenVoucher</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0">
<tr class="tableheader">
<td colspan="3">&nbsp;</td>
</tr><tr>
<td><img src="<?php 
echo $img_inc;
?>
"></td>
<td align="center">
Пример #5
0
require '../classes/adminauth.php';
require '../classes/systemmanager.php';
$a = new adminauth();
$s = new systemmanager();
if (!$a->CheckPermission('add_voucher')) {
    require '../classes/gui.php';
    include '../includes/header.php';
    include 'menu.php';
    echo '<center><b>You have no permission to add vouchers.</b></center></body></html>';
    die;
}
include '../includes/header.php';
include 'menu.php';
// Has a number been entered or do we have to display the form? Has the user set how long the voucher should be valid?
if (is_numeric($_POST['cnt']) && trim($_POST['cnt']) != '' && ($_POST['d'] != 0 || $_POST['h'] != 0 || $_POST['m'] != 0 || ($_POST['e_d'] != 0 || $_POST['e_h'] != 0 || $_POST['e_m'] != 0)) && ($_POST['start_expire'] != '' || $s->GetSetting('force_start_exp') == 'y')) {
    // Include and load the vouchermanager
    require '../classes/vouchermanager.php';
    $v = new vouchermanager();
    // Replace entered values with default values, if enforced. This prevents the user from injecting forbidden values to the system
    if ($s->GetSetting('force_device-qty') == 'y') {
        $_POST['dev-cnt'] = $s->GetSetting('default_device-qty');
    }
    if ($s->GetSetting('force_start_exp') == 'y') {
        if ($s->GetSetting('default_start_exp') == 'creation') {
            $_POST['start_expire'] = 'now';
        } else {
            $_POST['start_expire'] = 'given';
        }
    }
    if ($s->GetSetting('force_exp') == 'y') {
Пример #6
0
<?php

require '../classes/vouchermanager.php';
require '../classes/systemmanager.php';
$v = new vouchermanager();
$s = new systemmanager();
$authtype = $v->GetAuthMethod();
require '../includes/header.php';
if ($s->GetSetting('deny_drop_devices') == 'y') {
    die('Sorry, dropping devices has been disabled by the admin.');
}
if ($_GET['do'] == '') {
    echo 'To drop a device, please enter your voucher code again:<br><br>
	<form action="drop.php?do=lst-devices" method="post">
	Voucher code: <input type="text" name="vid" size="20" class="formstyle">';
    if ($s->GetSetting('use_verification') == 'y') {
        echo '<br>Verification key: <input type="text" name="verification_key" size="20" class="formstyle">';
    }
    echo '<br><br>
	<input type="submit" value="Next" class="formstyle">';
}
if ($_GET['do'] == 'lst-devices') {
    if ($s->GetSetting('use_verification') == 'y') {
        if (!$v->VerifyVoucherKey($_POST['vid'], $_POST['verification_key'])) {
            echo 'The verification key is invalid. Please go <a href="javascript:history.back();">back</a> and try again.</body></html>';
            die;
        }
    }
    $voucher_info = $v->GetVoucherInfo($_POST['vid']);
    $devices = $v->GetDeviceList($_POST['vid']);
    echo 'Device count: ' . $voucher_info['dev_count'] . ' (' . $voucher_info['remain'] . ' left)<br>