Login: reauth: window.location.hash is now updated to include the new SID so that page reloads will use it
authorDan
Sun, 25 Jan 2009 20:35:32 -0500
changeset 824 28d9fbcd4f0d
parent 823 4596c40aaa94
child 827 2c20563245b2
Login: reauth: window.location.hash is now updated to include the new SID so that page reloads will use it
includes/clientside/static/enano-lib-basic.js
includes/clientside/static/login.js
themes/oxygen/elements.tpl
--- a/includes/clientside/static/enano-lib-basic.js	Sun Jan 25 20:35:06 2009 -0500
+++ b/includes/clientside/static/enano-lib-basic.js	Sun Jan 25 20:35:32 2009 -0500
@@ -472,6 +472,19 @@
 /*!END_INCLUDER*/
 
 addOnloadHook(function() {
+  if ( $_REQUEST['auth'] )
+  {
+    var key = $_REQUEST['auth'];
+    var loc = String(window.location);
+    loc = loc.replace(/#.+$/, '').replace(/&auth=[0-9a-f]+/, '').replace(/\?auth=[0-9a-f]+(&)?/, '$1');
+    if ( key != 'false' )
+    {
+      var sep = loc.indexOf('?') != -1 ? '&' : '?';
+      loc = loc + sep + 'auth=' + key;
+    }
+    console.debug(loc);
+    window.location = loc;
+  }
   if ( $_REQUEST['do'] )
   {
     var act = $_REQUEST['do'];
--- a/includes/clientside/static/login.js	Sun Jan 25 20:35:06 2009 -0500
+++ b/includes/clientside/static/login.js	Sun Jan 25 20:35:32 2009 -0500
@@ -366,7 +366,7 @@
 {
   json = toJSONString(json);
   json = ajaxEscape(json);
-  ajaxPost(makeUrlNS('Special', 'Login/action.json'), 'r=' + json, function()
+  ajaxPost(makeUrlNS('Special', 'Login/action.json'), 'r=' + json, function(ajax)
     {
       if ( ajax.readyState == 4 && ajax.status == 200 )
       {
@@ -1298,6 +1298,7 @@
     {
       auth_level = level;
     }
+    window.location.hash = '#auth:' + key;
   }
   else
   {
@@ -1314,5 +1315,6 @@
         }
       }
     }
+    window.location.hash = '#auth:false';
   }
 }
--- a/themes/oxygen/elements.tpl	Sun Jan 25 20:35:06 2009 -0500
+++ b/themes/oxygen/elements.tpl	Sun Jan 25 20:35:32 2009 -0500
@@ -55,9 +55,9 @@
           <div class="rectbot">
             <table border="0" width="100%" cellspacing="0" cellpadding="0" style="font-size: 1px;">
               <tr>
-                <td style="margin: 0; padding: 0; height: 12px;"> <img alt=" " src="{CDNPATH}/images/spacer.gif" style="background-image: url({CDNPATH}/themes/oxygen/images/{STYLE_ID}/sprite-horiz.gif); background-position: -24px 0; background-repeat: no-repeat;" width="12" height="12" /> </td>
-                <td style="margin: 0; padding: 0; height: 12px;" class="rectbottop"></td>
-                <td style="margin: 0; padding: 0; height: 12px;"> <img alt=" " src="{CDNPATH}/images/spacer.gif" style="background-image: url({CDNPATH}/themes/oxygen/images/{STYLE_ID}/sprite-horiz.gif); background-position: -36px 0; background-repeat: no-repeat;" width="12" height="12" /> </td>
+                <td style="margin: 0; padding: 0;"><img                    alt=" " src="{CDNPATH}/images/spacer.gif" style="background-image: url({CDNPATH}/themes/oxygen/images/{STYLE_ID}/sprite-horiz.gif); background-position: -24px 0; background-repeat: no-repeat;" width="12" height="12" /></td>
+                <td style="margin: 0; padding: 0;" class="rectbottop"><img alt=" " src="{CDNPATH}/images/spacer.gif" width="12" height="12" /></td>
+                <td style="margin: 0; padding: 0;"><img                    alt=" " src="{CDNPATH}/images/spacer.gif" style="background-image: url({CDNPATH}/themes/oxygen/images/{STYLE_ID}/sprite-horiz.gif); background-position: -36px 0; background-repeat: no-repeat;" width="12" height="12" /></td>
               </tr>
             </table>
           </div>