ASDSO Dam Safety Toolbox

Log out: Difference between revisions

From ASDSO Dam Safety Toolbox
Jump to: navigation, search
No edit summary
No edit summary
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<html>
<html>
   <div id="mw-content-text" class="mw-body-content">
   <div id="confirmLogout">
     <div class="mw-htmlform-ooui-wrapper oo-ui-layout oo-ui-panelLayout">
     <p>Do you want to log out?</p>
      <form action="/wiki/Special:UserLogout" method="post" enctype="application/x-www-form-urlencoded"
    <button type="button" onclick="logOut()" class="button"
        class="mw-htmlform mw-htmlform-ooui oo-ui-layout oo-ui-formLayout">
      style="color: #fff;
        <div class="mw-htmlform-ooui-header oo-ui-layout oo-ui-fieldLayout oo-ui-fieldLayout-align-top">
      background-color: #36c;
          <div class="oo-ui-fieldLayout-body"><span class="oo-ui-fieldLayout-header"><label id="ooui-php-1"
      cursor: pointer;
                class="oo-ui-labelElement-label"></label></span>
      padding: 5px 12px;
            <div class="oo-ui-fieldLayout-field"><label aria-disabled="false" aria-labelledby="ooui-php-1"
      line-height: 1;
                class="oo-ui-widget oo-ui-widget-enabled oo-ui-labelElement-label oo-ui-labelElement oo-ui-labelWidget">Do
      border: 1px solid #36c;
                you want to log out?</label></div>
      border-radius: 2px;
          </div>
      transition: background-color 100ms,color 100ms,border-color 100ms,box-shadow 100ms;
        </div><input id="wpEditToken" type="hidden" value="134b1f4c5a12e594ff36fac74d2434ae64306181+\"
      min-height: 35px;
          name="wpEditToken">
      text-decoration: none;">Submit</button>
        <input type="hidden" value="Special:UserLogout" name="title">
        <input name="returnto" type="hidden" value="Log out">
        <input name="redirectparams" type="hidden" value="returnto=Log+out">
        <div class="mw-htmlform-submit-buttons">
          <span aria-disabled="false" id="ooui-php-2"
            class="mw-htmlform-submit oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-flaggedElement-primary oo-ui-flaggedElement-progressive oo-ui-buttonInputWidget"
            data-ooui="{&quot;_&quot;:&quot;OO.ui.ButtonInputWidget&quot;,&quot;type&quot;:&quot;submit&quot;,&quot;value&quot;:&quot;Submit&quot;,&quot;label&quot;:&quot;Submit&quot;,&quot;flags&quot;:[&quot;primary&quot;,&quot;progressive&quot;],&quot;classes&quot;:[&quot;mw-htmlform-submit&quot;]}"><button
              type="submit" tabindex="0" aria-disabled="false" value="Submit"
              class="oo-ui-inputWidget-input oo-ui-buttonElement-button"><span
                class="oo-ui-iconElement-icon oo-ui-iconElement-noIcon oo-ui-image-invert"></span><span
                class="oo-ui-labelElement-label">Submit</span><span
                class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-invert"></span></button></span>
        </div>
      </form>
    </div>
   </div>
   </div>
  <div id="logoutSuccess" style="visibility: hidden;">
    <p><strong>You are now logged out and will be redirected to the <a href="https://portal.damsafety.org">ASDSO Dam Safety Portal</a> in a few seconds.</strong></p>
    <!-- TODO: if we can figure out how to redirect from Impexium site use this instead of the above -->
    <!-- <p><strong>You are now logged out.</strong></p>
    <p>Return to <a id="redirectUrl" href="/wiki/Main_Page">Main Page</a></p> -->
  </div>
  <script>
    function setRedirects(){
      var previousUrl = document.referrer;
      if (!previousUrl || previousUrl !== "") {
        document.getElementById("redirectUrl").href = previousUrl;
        var pageTitle = previousUrl.split("https://damtoolbox.org/wiki/").pop().replaceAll('_',' ');
        document.getElementById("redirectUrl").text = pageTitle;
      }
    }
    function logOut() {
      // Clear cookie by setting the expiration date to one day ago
      var myDate = new Date();
      myDate.setDate(myDate.getDate()-1);
      document.cookie = "remoteUserEmail='';expires=" + myDate + ";domain=damtoolbox.org;path=/;secure";
      // Navigate to Impexium site and logout there
      setTimeout(function() {
        window.location.href = 'https://portal.damsafety.org/account/logout.aspx';
      }, 3000);
      // Show confirmation
      var x = document.getElementById("confirmLogout");
      x.style.display = "none";
      var y = document.getElementById("logoutSuccess");
      y.style.visibility = "visible";
    }
    //TODO: if we can figure out how to redirect from Impexium site use this
    //setRedirects();
  </script>
</html>
</html>

Latest revision as of 12:52, 2 May 2023

Do you want to log out?