diff --git a/e107_plugins/alt_auth/alt_auth_adminmenu.php b/e107_plugins/alt_auth/alt_auth_adminmenu.php index 31076fc25..38ee86854 100755 --- a/e107_plugins/alt_auth/alt_auth_adminmenu.php +++ b/e107_plugins/alt_auth/alt_auth_adminmenu.php @@ -1,10 +1,16 @@ $v) { - if ($v[$tableType] == TRUE) + if (varsettrue($v['showAll']) || varsettrue($v[$tableType])) { $ret .= ""; if ($v['optional'] == FALSE) $ret .= '* '; @@ -87,7 +93,7 @@ function alt_auth_get_allowed_fields($tableType) $ret = array(); foreach ($alt_auth_user_fields as $f => $v) { - if ($v[$tableType] == TRUE) + if (varsettrue($v['showAll']) || varsettrue($v[$tableType])) { $fieldname = $tableType.'_'.$v['optname']; $ret[$fieldname] = '1'; @@ -97,6 +103,29 @@ function alt_auth_get_allowed_fields($tableType) } +function add_extended_fields() +{ + global $alt_auth_user_fields, $euf, $pref; + if (!isset($pref['auth_extended'])) return; + if (!$pref['auth_extended']) return; + static $fieldsAdded = FALSE; + if ($fieldsAdded) return; + $xFields = $euf->user_extended_get_fieldList('','user_extended_struct_name'); +// print_a($xFields); + $fields = explode(',',$pref['auth_extended']); + foreach ($fields as $f) + { + if (isset($xFields[$f])) + { + $alt_auth_user_fields['x_'.$f] = array('prompt' => varset($xFields[$f]['user_extended_struct_text'],'').' ('.$f.')', + 'optname' => 'xf_x_'.$f, + 'default' => varset($xFields[$f]['default'],''), + 'optional' => TRUE, + 'showAll' => TRUE ); + } + } + $fieldsAdded = TRUE; +} $common_fields = array( @@ -135,7 +164,7 @@ function alt_auth_get_db_fields($prefix, $frm, $parm, $fields = 'server|uname|pw // Write all the options to the DB. $prefix must NOT have trailing underscore function alt_auth_post_options($prefix) { - global $common_fields, $sql; + global $common_fields, $sql, $admin_log; $lprefix = $prefix.'_'; $user_fields = alt_auth_get_allowed_fields($prefix); // Need this list in case checkboxes for parameters @@ -164,6 +193,7 @@ function alt_auth_post_options($prefix) } } } + $admin_log->log_event('AUTH_03',$prefix,E_LOG_INFORMATIVE,''); return LAN_ALT_UPDATED; } @@ -174,7 +204,7 @@ function alt_auth_post_options($prefix) function alt_auth_test_form($prefix,$frm) { $text = $frm -> form_open("post", e_SELF, 'testform'); - $text .= " + $text .= "
"; if (isset($_POST['testauth'])) diff --git a/e107_plugins/alt_auth/alt_auth_conf.php b/e107_plugins/alt_auth/alt_auth_conf.php index a1c563fdf..60c37f2a5 100755 --- a/e107_plugins/alt_auth/alt_auth_conf.php +++ b/e107_plugins/alt_auth/alt_auth_conf.php @@ -11,31 +11,65 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/alt_auth_conf.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:34:43 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2008-12-09 20:40:54 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ $eplug_admin = true; -require_once("../../class2.php"); -if(!getperms("P")){header("location:".e_BASE."index.php"); exit; } -require_once(e_HANDLER."form_handler.php"); -require_once(e_ADMIN."auth.php"); -include_lan(e_PLUGIN."alt_auth/languages/".e_LANGUAGE."/lan_alt_auth_conf.php"); -define("ALT_AUTH_ACTION", "main"); -require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php"); +require_once('../../class2.php'); +if(!getperms("P")){header('location:'.e_BASE.'index.php'); exit; } +require_once(e_HANDLER.'form_handler.php'); +require_once(e_ADMIN.'auth.php'); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +define('ALT_AUTH_ACTION', 'main'); +require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); +require_once(e_HANDLER.'user_extended_class.php'); +$euf = new e107_user_extended; + if(isset($_POST['updateprefs'])) { - $pref['auth_method'] = $_POST['auth_method']; - $pref['auth_noconn'] = intval($_POST['auth_noconn']); - $pref['auth_nouser'] = intval($_POST['auth_nouser']); - save_prefs(); - header("location:".e_SELF); - exit; + unset($temp); + $temp['auth_method'] = $tp->toDB($_POST['auth_method']); + $temp['auth_noconn'] = intval($_POST['auth_noconn']); + $temp['auth_nouser'] = intval($_POST['auth_nouser']); + if ($admin_log->logArrayDiffs($temp, $pref, 'AUTH_01')) + { + save_prefs(); // Only save if changes + 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']) + { + $pref['auth_extended'] = $au; + save_prefs(); + $admin_log->log_event('AUTH_02',$au,''); + } +} + + $authlist = alt_auth_get_authlist(); +if (isset($pref['auth_extended'])) +{ + $authExtended = explode(',',$pref['auth_extended']); +} +else +{ + $pref['auth_extended'] = ''; + $authExtended = array(); +} $auth_dropdown = " - @@ -104,6 +138,52 @@ $text .= " $ns -> tablerender("
".LAN_ALT_3."
", $text); +$extendedFields = $euf->user_extended_get_fields(); +//print_a($extendedFields); +if (count($extendedFields)) +{ + $text = "
+
+
".LAN_ALT_42."
+
+ + + + + + \n"; + + foreach ($extendedFields as $p => $fl ) + { + $text .= " + + + + + "; + foreach ($fl as $f) + { + $checked = (in_array($f['user_extended_struct_name'], $authExtended) ? " checked='checked'" : ''); + $text .= " + + + + \n"; + } + } + $text .= " + + +
".LAN_ALT_61."".LAN_ALT_62."".LAN_ALT_63."".LAN_ALT_64."
{$f['user_extended_struct_name']}{$f['user_extended_struct_text']}{$euf->user_extended_types[$f['user_extended_struct_type']]}
+ +
+ +"; +$ns -> tablerender("
".LAN_ALT_60."
", $text); + + +} + + require_once(e_ADMIN."footer.php"); function alt_auth_conf_adminmenu() @@ -112,4 +192,4 @@ function alt_auth_conf_adminmenu() } -?> \ No newline at end of file +?> \ No newline at end of file diff --git a/e107_plugins/alt_auth/alt_auth_login_class.php b/e107_plugins/alt_auth/alt_auth_login_class.php index ca61e5741..405948103 100755 --- a/e107_plugins/alt_auth/alt_auth_login_class.php +++ b/e107_plugins/alt_auth/alt_auth_login_class.php @@ -11,95 +11,148 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/alt_auth_login_class.php,v $ -| $Revision: 1.4 $ -| $Date: 2008-12-01 21:47:17 $ +| $Revision: 1.5 $ +| $Date: 2008-12-09 20:40:54 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ +define('AA_DEBUG',FALSE); + class alt_login { function alt_login($method, &$username, &$userpass) { - global $pref; - $newvals=array(); - define("AUTH_SUCCESS", -1); - define("AUTH_NOUSER", 1); - define("AUTH_BADPASSWORD", 2); - define("AUTH_NOCONNECT", 3); - require_once(e_PLUGIN."alt_auth/".$method."_auth.php"); - $_login = new auth_login; + global $pref, $admin_log; + $newvals=array(); + define("AUTH_SUCCESS", -1); + define("AUTH_NOUSER", 1); + define("AUTH_BADPASSWORD", 2); + define("AUTH_NOCONNECT", 3); + require_once(e_PLUGIN."alt_auth/".$method."_auth.php"); + $_login = new auth_login; - if(isset($_login->Available) && ($_login->Available === FALSE)) - { // Relevant auth method not available (e.g. PHP extension not loaded) - return AUTH_NOCONNECT; - } - - $login_result = $_login -> login($username, $userpass, $newvals, FALSE); - - if($login_result === AUTH_SUCCESS ) - { - if (MAGIC_QUOTES_GPC == FALSE) - { - $username = mysql_real_escape_string($username); + if(isset($_login->Available) && ($_login->Available === FALSE)) + { // Relevant auth method not available (e.g. PHP extension not loaded) + return AUTH_NOCONNECT; } - $username = preg_replace("/\sOR\s|\=|\#/", "", $username); - $username = substr($username, 0, varset($pref['loginname_maxlength'],30)); - $aa_sql = new db; - $uh = new UserHandler; - $db_vals = array('user_password' => $aa_sql->escape($uh->HashPassword($userpass,$username))); - foreach ($newvals as $k => $v) + $login_result = $_login -> login($username, $userpass, $newvals, FALSE); + + if($login_result === AUTH_SUCCESS ) { - if (strpos($k,'user_' !== 0)) $k = 'user_'.$k; // translate the field names (but latest handlers don't need translation) - $db_vals[$k] = $v; - } - if($aa_sql -> db_Select("user","*","user_loginname='{$username}' ")) - { // Existing user - get current data, see if any changes - $row = $aa_sql->db_Fetch(); - foreach ($db_vals as $k => $v) - { - if ($row[$k] == $v) unset($db_vals[$k]); - } - if (count($db_vals)) $aa_sql->db_UpdateArray('user',$db_vals," WHERE `user_id`=".$row['user_id']); + if (MAGIC_QUOTES_GPC == FALSE) + { + $username = mysql_real_escape_string($username); + } + $username = preg_replace("/\sOR\s|\=|\#/", "", $username); + $username = substr($username, 0, varset($pref['loginname_maxlength'],30)); + + $aa_sql = new db; + $uh = new UserHandler; + $db_vals = array('user_password' => $aa_sql->escape($uh->HashPassword($userpass,$username))); + $xFields = array(); // Possible extended user fields + foreach ($newvals as $k => $v) + { + if (strpos($k,'x_') === 0) + { // Extended field + $k = substr($k,2); + $xFields['user_'.$k] = $v; + } + else + { // Normal user table + if (strpos($k,'user_' !== 0)) $k = 'user_'.$k; // translate the field names (but latest handlers don't need translation) + $db_vals[$k] = $v; + } + } + if (count($xFields)) + { +// $qry = "SELECT u.*, ue.* FROM `#user` AS u + $qry = "SELECT u.user_id,u.".implode(',u.',array_keys($db_vals)).", ue.".implode(',ue.',array_keys($xFields))." FROM `#user` AS u + LEFT JOIN `#user_extended` AS ue ON ue.user_extended_id = u.user_id + WHERE u.user_loginname='{$username}' "; + if (AA_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","Query: {$qry}[!br!]".print_r($xFields,TRUE),FALSE,LOG_TO_ROLLING); + } + else + { + $qry = "SELECT * FROM `#user` WHERE `user_loginname`='{$username}'"; + } +// echo "Query: {$qry}
"; +// if($aa_sql -> db_Select("user","*","user_loginname='{$username}' ")) + if($aa_sql -> db_Select_gen($qry)) + { // Existing user - get current data, see if any changes + $row = $aa_sql->db_Fetch(MYSQL_ASSOC); + foreach ($db_vals as $k => $v) + { + if ($row[$k] == $v) unset($db_vals[$k]); + } + if (count($db_vals)) + { + $aa_sql->db_UpdateArray('user',$db_vals," WHERE `user_id`=".$row['user_id']); + } + foreach ($xFields as $k => $v) + { + if ($row[$k] == $v) unset($xFields[$k]); + } + if (AA_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","User data read: ".print_r($row,TRUE)."[!br!]".print_r($xFields,TRUE),FALSE,LOG_TO_ROLLING); + if (count($xFields)) + { + if ($row['user_extended_id']) + { + if (AA_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","Update existing extended record",FALSE,LOG_TO_ROLLING); + $aa_sql->db_UpdateArray('user_extended',$xFields," WHERE `user_extended_id`=".intval($row['user_id'])); + } + else + { // Never been an extended user fields record for this user + $xFields['user_extended_id'] = $row['user_id']; + if (AA_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","Write new extended record".print_r($xFields,TRUE),FALSE,LOG_TO_ROLLING); + $aa_sql->db_Insert('user_extended',$xFields); + } + } + } + else + { // Just add a new user + if (AA_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","Add new user: ".print_r($db_vals,TRUE)."[!br!]".print_r($xFields,TRUE),FALSE,LOG_TO_ROLLING); + if (!isset($db_vals['user_name'])) $db_vals['user_name'] = $username; + if (!isset($db_vals['user_loginname'])) $db_vals['user_loginname'] = $username; + if (!isset($db_vals['user_join'])) $db_vals['user_join'] = time(); + $db_vals['user_class'] = varset($pref['initial_user_classes'],''); + if (!isset($db_vals['user_signature'])) $db_vals['user_signature'] = ''; + if (!isset($db_vals['user_prefs'])) $db_vals['user_prefs'] = ''; + if (!isset($db_vals['user_perms'])) $db_vals['user_perms'] = ''; + $newID = $aa_sql->db_Insert('user',$db_vals); + if (($newID !== FALSE) && count($xfields)) + { + $xFields['user_extended_id'] = $newID; + $aa_sql->db_Insert('user_extended',$xFields); + } + } + return LOGIN_CONTINUE; } else - { // Just add a new user - if (!isset($db_vals['user_name'])) $db_vals['user_name'] = $username; - if (!isset($db_vals['user_loginname'])) $db_vals['user_loginname'] = $username; - if (!isset($db_vals['user_join'])) $db_vals['user_join'] = time(); - $db_vals['user_class'] = varset($pref['initial_user_classes'],''); - if (!isset($db_vals['user_signature'])) $db_vals['user_signature'] = ''; - if (!isset($db_vals['user_prefs'])) $db_vals['user_prefs'] = ''; - if (!isset($db_vals['user_perms'])) $db_vals['user_perms'] = ''; - $aa_sql->db_Insert('user',$db_vals); - } - return LOGIN_CONTINUE; - } - else - { // Failure modes - switch($login_result) - { - case AUTH_NOUSER: - if(!varset($pref['auth_nouser'],0)) + { // Failure modes + switch($login_result) { - $username=md5("xx_nouser_xx"); - return LOGIN_ABORT; + case AUTH_NOUSER: + if(!varset($pref['auth_nouser'],0)) + { + $username=md5("xx_nouser_xx"); + return LOGIN_ABORT; + } + break; + case AUTH_NOCONNECT: + if(!varset($pref['auth_noconn'])) + { + $username=md5("xx_noconn_xx"); + return LOGIN_ABORT; + } + break; + case AUTH_BADPASSWORD: + $userpass=md5("xx_badpassword_xx"); + return LOGIN_ABORT; // Not going to magically be able to log in! + break; } - break; - case AUTH_NOCONNECT: - if(!varset($pref['auth_noconn'])) - { - $username=md5("xx_noconn_xx"); - return LOGIN_ABORT; - } - break; - case AUTH_BADPASSWORD: - $userpass=md5("xx_badpassword_xx"); - return LOGIN_ABORT; // Not going to magically be able to log in! - break; } - } - return LOGIN_ABORT; // catch-all just in case + return LOGIN_ABORT; // catch-all just in case } } ?> \ No newline at end of file diff --git a/e107_plugins/alt_auth/e107db_conf.php b/e107_plugins/alt_auth/e107db_conf.php index 7f3a17e78..53f68bc65 100644 --- a/e107_plugins/alt_auth/e107db_conf.php +++ b/e107_plugins/alt_auth/e107db_conf.php @@ -12,14 +12,14 @@ +----------------------------------------------------------------------------+ */ $eplug_admin = true; -require_once("../../class2.php"); -require_once(e_ADMIN."auth.php"); -require_once(e_HANDLER."form_handler.php"); -include_lan("languages/".e_LANGUAGE."/lan_e107db_conf.php"); -include_lan("languages/".e_LANGUAGE."/lan_alt_auth_conf.php"); -define("ALT_AUTH_ACTION", "e107db"); -require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php"); -require_once(e_PLUGIN."alt_auth/extended_password_handler.php"); +require_once('../../class2.php'); +require_once(e_ADMIN.'auth.php'); +require_once(e_HANDLER.'form_handler.php'); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_e107db_conf.php'); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +define('ALT_AUTH_ACTION', 'e107db'); +require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); +require_once(e_PLUGIN.'alt_auth/extended_password_handler.php'); if($_POST['update']) { @@ -51,7 +51,7 @@ function show_e107db_form() $frm = new form; $text = $frm -> form_open("post", e_SELF); - $text .= ""; + $text .= "
"; $text .= "
".LAN_ALT_26.""; $text .= E107DB_LAN_1; @@ -89,31 +89,6 @@ require_once(e_ADMIN."footer.php"); -// Obsolete function update_e107db_prefs() -/* -function update_e107db_prefs() -{ - global $sql; - foreach($_POST as $k => $v) - { - $v = base64_encode(base64_encode($v)); - - if (substr($k,0,7) == 'e107db_') -// if(preg_match("/e107db_/", $k)) - { - if($sql -> db_Select("alt_auth", "*", "auth_type='e107db' AND auth_parmname='{$k}' ")) - { - $sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE auth_type='e107db' AND auth_parmname='{$k}' "); - } - else - { - $sql -> db_Insert("alt_auth", "'e107db','{$k}','{$v}' "); - } - } - } - return E107DB_LAN_UPDATED; -} -*/ function e107db_conf_adminmenu() { alt_auth_adminmenu(); diff --git a/e107_plugins/alt_auth/images/alt_auth_16.png b/e107_plugins/alt_auth/images/alt_auth_16.png new file mode 100644 index 000000000..04b5be075 Binary files /dev/null and b/e107_plugins/alt_auth/images/alt_auth_16.png differ diff --git a/e107_plugins/alt_auth/images/icon_ldap.png b/e107_plugins/alt_auth/images/alt_auth_32.png old mode 100755 new mode 100644 similarity index 100% rename from e107_plugins/alt_auth/images/icon_ldap.png rename to e107_plugins/alt_auth/images/alt_auth_32.png diff --git a/e107_plugins/alt_auth/importdb_conf.php b/e107_plugins/alt_auth/importdb_conf.php index 6110696c0..ed1475d91 100644 --- a/e107_plugins/alt_auth/importdb_conf.php +++ b/e107_plugins/alt_auth/importdb_conf.php @@ -12,11 +12,11 @@ +----------------------------------------------------------------------------+ */ $eplug_admin = true; -require_once("../../class2.php"); -require_once(e_ADMIN."auth.php"); -require_once(e_HANDLER."form_handler.php"); -include_lan("languages/".e_LANGUAGE."/lan_importdb_conf.php"); -include_lan("languages/".e_LANGUAGE."/lan_alt_auth_conf.php"); +require_once('../../class2.php'); +require_once(e_ADMIN.'auth.php'); +require_once(e_HANDLER.'form_handler.php'); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_importdb_conf.php'); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define("ALT_AUTH_ACTION", "importdb"); require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php"); require_once(e_PLUGIN."alt_auth/extended_password_handler.php"); @@ -54,7 +54,7 @@ function show_importdb_form() $frm = new form; $text = $frm -> form_open("post", e_SELF); - $text .= ""; + $text .= "
"; $text .= ""; diff --git a/e107_plugins/alt_auth/languages/English/English_log.php b/e107_plugins/alt_auth/languages/English/English_log.php new file mode 100644 index 000000000..12437305b --- /dev/null +++ b/e107_plugins/alt_auth/languages/English/English_log.php @@ -0,0 +1,28 @@ + diff --git a/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php b/e107_plugins/alt_auth/languages/English/admin_alt_auth.php old mode 100755 new mode 100644 similarity index 54% rename from e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php rename to e107_plugins/alt_auth/languages/English/admin_alt_auth.php index 4bada20bd..18f1a616e --- a/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php +++ b/e107_plugins/alt_auth/languages/English/admin_alt_auth.php @@ -1,13 +1,30 @@
+ The Extended User Field selection determines which may be added/updated when a user logs in - further configuration is required + for the specific authentication method.'); define('LAN_ALT_VALIDATE_HELP', 'You can check the settings by using the \'Test Database Access\' section to try and validate a user - this uses exactly - the same process as when a user tries to log in, and confirms whether your settings are correct'); + the same process as when a user tries to log in, and confirms whether your settings are correct + '); + ?> diff --git a/e107_plugins/alt_auth/languages/English/lan_e107db_conf.php b/e107_plugins/alt_auth/languages/English/admin_e107db_conf.php similarity index 100% rename from e107_plugins/alt_auth/languages/English/lan_e107db_conf.php rename to e107_plugins/alt_auth/languages/English/admin_e107db_conf.php diff --git a/e107_plugins/alt_auth/languages/English/lan_importdb_conf.php b/e107_plugins/alt_auth/languages/English/admin_importdb_conf.php similarity index 100% rename from e107_plugins/alt_auth/languages/English/lan_importdb_conf.php rename to e107_plugins/alt_auth/languages/English/admin_importdb_conf.php diff --git a/e107_plugins/alt_auth/languages/English/lan_ldap_conf.php b/e107_plugins/alt_auth/languages/English/admin_ldap_conf.php similarity index 100% rename from e107_plugins/alt_auth/languages/English/lan_ldap_conf.php rename to e107_plugins/alt_auth/languages/English/admin_ldap_conf.php diff --git a/e107_plugins/alt_auth/languages/English/lan_otherdb_conf.php b/e107_plugins/alt_auth/languages/English/admin_otherdb_conf.php similarity index 100% rename from e107_plugins/alt_auth/languages/English/lan_otherdb_conf.php rename to e107_plugins/alt_auth/languages/English/admin_otherdb_conf.php diff --git a/e107_plugins/alt_auth/languages/English/lan_radius_conf.php b/e107_plugins/alt_auth/languages/English/admin_radius_conf.php similarity index 100% rename from e107_plugins/alt_auth/languages/English/lan_radius_conf.php rename to e107_plugins/alt_auth/languages/English/admin_radius_conf.php diff --git a/e107_plugins/alt_auth/ldap_auth.php b/e107_plugins/alt_auth/ldap_auth.php index ad6ea9ae8..1406708e8 100755 --- a/e107_plugins/alt_auth/ldap_auth.php +++ b/e107_plugins/alt_auth/ldap_auth.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/ldap_auth.php,v $ -| $Revision: 1.4 $ -| $Date: 2008-12-01 21:47:17 $ +| $Revision: 1.5 $ +| $Date: 2008-12-09 20:40:54 $ | $Author: e107steved $ To do: @@ -210,7 +210,6 @@ class auth_login $entries = ldap_get_entries($this->connection, $this->result); if (count($entries) == 2) // All OK { - echo "Count: {$entries[0]['count']}
"; for ($j = 0; $j < $entries[0]['count']; $j++) { $k = $entries[0][$j]; // LDAP attribute name diff --git a/e107_plugins/alt_auth/ldap_conf.php b/e107_plugins/alt_auth/ldap_conf.php index ef0e9ccc0..eeef89dfb 100755 --- a/e107_plugins/alt_auth/ldap_conf.php +++ b/e107_plugins/alt_auth/ldap_conf.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/ldap_conf.php,v $ -| $Revision: 1.4 $ -| $Date: 2008-12-01 21:47:17 $ +| $Revision: 1.5 $ +| $Date: 2008-12-09 20:40:54 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -20,10 +20,10 @@ $eplug_admin = true; require_once("../../class2.php"); require_once(e_ADMIN."auth.php"); require_once(e_HANDLER."form_handler.php"); -include_lan("languages/".e_LANGUAGE."/lan_ldap_conf.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"); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE."/admin_ldap_conf.php"); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +define('ALT_AUTH_ACTION', 'ldap'); +require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); $server_types[1]="LDAP"; @@ -63,7 +63,7 @@ $current_filter = "(&(cn=[USERNAME]){$ldap['ldap_edirfilter']})"; $frm = new form; $text = $frm -> form_open("post",e_SELF); -$text .= "
".IMPORTDB_LAN_11."
"; +$text .= "
"; $text .= ""; + add_extended_fields(); $text .= alt_auth_get_field_list('ldap',$frm, $ldap, FALSE); $text .= "
".LDAPLAN_12.""; $text .= $frm -> form_select_open("ldap_servertype"); foreach($server_types as $v) @@ -110,6 +110,7 @@ $text .= "
".LDAPLAN_9."
".htmlentities($curre $text .= "
".LAN_ALT_27."
"; diff --git a/e107_plugins/alt_auth/otherdb_conf.php b/e107_plugins/alt_auth/otherdb_conf.php index e297b1653..0dad75b46 100644 --- a/e107_plugins/alt_auth/otherdb_conf.php +++ b/e107_plugins/alt_auth/otherdb_conf.php @@ -15,11 +15,11 @@ $eplug_admin = true; require_once("../../class2.php"); require_once(e_ADMIN."auth.php"); require_once(e_HANDLER."form_handler.php"); -include_lan("languages/".e_LANGUAGE."/lan_otherdb_conf.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"); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_otherdb_conf.php'); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.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']) { @@ -52,7 +52,7 @@ function show_otherdb_form() $frm = new form; $text = $frm -> form_open("post", e_SELF); - $text .= ""; + $text .= "
"; $text .= " + LAN_ALT_68 + + + + + + + \ No newline at end of file diff --git a/e107_plugins/alt_auth/radius_conf.php b/e107_plugins/alt_auth/radius_conf.php index 181c0340d..eec7c5be1 100644 --- a/e107_plugins/alt_auth/radius_conf.php +++ b/e107_plugins/alt_auth/radius_conf.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/alt_auth/radius_conf.php,v $ -| $Revision: 1.1 $ -| $Date: 2008-09-02 19:39:12 $ +| $Revision: 1.2 $ +| $Date: 2008-12-09 20:40:54 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -20,8 +20,8 @@ $eplug_admin = true; require_once("../../class2.php"); require_once(e_ADMIN."auth.php"); require_once(e_HANDLER."form_handler.php"); -include_lan("languages/".e_LANGUAGE."/lan_radius_conf.php"); -include_lan("languages/".e_LANGUAGE."/lan_alt_auth_conf.php"); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_radius_conf.php'); +include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define("ALT_AUTH_ACTION", "radius"); require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php"); @@ -53,7 +53,7 @@ while($row = $sql->db_Fetch()) $frm = new form; $text = $frm -> form_open("post",e_SELF); -$text .= "
".LAN_ALT_26.""; $text .= OTHERDB_LAN_15; @@ -87,29 +87,8 @@ function show_otherdb_form() require_once(e_ADMIN."footer.php"); -/* -function update_otherdb_prefs() -{ - global $sql; - foreach($_POST as $k => $v) - { - $v = base64_encode(base64_encode($v)); - if(preg_match("/otherdb_/", $k)) - { - if($sql -> db_Select("alt_auth", "*", "auth_type='otherdb' AND auth_parmname='{$k}' ")) - { - $sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE auth_type='otherdb' AND auth_parmname='{$k}' "); - } - else - { - $sql -> db_Insert("alt_auth", "'otherdb','{$k}','{$v}' "); - } - } - } - return "Settings Updated"; -} -*/ + function otherdb_conf_adminmenu() { alt_auth_adminmenu(); diff --git a/e107_plugins/alt_auth/plugin.php b/e107_plugins/alt_auth/plugin.php deleted file mode 100755 index e39bcdd9f..000000000 --- a/e107_plugins/alt_auth/plugin.php +++ /dev/null @@ -1,74 +0,0 @@ - diff --git a/e107_plugins/alt_auth/plugin.xml b/e107_plugins/alt_auth/plugin.xml new file mode 100644 index 000000000..35e794782 --- /dev/null +++ b/e107_plugins/alt_auth/plugin.xml @@ -0,0 +1,23 @@ + + + + + + + LAN_ALT_66 + alt_auth + Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt) + + + alt_auth_conf.php + images/alt_auth_32.png + images/alt_auth_16.png +
LAN_ALT_67
"; +$text .= "
"; $text .= "";
".LAN_RADIUS_01.""; $text .= $frm -> form_text("radius_server", 35, $radius['radius_server'], 120); $text .= "