jmtrevaskis

ropverify.patch

May 16th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. --- ropverify.bak.php 2012-05-16 18:21:06.000000000 +0530
  2. +++ ropverify.php 2012-05-16 20:02:56.000000000 +0530
  3. @@ -28,6 +28,28 @@
  4. $timestamp = getHttpVal('timestamp', 0);
  5. $username = strtolower(getHttpVal('user', 0));
  6. $passwd = getHttpVal('password', null);
  7. +
  8. +
  9. +//james vars
  10. +$debug = 0;
  11. +$otpOnlyAuthAllow = 0; //change to enable OTP only
  12. +$skipLdapAuth = 0; //dont edit this one
  13. +
  14. +//james script, if not OTP token, then set passwd as OTP for citrix
  15. +$passwdlen = strlen($passwd);
  16. +if ($otpOnlyAuthAllow == 1 && $passwdlen == 44) {
  17. + $otp = $passwd;
  18. + $skipLdapAuth = 1;
  19. +}
  20. +
  21. +//james debug
  22. +if ($debug) {
  23. + $myLog->log(LOG_ERR, $otp);
  24. + $myLog->log(LOG_ERR, $passwd);
  25. + $myLog->log(LOG_ERR, $passwdlen);
  26. +}
  27. +
  28. +
  29. if($otp && $username && $passwd){
  30. if($user_domain = seperatUsersAndDomain($username)){
  31. $user = $user_domain[0];
  32. @@ -402,6 +424,15 @@
  33. global $confs,$ldap_host,$ldap_port,$ldap_version,$ldap_secured,$ldap_timeout,$ldap_host1,$user_full_name;
  34. $myLog->log(LOG_DEBUG, 'Authenticating with LDAP/AD...');
  35.  
  36. + //james, if password length is 44, it means only token is present, so skip LDAP auth
  37. + global $skipLdapAuth,$debug;
  38. + if ($skipLdapAuth == 1) {
  39. + if ($debug) {
  40. + $myLog->log(LOG_ERR, 'skipping ldap auth');
  41. + }
  42. + return true;
  43. + }
  44. +
  45. // Connect to LDAP server
  46. $ldap_host = $confs["ldapconf"]["host"];
  47. $ldap_port = $confs["ldapconf"]["port"];
Add Comment
Please, Sign In to add comment