6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
8/16/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#14259] Event notification from another user's private calendar
*
Your Email Address
*
Spam protection
Enter the letters below:
.__ . .\ /.__.. , [__)|_/ >< [__] \./ | | \/ \| | |
Comment
>> This debug log is from reading the alarms already entered into the >> alarms table. We need to find out why the alarm_uid of the incorrect >> user is being set. Look in Kronolith_Application::listAlarms. Pay >> attention to the code that sets the $users variable. > > Ok, here´s what I´ve found so far. > > File: Horde/Share/Object.php > > public function listUsers($perm_level = null) > { > $perm = $this->getPermission(); > $results = array_keys($perm->getUserPermissions($perm_level)); > Horde::debug($results); > (...) > > After running horde-alarms, I get this: > >> 2016-02-18T19:00:17-02:00 DEBUG: Variable information: >> array(1) { >> [0]=> >> string(4) "robm" >> } >> >> Backtrace: >> 1. Horde_Alarm->notify() /usr/bin/horde-alarms:26 >> 2. Horde_Alarm->listAlarms() /usr/share/php/Horde/Alarm.php:434 >> 3. call_user_func() /usr/share/php/Horde/Alarm.php:113 >> 4. Horde_Core_Factory_Alarm->load() >> 5. Horde_Registry->callAppMethod() >> /usr/share/php/Horde/Core/Factory/Alarm.php:170 >> 6. call_user_func_array() /usr/share/php/Horde/Registry.php:1192 >> 7. Kronolith_Application->listAlarms() >> 8. Horde_Share_Object->listUsers() >> /var/www/horde/kronolith/lib/Application.php:503 >> 9. Horde::debug() /usr/share/php/Horde/Share/Object.php:213 >> >> 2016-02-18T19:00:17-02:00 DEBUG: Variable information: >> array(0) { >> } >> >> Backtrace: >> 1. Horde_Alarm->notify() /usr/bin/horde-alarms:26 >> 2. Horde_Alarm->listAlarms() /usr/share/php/Horde/Alarm.php:434 >> 3. call_user_func() /usr/share/php/Horde/Alarm.php:113 >> 4. Horde_Core_Factory_Alarm->load() >> 5. Horde_Registry->callAppMethod() >> /usr/share/php/Horde/Core/Factory/Alarm.php:170 >> 6. call_user_func_array() /usr/share/php/Horde/Registry.php:1192 >> 7. Kronolith_Application->listAlarms() >> 8. Horde_Share_Object->listUsers() >> /var/www/horde/kronolith/lib/Application.php:503 >> 9. Horde::debug() /usr/share/php/Horde/Share/Object.php:213 > > I don´t know why horde-alarms triggers Horde_Share_Object::listUsers > two times. Anyway, the second one it retrieves an empty array. PS: I > only activate the debug function after creating the test event and > before running horde-alarms. > > Then, I changed the debug to: > > public function listUsers($perm_level = null) > { > $perm = $this->getPermission(); > $results = array_keys($perm->getUserPermissions($perm_level)); > // Always return the share's owner. > $owner = $this->get('owner'); > if ($owner && !in_array($owner, $results)) { > Horde::debug($owner); > $results[] = $owner; > } > return $results; > } > > And then it gets weird, because clearly a user which does not have > access to that calendar (the user 'lfbm') is added to the results > array: > >> 2016-02-18T19:10:43-02:00 DEBUG: Variable information: >> string(4) "lfbm" >> >> Backtrace: >> 1. Horde_Alarm->notify() /usr/bin/horde-alarms:26 >> 2. Horde_Alarm->listAlarms() /usr/share/php/Horde/Alarm.php:434 >> 3. call_user_func() /usr/share/php/Horde/Alarm.php:113 >> 4. Horde_Core_Factory_Alarm->load() >> 5. Horde_Registry->callAppMethod() >> /usr/share/php/Horde/Core/Factory/Alarm.php:170 >> 6. call_user_func_array() /usr/share/php/Horde/Registry.php:1192 >> 7. Kronolith_Application->listAlarms() >> 8. Horde_Share_Object->listUsers() >> /var/www/horde/kronolith/lib/Application.php:503 >> 9. Horde::debug() /usr/share/php/Horde/Share/Object.php:217 > > So this is why the variable $users inside > Kronolith_Application::listAlarms shows both 'robm' (the calendar > owner) and 'lfbm' users. And the 'lfbm' is me, who is getting the > notificatinos from the private 'robm' calendar. > > File: kronolith/lib/Application.php > > public function listAlarms($time, $user = null) > { > $current_user = $GLOBALS['registry']->getAuth(); > if ((empty($user) || $user != $current_user) && > !$GLOBALS['registry']->isAdmin()) { > throw new Horde_Exception_PermissionDenied(); > } > > $group = $GLOBALS['injector']->getInstance('Horde_Group'); > $kronolith_shares = > $GLOBALS['injector']->getInstance('Kronolith_Shares'); > > $alarm_list = array(); > $time = new Horde_Date($time); > $calendars = is_null($user) > ? array_keys($kronolith_shares->listAllShares()) > : > $GLOBALS['calendar_manager']->get(Kronolith::DISPLAY_CALENDARS); > $alarms = Kronolith::listAlarms($time, $calendars, true); > foreach ($alarms as $calendar => $cal_alarms) { > if (!$cal_alarms) { > continue; > } > try { > $share = $kronolith_shares->getShare($calendar); > } catch (Exception $e) { > continue; > } > if (empty($user)) { > $users = $share->listUsers(Horde_Perms::READ); > Horde::debug($users); > (...) > > > horde_debug.txt results: > >> 2016-02-18T19:25:55-02:00 DEBUG: Variable information: >> array(1) { >> [0]=> >> string(4) "robm" >> } >> >> Backtrace: >> 1. Horde_Alarm->notify() /usr/bin/horde-alarms:26 >> 2. Horde_Alarm->listAlarms() /usr/share/php/Horde/Alarm.php:434 >> 3. call_user_func() /usr/share/php/Horde/Alarm.php:113 >> 4. Horde_Core_Factory_Alarm->load() >> 5. Horde_Registry->callAppMethod() >> /usr/share/php/Horde/Core/Factory/Alarm.php:170 >> 6. call_user_func_array() /usr/share/php/Horde/Registry.php:1192 >> 7. Kronolith_Application->listAlarms() >> 8. Horde::debug() /var/www/horde/kronolith/lib/Application.php:504 >> >> 2016-02-18T19:25:55-02:00 DEBUG: Variable information: >> array(1) { >> [0]=> >> string(4) "lfbm" >> } >> >> Backtrace: >> 1. Horde_Alarm->notify() /usr/bin/horde-alarms:26 >> 2. Horde_Alarm->listAlarms() /usr/share/php/Horde/Alarm.php:434 >> 3. call_user_func() /usr/share/php/Horde/Alarm.php:113 >> 4. Horde_Core_Factory_Alarm->load() >> 5. Horde_Registry->callAppMethod() >> /usr/share/php/Horde/Core/Factory/Alarm.php:170 >> 6. call_user_func_array() /usr/share/php/Horde/Registry.php:1192 >> 7. Kronolith_Application->listAlarms() >> 8. Horde::debug() /var/www/horde/kronolith/lib/Application.php:504 >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers