Fellows, this is my first attempt to share my knowledge with others.
If you have tips (even to straighten the spaghetti up) i will be very pleased
Syntax:
on every pagestart weblogin will force the plug in ntlm.
It will send a header to IE end return. Then it will read the header. The name, domain en Machine will be in there.
In order to cooperate with the network administrator, he needs access to a LDAP Module.
Every user will be created in LDAP. Every day the administrator can use the LDAP Module to import the userdata from LDAP.
NB. I decided NOT to update, but DELETE ALLE DATA and import again. i find some trouble with update.
`
Installation:
Following steps have to be done
1) modify weblogin snippet
2) modify weblogin.processor.inc.php
3) create plug-in ntlm
4) create LDAP Module.
Weblogin Snippet:
# ADD these lines for SSO
# We simulate a login screen and fill a $_POST['username'].
# By doing this, we do not have to major modify weblogin snippet and
# changes we have to do as we update modx is minimum*/
$_POST['username'] = check_user();
if(!$modx->getLoginUserID()){
$_POST['cmdweblogin'] = 'Login';
}
# End SSO
Standard configuration:
add "&sso=SSO;string;true"
Empty string to disable sso
weblogin.processor.inc.php
change line 192: if(!$sso) $givenPassword = $modx->db->escape($_POST[’password’]);
change line 218: if(!$sso) $dbasePassword = $row[’password’];
create a plug-in ntlm
Name: NTLM
Description: <strong>1.0</strong> - Provide the system of the headers
System configuration:
OnLoadWebDocument On
OnParseDocument On
OnWebAuthentication On
Put in the code from plugin.ntlm.php
create a Module LDAP
Name: LDAP
Description: <strong>1.0</strong>- Import and Change Userdata from LDAP
Put in the code from module.ldap.php
Modify the module as you needed. Please do not forget the check the groupname.
In my example i use "grp-intranet-" on line 105, 126, 166, 188
You can make a variable, but i decided not to, because every line is called different.
i just use same name in my example
In order to let the networkadministrators do the user job i wrote a module to read the usernames out of LDAP
LDAP works like this:
i create webusergroups on modx.
For example: planning
On LDAP we also make a group, but we name this grp-intranet-planning
grp-intranet- is made to keep all the groups conform
in this example we nee to be sure planning is spelled the same.
After running the module, all new users are imported and the groups and languages will be assigned to the users.
i hope it will help you all. id did for me.
i will modify code for better usage. if you have tips to clean the code up. let me know.
Problem/Todo:
Using SSO, manager login will not work with IE.
For Manager login use FireFox or Chrome