Skip to content

Commit

Permalink
Added missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuszkrzaczkowski committed Jul 10, 2015
1 parent b457cfe commit a9c5146
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions modules/Users/handlers/LogoutHandler.php
@@ -0,0 +1,29 @@
<?php

/**
* Logout handler
* @package YetiForce.User
* @license licenses/License.html
* @author Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
*/
class LogoutHandler extends VTEventHandler
{

function handleEvent($eventName, $entityData)
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');

if ($eventName == 'user.logout.before') {
$log->debug("Start LogoutHandler: user.logout.before");

$mainUrl = OSSMail_Record_Model::GetSite_URL() . 'modules/OSSMail/roundcube/';
vimport('~modules/OSSMail/RoundcubeLogin.class.php');
$rcl = new RoundcubeLogin($mainUrl);
if ($rcl->isLoggedIn()) {
$rcl->logout();
}
$log->debug("End LogoutHandler: user.logout.before");
}
}
}

0 comments on commit a9c5146

Please sign in to comment.