seeddms-code/inc/inc.ClassAuthentication.php

70 lines
1.5 KiB
PHP
Raw Normal View History

2016-08-10 13:52:55 +00:00
<?php
/**
* Implementation of user authentication
*
2021-09-20 14:41:48 +00:00
* @category DMS
* @package SeedDMS
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright 2010-2016 Uwe Steinmann
* @license GPL 2
* @version @package_version@
* @link https://www.seeddms.org
2016-08-10 13:52:55 +00:00
*/
/**
* Abstract class to authenticate user
*
2021-09-20 14:41:48 +00:00
* @category DMS
* @package SeedDMS
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright 2010-2016 Uwe Steinmann
* @license GPL 2
* @version Release: @package_version@
* @link https://www.seeddms.org
2016-08-10 13:52:55 +00:00
*/
2021-09-20 14:41:48 +00:00
abstract class SeedDMS_Authentication
{
2016-08-10 13:52:55 +00:00
/**
2021-09-20 14:41:48 +00:00
* DMS object
*
* @var SeedDMS_Core_DMS
2016-08-10 13:52:55 +00:00
* @access protected
*/
2021-09-20 14:41:48 +00:00
protected $dms;
2016-08-10 13:52:55 +00:00
/**
2021-09-20 14:41:48 +00:00
* DMS settings
*
* @var Settings
2016-08-10 13:52:55 +00:00
* @access protected
*/
2021-09-20 14:41:48 +00:00
protected $settings;
2016-08-10 13:52:55 +00:00
2021-09-20 14:41:48 +00:00
/**
* Constructor
*
* @param SeedDMS_Core_DMS $dms DMS object
* @param Settings $settings DMS settings
*/
function __construct($dms, $settings) /* {{{ */
{
2016-08-10 13:52:55 +00:00
$this->dms = $dms;
$this->settings = $settings;
} /* }}} */
/**
* Do Authentication
*
* This function must check the username and login. If authentication succeeds
* the user object otherwise false must be returned. If authentication fails
* the number of failed logins should be incremented and account disabled.
*
2021-09-20 14:41:48 +00:00
* @param string $username name of user to authenticate
* @param string $password password of user to authenticate
*
* @return object|false user object if authentication was successful
* otherwise false
2016-08-10 13:52:55 +00:00
*/
abstract function authenticate($username, $password);
}