0) { ps_query('delete from simpleldap_groupmap where rsgroup is not null'); } for ($i=0; $i < count($ldapgroups); $i++) { if ($ldapgroups[$i] <> '' && $rsgroups[$i] <> '' && is_numeric($rsgroups[$i])) { ps_query("replace into simpleldap_groupmap (ldapgroup,rsgroup,priority) values (?, ?, ?)", [ 's', $ldapgroups[$i], 'i', $rsgroups[$i], 'i', (($priority[$i]!="")? $priority[$i] : null) ] ); } } if (getval("submit","")!="" || getval("save","")!="") { set_plugin_config("simpleldap",array("simpleldap"=>$simpleldap)); } if (getval("submit","")!="") { redirect("pages/team/team_plugins.php"); } } // retrieve list if groups for use in mapping dropdown $rsgroups = ps_query('select ref, name from usergroup order by name asc'); include "../../../include/header.php"; // if some of the values aren't set yet, fudge them so we don't get an undefined error // this may be important for updates to the plugin that introduce new variables foreach( array( 'ldapserver', 'domain', 'port', 'basedn', 'loginfield', 'usersuffix', 'emailsuffix', 'fallbackusergroup', 'email_attribute', 'phone_attribute', 'update_group', 'create_new_match_email', 'allow_duplicate_email', 'notification_email', 'ldaptype', 'LDAPTLS_REQCERT_never', 'ldap_encoding', ) as $thefield ) { if(!isset($simpleldap[$thefield])) { $simpleldap[$thefield] = ''; } } if(getval("testConnflag","")!="" && getval("submit","")=="" && getval("save","")=="") { ?>
" . escape($lang["simpleldap_test"]) . " " . escape($simpleldap['ldapserver']) . ":" . escape($simpleldap['port']) . ""; debug("LDAP - Connecting to LDAP server: " . $simpleldap['ldapserver'] . " on port " . $simpleldap['port']); $dstestconn= @fsockopen($simpleldap['ldapserver'], $simpleldap['port'], $errno, $errstr, 5); if($dstestconn) { fclose($dstestconn); debug("LDAP - Connected to LDAP server "); ?>
" > ">

"; echo "

" . escape($lang["simpleldap_test_title"]) . "

" . escape($lang["simpleldap_result"]) . "

"; echo "" . escape($lang["simpleldap_connection"]) . " " . escape($simpleldap['ldapserver']) . ":" . escape($simpleldap['port']) . "" . escape(($dstestconn) ? $lang["status-ok"] : $lang["status-fail"]) . ""; echo "" . escape($lang["simpleldap_bind"]) . ""; echo "" . escape($lang["simpleldap_retrieve_user"]) . ""; echo ""; echo ""; ?>

 

" . escape($lang["simpleldap_extension_required"]) . "
"; } ?>

SimpleLDAP Configuration

"> "Active Directory",2=>"Oracle Directory")); config_boolean_field( 'LDAPTLS_REQCERT_never', $lang['simpleldap_LDAPTLS_REQCERT_never_label'], $simpleldap['LDAPTLS_REQCERT_never']); config_text_field("ldapserver",$lang['ldapserver'],$simpleldap['ldapserver'],60); config_text_field("port",$lang['port'],$simpleldap['port'],5); config_text_field("ldap_encoding", $lang['ldap_encoding'], $simpleldap['ldap_encoding'], 60); config_text_field("domain",$lang['domain'],$simpleldap['domain'],60); config_text_field("emailsuffix",$lang['emailsuffix'],$simpleldap['emailsuffix'],60); config_text_field("email_attribute",$lang['email_attribute'],$simpleldap['email_attribute'],60); config_text_field("phone_attribute",$lang['phone_attribute'],$simpleldap['phone_attribute'],60); config_text_field("basedn",$lang['basedn'],$simpleldap['basedn'],60); config_text_field("loginfield",$lang['loginfield'],$simpleldap['loginfield'],30); config_text_field("usersuffix",$lang['usersuffix'],$simpleldap['usersuffix'],30); config_text_field("ldapgroupfield",$lang['groupfield'],$simpleldap['ldapgroupfield'],30); config_boolean_field("createusers",$lang['createusers'],$simpleldap['createusers']); config_boolean_field("create_new_match_email",$lang['simpleldap_create_new_match_email'],$simpleldap['create_new_match_email']); config_boolean_field("allow_duplicate_email",$lang['simpleldap_allow_duplicate_email'],$simpleldap['allow_duplicate_email']); config_boolean_field("update_group",$lang['simpleldap_update_group'],$simpleldap['update_group']); config_text_field("notification_email",$lang['simpleldap_notification_email'],$simpleldap['notification_email'],60); ?>

= count($grouplist)){ $thegroup = array(); $thegroup['ldapgroup'] = ''; $thegroup['rsgroup'] = ''; $thegroup['priority'] = ''; $rowid = 'groupmapmodel'; } else { $thegroup = $grouplist[$i]; $rowid = "row$i"; } ?>
' /> ' />
"> ">