Source for file BaseAuth.php
Documentation is available at BaseAuth.php
require_once(UTIL_PKG_PATH . "PHP_Compat/Compat/Function/scandir.php");
* Class that manages the base autentication method
$this->mCfg['auth_id'] = $pAuthId;
$var = $gBitSystem->getConfig($op_id, $op['default']);
if ($op['type']== "checkbox") {
static $authMethod = array();
BaseAuth::scanAuthPlugins();
if (empty($authMethod[$pAuthId])) return null;
return $authMethod[$pAuthId];
$authMethod[$pAuthId]= $method;
foreach( $authScan as $plugDir ) {
if( $plugDir != 'CVS' && substr($plugDir,0,1)!= '.' && is_dir( $authDir. $plugDir ) ) {
'file' => $authDir. $plugDir. '/auth.php',
'class' => ucfirst( $plugDir ). 'Auth',
public static function register($id,$hash) {
if (empty($hash['name'])) {
if (empty($hash['file'])) {
if (empty($hash['class'])) {
$warning = '<div class="error">'. $str. '</div>';
if (empty($methods)) return 0;
function validate($user,$pass,$challenge,$response) {
$this->mInfo['login']= $user;
$this->mInfo['password']= $pass;
$this->mErrors[] = "BaseAuth is not an authentcation method";
$this->mErrors[] = "BaseAuth is not an authentcation method";
$this->mErrors[] = "BaseAuth is not an authentcation method";
public static function isActive($package) {
if ($gBitSystem->getConfig("users_auth_method_$i",$default)== $package) {
public static function init( $pAuthMixed ) {
$authPlugin = $gBitSystem->getConfig("users_auth_method_$pAuthMixed",$default);
if (!empty( $authPlugin ) ) {
} elseif (!empty($pAuthMixed)) {
require_once( $authPlugin['file'] );
$cl = $authPlugin['class'];
if (!empty($_REQUEST[$op_id])) {
if( $op['type'] == 'checkbox' ) {
$value = $gBitSystem->getConfig($op_id, $op['default']);
$method['options'][$op_id] = $op;
$authSettings['avail'][$meth_name]= $method;
$authSettings['err'][$meth_name]= implode("<br />",$instance->mErrors);
if (!empty($_REQUEST["loginprefs"])) {
for ($i= 0,$j= 0;$i< count($authSettings['avail']);$i++ ,$j++ ) {
$gBitSystem->storeConfig( "users_auth_method_$i",null, USERS_PKG_NAME );
if (empty($_REQUEST["users_auth_method_$i"])) {
} elseif(!empty($used[$_REQUEST["users_auth_method_$i"]])) {
$used[$_REQUEST["users_auth_method_$i"]]= "stored_$j";
$gBitSystem->storeConfig( "users_auth_method_$j", $_REQUEST["users_auth_method_$i"], USERS_PKG_NAME );
for ($i= 0;$i< count($authSettings['avail']);$i++ ) {
$authSettings['avail_method'][$i]['value']= $gBitSystem->getConfig("users_auth_method_$i",$default);
if (!$canManageAuth&& !empty($authSettings['avail_method'][$i]['value'])) {
$canManageAuth = $authSettings['avail'][$authSettings['avail_method'][$i]['value']]['canManageAuth'];
if (($gBitSystem->getConfig('users_allow_register','y')== 'y')&& !$canManageAuth) {
$authSettings['err']['bit_reg']= "Registration is enabled but there are no Auth Methods that support this, Registration won't work!";
|