toDB($_POST['auth_method']);
$temp['auth_noconn'] = intval($_POST['auth_noconn']);
$temp['auth_method2'] = $tp->toDB($_POST['auth_method2']);
$temp['auth_badpassword'] = intval($_POST['auth_badpassword']);
if ($admin_log->logArrayDiffs($temp, $pref, 'AUTH_01'))
{
e107::getConfig('core')->setPref($temp)->save(false);
header('location:'.e_SELF);
exit;
}
}
if(isset($_POST['updateeufs']))
{
$authExtended = array();
foreach ($_POST['auth_euf_include'] as $au)
{
$authExtended[] = trim($tp->toDB($au));
}
$au = implode(',',$authExtended);
if ($au != $pref['auth_extended'])
{
e107::getConfig()->set('auth_extended', $au)->save(true,true,true);
e107::getLog()->add('AUTH_02',$au,'');
}
}
// Avoid need for lots of checks later
if (!isset($pref['auth_badpassword'])) $pref['auth_badpassword'] = 0;
if (!isset($pref['auth_noconn'])) $pref['auth_noconn'] = 0;
// Convert prefs
if (isset($pref['auth_nouser']))
{
$cfg = e107::getConfig();
$cfg->set('auth_method2', 'none');
if($pref['auth_nouser'])
{
$cfg->set('auth_method2', 'e107');
}
$cfg->remove('auth_nouser');
if (!isset($pref['auth_badpassword']))
{
$cfg->set('auth_badpassword', 0);
}
$cfg->save(false, true, true);
}
$authlist = alt_auth_admin::alt_auth_get_authlist();
if (isset($pref['auth_extended']))
{
$authExtended = explode(',',$pref['auth_extended']);
}
else
{
$pref['auth_extended'] = '';
$authExtended = array();
}
if(e107::getDb()->getPDO() === false)
{
$mess = "PDO is required to use alt-auth. To enable add: define('e_PDO', true);
to e107_config.php.
Warning: If PDO is not correctly configured on your server then your site may fail to connect with the database.";
echo e107::getMessage()->addInfo($mess)->render();
}
if(!empty($message))
{
echo e107::getMessage()->addSuccess($message)->render();
}
$altAuthAdmin = new alt_auth_admin();
$text = "