Browse Source

Add forgotten files + clean some code

pull/5/head
Jaussoin Timothée 15 years ago
parent
commit
199d1549f8
  1. 7
      lib/User.php
  2. 1
      lib/XMPPConnect.php
  3. 53
      lib/widgets/Logout/Logout.php
  4. BIN
      lib/widgets/Logout/img/door_open.png
  5. 13
      lib/widgets/Logout/logout.css
  6. 3
      lib/widgets/Logout/logout.js

7
lib/User.php

@ -69,15 +69,8 @@ class User {
function desauth()
{
//unset($_SESSION['login']);
/*if(isset($this->xmppSession)) {
$this->xmppSession->logout();
}*/
unset($_SESSION);
session_destroy();
//return true;
// movim_log($_SESSION);
}

1
lib/XMPPConnect.php

@ -259,7 +259,6 @@ class XMPPConnect
$evt = new EventHandler();
if($payload['type'] == 'unavailable') {
//list($jid, $place) = explode("/",$payload['from']);
if($payload['from'] == $this->jaxl->jid)
$evt->runEvent('postdisconnected', $data);
else

53
lib/widgets/Logout/Logout.php

@ -0,0 +1,53 @@
<?php
/**
* @file Logout.php
* This file is part of MOVIM.
*
* @brief The little logout widget.
*
* @author Guillaume Pasquet <etenil@etenilsrealm.nl>
*
* @version 1.0
* @date 20 October 2010
*
* Copyright (C)2010 MOVIM project
*
* See COPYING for licensing information.
*/
class Logout extends Widget
{
function WidgetLoad()
{
$this->addcss('logout.css');
$this->addjs('logout.js');
$this->registerEvent('postdisconnected', 'onPostDisconnect');
}
function onPostDisconnect($data)
{
$uri = str_replace("jajax.php", "", BASE_URI);
$this->sendto('pageLogout', array(
$this->cdata($uri."index.php?q=disconnect")
));
}
function ajaxLogout()
{
$user = new User();
$xmpp = XMPPConnect::getInstance($user->getLogin());
$xmpp->logout();
}
function build()
{
var_dump($_SESSION);
?>
<div id="logout" onclick="<?php $this->callAjax('ajaxLogout', "'movim_drop'", "'drop'");?>"></div>
<?php
}
}
?>

BIN
lib/widgets/Logout/img/door_open.png

After

Width: 16  |  Height: 16  |  Size: 508 B

13
lib/widgets/Logout/logout.css

@ -0,0 +1,13 @@
#logout {
position: absolute;
top: 0px;
right: 2px;
background-image: url(img/door_open.png);
background-repeat: no-repeat;
background-position: 0px 0px;
height: 1em;
width: 1em;
padding: 3px;
margin-top: 2px;
cursor: pointer;
}

3
lib/widgets/Logout/logout.js

@ -0,0 +1,3 @@
function pageLogout(uri) {
window.location.replace(uri);
}
Loading…
Cancel
Save