if identity (uid) changes - reload any other open browser windows on next ping.

This commit is contained in:
friendica 2012-05-22 16:01:07 -07:00
parent 3ce06caeed
commit e70573f34c
5 changed files with 267 additions and 249 deletions

View File

@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1349' );
define ( 'FRIENDICA_VERSION', '3.0.1350' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1144 );
@ -511,6 +511,7 @@ if(! class_exists('App')) {
$tpl = file_get_contents('view/head.tpl');
$this->page['htmlhead'] = replace_macros($tpl,array(
'$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
'$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
'$delitem' => t('Delete this item?'),
'$comment' => t('Comment'),

View File

@ -117,6 +117,9 @@
/* nav update event */
$('nav').bind('nav-update', function(e,data){;
var invalid = $(data).find('invalid').text();
if(invalid == 1) { window.location.href=window.location.href }
var net = $(data).find('net').text();
if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') }
$('#net-update').html(net);
@ -211,7 +214,8 @@
function NavUpdate() {
if(! stopped) {
$.get("ping",function(data) {
var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
$.get(pingCmd,function(data) {
$(data).find('result').each(function() {
// send nav-update event
$('nav').trigger('nav-update', this);

View File

@ -10,8 +10,16 @@ function ping_init(&$a) {
<result>";
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
if(local_user()){
// Different login session than the page that is calling us.
if(intval($_GET['uid']) && intval($_GET['uid']) != local_user()) {
echo '<invalid>1</invalid></result>';
killme();
}
$firehose = intval(get_pconfig(local_user(),'system','notify_full'));
$t = q("select count(*) as total from notify where uid = %d and seen = 0",

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@
<script>
var updateInterval = $update_interval;
var localUser = $local_user;
function confirmDelete() { return confirm("$delitem"); }
function commentOpen(obj,id) {