$insert_stmt = $db->prepare("INSERT INTO tokenattributes(uid, attr_key, attr_value) VALUES(:uid, :attr_key, :attr_value)"); if (!$insert_stmt->execute(array("uid" => $uid, "attr_key" => $key, "attr_value" => $value))) { error_log('Failed to insert attribute for uid:' . $uid); return null; } } } return attributes; } $as = new SimpleSAML_Auth_Simple('default-sp'); if ($as->isAuthenticated()) { $attributes = $as->getAttributes(); $attributes = $this->resetAttributes($attributes); if (isset($attributes['uid'])) { $uid = $attributes['uid'][0]; echo '<a href=\'javascript:insertValue("' . base64_encode(SimpleSAML_Utilities::aesEncrypt($uid)) . '")\'>Aktiver VenligLogin, så jeg kan komme på næste gang med min PIN kode</a>'; } } ?> <?php if (array_key_exists('post', $this->data)) { $post = $this->data['post']; } else { /* For backwards compatibility. */ assert('array_key_exists("response", $this->data)'); assert('array_key_exists("RelayStateName", $this->data)'); assert('array_key_exists("RelayState", $this->data)'); $post = array('SAMLResponse' => $this->data['response'], $this->data['RelayStateName'] => $this->data['RelayState']); } /**