- if (Session::get('submanage')) {
- $user = User::getById(Session::get('submanage'));
+ if (DI::userSession()->getSubManagedUserId()) {
+ $user = User::getById(DI::userSession()->getSubManagedUserId());
DI::auth()->setForUser(DI::app(), $user, true, true);
if ($limited_id) {
DI::auth()->setForUser(DI::app(), $user, true, true);
if ($limited_id) {
foreach ($identities as $key => $identity) {
$identities[$key]['thumb'] = User::getAvatarUrl($identity, Proxy::SIZE_THUMB);
$identities[$key]['selected'] = ($identity['nickname'] === DI::app()->getLoggedInUserNickname());
foreach ($identities as $key => $identity) {
$identities[$key]['thumb'] = User::getAvatarUrl($identity, Proxy::SIZE_THUMB);
$identities[$key]['selected'] = ($identity['nickname'] === DI::app()->getLoggedInUserNickname());
- $condition = ["`uid` = ? AND `msg` != '' AND NOT (`type` IN (?, ?)) AND NOT `seen`", $identity['uid'], Notification\Type::INTRO, Notification\Type::MAIL];
+ $condition = ["`msg` != '' AND NOT (`type` IN (?, ?)) AND NOT `seen`", Notification\Type::INTRO, Notification\Type::MAIL];
$params = ['distinct' => true, 'expression' => 'convid'];
$notifications += DBA::count('mail', ['uid' => $identity['uid'], 'seen' => false], $params);
$params = ['distinct' => true, 'expression' => 'convid'];
$notifications += DBA::count('mail', ['uid' => $identity['uid'], 'seen' => false], $params);