<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12021] trunk:
Show the login form in a popup when autosave hits the login grace period,
fixes #10704</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12021">12021</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-10-11 11:26:59 +0000 (Sun, 11 Oct 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Show the login form in a popup when autosave hits the login grace period, fixes <a href="http://trac.wordpress.org/ticket/10704">#10704</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadmincsslogincss">trunk/wp-admin/css/login.css</a></li>
<li><a href="#trunkwpadmincsslogindevcss">trunk/wp-admin/css/login.dev.css</a></li>
<li><a href="#trunkwpincludesjsautosavedevjs">trunk/wp-includes/js/autosave.dev.js</a></li>
<li><a href="#trunkwpincludesjsautosavejs">trunk/wp-includes/js/autosave.js</a></li>
<li><a href="#trunkwpincludespluggablephp">trunk/wp-includes/pluggable.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwploginphp">trunk/wp-login.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-admin/admin-ajax.php        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -891,6 +891,8 @@
</span><span class="cx">         $message = sprintf( __('Draft Saved at %s.'), date_i18n( $draft_saved_date_format ) );
</span><span class="cx">
</span><span class="cx">         $supplemental = array();
</span><ins>+        if ( isset($login_grace_period) )
+                $supplemental['session_expired'] = add_query_arg( 'interim-login', 1, wp_login_url() );
</ins><span class="cx">
</span><span class="cx">         $id = $revision_id = 0;
</span><span class="cx">         if($_POST['post_ID'] < 0) {
</span></span></pre></div>
<a id="trunkwpadmincsslogincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/login.css (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/login.css        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-admin/css/login.css        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -1 +1 @@
</span><del>-*{margin:0;padding:0;}body{border-top-width:30px;border-top-style:solid;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog a{position:absolute;top:7px;left:15px;text-decoration:none;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;}
</del><span class="cx">\ No newline at end of file
</span><ins>+*{margin:0;padding:0;}body{border-top-width:30px;border-top-style:solid;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog a{position:absolute;top:7px;left:15px;text-decoration:none;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincsslogindevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/login.dev.css (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/login.dev.css        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-admin/css/login.dev.css        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -58,7 +58,8 @@
</span><span class="cx">         line-height: 19px;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-form .submit {
</del><ins>+form .submit,
+.alignright {
</ins><span class="cx">         float: right;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesjsautosavedevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/autosave.dev.js (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/autosave.dev.js        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-includes/js/autosave.dev.js        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', autosaveDelayPreview = false, notSaved = true, blockSave = false;
</del><ins>+var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', autosaveDelayPreview = false, notSaved = true, blockSave = false, interimLogin = false;
</ins><span class="cx">
</span><span class="cx"> jQuery(document).ready( function($) {
</span><span class="cx">         var dotabkey = true;
</span><span class="lines">@@ -81,17 +81,25 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> function autosave_parse_response(response) {
</span><del>-        var res = wpAjax.parseAjaxResponse(response, 'autosave'), message = '', postID;
</del><ins>+        var res = wpAjax.parseAjaxResponse(response, 'autosave'), message = '', postID, sup, url;
</ins><span class="cx">
</span><span class="cx">         if ( res && res.responses && res.responses.length ) {
</span><span class="cx">                 message = res.responses[0].data; // The saved message or error.
</span><span class="cx">                 // someone else is editing: disable autosave, set errors
</span><span class="cx">                 if ( res.responses[0].supplemental ) {
</span><del>-                        if ( 'disable' == res.responses[0].supplemental['disable_autosave'] ) {
</del><ins>+                        sup = res.responses[0].supplemental;
+                        if ( 'disable' == sup['disable_autosave'] ) {
</ins><span class="cx">                                 autosave = function() {};
</span><span class="cx">                                 res = { errors: true };
</span><span class="cx">                         }
</span><del>-                        jQuery.each(res.responses[0].supplemental, function(selector, value) {
</del><ins>+                        if ( sup['session_expired'] && (url = sup['session_expired']) ) {
+                                if ( !interimLogin || interimLogin.closed ) {
+                                        interimLogin = window.open(url, 'login', 'width=600,height=450,resizable=yes,scrollbars=yes,status=yes');
+                                        interimLogin.focus();
+                                }
+                                delete sup['session_expired'];
+                        }
+                        jQuery.each(sup, function(selector, value) {
</ins><span class="cx">                                 if ( selector.match(/^replace-/) ) {
</span><span class="cx">                                         jQuery('#'+selector.replace('replace-', '')).val(value);
</span><span class="cx">                                 }
</span></span></pre></div>
<a id="trunkwpincludesjsautosavejs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/autosave.js (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/autosave.js        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-includes/js/autosave.js        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var autosave,autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,notSaved=true,blockSave=false;jQuery(document).ready(function(b){var a=true;autosaveLast=b("#post #title").val()+b("#post #content").val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b("#post").submit(function(){b.cancel(autosavePeriodical)});b('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;b(":button, :submit","#submitpost").each(function(){var c=b(this);if(c.hasClass("button-primary")){c.addClass("button-primary-disabled")}else{c.addClass("button-disabled")}});b("#ajax-loading").css("visibility","visible")});window.onbeforeunload=function(){var c=typeof(tinyMCE)!="undefined"?tinyMCE.activeEditor:false,e,d;if(c&&!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b("#post #title").val(),d=b("#post #content").val();if((e||d)&&e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b("#post-preview").click(function(){if(1>b("#post_ID").val()&&notSaved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b("input#wp-preview").val("dopreview");b("form#post").attr("target","wp-preview").submit().attr("target","");b("input#wp-preview").val("")};if(typeof tinyMCE!="undefined"){b("#title")[b.browser.opera?"keypress":"keydown"](function(c){if(c.which==9&&!c.shiftKey&&!c.controlKey&&!c.altKey){if((b("#post_ID").val()<1)&&(b("#title").val().length>0)){autosave()}if(tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}if(0>b("#post_ID").val()){b("#title").blur(function(){if(!this.value||0<b("#post_ID").val()){return}delayed_autosave()})}});function autosave_parse_response(b){var c=wpAjax.parseAjaxResponse(b,"autosave"),d="",a;if(c&&c.responses&&c.responses.length){d=c.responses[0].data;if(c.responses[0].supplemental){if("disable"==c.responses[0].supplemental.disable_autosave){autosave=function(){};c={errors:true}}jQuery.each(c.responses[0].supplemental,function(e,f){if(e.match(/^replace-/)){jQuery("#"+e.replace("replace-","")).val(f)}})}if(!c.errors){a=parseInt(c.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(d){jQuery("#autosave").html(d)}else{if(autosaveOldMessage&&c){jQuery("#autosave").html(autosaveOldMessage)}}return c}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){c=jQuery("#post_ID").val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c<0&&a>0){notSaved=false;jQuery("#media-buttons a").each(function(){this.href=this.href.replace(c,a)})}if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&&a>0){if(a==parseInt(jQuery("#post_ID").val(),10)){return}jQuery("#post_ID").attr({name:"post_ID"});jQuery("#post_ID").val(a);jQuery.post(autosaveL10n.requestFile,{action:"autosave-generate-nonces",post_ID:a,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()},function(b){jQuery("#_wpnonce").val(b.updateNonce);jQuery("#delete-action a.submitdelete").attr("href",b.deleteURL);autosave_enable_buttons();jQuery("#delete-action a.submitdelete").fadeIn()},"json");jQuery("#hiddenaction").val("editpost")}}function autosave_update_slug(a){if(jQuery.isFunction(make_slugedit_clickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(slugL10n.requestFile,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);make_slugedit_clickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery("#ajax-loading").css("visibility","hidden")},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c&&f){b=tinyMCE.activeEditor;if(b.plugins.spellchecker&&b.plugins.spellchecker.active){f=false}else{if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery("#original_post_status").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}d.user_ID=jQuery("#user-id").val();if(f){autosaveLast=jQuery("#title").val()+jQuery("#content").val()}else{d.autosave=0}if(parseInt(d.post_ID,10)<1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})};
</del><span class="cx">\ No newline at end of file
</span><ins>+var autosave,autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,notSaved=true,blockSave=false,interimLogin=false;jQuery(document).ready(function(b){var a=true;autosaveLast=b("#post #title").val()+b("#post #content").val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b("#post").submit(function(){b.cancel(autosavePeriodical)});b('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;b(":button, :submit","#submitpost").each(function(){var c=b(this);if(c.hasClass("button-primary")){c.addClass("button-primary-disabled")}else{c.addClass("button-disabled")}});b("#ajax-loading").css("visibility","visible")});window.onbeforeunload=function(){var c=typeof(tinyMCE)!="undefined"?tinyMCE.activeEditor:false,e,d;if(c&&!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b("#post #title").val(),d=b("#post #content").val();if((e||d)&&e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b("#post-preview").click(function(){if(1>b("#post_ID").val()&&notSaved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b("input#wp-preview").val("dopreview");b("form#post").attr("target","wp-preview").submit().attr("target","");b("input#wp-preview").val("")};if(typeof tinyMCE!="undefined"){b("#title")[b.browser.opera?"keypress":"keydown"](function(c){if(c.which==9&&!c.shiftKey&&!c.controlKey&&!c.altKey){if((b("#post_ID").val()<1)&&(b("#title").val().length>0)){autosave()}if(tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}if(0>b("#post_ID").val()){b("#title").blur(function(){if(!this.value||0<b("#post_ID").val()){return}delayed_autosave()})}});function autosave_parse_response(c){var e=wpAjax.parseAjaxResponse(c,"autosave"),f="",a,b,d;if(e&&e.responses&&e.responses.length){f=e.responses[0].data;if(e.responses[0].supplemental){b=e.responses[0].supplemental;if("disable"==b.disable_autosave){autosave=function(){};e={errors:true}}if(b.session_expired&&(d=b.session_expired)){if(!interimLogin||interimLogin.closed){interimLogin=window.open(d,"login","width=600,height=450,resizable=yes,scrollbars=yes,status=yes");interimLogin.focus()}delete b.session_expired}jQuery.each(b,function(g,h){if(g.match(/^replace-/)){jQuery("#"+g.replace("replace-","")).val(h)}})}if(!e.errors){a=parseInt(e.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(f){jQuery("#autosave").html(f)}else{if(autosaveOldMessage&&e){jQuery("#autosave").html(autosaveOldMessage)}}return e}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){c=jQuery("#post_ID").val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c<0&&a>0){notSaved=false;jQuery("#media-buttons a").each(function(){this.href=this.href.replace(c,a)})}if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&&a>0){if(a==parseInt(jQuery("#post_ID").val(),10)){return}jQuery("#post_ID").attr({name:"post_ID"});jQuery("#post_ID").val(a);jQuery.post(autosaveL10n.requestFile,{action:"autosave-generate-nonces",post_ID:a,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()},function(b){jQuery("#_wpnonce").val(b.updateNonce);jQuery("#delete-action a.submitdelete").attr("href",b.deleteURL);autosave_enable_buttons();jQuery("#delete-action a.submitdelete").fadeIn()},"json");jQuery("#hiddenaction").val("editpost")}}function autosave_update_slug(a){if(jQuery.isFunction(make_slugedit_clickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(slugL10n.requestFile,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);make_slugedit_clickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery("#ajax-loading").css("visibility","hidden")},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c&&f){b=tinyMCE.activeEditor;if(b.plugins.spellchecker&&b.plugins.spellchecker.active){f=false}else{if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery("#original_post_status").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}d.user_ID=jQuery("#user-id").val();if(f){autosaveLast=jQuery("#title").val()+jQuery("#content").val()}else{d.autosave=0}if(parseInt(d.post_ID,10)<1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})};
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludespluggablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/pluggable.php (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/pluggable.php        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-includes/pluggable.php        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -539,6 +539,9 @@
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if ( $expiration < time() ) // AJAX/POST grace period set above
+                $GLOBALS['login_grace_period'] = 1;
+
</ins><span class="cx">         do_action('auth_cookie_valid', $cookie_elements, $user);
</span><span class="cx">
</span><span class="cx">         return $user->ID;
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-includes/script-loader.php        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">                 'l10n_print_after' => 'try{convertEntities(wpAjax);}catch(e){};'
</span><span class="cx">         ) );
</span><span class="cx">
</span><del>-        $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090913' );
</del><ins>+        $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20091010' );
</ins><span class="cx">         $scripts->add_data( 'autosave', 'group', 1 );
</span><span class="cx">
</span><span class="cx">         $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20091007' );
</span><span class="lines">@@ -479,7 +479,7 @@
</span><span class="cx">         $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20090625' );
</span><span class="cx">         $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20090514' );
</span><span class="cx">         $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
</span><del>-        $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20090824' );
</del><ins>+        $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20091010' );
</ins><span class="cx">         $styles->add( 'plugin-install', "/wp-admin/css/plugin-install$suffix.css", array(), '20090514' );
</span><span class="cx">         $styles->add( 'theme-install', "/wp-admin/css/theme-install$suffix.css", array(), '20090610' );
</span><span class="cx">         $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
</span></span></pre></div>
<a id="trunkwploginphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-login.php (12020 => 12021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-login.php        2009-10-11 00:37:26 UTC (rev 12020)
+++ trunk/wp-login.php        2009-10-11 11:26:59 UTC (rev 12021)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> * @param WP_Error $wp_error Optional. WordPress Error Object
</span><span class="cx"> */
</span><span class="cx"> function login_header($title = 'Log In', $message = '', $wp_error = '') {
</span><del>-        global $error, $is_iphone;
</del><ins>+        global $error, $is_iphone, $interim_login;
</ins><span class="cx">
</span><span class="cx">         // Don't index any of these forms
</span><span class="cx">         add_filter( 'pre_option_blog_public', create_function( '$a', 'return 0;' ) );
</span><span class="lines">@@ -53,18 +53,22 @@
</span><span class="cx"> <head>
</span><span class="cx">         <title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
</span><span class="cx">         <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
</span><del>-        <?php
</del><ins>+<?php
</ins><span class="cx">         wp_admin_css( 'login', true );
</span><span class="cx">         wp_admin_css( 'colors-fresh', true );
</span><span class="cx">
</span><del>-        if ( $is_iphone ) {
-        ?>
</del><ins>+        if ( $is_iphone ) { ?>
</ins><span class="cx">         <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
</span><span class="cx">         <style type="text/css" media="screen">
</span><span class="cx">         form { margin-left: 0px; }
</span><span class="cx">         #login { margin-top: 20px; }
</span><span class="cx">         </style>
</span><del>-        <?php
</del><ins>+<?php
+        } elseif ( isset($interim_login) && $interim_login ) { ?>
+        <style type="text/css" media="all">
+        .login #login { margin: 20px auto; }
+        </style>
+<?php
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         do_action('login_head'); ?>
</span><span class="lines">@@ -282,7 +286,7 @@
</span><span class="cx">         $action = 'resetpass';
</span><span class="cx">
</span><span class="cx"> // validate action so as to default to the login screen
</span><del>-if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action) )
</del><ins>+if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login'), true) && false === has_filter('login_form_' . $action) )
</ins><span class="cx">         $action = 'login';
</span><span class="cx">
</span><span class="cx"> nocache_headers();
</span><span class="lines">@@ -443,6 +447,7 @@
</span><span class="cx"> case 'login' :
</span><span class="cx"> default:
</span><span class="cx">         $secure_cookie = '';
</span><ins>+        $interim_login = isset($_REQUEST['interim-login']);
</ins><span class="cx">
</span><span class="cx">         // If the user wants ssl but the session is not ssl, force a secure cookie.
</span><span class="cx">         if ( !empty($_POST['log']) && !force_ssl_admin() ) {
</span><span class="lines">@@ -472,6 +477,15 @@
</span><span class="cx">         $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
</span><span class="cx">
</span><span class="cx">         if ( !is_wp_error($user) ) {
</span><ins>+                if ( $interim_login ) {
+                        $message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
+                        login_header( '', $message ); ?>
+                        <script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script>
+                        <p class="alignright">
+                        <input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p>
+                        </div></body></html>
+<?php                exit;
+                }
</ins><span class="cx">                 // If the user can't edit posts, send them to their profile.
</span><span class="cx">                 if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) )
</span><span class="cx">                         $redirect_to = admin_url('profile.php');
</span><span class="lines">@@ -489,11 +503,18 @@
</span><span class="cx">                 $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
</span><span class="cx">
</span><span class="cx">         // Some parts of this script use the main login form to display a message
</span><del>-        if                ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )                        $errors->add('loggedout', __('You are now logged out.'), 'message');
-        elseif        ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )        $errors->add('registerdisabled', __('User registration is currently not allowed.'));
-        elseif        ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )        $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
-        elseif        ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )        $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
-        elseif        ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )        $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
</del><ins>+        if                ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )
+                $errors->add('loggedout', __('You are now logged out.'), 'message');
+        elseif        ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
+                $errors->add('registerdisabled', __('User registration is currently not allowed.'));
+        elseif        ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
+                $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
+        elseif        ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
+                $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
+        elseif        ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
+                $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
+        elseif        ( $interim_login )
+                $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message');
</ins><span class="cx">
</span><span class="cx">         login_header(__('Log In'), '', $errors);
</span><span class="cx">
</span><span class="lines">@@ -515,12 +536,17 @@
</span><span class="cx">         <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <?php esc_attr_e('Remember Me'); ?></label></p>
</span><span class="cx">         <p class="submit">
</span><span class="cx">                 <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" />
</span><ins>+<?php        if ( $interim_login ) { ?>
+                <input type="hidden" name="interim-login" value="1" />
+<?php        } else { ?>
</ins><span class="cx">                 <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
</span><ins>+<?php         } ?>
</ins><span class="cx">                 <input type="hidden" name="testcookie" value="1" />
</span><span class="cx">         </p>
</span><span class="cx"> </form>
</span><span class="cx"> <?php endif; ?>
</span><span class="cx">
</span><ins>+<?php if ( !$interim_login ) { ?>
</ins><span class="cx"> <p id="nav">
</span><span class="cx"> <?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
</span><span class="cx"> <?php elseif (get_option('users_can_register')) : ?>
</span><span class="lines">@@ -531,12 +557,12 @@
</span><span class="cx"> <?php endif; ?>
</span><span class="cx"> </p>
</span><span class="cx">
</span><ins>+<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
+<?php } ?>
</ins><span class="cx"> </div>
</span><span class="cx">
</span><del>-<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&larr; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
-
</del><span class="cx"> <script type="text/javascript">
</span><del>-<?php if ( $user_login ) { ?>
</del><ins>+<?php if ( $user_login || $interim_login ) { ?>
</ins><span class="cx"> setTimeout( function(){ try{
</span><span class="cx"> d = document.getElementById('user_pass');
</span><span class="cx"> d.value = '';
</span></span></pre>
</div>
</div>
</body>
</html>