{"id":1833,"date":"2023-06-06T15:38:22","date_gmt":"2023-06-06T15:38:22","guid":{"rendered":"https:\/\/wp.pinnari.fi\/?page_id=1833"},"modified":"2023-08-30T18:03:08","modified_gmt":"2023-08-30T18:03:08","slug":"kirjaudu","status":"publish","type":"page","link":"https:\/\/bongariliitto.fi\/index.php\/kirjaudu\/","title":{"rendered":"Kirjaudu"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1833\" class=\"elementor elementor-1833\">\n\t\t\t\t\t\t\t\t\t<section data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"ob-is-breaking-bad elementor-section elementor-top-section elementor-element elementor-element-fa79cfc elementor-section-full_width elementor-section-height-full elementor-section-content-middle elementor-section-height-default elementor-section-items-middle\" data-id=\"fa79cfc\" data-element_type=\"section\" data-settings=\"{&quot;_ob_bbad_use_it&quot;:&quot;yes&quot;,&quot;_ob_bbad_sssic_use&quot;:&quot;no&quot;,&quot;_ob_glider_is_slider&quot;:&quot;no&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3eb9723\" data-id=\"3eb9723\" data-element_type=\"column\" data-settings=\"{&quot;_ob_bbad_is_stalker&quot;:&quot;no&quot;,&quot;_ob_teleporter_use&quot;:false,&quot;_ob_column_hoveranimator&quot;:&quot;no&quot;,&quot;_ob_column_has_pseudo&quot;:&quot;no&quot;}\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-54a1a81 elementor-hidden-mobile ob-has-background-overlay elementor-widget elementor-widget-image\" data-id=\"54a1a81\" data-element_type=\"widget\" data-settings=\"{&quot;_ob_photomorph_use&quot;:&quot;no&quot;,&quot;_ob_perspektive_use&quot;:&quot;no&quot;,&quot;_ob_poopart_use&quot;:&quot;yes&quot;,&quot;_ob_shadough_use&quot;:&quot;no&quot;,&quot;_ob_allow_hoveranimator&quot;:&quot;no&quot;,&quot;_ob_widget_stalker_use&quot;:&quot;no&quot;}\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.14.0 - 26-06-2023 *\/\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=\".svg\"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}<\/style>\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"81\" height=\"108\" src=\"https:\/\/bongariliitto.fi\/wp-content\/uploads\/2023\/06\/logo_0000_Taso-1.svg\" class=\"attachment-large size-large wp-image-1818\" alt=\"\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e610170 ob-harakiri-inherit ob-has-background-overlay elementor-widget elementor-widget-heading\" data-id=\"e610170\" data-element_type=\"widget\" data-settings=\"{&quot;_ob_use_harakiri&quot;:&quot;yes&quot;,&quot;_ob_harakiri_writing_mode&quot;:&quot;inherit&quot;,&quot;_ob_harakiri_text_clip&quot;:&quot;none&quot;,&quot;_ob_perspektive_use&quot;:&quot;no&quot;,&quot;_ob_poopart_use&quot;:&quot;yes&quot;,&quot;_ob_shadough_use&quot;:&quot;no&quot;,&quot;_ob_allow_hoveranimator&quot;:&quot;no&quot;,&quot;_ob_widget_stalker_use&quot;:&quot;no&quot;}\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.14.0 - 26-06-2023 *\/\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style><h2 class=\"elementor-heading-title elementor-size-default\">Kirjaudu sis\u00e4\u00e4n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2da5e2c ob-harakiri-inherit ob-has-background-overlay elementor-widget elementor-widget-text-editor\" data-id=\"2da5e2c\" data-element_type=\"widget\" data-settings=\"{&quot;_ob_use_harakiri&quot;:&quot;yes&quot;,&quot;_ob_harakiri_writing_mode&quot;:&quot;inherit&quot;,&quot;_ob_postman_use&quot;:&quot;no&quot;,&quot;_ob_perspektive_use&quot;:&quot;no&quot;,&quot;_ob_poopart_use&quot;:&quot;yes&quot;,&quot;_ob_shadough_use&quot;:&quot;no&quot;,&quot;_ob_allow_hoveranimator&quot;:&quot;no&quot;,&quot;_ob_widget_stalker_use&quot;:&quot;no&quot;}\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.14.0 - 26-06-2023 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>K\u00e4yt\u00e4 Pinnari-tunnuksiasi vahvistaaksesi oikeutesi kaikkiin sivuihin<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d105a21 ob-has-background-overlay elementor-widget elementor-widget-html\" data-id=\"d105a21\" data-element_type=\"widget\" data-settings=\"{&quot;_ob_perspektive_use&quot;:&quot;no&quot;,&quot;_ob_poopart_use&quot;:&quot;yes&quot;,&quot;_ob_shadough_use&quot;:&quot;no&quot;,&quot;_ob_allow_hoveranimator&quot;:&quot;no&quot;,&quot;_ob_widget_stalker_use&quot;:&quot;no&quot;}\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<form id=\"loginForm\" method=\"post\" action=\"https:\/\/pinnari.fi\/api\/users\/login\" onsubmit=\"event.preventDefault(); submitForm();\" style=\"display: flex; flex-direction: column; align-items: center; width: 100%;\">\n  <input type=\"text\" name=\"username\" placeholder=\"K\u00e4ytt\u00e4j\u00e4nimi\" required style=\"margin-bottom: 10px; padding: 5px; min-width: 200px; max-width: 600px;\">\n  <input type=\"password\" name=\"password\" placeholder=\"Salasana\" required style=\"margin-bottom: 10px; min-width: 200px; max-width: 600px; padding: 5px;\">\n  <button type=\"submit\" style=\"background-color: #ffbe00; color: #ffffff; padding: 10px 20px; border: none; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s;\">\n    Login\n  <\/button>\n<\/form>\n\n<script>\n  function setCookie(name, value, days) {\n    var expires = \"\";\n    if (days) {\n      var date = new Date();\n      date.setTime(date.getTime() + (days*24*60*60*1000));\n      expires = \"; expires=\" + date.toUTCString();\n    }\n    document.cookie = name + \"=\" + (value || \"\")  + expires + \"; path=\/\";\n  }\n\n  function getParameterByName(name) {\n  var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);\n  return match && decodeURIComponent(match[1].replace(\/\\+\/g, ' '));\n}\n\nfunction submitForm() {\n  const form = document.querySelector('#loginForm');\n  const username = form.querySelector('input[name=\"username\"]').value;\n  const password = form.querySelector('input[name=\"password\"]').value;\n\n  \/\/ Perform API request\n  fetch('https:\/\/pinnari.fi\/api\/users\/login', {\n    method: 'POST',\n    body: JSON.stringify({ username: username, password: password }),\n    headers: {\n      'Content-Type': 'application\/json'\n    }\n  })\n  .then(response => response.json())\n  .then(data => {\n    if (data.success) {\n      \/\/ Save token to cookie\n      console.log(data.authorization.token);\n      setCookie('auth-token', data.authorization.token, 1); \/\/ setting cookie for 1 day\n      \n      \/\/ Get the redirect_to URL\n      const redirectTo = getParameterByName('redirect_to') || 'https:\/\/bongariliitto.fi\/';\n      \n      \/\/ Redirect to given URL\n      window.location.href = redirectTo;\n    } else {\n      \/\/ Display error dialog\n      alert('Kirjautuminen ep\u00e4onnistui, tarkista K\u00e4ytt\u00e4j\u00e4nimi ja salasana.');\n    }\n  })\n  .catch(error => {\n    \/\/ Handle any network or request errors\n    console.error('Error:', error);\n  });\n}\n<\/script>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Kirjaudu sis\u00e4\u00e4n K\u00e4yt\u00e4 Pinnari-tunnuksiasi vahvistaaksesi oikeutesi kaikkiin sivuihin Login<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"_eb_attr":""},"categories":[],"tags":[],"folder":[121],"_links":{"self":[{"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/pages\/1833"}],"collection":[{"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/comments?post=1833"}],"version-history":[{"count":52,"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/pages\/1833\/revisions"}],"predecessor-version":[{"id":2692,"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/pages\/1833\/revisions\/2692"}],"wp:attachment":[{"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/media?parent=1833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/categories?post=1833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/tags?post=1833"},{"taxonomy":"folder","embeddable":true,"href":"https:\/\/bongariliitto.fi\/index.php\/wp-json\/wp\/v2\/folder?post=1833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}