ASDSO Dam Safety Toolbox

Log out: Difference between revisions

From ASDSO Dam Safety Toolbox
Jump to: navigation, search
No edit summary
No edit summary
 
(36 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<html>
<html>
   <form method="post" class="mw-htmlform mw-htmlform-ooui oo-ui-layout oo-ui-formLayout">
   <div id="confirmLogout">
     <div class="mw-htmlform-ooui-header oo-ui-layout oo-ui-fieldLayout oo-ui-fieldLayout-align-top">
     <p>Do you want to log out?</p>
      <div class="oo-ui-fieldLayout-body">
    <button type="button" onclick="logOut()" class="button"
        <div class="oo-ui-fieldLayout-field">
      style="color: #fff;
          <label aria-disabled="false" aria-labelledby="ooui-php-1" class="oo-ui-widget oo-ui-widget-enabled oo-ui-labelElement-label oo-ui-labelElement oo-ui-labelWidget">
      background-color: #36c;
            Do you want to log out?
      cursor: pointer;
          </label>
      padding: 5px 12px;
        </div>
      line-height: 1;
      </div>
      border: 1px solid #36c;
    </div>
      border-radius: 2px;
    <input id="wpEditToken" type="hidden" value="26793b672396a00acccbb4676dce62ec64305a77+\" name="wpEditToken">
      transition: background-color 100ms,color 100ms,border-color 100ms,box-shadow 100ms;
     <input type="hidden" value="Special:UserLogout" name="title">
      min-height: 35px;
     <input name="returnto" type="hidden" value="Main Page">
      text-decoration: none;">Submit</button>
     <input name="redirectparams" type="hidden" value="returnto=Main+Page">
  </div>
     <div class="mw-htmlform-submit-buttons">
  <div id="logoutSuccess" style="visibility: hidden;">
       <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">
    <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>
         <button type="submit" name="impexiumLogout" aria-disabled="false" value="Submit" class="oo-ui-inputWidget-input oo-ui-buttonElement-button">
     <!-- TODO: if we can figure out how to redirect from Impexium site use this instead of the above -->
          <span class="oo-ui-labelElement-label">Submit</span>
    <!-- <p><strong>You are now logged out.</strong></p>
        </button>
     <p>Return to <a id="redirectUrl" href="/wiki/Main_Page">Main Page</a></p> -->
      </span>
  </div>
     </div>
 
   </form>
  <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?