Skip to content
Snippets Groups Projects
Commit 103c95d5 authored by Peter Rotich's avatar Peter Rotich Committed by Peter Rotich
Browse files

Change AuthenticatedUser user to interface class.

This is necessary to force downstream classes to implement key required
functions.
parent 5dda909b
Branches
Tags
No related merge requests found
......@@ -2,13 +2,15 @@
require(INCLUDE_DIR.'class.ostsession.php');
require(INCLUDE_DIR.'class.usersession.php');
class AuthenticatedUser {
// How the user was authenticated
var $backend;
interface AuthenticatedUser {
// Get basic information
function getId() {}
function getUsername() {}
function getId();
function getUsername();
function setBackend($bk);
function getBackend();
function getRole();
}
interface AuthDirectorySearch {
......
......@@ -22,7 +22,7 @@ include_once(INCLUDE_DIR.'class.passwd.php');
include_once(INCLUDE_DIR.'class.user.php');
include_once(INCLUDE_DIR.'class.auth.php');
class Staff extends AuthenticatedUser {
class Staff implements AuthenticatedUser {
var $ht;
var $id;
......@@ -95,6 +95,20 @@ class Staff extends AuthenticatedUser {
return $this->config->getInfo() + $this->getHastable();
}
// AuthenticatedUser implementation...
// TODO: Move to an abstract class that extends Staff
function setBackend($bk) {
}
function getBackend() {
}
function getRole() {
return 'staff';
}
/*compares user password*/
function check_passwd($password, $autoupdate=true) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment