jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Controllers/] [NotificationController.php] - Blame information for rev 2

 

Line No. Rev Author Line
12simandl<?php
2 
3namespace Phem\Controllers;
4 
5use DateTime;
6use Phem\Environment\Application;
7use Phem\Environment\EnvironmentManager;
8use Phem\Environment\Message;
9use Phem\Environment\MessageArgs;
10 
11/**
12 *
13 * @author kubapet
14 */
15class NotificationController extends Controller
16{
17 
18 public function userWentOffline($uid)
19 {
20 sleep(15);
21 
22 $lock = Application::lockVarsWait();
23 $users = Application::getUsers();
24 $rlUsers = Application::getRecentlyLoggedUsers();
25 $rlUsers->removeKey($uid);
26 Application::setRecentlyLoggedUsers($rlUsers);
27 $lock->unlock();
28 
29 if ($users->get($uid) != null)
30 {
31 exit;
32 }
33 
34 $msgArgs = new MessageArgs();
35 $msgArgs->setActionUrl(EnvironmentManager::getLinkBuilder()->navigate("Administration","loggedUsers"));
36 $msgArgs->setActionType("replace");
37 $msgArgs->setActionTarget("loggedUsers");
38 
39 $msg = new Message;
40 $msg->setSubject('UĹživatel je offline');
41 $msg->getArgs()->add($msgArgs);
42 $msg->setDate(new DateTime(date("Y-m-d")));
43 $msg->setFromUsr($uid);
44 
45 $msgArgs->setMessage($msg);
46 
47 //$msg->setText($uid);
48 Application::notify($msg);
49 }
50 
51}

Powered by WebSVN 2.2.1