[Chilli] Parameters in uamhomepage
Alexandre Rubert
alexandre.rubert at gmail.com
Tue Aug 6 07:15:01 UTC 2013
Sorry for this confusion.
I have setup like this
HS_UAMHOMEPAGE=http://192.168.182.1/portal/index.php
HS_UAMSERVER=https://192.168.182.1/cgi-bin/login.cgi
My uamhomepage include links to differents website allowed by my coova
configuration, link to http://192.168.182.1:3990/prelogin for
authentication (login.cgi), and a personal local website in php. When I
launch my browser it goes to
http://192.168.182.1/portal/index.php?loginurl=...&mac=...&... I'd like
it to redirect to http://192.168.182.1/portal/index.php with no
parameters. The only moment I want these parameters is when I click on
the link http://192.168.182.1:3990/prelogin wich redirect to
https://192.168.182.1/cgi-bin/login.cgi
I hope to be understood.
Thanks
Le 06/08/2013 08:50, Jed Gainer a écrit :
> huh?
>
> First you say you don't want them then you say you do.
>
> Well you have to have them.
>
> I have it setup like
>
> #/etc/chilli/config
> HS_UAMFORMAT=http://10.1.0.1:81/uam/login.php
> HS_UAMHOMEPAGE=http://10.1.0.1:81/uam/splash.php
>
> <?php
> /* splash.php */
> $url = str_replace('&', '&', $_GET['loginurl']);
> $url_amp = str_replace('&', '&', $url);
> include('php/config.php');
>
> $page = 'Splash';
> include($conf['template_dir'] . '/splash.php');
> ?>
>
> <?php
> /* templates/default/splash.php */
> if (!isset($page))
> die();
> ?>
> <!DOCTYPE html>
> <html>
> <head>
> <!--[if IE]><meta http-equiv="X-UA-Compatible"
> content="IE=edge,chrome=1"><![endif]-->
> <meta <meta name="description" content="derp">
> <meta name="viewport" content="width=device-width">
> <meta http-equiv="refresh" content="5; URL='<?=$url_amp?>'">
> <title>Welcome to <?=$conf['sitename']?></title>
> <link href="css/bootstrap.min.css" rel="stylesheet">
> <link rel="stylesheet" href="css/default.css">
> <style type="text/css">
> body
> {
> text-align: center;
> }
> </style>
> <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
> <!--[if lt IE 7]><link rel="stylesheet"
> href="css/bootstrap-ie6.css"><![endif]-->
> <!--[if lt IE 9]><script src="js/html5shim.js"></script><![endif]-->
> <script>
> var date = new Date();
> date.setTime(date.getTime() + 2592000000);
> document.cookie = "js=true; expires=" + date.toGMTString() + "; path=/";
> window.location.replace("<?=$url?>&js=true");
> </script>
> </head>
> <body>
> <div class="container">
> <div class="page-header">
> <h1>Welcome to <?=$conf['sitename']?></h1>
> <img src="img/logo.jpg">
> <h2><img src="img/wait.gif"> <a
> href="<?=$url_amp?>">redirecting...</a></h2>
> </div>
> </div>
> <script src="js/jquery.min.js"></script>
> <script src="js/bootstrap.min.js"></script>
> </body>
> </html>
>
> <?php
> /* login.php */
> $page = 'Login';
> include('page-header.php');
>
> if (isset($_GET['challenge']))
> $_SESSION['chilli'] = $_GET;
>
> if (isset($_GET['login']))
> {
> if (!$db_radius->user_exists($_POST['username']))
> $errors[] = 'Name does not exist.';
> elseif ($_POST['password'] !=
> $db_radius->get_user_password($_POST['username']))
> $errors[] = 'Password incorrect.';
> if (empty($errors))
> chilli_login();
> }
>
> if (!empty($_GET['res']))
> {
> switch ($_GET['res'])
> {
> case 'success':
> $_SESSION = array(
> 'username' => strpos($_GET['uid'], '@') === false ?
> ucwords($_GET['uid']) : $_GET['uid']
> );
> file_put_contents('logs/logins/' . date('Y-m-d') . '.log',
> "SUCCESS\t" . date('h:i:s a') . "\t'{$_GET['uid']}'\n" .
> print_r($_GET, true), FILE_APPEND);
> //header('Location: http://google.ca');
> header('Location: bandwidth.php');
> die();
> case 'already':
> //header('Location: http://google.ca');
> header('Location: bandwidth.php');
> die();
> case 'logoff':
> $_SESSION = array();
> }
> }
>
> if (!empty($_GET['res']))
> {
> switch ($_GET['res'])
> {
> case 'failed':
> $errors = array();
> if (isset($_GET['reply']))
> if ($_GET['reply'] == 'Your maximum daily usage time
> has been reached' ||
> $_GET['reply'] == 'Your maximum weekly usage time
> has been reached' ||
> $_GET['reply'] == 'Your maximum monthly usage time
> has been reached')
> {
> $bandwidth =
> $db_radius->get_user_bandwidth($_SESSION['login']['username']);
> $bandwidth_types = array('all-time', 'daily',
> 'weekly', 'monthly');
> $errors[] = "You have used your " .
> format_bytes($bandwidth['limit']['bytes'], 2) . " of
> {$bandwidth_types[$bandwidth['limit']['type']]} bandwidth!";
> $remaining_time = ($bandwidth['remaining']['time']
> > 0 ? duration($bandwidth['remaining']['time']) : '∞');
> $errors[] = "Your bandwidth resets in:
> {$remaining_time}.";
> }
> elseif ($_GET['reply'] == 'Your maximum never usage
> time has been reached')
> {
> $errors[] = "You have used all your bandwidth.";
> $errors[] = "You need to buy more to use the
> Internet.";
> }
> else
> $errors[] = $_GET['reply'];
> else
> $errors[] = "Username and/or password rejected.";
> file_put_contents('logs/logins/' . date('Y-m-d') . '.log',
> "FAILED\t" . date('h:i:s a') .
> "\t'{$_SESSION['login']['username']}'\t\t'{$_SESSION['login']['password']}'\t\t'"
> . $db_radius->get_user_password($_SESSION['login']['username']) .
> "'\n\$errors = " . print_r($errors, true) . "\n", FILE_APPEND);
> }
> }
> include('page-footer.php');
>
> include($conf['template_dir'] . '/page-header.php');
> include($conf['template_dir'] . '/login.php');
> include($conf['template_dir'] . '/page-footer.php');
> ?>
>
> <?php
> /* templates/default/login.php */
> if (!isset($page))
> die();
> ?>
> <div class="row-fluid">
> <div class="span5">
> <form method="post" action="paypal.php" class="form-signin2"
> autocomplete="off">
> <h4 class="form-signin-heading">Buy Internet</h4>
> <select id="selectAmount" name="amount_select">
> <option value="20">$20 - 400MB</option>
> <option value="50" selected>$50 - 1000MB</option>
> <option value="100">$100 - 2000MB</option>
> <option value="200">$200 - 4000MB</option>
> <option value="0">Other (specify below)</option>
> </select>
> <div id="amount" class="control-group">
> <div class="input-prepend input-append">
> <span class="add-on">$</span>
> <input id="inputAmount" type="text" name="amount_input"
> value="0" style="text-align: right" autocomplete="off">
> <span class="add-on">.00</span>
> </div>
> </div>
> <button id="buttonPayPal" type="submit" class="btn btn-large
> btn-primary">Continue to PayPal</button>
> </form>
> </div>
> <div class="span2">
> <h3 style="text-align: center">- OR -</h3>
> </div>
> <div class="span5">
> <form class="form-signin"
> action="login.php?login&<?=http_build_query($_GET, '', '&')?>"
> method="post" autocomplete="off">
> <?php if (isset($errors)): foreach ($errors as $error): ?>
> <h2 class="form-signin-heading text-error"><?=$error?></h2>
> <?php endforeach; else: ?>
> <h4 class="form-signin-heading">Login to the Internet</h4>
> <?php endif; ?>
> <input id="inputName" type="text" name="username"
> class="input-block-level" placeholder="Name" autocomplete="off">
> <input type="password" name="password"
> class="input-block-level" placeholder="Password">
> <button class="btn btn-large btn-primary" type="submit">Sign
> in</button>
> </form>
> </div>
> </div>
>
>
>
> On Mon, Aug 5, 2013 at 11:08 PM, Alexandre Rubert
> <alexandre.rubert at gmail.com <mailto:alexandre.rubert at gmail.com>> wrote:
>
> Hello,
> When I set uamhomepage, I'm redirected to this page but with lot
> of parameters like loginurl, mac etc... How can I do to be
> redirected to this page without parameters ? My uamhomepage is a
> local php file which can have GET parameters. I'd like to have
> mac, loginurl... parameters when I go to uamlisten:uamport/prelogin.
> Thanks
> _______________________________________________
> Chilli mailing list
> Chilli at coova.org <mailto:Chilli at coova.org>
> http://lists.coova.org/cgi-bin/mailman/listinfo/chilli
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.coova.org/pipermail/chilli/attachments/20130806/1aadc26a/attachment-0001.html>
More information about the Chilli
mailing list