diff --git a/e107_plugins/alt_auth/alt_auth_adminmenu.php b/e107_plugins/alt_auth/alt_auth_adminmenu.php
index e738b97be..973c8be06 100755
--- a/e107_plugins/alt_auth/alt_auth_adminmenu.php
+++ b/e107_plugins/alt_auth/alt_auth_adminmenu.php
@@ -145,7 +145,7 @@ class alt_auth_admin extends alt_auth_base
if ($v['optional'] == FALSE) $ret .= '* ';
$ret .= $v['prompt'].':';
- $ret .= "
";
+ $ret .= " | ";
// $fieldname = $tableType.'_'.$v['optname'];
$fieldname = $tableType.'_xf_'.$f; // Name of the input box
$value = varset($v['default'],'');
@@ -367,14 +367,14 @@ class alt_auth_admin extends alt_auth_base
*/
public function alt_auth_test_form($prefix, $frm)
{
- $text = $frm -> form_open('post', e_SELF, 'testform');
- $text .= "
- ";
+ $text = '';
- if (isset($_POST['testauth']))
+ if(!empty($_POST['testauth']))
{
// Try and connect to DB/server, and maybe validate user name
require_once(e_PLUGIN.'alt_auth/'.$prefix.'_auth.php');
+ e107::getDebug()->log('Loading: alt_auth/'.$prefix.'_auth.php');
+
$_login = new auth_login;
$log_result = AUTH_UNKNOWN;
$pass_vars = array();
@@ -389,16 +389,27 @@ class alt_auth_admin extends alt_auth_base
$log_result = $_login->login($val_name, $_POST['passtovalidate'], $pass_vars, ($val_name == ''));
}
- $text .= "".LAN_ALT_48;
+ $text = "
+
+
+
+
+ ".LAN_ALT_48." | ";
+ $text .= "";
+
if ($val_name)
{
- $text .= " ".LAN_ALT_49.$val_name.' '.LAN_ALT_50;
+ $text .= LAN_ALT_49.": ".$val_name.' '.LAN_ALT_50.": ";
if (varset($_POST['passtovalidate'],'')) $text .= str_repeat('*',strlen($_POST['passtovalidate'])); else $text .= LAN_ALT_51;
}
- $text .= " | ";
+ $text .= " | ";
+
+ $err = '';
+
switch ($log_result)
{
case AUTH_SUCCESS :
+ $text .= " ";
$text .= LAN_ALT_58;
if (count($pass_vars))
{
@@ -408,45 +419,75 @@ class alt_auth_admin extends alt_auth_base
$text .= ' '.$k.'=>'.$v;
}
}
+ $text .= " ";
break;
case AUTH_NOUSER :
- $text .= LAN_ALT_52.LAN_ALT_55;
+ $err = LAN_ALT_52.LAN_ALT_55;
break;
case AUTH_BADPASSWORD :
- $text .= LAN_ALT_52.LAN_ALT_56;
+ $err = LAN_ALT_52.LAN_ALT_56;
break;
case AUTH_NOCONNECT :
- $text .= LAN_ALT_52.LAN_ALT_54;
+ $err = LAN_ALT_52.LAN_ALT_54;
break;
case AUTH_UNKNOWN :
- $text .= LAN_ALT_52.LAN_ALT_53;
+ $err = LAN_ALT_52.LAN_ALT_53;
break;
case AUTH_NOT_AVAILABLE :
- $text .= LAN_ALT_52.LAN_ALT_57;
+ $err = LAN_ALT_52.LAN_ALT_57;
break;
+ case LOGIN_CONTINUE:
+ $err = "wrong encoding?";
+ break;
default :
- $text .= "Coding error";
+ $err = "Coding error";
+ var_dump($log_result);
}
- if (isset($_login ->ErrorText)) $text .= ' '.$_login ->ErrorText;
- $text .= " | ";
+
+ if(!empty($err))
+ {
+ $text .= "".$err." ";
+ }
+
+ if(!empty($_login ->ErrorText))
+ {
+ $text .= "".$_login ->ErrorText." ";
+ }
+
+ $text .= " ";
+
+ // $text = "".$text." ";
}
+ $text .= $frm -> form_open('post', e_SELF, 'testform');
+ $text .= "
+
+
+
+
+ ".LAN_ALT_42." | ";
+
$text .= "".LAN_ALT_33." | ";
- $text .= $frm->form_text('nametovalidate', 35, '', 120);
+ // $text .= $frm->form_text('nametovalidate', 35, '', 120);
+ $text .= e107::getForm()->text('nametovalidate','',35);
$text .= " | ";
$text .= "".LAN_ALT_34." | ";
$text .= $frm->form_password('passtovalidate', 35, '', 120);
$text .= " | ";
- $text .= " ";
+
$text .= " ";
+
+ $text .= "";
+ // $text .= $frm->form_button("submit", 'testauth', LAN_ALT_47);
+ $text .= e107::getForm()->admin_button('testauth', LAN_ALT_47,'other');
+ $text .= " ";
+
$text .= $frm->form_close();
- return $text;
+
+ return e107::getMessage()->render().$text;
}
@@ -507,7 +548,14 @@ function alt_auth_adminmenu()
$var['main']['text'] = LAN_ALT_31;
$var['main']['link'] = e_PLUGIN.'alt_auth/alt_auth_conf.php';
- show_admin_menu('alt auth', ALT_AUTH_ACTION, $var);
+
+
+ $icon = e107::getParser()->toIcon(e_PLUGIN.'alt_auth/images/alt_auth_32.png');
+ $caption = $icon."alt auth";
+
+ show_admin_menu($caption, ALT_AUTH_ACTION, $var);
+
+
$var = array();
foreach($authlist as $a)
{
@@ -517,6 +565,9 @@ function alt_auth_adminmenu()
$var[$a]['link'] = e_PLUGIN."alt_auth/{$a}_conf.php";
}
}
+
+
+
show_admin_menu(LAN_ALT_29, ALT_AUTH_ACTION, $var);
}
?>
diff --git a/e107_plugins/alt_auth/alt_auth_conf.php b/e107_plugins/alt_auth/alt_auth_conf.php
index 8598accbb..64912fe59 100755
--- a/e107_plugins/alt_auth/alt_auth_conf.php
+++ b/e107_plugins/alt_auth/alt_auth_conf.php
@@ -107,16 +107,29 @@ else
$authExtended = array();
}
-
-if(isset($message))
+if(e107::getDb()->getPDO() === false)
{
- e107::getRender()->tablerender('', "".$message." ");
+ $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 = "
| |