mirror of
https://github.com/e107inc/e107.git
synced 2025-08-25 15:31:41 +02:00
alt_auth - updated/enhanced - first cut ready for some proper testing
This commit is contained in:
@@ -16,12 +16,15 @@ require_once("../../class2.php");
|
||||
require_once(e_ADMIN."auth.php");
|
||||
require_once(e_HANDLER."form_handler.php");
|
||||
include_lan("languages/".e_LANGUAGE."/lan_otherdb_auth.php");
|
||||
include_lan("languages/".e_LANGUAGE."/lan_alt_auth_conf.php");
|
||||
define("ALT_AUTH_ACTION", "otherdb");
|
||||
require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php");
|
||||
require_once(e_PLUGIN."alt_auth/extended_password_handler.php");
|
||||
|
||||
if($_POST['update'])
|
||||
{
|
||||
$message = update_otherdb_prefs();
|
||||
// $message = update_otherdb_prefs();
|
||||
$message = alt_auth_post_options('otherdb');
|
||||
}
|
||||
|
||||
if($message)
|
||||
@@ -36,8 +39,9 @@ function show_otherdb_form()
|
||||
{
|
||||
global $sql, $tp, $ns;
|
||||
|
||||
$password_methods = array("md5", "plaintext");
|
||||
$db_types = array("e107" => "mysql - e107 database", "mysql" => "mysql - generic database");
|
||||
|
||||
$password_methods = ExtendedPasswordHandler::GetPasswordTypes(TRUE);
|
||||
// $db_types = array("e107" => "mysql - e107 database", "mysql" => "mysql - generic database");
|
||||
|
||||
$sql -> db_Select("alt_auth", "*", "auth_type = 'otherdb' ");
|
||||
$parm = array();
|
||||
@@ -47,72 +51,43 @@ function show_otherdb_form()
|
||||
}
|
||||
|
||||
$frm = new form;
|
||||
$text = $frm -> form_open("POST", e_SELF);
|
||||
$text = $frm -> form_open("post", e_SELF);
|
||||
$text .= "<table style='width:96%'>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_1."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_select_open("otherdb_dbtype");
|
||||
foreach($db_types as $k => $v)
|
||||
$text .= "<tr><td class='forumheader3'>".LAN_ALT_26."</td><td class='forumheader3'>";
|
||||
$text .= OTHERDB_LAN_15;
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= alt_auth_get_db_fields('otherdb', $frm, $parm, 'server|uname|pwd|db|table|ufield|pwfield|salt');
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_9."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_select_open("otherdb_password_method");
|
||||
foreach($password_methods as $k => $v)
|
||||
{
|
||||
$sel = ($parm['otherdb_dbtype'] == $k) ? " Selected" : "";
|
||||
$sel = ($parm['otherdb_password_method'] == $k) ? " Selected" : "";
|
||||
$text .= $frm -> form_option($v, $sel, $k);
|
||||
}
|
||||
$text .= $frm -> form_select_close();
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_2."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_text("otherdb_server", 35, $parm['otherdb_server'], 120);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_3."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_text("otherdb_username", 35, $parm['otherdb_username'], 120);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_4."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_text("otherdb_password", 35, $parm['otherdb_password'], 120);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_5."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_text("otherdb_database", 35, $parm['otherdb_database'], 120);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_6."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_text("otherdb_table", 35, $parm['otherdb_table'], 120);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader2' colspan='2'>".OTHERDB_LAN_11."</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_7."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_text("otherdb_user_field", 35, $parm['otherdb_user_field'], 120);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_8."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_text("otherdb_password_field", 35, $parm['otherdb_password_field'], 120);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "<tr><td class='forumheader3'>".OTHERDB_LAN_9."</td><td class='forumheader3'>";
|
||||
$text .= $frm -> form_select_open("otherdb_password_method");
|
||||
foreach($password_methods as $v)
|
||||
{
|
||||
$sel = ($parm['otherdb_password_method'] == $v) ? " Selected" : "";
|
||||
$text .= $frm -> form_option($v, $sel, $v);
|
||||
}
|
||||
$text .= $frm -> form_select_close();
|
||||
$text .= "</td></tr>";
|
||||
$text .= alt_auth_get_field_list('otherdb',$frm, $parm, FALSE);
|
||||
|
||||
$text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
|
||||
$text .= $frm -> form_button("submit", "update", "Update settings");
|
||||
$text .= $frm -> form_button("submit", "update", LAN_ALT_UPDATESET);
|
||||
$text .= "</td></tr>";
|
||||
|
||||
$text .= "</table>";
|
||||
$text .= $frm -> form_close();
|
||||
|
||||
$ns -> tablerender(OTHERDB_LAN_10, $text);
|
||||
|
||||
$ns->tablerender(LAN_ALT_40.LAN_ALT_41,alt_auth_test_form('otherdb',$frm));
|
||||
}
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
||||
|
||||
|
||||
/*
|
||||
function update_otherdb_prefs()
|
||||
{
|
||||
global $sql;
|
||||
@@ -134,7 +109,7 @@ function update_otherdb_prefs()
|
||||
}
|
||||
return "Settings Updated";
|
||||
}
|
||||
|
||||
*/
|
||||
function otherdb_conf_adminmenu()
|
||||
{
|
||||
alt_auth_adminmenu();
|
||||
|
Reference in New Issue
Block a user