Guest User

Untitled

a guest
Apr 11th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1.   public function authenticate(&$ps_username, $ps_password="", $pa_options="") {
  2.             //return 2;
  3.  
  4.             require_once('/var/aegir/simplesamlphp/lib/_autoload.php');
  5.             $as = new SimpleSAML_Auth_Simple('colibreo-ca2-sp');
  6.             $as->requireAuth();
  7.             if ($as->isAuthenticated()) {
  8.                 $attributes = $as->getAttributes();
  9.                 if (is_array($attributes["user_name"]) && count($attributes["user_name"]) > 0) {
  10.                     if ($this->load($attributes["user_name"][0])) {
  11.                         return true;
  12.                     }
  13.                 }
  14.             }
  15.             /*
  16.             if (!isset($pa_options["dont_check_ips"]) || !$pa_options["dont_check_ips"]) {
  17.         if ($vn_user_id = $this->ipAuthenticate()) {
  18.                     if ($this->load($vn_user_id)) {
  19.             $ps_username = $this->get("user_name");
  20.             return 2;
  21.                     }
  22.                 }
  23.             }
  24.             */
  25.             return false;
  26.         }
Add Comment
Please, Sign In to add comment