Skip to content

Commit

Permalink
Revert "Merge pull request pfsense#100 from sbeaver-netgate/halt"
Browse files Browse the repository at this point in the history
This reverts commit 5bd4066, reversing
changes made to b9bd627.
  • Loading branch information
SjonHortensius committed Apr 28, 2015
1 parent 01752a9 commit 45d6ada
Show file tree
Hide file tree
Showing 30 changed files with 1,061 additions and 1,292 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ upload.sh
.project
.settings/
# PhpStorm
.idea
.idea
*.php-e
171 changes: 85 additions & 86 deletions PROGRESS.md

Large diffs are not rendered by default.

36 changes: 17 additions & 19 deletions etc/inc/authgui.inc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ if ($local_ip == false) {
<head>
<link rel="stylesheet" href="/bootstrap/css/pfSense.css" />
<title><?=gettext("Login"); ?></title>
<script>var events = events || [];</script>
</head>
<body id="login" class="no-menu">
<div id="jumbotron">
Expand Down Expand Up @@ -262,24 +263,21 @@ if ($local_ip == false) {
</div>
</div>
</div>
</div>
<script src="/jquery/jquery-1.11.1.min.js"></script>
<script>
$(function() {
document.cookie=
"cookie_test=1" +
"<?php echo $config['system']['webgui']['protocol'] == 'https' ? '; secure' : '';?>";

if (document.cookie.indexOf("cookie_test") == -1)
document.getElementById("no_cookies").className = '';

// Delete it
document.cookie = "cookie_test=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
});
</script>
</body>
</html>

<script>
events.push(function() {
document.cookie=
"cookie_test=1" +
"<?php echo $config['system']['webgui']['protocol'] == 'https' ? '; secure' : '';?>";

if (document.cookie.indexOf("cookie_test") == -1)
document.getElementById("no_cookies").className = '';

// Delete it
document.cookie = "cookie_test=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
});
</script>
<?php
} // end function
require('foot.inc');

?>
} // end function
1 change: 1 addition & 0 deletions usr/local/www/bootstrap/css/pfSense.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tr.disabled th {
/** Content structure */
.table-responsive {
clear: both;
margin-bottom: 0px;
}

.form-horizontal {
Expand Down
2 changes: 1 addition & 1 deletion usr/local/www/carp_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ interfaces_sync_setup();
<td>
<td><?=convert_friendly_interface_to_friendly_descr($carp['interface'])?>@<?=$vhid?></td>
<td><?=$ipaddress?></td>
<td><i class="icon icon-<?=$icon?>">$status</td>
<td><i class="icon icon-<?=$icon?>">$status</i></td>
</tr>
<?php }?>
</table>
Expand Down
7 changes: 4 additions & 3 deletions usr/local/www/classes/Form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ class Form extends Form_Element
protected $_sections = array();
protected $_global = array();

public function __construct(Form_Button $submit = null)
public function __construct($submit = null)
{
if (!isset($submit))
$submit = new Form_Button(
'save',
'Save'
);

$this->addGlobal($submit);
if (false !== $submit)
$this->addGlobal($submit);
}

public function add(Form_Section $section)
Expand Down Expand Up @@ -112,4 +113,4 @@ public function __toString()
</form>
EOT;
}
}
}
100 changes: 55 additions & 45 deletions usr/local/www/diag_authentication.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
diag_authentication.php
part of the pfSense project (https://www.pfsense.org)
part of the pfSense project (https://www.pfsense.org)
Copyright (C) 2010 Ermal Luçi
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
All rights reserved.
Expand Down Expand Up @@ -29,7 +29,7 @@
*/

/*
pfSense_MODULE: auth
pfSense_MODULE: auth
*/

##|+PRIV
Expand All @@ -51,16 +51,19 @@
if (!$authcfg)
$input_errors[] = $_POST['authmode'] . " " . gettext("is not a valid authentication server");

if (empty($_POST['username']) || empty($_POST['passwordfld']))
if (empty($_POST['username']) || empty($_POST['password']))
$input_errors[] = gettext("A username and password must be specified.");

if (!$input_errors) {
if (authenticate_user($_POST['username'], $_POST['passwordfld'], $authcfg)) {
if (authenticate_user($_POST['username'], $_POST['password'], $authcfg)) {
$savemsg = gettext("User") . ": " . $_POST['username'] . " " . gettext("authenticated successfully.");
$groups = getUserGroups($_POST['username'], $authcfg);
$savemsg .= "<br />" . gettext("This user is a member of these groups") . ": <br />";
$savemsg .= "&nbsp;" . gettext("This user is a member of groups") . ": <br />";
$savemsg .= "<ul>";
foreach ($groups as $group)
$savemsg .= "{$group} ";
$savemsg .= "<li>" . "{$group} " . "</li>";
$savemsg .= "</ul>";

} else {
$input_errors[] = gettext("Authentication failed.");
}
Expand All @@ -71,42 +74,49 @@
include("head.inc");

?>
<?php if ($input_errors) print_input_errors($input_errors)?>
<?php if ($savemsg) print_info_box($savemsg)?>
<div id="container">
<form class="form-horizontal" action="diag_authentication.php" method="post">
<div class="form-group">
<label for="authmode" class="col-sm-2 control-label"><?=gettext("Authentication Server")?></label>
<div class="col-sm-10">
<select name="authmode" id="authmode" class="formselect" >
<?php
foreach (auth_get_authserver_list() as $auth_server):
$selected = ($auth_server['name'] == $pconfig['authmode'])
?>
<option value="<?=$auth_server['name']?>" <?=($selected?'selected="selected"':'')?>>
<?=$auth_server['name']?>
</option>
<?php endforeach?>
</select>
</div>
</div>

<div class="form-group">
<label for="authmode" class="col-sm-2 control-label"><?=gettext("Username")?></label>
<div class="col-sm-10">
<input name="username" value="<?=htmlspecialchars($pconfig['username'])?>" />
</div>
</div>

<div class="form-group">
<label for="authmode" class="col-sm-2 control-label"><?=gettext("Password")?></label>
<div class="col-sm-10">
<input name="password" type="password" value="<?=htmlspecialchars($pconfig['password'])?>" />
</div>
</div>

<button type="submit" class="btn btn-primary"><?=gettext("Test");?></button>
</form>
</div>
</div>
<?php include("foot.inc")?>
<?php
if ($input_errors)
print_input_errors($input_errors);

if ($savemsg)
print('<div class="alert alert-success" role="alert">'. $savemsg.'</div>');

require('classes/Form.class.php');

$form = new Form(new Form_Button(
'Submit',
gettext('Test')
));

$section = new Form_Section('Authentication Test');

foreach (auth_get_authserver_list() as $auth_server)
$serverlist[$auth_server['name']] = $auth_server['name'];

$section->addInput(new Form_Select(
'authmode',
'Authentication Server',
$pconfig['authmode'],
$serverlist
))->setHelp('Select the authentication server to test against');

$section->addInput(new Form_Input(
'username',
'Username',
'text',
$pconfig['username'],
['placeholder' => 'Username']
));

$section->addInput(new Form_Input(
'password',
'Password',
'password',
$pconfig['password'],
['placeholder' => 'Password']
));

$form->add($section);
print $form;

include("foot.inc");
123 changes: 50 additions & 73 deletions usr/local/www/diag_limiter_info.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<?php
/* $Id$ */
/*
diag_limiter_info.php
Copyright (C) 2010 Scott Ullrich
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
All rights reserved.
diag_limiter_info.php
Copyright (C) 2010 Scott Ullrich
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

/*
pfSense_BUILDER_BINARIES: /usr/bin/top
pfSense_MODULE: system
pfSense_MODULE: system
*/

##|+PRIV
Expand All @@ -47,8 +47,8 @@

if($_REQUEST['getactivity']) {
$text = `/sbin/ipfw pipe show`;
if($text == "")
$text = "We could not find any limiters on this system.";
if($text == "")
$text = "Unable to find any limiters on this system.";
echo "Limiters:\n";
echo $text;
$text = `/sbin/ipfw queue show`;
Expand All @@ -61,59 +61,36 @@

include("head.inc");

if ($input_errors)
print_input_errors($input_errors);

?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<script type="text/javascript">
//<![CDATA[
<script>
function getlimiteractivity() {
var url = "/diag_limiter_info.php";
var pars = 'getactivity=yes';
jQuery.ajax(
url,
$.ajax(
'/diag_limiter_info.php',
{
type: 'post',
data: pars,
complete: activitycallback
});
}
function activitycallback(transport) {
jQuery('#limiteractivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>');
setTimeout('getlimiteractivity()', 2000);
data: {
getactivity: 'yes'
},
success: function (data) {
$('#xhrOutput').html(data);
},
});
}
setTimeout('getlimiteractivity()', 5000);
//]]>

events.push(function(){
setInterval('getlimiteractivity()', 2500);
getlimiteractivity();
});
</script>
<div id="maincontent">
<?php
if($savemsg) {
echo "<div id=\"savemsg\">";
print_info_box($savemsg);
echo "</div>";
}
if ($input_errors)
print_input_errors($input_errors);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag limiter info">
<tr>
<td>
<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
<tr>
<td align="center">
<table summary="results">
<tr><td>
<div id="limiteractivitydiv">
<?=gettext("Gathering Limiter information, please wait...");?>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

<div class="panel panel-default">
<div class="panel-heading">Limiter Information</div>
<div class="panel-body">
<pre id="xhrOutput"><?=gettext("Gathering Limiter information, please wait...")?></pre>
</div>
</div>
<?php include("fend.inc"); ?>
</body>
</html>

<?php include("foot.inc");
Loading

0 comments on commit 45d6ada

Please sign in to comment.