FreeIPA Auth Adaptor for LibreTime
Allow delegating user authentication to FreeIPA rather than having it be checked against the database.
This commit is contained in:
parent
a01c7c23ec
commit
aa5bc06d74
8 changed files with 371 additions and 2 deletions
|
@ -76,7 +76,10 @@ class Application_Model_Auth
|
|||
public static function getAuthAdapter()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
if ($CC_CONFIG['auth'] !== 'local') {
|
||||
return self::getCustomAuthAdapter($CC_CONFIG['auth']);
|
||||
}
|
||||
|
||||
// Database config
|
||||
$db = Zend_Db::factory('PDO_' . $CC_CONFIG['dsn']['phptype'], array(
|
||||
'host' => $CC_CONFIG['dsn']['hostspec'],
|
||||
|
@ -95,6 +98,15 @@ class Application_Model_Auth
|
|||
return $authAdapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an alternative Adapter that does not need to auth agains a databse table
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public static function getCustomAuthAdapter($adaptor) {
|
||||
return new $adaptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get random string
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue