ldapauth.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * @return object|bool
  4. * @param string $account
  5. * @param string $password
  6. * @param int $passwordStrength
  7. */
  8. public function identify($account, $password, $passwordStrength = 0)
  9. {
  10. /* If ionCube is not loaded, jump to loader-wizard.php. */
  11. $user = parent::identify($account, $password, $passwordStrength);
  12. if($user and !extension_loaded('ionCube Loader') and !extension_loaded('swoole_loader') and getenv('PHP_ENCODER') != 'NONE')
  13. {
  14. $user->rights = $this->authorize($account);
  15. $user->groups = $this->getGroups($account);
  16. $user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false;
  17. $this->session->set('user', $user);
  18. $documentRoot = isset($_SERVER['SCRIPT_FILENAME']) ? dirname($_SERVER['SCRIPT_FILENAME']) : $_SERVER['DOCUMENT_ROOT'];
  19. $link = is_file($documentRoot . '/loader-wizard.php') ? 'loader-wizard.php' : 'http://www.ioncube.com/lw/';
  20. die(js::locate($link, 'parent'));
  21. }
  22. return $this->loadExtension('ldapauth')->identify($account, $password, $passwordStrength, $user);
  23. }
  24. public function getLDAPConfig()
  25. {
  26. return $this->loadExtension('ldapauth')->getLDAPConfig();
  27. }
  28. public function getLDAPUser($type = 'all', $queryID = 0)
  29. {
  30. return $this->loadExtension('ldapauth')->getLDAPUser($type, $queryID);
  31. }
  32. public function importLDAP($type = 'all', $queryID = 0)
  33. {
  34. return $this->loadExtension('ldapauth')->importLDAP($type, $queryID);
  35. }
  36. public function getUserWithoutLDAP()
  37. {
  38. return $this->loadExtension('ldapauth')->getUserWithoutLDAP();
  39. }