// $g = $GLOBALS['ansel_storage']->getGallery($image->gallery);
// $pwd = $g->get('passwd');
// $no_agelimit = empty($GLOBALS['conf']['ages']['limits']) || $g->get('age') == 0;
-// if ($g->get('owner') == Horde_Auth::getAuth() && empty($pwd) && $no_agelimit) {
+// if (Horde_Auth::getAuth() && $g->get('owner') == Horde_Auth::getAuth() && empty($pwd) && $no_agelimit) {
// $perms[$image->gallery] = true;
// } else {
// $perms[$image->gallery] = false;
$page = Horde_Util::getFormData('page', 0);
$perpage = $prefs->getValue('facesperpage');
$owner = Horde_Util::getGet('owner', Horde_Auth::getAuth());
-if ($owner == Horde_Auth::getAuth()) {
+if (!$owner) {
+ $title = _("From system galleries");
+} elseif ($owner == Horde_Auth::getAuth()) {
$title = _("From my galleries");
} else {
- $title = sprintf(_("From galleries of %s"));
+ $title = sprintf(_("From galleries of %s"), $owner);
}
$count = $faces->countOwnerFaces($owner);
$gallery->set('age', $gallery_age);
$gallery->set('download', $gallery_download);
$gallery->set('view_mode', $gallery_mode);
- if ($gallery->get('owner') == Horde_Auth::getAuth()) {
+ if (Horde_Auth::getAuth() &&
+ $gallery->get('owner') == Horde_Auth::getAuth()) {
$gallery->set('passwd', $gallery_passwd);
}
$owner = $gallery->get('owner');
}
if (!empty($owner)) {
- if ($owner == Horde_Auth::getAuth()) {
+ if (!$owner) {
+ $owner_title = _("System Galleries");
+ } elseif ($owner == Horde_Auth::getAuth()) {
$owner_title = _("My Galleries");
} elseif (!empty($GLOBALS['conf']['gallery']['customlabel'])) {
$uprefs = Horde_Prefs::singleton($GLOBALS['conf']['prefs']['driver'],
$owners = array();
$galleries = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, null, null, false);
foreach ($galleries as $gallery) {
- $owners[$gallery->data['share_owner']] = true;
+ $owners[$gallery->data['share_owner'] ? $gallery->data['share_owner'] : '-system-'] = true;
}
$results = array();
'filter' => 's.share_owner = ' . $GLOBALS['ansel_db']->quote($owner),
'order' => 'f.face_id DESC');
- if ($owner != Horde_Auth::getAuth()) {
+ if (!Horde_Auth::getAuth() || $owner != Horde_Auth::getAuth()) {
$info['filter'] .= ' AND s.gallery_passwd IS NULL';
}
public function countOwnerFaces($owner)
{
$info = array('filter' => 's.share_owner = ' . $GLOBALS['ansel_db']->quote($owner));
- if ($owner != Horde_Auth::getAuth()) {
+ if (!Horde_Auth::getAuth() || $owner != Horde_Auth::getAuth()) {
$info['filter'] .= ' AND s.gallery_passwd IS NULL';
}
*/
public function canDownload()
{
- if (Horde_Auth::getAuth() == $this->data['share_owner'] || Horde_Auth::isAdmin('ansel:admin')) {
+ if (Horde_Auth::getAuth() &&
+ (Horde_Auth::getAuth() == $this->data['share_owner'] ||
+ Horde_Auth::isAdmin('ansel:admin'))) {
return true;
}
*/
public function isOldEnough()
{
- if ($this->data['share_owner'] == Horde_Auth::getAuth() ||
+ if ((Horde_Auth::getAuth() &&
+ $this->data['share_owner'] == Horde_Auth::getAuth()) ||
empty($GLOBALS['conf']['ages']['limits']) ||
empty($this->data['attribute_age'])) {
*/
public function hasPasswd()
{
- if (Horde_Auth::getAuth() == $this->get('owner') || Horde_Auth::isAdmin('ansel:admin')) {
+ if (Horde_Auth::getAuth() &&
+ (Horde_Auth::getAuth() == $this->get('owner') ||
+ Horde_Auth::isAdmin('ansel:admin'))) {
return false;
}
if (!is_a($gal, 'PEAR_Error')) {
$owner = $gal->get('owner');
if ($gal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) &&
- (!isset($user) || (isset($user) && $owner == $user))) {
+ (!isset($user) || (isset($user) && $owner && $owner == $user))) {
$imgs[] = $id;
}
} else {
Horde::logMessage($gallery, __FILE__, __LINE__, PEAR_LOG_ERR);
continue;
}
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) && (!isset($user) || (isset($user) && $gallery->get('owner') == $user))) {
+ if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) && (!isset($user) || (isset($user) && $gallery->get('owner') && $gallery->get('owner') == $user))) {
$results['galleries'][] = $id;
}
}
}
if ($num_galleries == 0 && empty($this->_params['api'])) {
- if ($filter == $owner && $owner == Horde_Auth::getAuth()) {
+ if ($owner && $filter == $owner && $owner == Horde_Auth::getAuth()) {
$notification->push(_("You have no photo galleries, add one!"),
'horde.message');
header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('gallery.php'), 'actionID', 'add'));
}
}
- if ($this->_view->gallery->get('owner') == Horde_Auth::getAuth()) {
+ if (Horde_Auth::getAuth() &&
+ $this->_view->gallery->get('owner') == Horde_Auth::getAuth()) {
$html .= '<li>' . Horde::link('#', '', 'popup widget', '', Horde::popupJs(Horde::applicationUrl('perms.php'), array('params' => array('cid' => $this->_view->gallery->id), 'urlencode' => true)) . 'return false;') . Horde::img('perms.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Set permissions") . '</a></li>';
} elseif (!empty($conf['report_content']['driver']) &&
(($conf['report_content']['allow'] == 'authenticated' && Horde_Auth::isAuthenticated()) ||
$feedurl = Horde::url('rss.php', true);
$owner = $this->_view->gallery->get('owner');
$html = $this->_htmlBegin();
- $html .= Horde::link(Ansel::getUrlFor('rss_user', array('owner' => $owner))) . Horde::img('feed.png', '', '', $registry->getImageDir('horde')) . ' ' . sprintf(_("Recent photos by %s"), $owner) . '</a>';
+ $html .= Horde::link(Ansel::getUrlFor('rss_user', array('owner' => $owner))) . Horde::img('feed.png', '', '', $registry->getImageDir('horde')) . ' ' . ($owner ? sprintf(_("Recent photos by %s"), $owner) : _("Recent system photos")) . '</a>';
$slug = $this->_view->gallery->get('slug');
$html .= '<br />' . Horde::link(Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))) . ' ' . Horde::img('feed.png', '', '', $registry->getImageDir('horde')) . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset())) . '</a>';
if (is_a($share, 'PEAR_Error')) {
$notification->push($share, 'horde.error');
- } elseif (isset($share) && Horde_Auth::getAuth() != $share->get('owner')) {
+ } elseif (!Horde_Auth::getAuth() ||
+ (isset($share) && Horde_Auth::getAuth() != $share->get('owner'))) {
exit('permission denied');
}
break;
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent share."), 'horde.error');
} else {
- if (Horde_Auth::getAuth() != $share->get('owner')) {
+ if (!Horde_Auth::getAuth() ||
+ Horde_Auth::getAuth() != $share->get('owner')) {
exit('permission denied');
}
$perm = &$share->getPermission();
</td>
</tr>
<?php } ?>
-<?php if (empty($gallery) || Horde_Auth::getAuth() == $gallery->get('owner')): ?>
+<?php if (Horde_Auth::getAuth() && !empty($gallery) && Horde_Auth::getAuth() == $gallery->get('owner')): ?>
<tr>
<td align="right" valign="top"><strong><?php echo _("Gallery Password") ?></strong> </td>
<td><input name="gallery_passwd" type="password" value="<?php echo htmlspecialchars($gallery_passwd) ?>" size="50" /></td>
if ($this->gallery->canDownload()) {
$actionHTML .= (empty($this->_params['api']) && $needSeperator ? ' | ' : '') . Horde::link($this->_urls['download'], '', '', '', '', '', '', array('id' => 'image_download_link')) . _("Download Original Photo"); $needSeperator = true . '</a>';
}
- if (empty($this->_params['api']) && $this->gallery->get('owner') != Horde_Auth::getAuth() &&
+ if (empty($this->_params['api']) &&
+ (!Horde_Auth::getAuth() ||
+ $this->gallery->get('owner') != Horde_Auth::getAuth()) &&
!empty($GLOBALS['conf']['report_content']['driver']) &&
- (($conf['report_content']['allow'] == 'authenticated' && Horde_Auth::isAuthenticated()) ||
+ (($conf['report_content']['allow'] == 'authenticated' &&
+ Horde_Auth::isAuthenticated()) ||
$conf['report_content']['allow'] == 'all')) {
$actionHTML .= ($needSeperator ? ' | ' : '' ) . Horde::link($this->_urls['report']) . _("Report") . '</a>';
}
// Only owners of a group can delete them
- if (Horde_Auth::getAuth() != $share->get('owner') &&
- !Horde_Auth::isAdmin('folks:admin')) {
+ if (!Horde_Auth::getAuth() ||
+ (Horde_Auth::getAuth() != $share->get('owner') &&
+ !Horde_Auth::isAdmin('folks:admin'))) {
return PEAR::raiseError("You can rename only your own groups.");
}
}
// Only owners of a group can delete them
- if (Horde_Auth::getAuth() != $share->get('owner') &&
- !Horde_Auth::isAdmin('folks:admin')) {
+ if (!Horde_Auth::getAuth() ||
+ (Horde_Auth::getAuth() != $share->get('owner') &&
+ !Horde_Auth::isAdmin('folks:admin'))) {
return PEAR::raiseError("You can delete only your own groups.");
}
}
if (is_a($share, 'PEAR_Error')) {
$notification->push($share, 'horde.error');
- } elseif (isset($share) && Horde_Auth::getAuth() != $share->get('owner')) {
+ } elseif (!Horde_Auth::getAuth() ||
+ (isset($share) && Horde_Auth::getAuth() != $share->get('owner'))) {
exit('permission denied');
}
break;
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent share."), 'horde.error');
} else {
- if (Horde_Auth::getAuth() != $share->get('owner')) {
+ if (!Horde_Auth::getAuth() ||
+ Horde_Auth::getAuth() != $share->get('owner')) {
exit('permission denied');
}
$perm = &$share->getPermission();
$rewrite = isset($conf['urls']['pretty']) &&
$conf['urls']['pretty'] == 'rewrite';
$subscribe_url = Horde::url($registry->get('webroot', 'horde') . ($rewrite ? '/rpc/kronolith/' : '/rpc.php/kronolith/'), true, -1)
- . $calendar->get('owner') . '/' . $calendar->getName() . '.ics';
+ . ($calendar->get('owner') ? $calendar->get('owner') : '-system-')
+ . '/' . $calendar->getName() . '.ics';
}
if (is_null($calendar)) {
// Calendars
foreach (array(true, false) as $my) {
foreach ($GLOBALS['all_calendars'] as $id => $calendar) {
- $owner = $calendar->get('owner') == Horde_Auth::getAuth();
+ $owner = Horde_Auth::getAuth() &&
+ $calendar->get('owner') == Horde_Auth::getAuth();
if (($my && $owner) || (!$my && !$owner)) {
$code['conf']['calendars']['internal'][$id] = array(
- 'name' => ($owner ? '' : '[' . Horde_Auth::convertUsername($calendar->get('owner'), false) . '] ')
+ 'name' => ($owner || !$calendar->get('owner') ? '' : '[' . Horde_Auth::convertUsername($calendar->get('owner'), false) . '] ')
. $calendar->get('name'),
'desc' => $calendar->get('desc'),
'owner' => $owner,
continue;
}
foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW) as $id => $tasklist) {
- $owner = $tasklist->get('owner') == Horde_Auth::getAuth();
+ $owner = Horde_Auth::getAuth() &&
+ $tasklist->get('owner') == Horde_Auth::getAuth();
if (($my && $owner) || (!$my && !$owner)) {
$code['conf']['calendars']['tasklists']['tasks/' . $id] = array(
- 'name' => ($owner ? '' : '[' . Horde_Auth::convertUsername($tasklist->get('owner'), false) . '] ')
+ 'name' => ($owner || !$tasklist->get('owner') ? '' : '[' . Horde_Auth::convertUsername($tasklist->get('owner'), false) . '] ')
. $tasklist->get('name'),
'desc' => $tasklist->get('desc'),
'owner' => $owner,
*/
public static function listCalendars($owneronly = false, $permission = Horde_Perms::SHOW)
{
+ if ($owneronly && !Horde_Auth::getAuth()) {
+ return array();
+ }
+
$calendars = $GLOBALS['kronolith_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
if (is_a($calendars, 'PEAR_Error')) {
Horde::logMessage($calendars, __FILE__, __LINE__, PEAR_LOG_ERR);
*/
public static function updateShare(&$calendar, $info)
{
- if ($calendar->get('owner') != Horde_Auth::getAuth()) {
+ if (!Horde_Auth::getAuth() ||
+ $calendar->get('owner') != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("You are not allowed to change this calendar."));
}
*/
public static function deleteShare($calendar)
{
- if ($calendar->getName() == Horde_Auth::getAuth()) {
- return PEAR::raiseError(_("This calendar cannot be deleted."));
+ if (!Horde_Auth::getAuth() ||
+ $calendar->get('owner') != Horde_Auth::getAuth()) {
+ return PEAR::raiseError(_("You are not allowed to delete this calendar."));
}
- if ($calendar->get('owner') != Horde_Auth::getAuth()) {
- return PEAR::raiseError(_("You are not allowed to delete this calendar."));
+ if ($calendar->getName() == Horde_Auth::getAuth()) {
+ return PEAR::raiseError(_("This calendar cannot be deleted."));
}
// Delete the calendar.
$from = $identity->getDefaultFromAddress(true);
$owner = $share->get('owner');
- $recipients[$owner] = self::_notificationPref($owner, 'owner');
+ if ($owner) {
+ $recipients[$owner] = self::_notificationPref($owner, 'owner');
+ }
foreach ($share->listUsers(Horde_Perms::READ) as $user) {
if (!isset($recipients[$user])) {
$filter['calendar'] = array($filter['calendar']);
}
foreach ($filter['calendar'] as $calendar) {
- $owners[] = $GLOBALS['all_calendars'][$calendar]->get('owner');
+ if ($GLOBALS['all_calendars'][$calendar]->get('owner')) {
+ $owners[] = $GLOBALS['all_calendars'][$calendar]->get('owner');
+ }
}
$args = array('tagId' => self::$_tagger->ensureTags($tags),
'userId' => $owners,
}
if (is_a($share, 'PEAR_Error')) {
$notification->push($share, 'horde.error');
- } elseif (isset($share) && Horde_Auth::getAuth() != $share->get('owner')) {
+ } elseif (!Horde_Auth::getAuth() ||
+ (isset($share) && Horde_Auth::getAuth() != $share->get('owner'))) {
exit('permission denied');
}
break;
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent share."), 'horde.error');
} else {
- if (Horde_Auth::getAuth() != $share->get('owner')) {
+ if (!Horde_Auth::getAuth() ||
+ Horde_Auth::getAuth() != $share->get('owner')) {
exit('permission denied');
}
$perm = &$share->getPermission();
$current_user = Horde_Auth::getAuth();
$calendars = array();
foreach (Kronolith::listCalendars(false, Horde_Perms::READ) as $id => $cal) {
- if ($cal->get('owner') == $current_user) {
+ if ($cal->get('owner') && $cal->get('owner') == $current_user) {
$calendars[_("My Calendars:")]['|' . $id] = $cal->get('name');
} else {
$calendars[_("Shared Calendars:")]['|' . $id] = $cal->get('name');
<p><em><?php echo htmlspecialchars($desc) ?></em></p>
<?php endif; ?>
<p>
- <?php printf(_("Local calendar owned by %s."), Kronolith::getUserName($calendar->get('owner'))) ?>
+ <?php echo $calendar->get('owner') ? sprintf(_("Local calendar owned by %s."), Kronolith::getUserName($calendar->get('owner'))) : _("Local system calendar") ?>
<?php echo _("To subscribe to this calendar from another calendar program, use this URL:") ?>
</p>
<p class="calendar-info-url">
<td><?php echo htmlspecialchars($calendar->get('name')) ?></td>
<td><?php echo _("Local") ?></td>
<td><?php $url = Horde_Util::addParameter($display_url_base, 'display_cal', $calendar->getName(), false); echo Horde::link($url, _("Click or copy this URL to display this calendar")) . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
- <td><?php $url = $subscribe_url_base . $calendar->get('owner') . '/' . $calendar->getName() . '.ics'; echo Horde::link($url, _("Click or copy this URL to display this calendar"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
+ <td><?php $url = $subscribe_url_base . ($calendar->get('owner') ? $calendar->get('owner') : '-system-') . '/' . $calendar->getName() . '.ics'; echo Horde::link($url, _("Click or copy this URL to display this calendar"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
<td><?php echo Horde::link(Horde_Util::addParameter($edit_url_base, 'c', $calendar->getName()), _("Edit")) . $edit_img . '</a>' ?></td>
<?php if (empty($conf['share']['no_sharing'])): ?>
<td><?php echo Horde::link(Horde_Util::addParameter($perms_url_base, 'share', $calendar->getName()), _("Change Permissions"), '', '_blank', Horde::popupJs($perms_url_base, array('params' => array('share' => $calendar->getName()), 'urlencode' => true)) . 'return false;') . $perms_img . '</a>' ?></td>
$my_calendars = array();
$shared_calendars = array();
foreach (Kronolith::listCalendars() as $id => $cal) {
- if ($cal->get('owner') == $current_user) {
+ if ($cal->get('owner') && $cal->get('owner') == $current_user) {
$my_calendars[$id] = $cal;
} else {
$shared_calendars[$id] = $cal;
<h4><?php echo _("Shared Calendars:") ?></h4>
<ul id="sharedcalendars">
<?php foreach ($shared_calendars as $id => $cal): ?>
- <li<?php echo Kronolith::getCSSColors($cal) ?>><label><input type="checkbox" class="checkbox" name="display_cal[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_calendars) ? ' checked="checked"' : '') . ' /> [' . htmlspecialchars(Horde_Auth::convertUsername($cal->get('owner'), false)) . '] ' . htmlspecialchars($cal->get('name')) ?></label> <?php echo $info_img ?></li>
+ <li<?php echo Kronolith::getCSSColors($cal) ?>><label><input type="checkbox" class="checkbox" name="display_cal[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_calendars) ? ' checked="checked"' : '') . ' /> ' . ($cal->get('owner') ? '[' . htmlspecialchars(Horde_Auth::convertUsername($cal->get('owner'), false)) . '] ' : '') . htmlspecialchars($cal->get('name')) ?></label> <?php echo $info_img ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
$tasklists = Nag::listTasklists(false, Horde_Perms::READ);
$owners = array();
foreach ($tasklists as $tasklist) {
- $owners[$tasklist->get('owner')] = true;
+ $owners[$tasklist->get('owner') ? $tasklist->get('owner') : '-system-'] = true;
}
$results = array();
*/
function listTasklists($owneronly = false, $permission = Horde_Perms::SHOW)
{
+ if ($owneronly && !Horde_Auth::getAuth()) {
+ return array();
+ }
$tasklists = $GLOBALS['nag_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
if (is_a($tasklists, 'PEAR_Error')) {
Horde::logMessage($tasklists, __FILE__, __LINE__, PEAR_LOG_ERR);
*/
public static function updateTasklist(&$tasklist, $info)
{
- if ($tasklist->get('owner') != Horde_Auth::getAuth()) {
+ if (!Horde_Auth::getAuth() ||
+ $tasklist->get('owner') != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("You are not allowed to change this task list."));
}
return PEAR::raiseError(_("This task list cannot be deleted."));
}
- if ($tasklist->get('owner') != Horde_Auth::getAuth()) {
+ if (!Horde_Auth::getAuth() ||
+ $tasklist->get('owner') != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("You are not allowed to delete this task list."));
}
$from = $identity->getDefaultFromAddress(true);
$owner = $share->get('owner');
- $recipients[$owner] = Nag::_notificationPref($owner, 'owner');
+ if (strlen($owner)) {
+ $recipients[$owner] = Nag::_notificationPref($owner, 'owner');
+ }
foreach ($share->listUsers(Horde_Perms::READ) as $user) {
if (empty($recipients[$user])) {
}
$subscribe_url = Horde::url($registry->get('webroot', 'horde') . '/rpc.php/nag/', true, -1)
- . $tasklist->get('owner') . '/' . $tasklist->getName() . '.ics';
+ . ($tasklist->get('owner') ? $tasklist->get('owner') : '')
+ . '/' . $tasklist->getName() . '.ics';
$identity = Horde_Prefs_Identity::singleton('none', $tasklist->get('owner'));
$owner_name = $identity->getValue('fullname');
$my_tasklists = array();
$shared_tasklists = array();
foreach (Nag::listTasklists() as $id => $tl) {
- if ($tl->get('owner') == $current_user) {
+ if ($tl->get('owner') && $tl->get('owner') == $current_user) {
$my_tasklists[$id] = $tl;
} else {
$shared_tasklists[$id] = $tl;
<h4><?php echo _("Shared Task Lists:") ?></h4>
<ul id="sharedtasklists">
<?php foreach ($shared_tasklists as $id => $tl): ?>
- <li><label><input type="checkbox" class="checkbox" name="display_tasklist[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_tasklists) ? ' checked="checked"' : '') . ' /> [' . htmlspecialchars(Horde_Auth::convertUsername($tl->get('owner'), false)) . '] ' . htmlspecialchars($tl->get('name')) ?></label> <?php echo $info_img ?></li>
+ <li><label><input type="checkbox" class="checkbox" name="display_tasklist[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_tasklists) ? ' checked="checked"' : '') . ' /> ' . ($tl->get('owner') ? '[' . htmlspecialchars(Horde_Auth::convertUsername($tl->get('owner'), false)) . '] ' : '') . htmlspecialchars($tl->get('name')) ?></label> <?php echo $info_img ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<p><em><?php echo htmlspecialchars($desc) ?></em></p>
<?php endif; ?>
<p>
- <?php printf(_("Task List owned by %s."), $owner_name) ?>
+ <?php echo $owner_name ? sprintf(_("Task List owned by %s."), $owner_name) : _("Task List owned by system.") ?>
<?php echo _("To subscribe to this task list from another program, use this URL: ") ?>
</p>
<p class="tasklist-info-url">
<tr>
<td><?php echo htmlspecialchars($tasklist->get('name')) ?></td>
<td><?php $url = Horde_Util::addParameter($display_url_base, 'display_cal', $tasklist->getName(), false); echo Horde::link($url, _("Click or copy this URL to display this task list"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
- <td><?php $url = $subscribe_url_base . $tasklist->get('owner') . '/' . $tasklist->getName() . '.ics'; echo Horde::link($url, _("Click or copy this URL to display this task list"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
+ <td><?php $url = $subscribe_url_base . ($tasklist->get('owner') ? $tasklist->get('owner') : '-system-') . '/' . $tasklist->getName() . '.ics'; echo Horde::link($url, _("Click or copy this URL to display this task list"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '</a>' ?></td>
<td><?php echo Horde::link(Horde_Util::addParameter($edit_url_base, 't', $tasklist->getName()), _("Edit")) . $edit_img . '</a>' ?></td>
<?php if (empty($conf['share']['no_sharing'])): ?>
<td><?php echo Horde::link(Horde_Util::addParameter($perms_url_base, 'share', $tasklist->getName()), _("Change Permissions"), '', '_blank', Horde::popupJs($perms_url_base, array('params' => array('share' => $tasklist->getName()), 'urlencode' => true)) . 'return false;') . $perms_img . '</a>' ?></td>
return false;
}
- if ($this->_class->get('owner') != Horde_Auth::getAuth()) {
+ if (!Horde_Auth::getAuth() ||
+ $this->_class->get('owner') != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("Permission denied"));
}
*/
function listClasses($owneronly = false, $permission = Horde_Perms::SHOW)
{
- global $registry;
+ if ($owneronly && !Horde_Auth::getAuth()) {
+ return array();
+ }
$classes = $GLOBALS['skoli_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
if (is_a($classes, 'PEAR_Error')) {
}
// Check if we have access to the attached addressbook.
- $addressbooks = $registry->call('contacts/sources');
+ $addressbooks = $GLOBALS['registry']->call('contacts/sources');
foreach ($classes as $key=>$val) {
if (!isset($addressbooks[$val->get('address_book')])) {
unset($classes[$key]);
$my_classes = array();
$shared_classes = array();
foreach (Skoli::listClasses() as $id => $cl) {
- if ($cl->get('owner') == $current_user) {
+ if ($cl->get('owner') && $cl->get('owner') == $current_user) {
$my_classes[$id] = $cl;
} else {
$shared_classes[$id] = $cl;
<h4><?php echo _("Shared Classes:") ?></h4>
<ul id="sharedclasses">
<?php foreach ($shared_classes as $id => $cl): ?>
- <li><label><input type="checkbox" class="checkbox" name="display_class[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_classes) ? ' checked="checked"' : '') . ' /> [' . htmlspecialchars(Horde_Auth::convertUsername($cl->get('owner'), false)) . '] ' . htmlspecialchars($cl->get('name')) ?></label></li>
+ <li><label><input type="checkbox" class="checkbox" name="display_class[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_classes) ? ' checked="checked"' : '') . ' /> ' . ($cl->get('owner') ? '[' . htmlspecialchars(Horde_Auth::convertUsername($cl->get('owner'), false)) . '] ' : '') . htmlspecialchars($cl->get('name')) ?></label></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
$notification->push($addressbook, 'horde.error');
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
exit;
-} elseif ($addressbook->get('owner') != Horde_Auth::getAuth()) {
+} elseif (!Horde_Auth::getAuth() ||
+ $addressbook->get('owner') != Horde_Auth::getAuth()) {
$notification->push(_("You are not allowed to delete this addressbook."), 'horde.error');
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
exit;
$notification->push($addressbook, 'horde.error');
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
exit;
-} elseif ($addressbook->get('owner') != Horde_Auth::getAuth()) {
+} elseif (!Horde_Auth::getAuth() ||
+ $addressbook->get('owner') != Horde_Auth::getAuth()) {
$notification->push(_("You are not allowed to change this addressbook."), 'horde.error');
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
exit;
return false;
}
- if ($this->_addressbook->get('owner') != Horde_Auth::getAuth()) {
+ if (!Horde_Auth::getAuth() ||
+ $this->_addressbook->get('owner') != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("You do not have permissions to delete this address book."));
}
// No backends are configured to provide shares
return array();
}
+ if ($owneronly && !Horde_Auth::getAuth()) {
+ return array();
+ }
$sources = $GLOBALS['turba_shares']->listShares(
Horde_Auth::getAuth(), $permission,