1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 10:04:35 +02:00

alt_auth - updated/enhanced - first cut ready for some proper testing

This commit is contained in:
e107steved
2008-07-25 19:33:04 +00:00
parent ec13689f67
commit 85339ec550
20 changed files with 1445 additions and 375 deletions

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/ldap_conf.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2008-07-25 19:33:02 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
$eplug_admin = true;
@@ -21,6 +21,7 @@ require_once("../../class2.php");
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."form_handler.php");
include_lan("languages/".e_LANGUAGE."/lan_ldap_auth.php");
include_lan("languages/".e_LANGUAGE."/lan_alt_auth_conf.php");
define("ALT_AUTH_ACTION", "ldap");
require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php");
@@ -32,46 +33,36 @@ $server_types[3]="eDirectory";
$ldap_ver[1]="2";
$ldap_ver[2]="3";
$message = '';
if($_POST['update'])
{
foreach($_POST as $k => $v)
{
if(preg_match("/ldap_/", $k))
{
if($sql -> db_Select("alt_auth", "*", "auth_type='ldap' AND auth_parmname='{$k}' "))
{
$sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE auth_type='ldap' AND auth_parmname='{$k}' ");
}
else
{
$sql -> db_Insert("alt_auth", "'ldap','{$k}','{$v}' ");
}
}
}
$message = LDAPLAN_10;
$message .= alt_auth_post_options('ldap');
}
if(!function_exists('ldap_connect'))
{
$message = "<div style='color:#f00; font-weight:bold'>".LDAPLAN_11."</div>";
$message .= "<br /><br /><div style='color:#f00; font-weight:bold'>".LDAPLAN_11."</div><br />";
}
if($message)
{
$ns->tablerender("","<div style='text-align:center;'>".$message."</div>");
$ns->tablerender("","<div style='text-align:center;'>".$message."</div>");
}
$ldap['ldap_edirfilter'] == "";
$sql -> db_Select("alt_auth", "*", "auth_type = 'ldap' ");
while($row = $sql->db_Fetch())
{
$ldap[$row['auth_parmname']] = $row['auth_parmval'];
$ldap[$row['auth_parmname']] = base64_decode(base64_decode($row['auth_parmval'])); // Encoding is new for 0.8
}
$current_filter = "(&(cn=[USERNAME]){$ldap['ldap_edirfilter']})";
$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'>".LDAPLAN_12."</td><td class='forumheader3'>";
$text .= $frm -> form_select_open("ldap_servertype");
@@ -113,7 +104,11 @@ $text .= "</td></tr>";
$text .= "<tr><td class='forumheader3'>".LDAPLAN_7."<br /><span class='smalltext'>".LDAPLAN_8."</span></td><td class='forumheader3'>";
$text .= $frm -> form_text("ldap_edirfilter", 35, $ldap['ldap_edirfilter'], 120);
$text .= "<br /><span class='smalltext'>".LDAPLAN_9."<br />{$current_filter}</span></td></tr>";
$text .= "<br /><span class='smalltext'>".LDAPLAN_9."<br />".htmlentities($current_filter)."</span></td></tr>";
$text .= "<tr><td class='forumheader2' colspan='2'>".LDAPLAN_14."</td></tr>";
$text .= alt_auth_get_field_list('ldap',$frm, $ldap, FALSE);
$text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
$text .= $frm -> form_button("submit", "update", LDAPLAN_13);
@@ -123,6 +118,8 @@ $text .= "</table>";
$text .= $frm -> form_close();
$ns -> tablerender(LDAPLAN_6,$text);
$ns->tablerender(LAN_ALT_40.LAN_ALT_41,alt_auth_test_form('ldap',$frm));
require_once(e_ADMIN."footer.php");
function ldap_conf_adminmenu()