aboutsummaryrefslogtreecommitdiffstats
path: root/packages/authng/pkg
diff options
context:
space:
mode:
authorDaniel Stefan Haischt <dsh@pfsense.org>2007-09-09 22:31:01 +0000
committerDaniel Stefan Haischt <dsh@pfsense.org>2007-09-09 22:31:01 +0000
commitefa856a4e2b769a95b3a4a7d7c082c0bb3872d66 (patch)
treedf56ad33bee96e0da7fd4b153c0458a3f24812cf /packages/authng/pkg
parentbae8b3e877512740864ffd1e08820b41c71cf72b (diff)
downloadpfsense-packages-efa856a4e2b769a95b3a4a7d7c082c0bb3872d66.tar.gz
pfsense-packages-efa856a4e2b769a95b3a4a7d7c082c0bb3872d66.tar.bz2
pfsense-packages-efa856a4e2b769a95b3a4a7d7c082c0bb3872d66.zip
* added appropriated methods for authgui to peer classes
Diffstat (limited to 'packages/authng/pkg')
-rw-r--r--packages/authng/pkg/authng.inc2
-rw-r--r--packages/authng/pkg/authng_authgui.inc12
-rw-r--r--packages/authng/pkg/authng_classdefs.inc2
-rw-r--r--packages/authng/pkg/authng_peers.inc32
4 files changed, 39 insertions, 9 deletions
diff --git a/packages/authng/pkg/authng.inc b/packages/authng/pkg/authng.inc
index a9b95838..dbe2cc9d 100644
--- a/packages/authng/pkg/authng.inc
+++ b/packages/authng/pkg/authng.inc
@@ -2,7 +2,7 @@
/* $Id$ */
/* ========================================================================== */
/*
- authng_peers.xml
+ authng.inc
part of pfSense (http://www.pfSense.com)
Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
All rights reserved.
diff --git a/packages/authng/pkg/authng_authgui.inc b/packages/authng/pkg/authng_authgui.inc
index 0556883e..944c9b89 100644
--- a/packages/authng/pkg/authng_authgui.inc
+++ b/packages/authng/pkg/authng_authgui.inc
@@ -2,7 +2,7 @@
/* $Id$ */
/* ========================================================================== */
/*
- authng_authmethods.inc
+ authng_authgui.inc
part of pfSense (http://www.pfSense.com)
Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
All rights reserved.
@@ -46,7 +46,7 @@ if (!$authMethod->authenticate($backend)) { exit; }
/* scriptname is set in headjs.php if the user did try to access a page other
* than index.php without beeing logged in.
*/
-if (isset($_POST['scriptname']) && isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
+if (isset($_POST['scriptname']) && $userPeer->isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER'])) {
pfSenseHeader("{$_POST['scriptname']}");
exit;
}
@@ -55,7 +55,7 @@ $allowed = array();
// Once here, the user has authenticated with the web server.
// Now, we give them access only to the appropriate pages for their group.
-if (!(isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER']))) {
+if (!($userPeer->isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER']))) {
$allowed[] = '';
if (isset($config['system']['group'][$groupindex[$config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['groupname']]]['pages'][0]['page'])) {
$useridx = $userindex[$HTTP_SERVER_VARS['AUTH_USER']];
@@ -67,7 +67,7 @@ if (!(isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER']))) {
/* get the group homepage, to be able to forward
* the user to this particular PHP page.
*/
- getGroupHomePage($group) == "" ? $home = "/index.php" : $home = "/" . getGroupHomePage($group);
+ $groupPeer->getGroupHomePage($group) == "" ? $home = "/index.php" : $home = "/" . $groupPeer->getGroupHomePage($group);
/* okay but if the user realy tries to explicitely access a particular
* page, set $home to that page instead.
@@ -248,8 +248,8 @@ function display_login_form() {
$('inputerrors').innerHTML='';
}
<?php
- require("headjs.php");
- echo getHeadJS();
+// require("headjs.php");
+// echo getHeadJS();
?>
//-->
</script>
diff --git a/packages/authng/pkg/authng_classdefs.inc b/packages/authng/pkg/authng_classdefs.inc
index a61361b3..a64dc415 100644
--- a/packages/authng/pkg/authng_classdefs.inc
+++ b/packages/authng/pkg/authng_classdefs.inc
@@ -2,7 +2,7 @@
/* $Id$ */
/* ========================================================================== */
/*
- authng_classdefs.xml
+ authng_classdefs.inc
part of pfSense (http://www.pfSense.com)
Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
All rights reserved.
diff --git a/packages/authng/pkg/authng_peers.inc b/packages/authng/pkg/authng_peers.inc
index cc75c94c..65546c41 100644
--- a/packages/authng/pkg/authng_peers.inc
+++ b/packages/authng/pkg/authng_peers.inc
@@ -2,7 +2,7 @@
/* $Id$ */
/* ========================================================================== */
/*
- authng_peers.xml
+ authng_peers.inc
part of pfSense (http://www.pfSense.com)
Copyright (C) 2007 Daniel S. Haischt <me@daniel.stefan.haischt.name>
All rights reserved.
@@ -194,6 +194,21 @@ class AbstractUserPeer {
function getUserByIndex($index) {
return $this->users[$index];
}
+
+ function getUserByName($username) {
+ return $this->users[$username];
+ }
+
+ function isSystemAdmin($username) {
+ $result = false;
+ $user = getUserByName($username);
+
+ if ($user) {
+ $result = $user->isSystemAdmin();
+ }
+
+ return $result;
+ }
}
/**
@@ -230,6 +245,21 @@ class AbstractGroupPeer {
function getGroupByIndex($index) {
return $this->groups[$index];
}
+
+ function getGroupByName($groupname) {
+ return $this->groups[$groupname];
+ }
+
+ function getGroupHomePage($groupname) {
+ $result = false;
+ $group = getGroupByName($groupname);
+
+ if ($group) {
+ $result = $group->getHome();
+ }
+
+ return $result;
+ }
}
/**