/** * Read configuration, initialise connection to LDAP database * * @return AUTH_xxxx result code */ function __construct() { $this->copyAttribs = array(); $radius = altAuthGetParams('radius'); $this->server = explode(',', $radius['radius_server']); $this->port = 1812; // Assume fixed port number for now - 1812 (UDP) is listed for servers, 1645 for authentification. (1646, 1813 for accounting) // (A Microsoft app note says 1812 is the RFC2026-compliant port number. (http://support.microsoft.com/kb/230786) // $this->port = 1645; $this->secret = explode(',', $radius['radius_secret']); if (count($this->server) > 1 && count($this->secret) == 1) { $this->secret = array(); foreach ($this->server as $k => $v) { $this->secret[$k] = $radius['radius_secret']; // Same secret for all servers, if only one entered } } $this->ErrorText = ''; if (!function_exists('radius_auth_open')) { return AUTH_NORESOURCE; } if (!$this->connect()) { return AUTH_NOCONNECT; } $this->Available = TRUE; return AUTH_SUCCESS; }
function show_importdb_form() { $ns = e107::getRender(); $parm = altAuthGetParams('importdb'); $frm = new form(); $text = $frm->form_open('post', e_SELF); $text .= "<table class='table adminform'>\r\n\t<colgroup span='2'>\r\n\t\t<col class='col-label' />\r\n\t\t<col class='col-control' />\r\n\t</colgroup>"; $text .= "<tr><td colspan='2'>" . IMPORTDB_LAN_11 . "</td></tr>"; $text .= "<tr><td>" . IMPORTDB_LAN_9 . "</td><td>"; $text .= altAuthGetPasswordSelector('importdb_password_method', $frm, $parm['importdb_password_method'], TRUE); $text .= "</td></tr>"; $text .= "</table><div class='buttons-bar center'>"; $text .= e107::getForm()->admin_button("update", LAN_UPDATE, 'update'); $text .= "</div>"; $text .= $frm->form_close(); $ns->tablerender(IMPORTDB_LAN_10, $text); $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, alt_auth_test_form('importdb', $frm)); }
function show_otherdb_form() { $ns = e107::getRender(); $parm = altAuthGetParams('otherdb'); $frm = new form(); $text = $frm->form_open("post", e_SELF); $text .= "<table class='table adminform'>"; $text .= "<tr><td>" . LAN_ALT_26 . "</td><td>"; $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>" . OTHERDB_LAN_9 . "</td><td>"; $text .= altAuthGetPasswordSelector('otherdb_password_method', $frm, $parm['otherdb_password_method'], TRUE); $text .= "</td></tr>"; $text .= "<tr><td class='forumheader2' colspan='2'>" . LAN_ALT_27 . "</td></tr>"; $text .= alt_auth_get_field_list('otherdb', $frm, $parm, FALSE); $text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>"; $text .= e107::getForm()->admin_button("update", LAN_UPDATE, 'update'); $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)); }
function show_e107db_form() { $ns = e107::getRender(); $parm = altAuthGetParams('e107db'); $frm = new form(); $text = $frm->form_open('post', e_SELF); $text .= "<table class='table adminform'>\r\n\t<colgroup span='2'>\r\n\t\t<col class='col-label' />\r\n\t\t<col class='col-control' />\r\n\t</colgroup>"; $text .= "<tr><td>" . LAN_ALT_26 . "</td><td>"; $text .= E107DB_LAN_1; $text .= "</td></tr>"; $text .= alt_auth_get_db_fields('e107db', $frm, $parm, 'server|uname|pwd|db|prefix|classfilt'); $text .= "<tr><td>" . E107DB_LAN_9 . "</td><td>"; $text .= altAuthGetPasswordSelector('e107db_password_method', $frm, $parm['e107db_password_method'], FALSE); $text .= "</td></tr>"; $text .= "<tr><td colspan='2'><br />" . E107DB_LAN_11 . "</td></tr>"; $text .= alt_auth_get_field_list('e107db', $frm, $parm, TRUE); $text .= "</table><div class='buttons-bar center'>"; $text .= e107::getForm()->admin_button("update", LAN_UPDATE, 'update'); // $text .= $frm -> form_button("submit", "update", LAN_ALT_UPDATESET); $text .= '</div>'; $text .= $frm->form_close(); $ns->tablerender(E107DB_LAN_10, $text); $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, alt_auth_test_form('e107db', $frm)); }
/** * Read configuration * * @return AUTH_xxxx result code */ public function __construct() { $this->ErrorText = ''; $this->conf = altAuthGetParams('otherdb'); $this->Available = TRUE; }
$server_types[2] = 'ActiveDirectory'; $server_types[3] = 'eDirectory'; $ldap_ver[1] = '2'; $ldap_ver[2] = '3'; $message = ''; if ($_POST['update']) { $message .= alt_auth_post_options('ldap'); } if (!function_exists('ldap_connect')) { // $message .= "<br /><br /><div style='color:#f00; font-weight:bold'>".LDAPLAN_11."</div><br />"; $mes->addWarning(LDAPLAN_11); } if ($message) { e107::getRender()->tablerender('', "<div style='text-align:center;'>" . $message . '</div>'); } $ldap = altAuthGetParams('ldap'); if (!isset($ldap['ldap_edirfilter'])) { $ldap['ldap_edirfilter'] == ''; } //print_a($ldap); $current_filter = "(&(cn=[USERNAME]){$ldap['ldap_edirfilter']})"; $frm = new form(); $text = $frm->form_open('post', e_SELF); $text .= "<table class='table adminform'>"; $text .= "<tr><td>" . LDAPLAN_12 . "</td><td>"; $text .= $frm->form_select_open("ldap_servertype"); foreach ($server_types as $v) { $sel = $ldap['ldap_servertype'] == $v ? " Selected='selected'" : ''; $text .= $frm->form_option($v, $sel, $v); } $text .= $frm->form_select_close();