/* Thread list, if applicable. */
if (isset($GLOBALS['forum_id'])) {
$menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::applicationUrl('threads.php')), _("_Threads"), 'threads.png', Horde_Themes::img());
- if ($scope == 'agora' && Horde_Auth::getAuth()) {
+ if ($scope == 'agora' && $GLOBALS['registry']->getAuth()) {
$menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::applicationUrl('messages/edit.php')), _("New Thread"), 'newmessage.png', Horde_Themes::img());
}
}
global $conf;
if (!parent::validate($vars, $canAutoFill)) {
- if (!Horde_Auth::getAuth() && !empty($conf['forums']['captcha'])) {
+ if (!$GLOBALS['registry']->getAuth() && !empty($conf['forums']['captcha'])) {
$vars->remove('captcha');
$this->removeVariable($varname = 'captcha');
$this->insertVariableBefore('newcomment', _("Spam protection"), 'captcha', 'figlet', true, null, null, array(Agora::getCAPTCHA(true), $conf['forums']['figlet_font']));
. 'message_timestamp, message_modifystamp, ip) '
. ' VALUES (?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?)';
- $author = Horde_Auth::getAuth() ? Horde_Auth::getAuth() : $info['posted_by'];
+ $author = $GLOBALS['registry']->getAuth() ? $GLOBALS['registry']->getAuth() : $info['posted_by'];
$info['message_id'] = $this->_write_db->nextId('agora_messages');
$params = array($info['message_id'],
$this->_forum_id,
/* Check permissions */
if ($GLOBALS['registry']->isAdmin(array('permission' => 'agora:admin')) ||
($GLOBALS['injector']->getInstance('Horde_Perms')->exists('agora:forums:' . $this->_scope) &&
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('agora:forums:' . $this->_scope, Horde_Auth::getAuth(), Horde_Perms::DELETE))) {
+ $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('agora:forums:' . $this->_scope, $GLOBALS['registry']->getAuth(), Horde_Perms::DELETE))) {
$sql .= ' AND scope = ? ';
$params[] = $this->_scope;
} else {
// Get only author forums
$sql .= ' AND scope = ? AND author = ?';
$params[] = $this->_scope;
- $params[] = Horde_Auth::getAuth();
+ $params[] = $GLOBALS['registry']->getAuth();
}
/* Get moderate forums and their names */
$form->addHidden('', 'message_id', 'int', false);
$form->addHidden('', 'message_parent_id', 'int', false);
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
$form->addVariable(_("From"), 'posted_by', 'text', true);
}
$form->addVariable(_("Attachment"), 'message_attachment', 'file', false);
}
- if (!empty($conf['forums']['captcha']) && !Horde_Auth::getAuth()) {
+ if (!empty($conf['forums']['captcha']) && !$GLOBALS['registry']->getAuth()) {
$form->addVariable(_("Spam protection"), 'captcha', 'figlet', true, null, null, array(Agora::getCAPTCHA(!$form->isSubmitted()), $conf['forums']['figlet_font']));
}
}
$moderate = array();
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
$edit_url = Horde::applicationUrl('messages/edit.php');
$editforum_url = Horde::applicationUrl('editforum.php');
$delete_url = Horde::applicationUrl('deleteforum.php');
{
if (empty($info['forum_id'])) {
if (empty($info['author'])) {
- $info['author'] = Horde_Auth::getAuth();
+ $info['author'] = $GLOBALS['registry']->getAuth();
}
$info['forum_id'] = $this->newForum($info['forum_name'], $info['author']);
if ($info['forum_id'] instanceof PEAR_Error) {
public function hasPermission($perm = Horde_Perms::READ, $forum_id = null, $scope = null)
{
// Allow all admins
- if (($forum_id === null && isset($this->_forum['author']) && $this->_forum['author'] == Horde_Auth::getAuth()) ||
+ if (($forum_id === null && isset($this->_forum['author']) && $this->_forum['author'] == $GLOBALS['registry']->getAuth()) ||
$GLOBALS['registry']->isAdmin(array('permission' => 'agora:admin'))) {
return true;
}
return ($perm & Horde_Perms::DELETE) ? false : true;
}
- return $perms->hasPermission('agora:forums:' . $scope, Horde_Auth::getAuth(), $perm) ||
- $perms->hasPermission('agora:forums:' . $scope . ':' . $forum_id, Horde_Auth::getAuth(), $perm);
+ return $perms->hasPermission('agora:forums:' . $scope, $GLOBALS['registry']->getAuth(), $perm) ||
+ $perms->hasPermission('agora:forums:' . $scope . ':' . $forum_id, $GLOBALS['registry']->getAuth(), $perm);
}
/**
$mail = new Horde_Mime_Mail(array(
'subject' => sprintf(_("Message %s reported as abuse"),
$message_id),
- 'body' => $url . "\n\n" . Horde_Auth::getAuth() . "\n\n" . $_SERVER["REMOTE_ADDR"],
+ 'body' => $url . "\n\n" . $registry->getAuth() . "\n\n" . $_SERVER["REMOTE_ADDR"],
'to' => $emails,
'from' => $emails[0],
'charset' => Horde_Nls::getCharset()));
/* Default to agora and current user if is not an admin. */
$scope = Horde_Util::getGet('scope', 'agora');
-$owner = $registry->isAdmin() ? Horde_Util::getGet('owner', Horde_Auth::getAuth()) : Horde_Auth::getAuth();
+$owner = $registry->isAdmin() ? Horde_Util::getGet('owner', $registry->getAuth()) : $registry->getAuth();
/* Get the sorting. */
$sort_by = Agora::getSortBy('threads');
*/
// public function user_age()
// {
-// $query = 'SELECT age FROM user WHERE user_uid = ' . $GLOBALS['ansel_db']->quote(Horde_Auth::getAuth());
+// $query = 'SELECT age FROM user WHERE user_uid = ' . $GLOBALS['ansel_db']->quote($GLOBALS['registry']->getAuth());
// $result = $GLOBALS['ansel_db']->queryOne($query);
// if (is_a($result, 'PEAR_Error')) {
// throw new Horde_Exception_Prior($result);
// $g = $GLOBALS['ansel_storage']->getGallery($image->gallery);
// $pwd = $g->get('passwd');
// $no_agelimit = empty($GLOBALS['conf']['ages']['limits']) || $g->get('age') == 0;
-// if (Horde_Auth::getAuth() && $g->get('owner') == Horde_Auth::getAuth() && empty($pwd) && $no_agelimit) {
+// if ($GLOBALS['registry']->getAuth() && $g->get('owner') == $GLOBALS['registry']->getAuth() && empty($pwd) && $no_agelimit) {
// $perms[$image->gallery] = true;
// } else {
// $perms[$image->gallery] = false;
/* If we have a single gallery, check perms now */
if (!empty($gallery_id)) {
$gallery = $ansel_storage->getGallery($gallery_id);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("You are not allowed to edit these photos."), 'horde.error');
echo Horde::wrapInlineScript(array(
'window.opener.location.href = window.opener.location.href;',
if (empty($gallery_id)) {
// Images might be from different galleries
$gallery = $ansel_storage->getGallery($image->gallery);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
continue;
}
}
}
$gallery = $ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("Access denied editing the photo."));
header('Location: ' . Ansel::getUrlFor('view', array('gallery' => $image->gallery)));
exit;
$name = Horde_Util::getFormData('name');
if ($face_id) {
- $faces = $GLOBALS['injector']->getInstance('Ansel_Faces');
+ $faces = $injector->getInstance('Ansel_Faces');
try {
$face = $faces->getFaceById($face_id, true);
$x1 = $face['face_x1'];
header('Location: ' . Ansel::getUrlFor('view', array('gallery' => $gallery_id)));
exit;
}
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied editing gallery \"%s\"."), $gallery->get('name')), 'horde.error');
header('Location: ' . Ansel::getUrlFor('view', array('gallery' => $gallery_id)));
exit;
$reloadimage = Horde::img('reload.png');
$customimage = Horde::img('layout.png');
$customurl = Horde::applicationUrl('faces/custom.php')->add('page', $page);
-$face = $GLOBALS['injector']->getInstance('Ansel_Faces');
+$face = $injector->getInstance('Ansel_Faces');
$autogenerate = $face->canAutogenerate();
$vars = Horde_Variables::getDefaultVariables();
$image = &$ansel_storage->getImage($image_id);
$gallery = &$ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception('Access denied editing the photo.');
}
-$faces = $GLOBALS['injector']->getInstance('Ansel_Faces');
+$faces = $injector->getInstance('Ansel_Faces');
$result = $faces->setName($face_id, $name);
exit;
}
- $path = $tmp . '/search_face_' . Horde_Auth::getAuth() . Ansel_Faces::getExtension();
+ $path = $tmp . '/search_face_' . $registry->getAuth() . Ansel_Faces::getExtension();
if (file_put_contents($path, $img->raw())) {
header('Location: ' . Horde::applicationUrl('faces/search/image_define.php'));
} else {
/* check if image exists */
$tmp = Horde::getTempDir();
-$path = $tmp . '/search_face_' . Horde_Auth::getAuth() . Ansel_Faces::getExtension();
+$path = $tmp . '/search_face_' . $registry->getAuth() . Ansel_Faces::getExtension();
if (file_exists($path) !== true) {
$notification->push(_("You must upload the search photo first"));
/* Check if image exists. */
$tmp = Horde::getTempDir();
-$path = $tmp . '/search_face_' . Horde_Auth::getAuth() . Ansel_Faces::getExtension();
+$path = $tmp . '/search_face_' . $registry->getAuth() . Ansel_Faces::getExtension();
if (!file_exists($path)) {
$notification->push(_("You must upload the search photo first"));
}
/* Save image. */
-$path = $tmp . '/search_face_thumb_' . Horde_Auth::getAuth() . Ansel_Faces::getExtension();
+$path = $tmp . '/search_face_thumb_' . $registry->getAuth() . Ansel_Faces::getExtension();
if (!file_put_contents($path, $img->raw())) {
$notification->push(_("Cannot store search photo"));
header('Location: ' . Horde::applicationUrl('faces/search/image.php'));
}
/* Save signature. */
-$path = $tmp . '/search_face_' . Horde_Auth::getAuth() . '.sig';
+$path = $tmp . '/search_face_' . $registry->getAuth() . '.sig';
if (file_put_contents($path, $signature)) {
header('Location: ' . Horde::applicationUrl('faces/search/image.php'));
exit;
}
} else {
$tmp = Horde::getTempDir();
- $path = $tmp . '/search_face_' . Horde_Auth::getAuth() . '.sig';
+ $path = $tmp . '/search_face_' . $registry->getAuth() . '.sig';
if (file_exists($path) !== true) {
$notification->push(_("You must upload the search photo first"));
header('Location: ' . Horde::applicationUrl('faces/search/image.php'));
$thumb = Horde_Util::getGet('thumb');
$tmp = Horde::getTempDir();
-$path = $tmp . '/search_face_' . ($thumb ? 'thumb_' : '') . Horde_Auth::getAuth() . Ansel_Faces::getExtension();
+$path = $tmp . '/search_face_' . ($thumb ? 'thumb_' : '') . $registry->getAuth() . Ansel_Faces::getExtension();
header('Content-type: image/' . $conf['image']['type']);
readfile($path);
$page = Horde_Util::getFormData('page', 0);
$perpage = $prefs->getValue('facesperpage');
-$owner = Horde_Util::getGet('owner', Horde_Auth::getAuth());
+$owner = Horde_Util::getGet('owner', $GLOBALS['registry']->getAuth());
if (!$owner) {
$title = _("From system galleries");
-} elseif ($owner == Horde_Auth::getAuth()) {
+} elseif ($owner == $GLOBALS['registry']->getAuth()) {
$title = _("From my galleries");
} else {
$title = sprintf(_("From galleries of %s"), $owner);
exit;
}
- if (!$parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$parent->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied adding a gallery to \"%s\"."),
$parent->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('view.php?view=List', true));
case 'downloadzip':
$galleryId = Horde_Util::getFormData('gallery');
$gallery = $ansel_storage->getGallery($galleryId);
- if (!Horde_Auth::getAuth() ||
- !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if (!$registry->getAuth() ||
+ !$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
$notification->push(sprintf(_("Access denied downloading photos from \"%s\"."), $gallery->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('view.php?view=List', true));
// Check general permissions.
if (!$registry->isAdmin() &&
($injector->getInstance('Horde_Perms')->exists('ansel') &&
- !$injector->getInstance('Horde_Perms')->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT))) {
+ !$injector->getInstance('Horde_Perms')->hasPermission('ansel', $registry->getAuth(), Horde_Perms::EDIT))) {
$notification->push(_("Access denied editing galleries."), 'horde.error');
header('Location: ' . Horde::applicationUrl('view.php?view=List', true));
exit;
// Modifying an existing gallery.
$gallery = $ansel_storage->getGallery($galleryId);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving gallery \"%s\"."), $gallery->get('name')), 'horde.error');
} else {
// Don't allow the display name to be nulled out.
$gallery->set('age', $gallery_age);
$gallery->set('download', $gallery_download);
$gallery->set('view_mode', $gallery_mode);
- if (Horde_Auth::getAuth() &&
- $gallery->get('owner') == Horde_Auth::getAuth()) {
+ if ($registry->getAuth() &&
+ $gallery->get('owner') == $registry->getAuth()) {
$gallery->set('passwd', $gallery_passwd);
}
header('Location: ' . Horde::applicationUrl(Ansel::getUrlFor('view', array('view' => 'List'), true)));
exit;
}
- if (!$parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$parent->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(
_("You do not have permission to add children to %s."),
$parent->get('name')), 'horde.error');
exit;
}
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied setting captions for %s."), $gallery->get('name')), 'horde.error');
header('Location: ' . Ansel::getUrlFor('view', array('view' => 'List'), true));
exit;
}
switch ($actionID) {
case 'delete':
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::DELETE)) {
$notification->push(sprintf(_("Access denied deleting gallery \"%s\"."),
$gallery->get('name')), 'horde.error');
} else {
}
// Clear the OtherGalleries widget cache
- if ($GLOBALS['conf']['ansel_cache']['usecache']) {
- $GLOBALS['injector']->getInstance('Horde_Cache')->expire('Ansel_OtherGalleries' . $gallery->get('owner'));
+ if ($conf['ansel_cache']['usecache']) {
+ $injector->getInstance('Horde_Cache')->expire('Ansel_OtherGalleries' . $gallery->get('owner'));
}
// Return to the default view.
exit;
case 'empty':
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::DELETE)) {
$notification->push(sprintf(_("Access denied deleting gallery \"%s\"."),
$gallery->get('name')),
'horde.error');
exit;
}
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied editing gallery \"%s\"."), $gallery->get('name')), 'horde.error');
header('Location: ' . Ansel::getUrlFor('view', array('view' => 'List'), true));
exit;
$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (empty($name)) {
- $name = Horde_Auth::getAuth();
+ $name = $registry->getAuth();
}
// Set up array of possible substitutions.
$watermark_array = array('%N' => $name, // User's fullname.
- '%L' => Horde_Auth::getAuth()); // User login.
+ '%L' => $registry->getAuth()); // User login.
$watermark = str_replace(array_keys($watermark_array),
array_values($watermark_array), $watermark);
$watermark = strftime($watermark);
case 'saveclose':
case 'save':
$title = _("Save Photo");
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving photo to \"%s\"."), $gallery->get('name')),
'horde.error');
$imageurl = Ansel::getUrlFor('view', array_merge(
/* See if we were replacing photo */
if (!empty($info['file0']['file'])) {
try {
- $GLOBALS['browser']->wasFileUploaded('file0');
+ $browser->wasFileUploaded('file0');
if (filesize($info['file0']['file'])) {
/* Read in the uploaded data. */
$data = file_get_contents($info['file0']['file']);
'slug' => $gallery->get('slug')),
$date));
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("Access denied editing the photo."),
'horde.error');
exit;
case 'watermark':
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving photo to \"%s\"."),
$gallery->get('name')),
'horde.error');
case 'grayscale':
case 'crop':
case 'resize':
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving photo to \"%s\"."),
$gallery->get('name')),
'horde.error');
/* Delete the images if we're provided with a valid image ID. */
if (count($images)) {
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::DELETE)) {
$notification->push(sprintf(_("Access denied deleting photos from \"%s\"."), $gallery->get('name')), 'horde.error');
} else {
foreach ($images as $image) {
$galleryId = Horde_Util::getFormData('gallery');
if ($galleryId) {
$gallery = $ansel_storage->getGallery($galleryId);
- if (!Horde_Auth::getAuth() ||
- !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) ||
+ if (!$registry->getAuth() ||
+ !$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ) ||
$gallery->hasPasswd() || !$gallery->isOldEnough()) {
$notification->push(sprintf(_("Access denied downloading photos from \"%s\"."), $gallery->get('name')), 'horde.error');
case 'previewcrop':
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("Access denied editing the photo."), 'horde.error');
$imageurl = Ansel::getUrlFor(
'view', array('gallery' => $gallery_id,
exit;
case 'imagecrop':
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$params = Horde_Util::getFormData('params');
list($x1, $y1, $x2, $y2) = explode('.', $params);
$image = &$ansel_storage->getImage($image_id);
$image = $ansel_storage->getImage(Horde_Util::getFormData('image'));
$gallery = $ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) || !$gallery->canDownload()) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ) || !$gallery->canDownload()) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."), __FILE__, __LINE__);
}
$image->downloadHeaders();
/* Sendfile support. Lighttpd < 1.5 only understands the X-LIGHTTPD-send-file header */
if ($conf['vfs']['src'] == 'sendfile') {
- $filename = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('full'), $image->getVFSName('full'));
+ $filename = $injector->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('full'), $image->getVFSName('full'));
header('Content-Type: ' . $image->getType('full'));
header('X-LIGHTTPD-send-file: ' . $filename);
header('X-Sendfile: ' . $filename);
$image = $ansel_storage->getImage(Horde_Util::getFormData('image'));
$gallery = $ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) || !$gallery->canDownload()) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ) || !$gallery->canDownload()) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
}
/* Sendfile support. Lighttpd < 1.5 only understands the X-LIGHTTPD-send-file header */
if ($conf['vfs']['src'] == 'sendfile') {
- $filename = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('full'), $image->getVFSName('full'));
+ $filename = $injector->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('full'), $image->getVFSName('full'));
header('Content-Type: ' . $image->getType('full'));
header('X-LIGHTTPD-send-file: ' . $filename);
header('X-Sendfile: ' . $filename);
$image = &$ansel_storage->getImage(Horde_Util::getFormData('image'));
$gallery = $ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
}
/* Sendfile support. Lighttpd < 1.5 only understands the X-LIGHTTPD-send-file header */
if ($conf['vfs']['src'] == 'sendfile') {
- $filename = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('screen'), $image->getVFSName('screen'));
+ $filename = $injector->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('screen'), $image->getVFSName('screen'));
header('Content-Type: ' . $image->getType('screen'));
header('X-LIGHTTPD-send-file: ' . $filename);
header('X-Sendfile: ' . $filename);
$image = $ansel_storage->getImage(Horde_Util::getFormData('image'));
$gallery = $ansel_storage->getGallery(abs($image->gallery));
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
}
Horde::logMessage($e, 'ERR');
exit;
}
- $filename = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('mini'), $image->getVFSName('mini'));
+ $filename = $injector->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('mini'), $image->getVFSName('mini'));
header('Content-Type: ' . $image->getType('mini'));
header('X-LIGHTTPD-send-file: ' . $filename);
header('X-Sendfile: ' . $filename);
$style = Horde_Util::getFormData('style');
$image = $ansel_storage->getImage(Horde_Util::getFormData('image'));
$gallery = $ansel_storage->getGallery(abs($image->gallery));
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
}
Horde::logMessage($e, 'ERR');
exit;
}
- $filename = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('prettythumb', $style), $image->getVFSName('prettythumb'));
+ $filename = $injector->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('prettythumb', $style), $image->getVFSName('prettythumb'));
header('Content-Type: ' . $image->getType('prettythumb'));
header('X-LIGHTTPD-send-file: ' . $filename);
header('X-Sendfile: ' . $filename);
$image = &$ansel_storage->getImage(Horde_Util::getFormData('image'));
$gallery = $ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
}
Horde::logMessage($result, 'ERR');
exit;
}
- $filename = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('screen'), $image->getVFSName('screen'));
+ $filename = $injector->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('screen'), $image->getVFSName('screen'));
header('Content-Type: ' . $image->getType('screen'));
header('X-LIGHTTPD-send-file: ' . $filename);
header('X-Sendfile: ' . $filename);
$image = $ansel_storage->getImage(Horde_Util::getFormData('image'));
$gallery = $ansel_storage->getGallery(abs($image->gallery));
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
}
Horde::logMessage($result, 'ERR');
exit;
}
- $filename = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('thumb'), $image->getVFSName('thumb'));
+ $filename = $injector->getInstance('Horde_Vfs')->getVfs('images')->readFile($image->getVFSPath('thumb'), $image->getVFSName('thumb'));
header('Content-Type: ' . $image->getType('thumb'));
header('X-LIGHTTPD-send-file: ' . $filename);
header('X-Sendfile: ' . $filename);
require_once dirname(__FILE__) . '/../lib/Application.php';
Horde_Registry::appInit('ansel');
$gallery = $ansel_storage->getGallery((int)Horde_Util::getFormData('gallery'));
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied();
}
public function handle($args, $post)
{
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
/* Are we requesting the unformatted text? */
if (!empty($args['action']) && $args['action'] == 'load') {
$id = $args['id'];
$id = $args['id'];
$image = $GLOBALS['ansel_storage']->getImage($id);
$g = $GLOBALS['ansel_storage']->getGallery($image->gallery);
- if ($g->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($g->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$image->caption = $pref_value;
try {
$result = $image->save();
function handle($args, $post)
{
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$action = $args['action'];
$image_id = (int)$post['image'];
$reload = empty($post['reload']) ? 0 : $post['reload'];
$face_id = (int)$post['face'];
$image = $GLOBALS['ansel_storage']->getImage($image_id);
$gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception('Access denied editing the photo.');
}
$name = $post['facename'];
$image = &$GLOBALS['ansel_storage']->getImage($image_id);
$gallery = &$GLOBALS['ansel_storage']->getGallery($image->gallery);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception('You are not allowed to edit this photo');
}
}
// Bail out if no perms on the image.
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
return array('response' => 0);
}
switch ($type) {
// Now get the "add geotag" stuff
$addurl = Horde::applicationUrl('map_edit.php')->add('image', $img);
$addLink = $addurl->link(array('onclick' => Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $img), 'urlencode' => true, 'width' => '750', 'height' => '600')) . 'return false;'));
- $imgs = $GLOBALS['ansel_storage']->getRecentImagesGeodata(Horde_Auth::getAuth());
+ $imgs = $GLOBALS['ansel_storage']->getRecentImagesGeodata($GLOBALS['registry']->getAuth());
if (count($imgs) > 0) {
$imgsrc = '<div class="ansel_location_sameas">';
foreach ($imgs as $id => $data) {
return array('response' => 1,
'message' => $this->_getTagHtml($newTags,
- $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)));
+ $parent->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)));
}
break;
return array('response' => 1,
'message' => $this->_getTagHtml($newTags,
- $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)));
+ $parent->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)));
break;
}
default:
$url = Ansel::getUrlFor('view',
array('view' => 'List',
- 'owner' => Horde_Auth::getAuth(),
+ 'owner' => $GLOBALS['registry']->getAuth(),
'groupby' => 'owner'),
true);
break;
(($GLOBALS['prefs']->getValue('defaultview') == 'galleries' &&
basename($_SERVER['PHP_SELF']) == 'index.php') ||
((basename($_SERVER['PHP_SELF']) == 'group.php') &&
- Horde_Util::getFormData('owner') !== Horde_Auth::getAuth())
+ Horde_Util::getFormData('owner') !== $GLOBALS['registry']->getAuth())
? 'current'
: '__noselection'));
- if (Horde_Auth::getAuth()) {
- $url = Ansel::getUrlFor('view', array('owner' => Horde_Auth::getAuth(),
+ if ($GLOBALS['registry']->getAuth()) {
+ $url = Ansel::getUrlFor('view', array('owner' => $GLOBALS['registry']->getAuth(),
'groupby' => 'owner',
'view' => 'List'));
$menu->add($url, _("_My Galleries"), 'mygalleries.png', null, null,
null,
- (Horde_Util::getFormData('owner', false) == Horde_Auth::getAuth())
+ (Horde_Util::getFormData('owner', false) == $GLOBALS['registry']->getAuth())
? 'current' :
'__noselection');
}
/* Let authenticated users create new galleries. */
if ($GLOBALS['registry']->isAdmin() ||
- (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('ansel') && Horde_Auth::getAuth()) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('ansel') && $GLOBALS['registry']->getAuth()) ||
+ $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('ansel', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$menu->add(Horde::applicationUrl('gallery.php')->add('actionID', 'add'),
_("_New Gallery"), 'add.png', null, null, null,
(basename($_SERVER['PHP_SELF']) == 'gallery.php' &&
if (!empty($owner)) {
if (!$owner) {
$owner_title = _("System Galleries");
- } elseif ($owner == Horde_Auth::getAuth()) {
+ } elseif ($owner == $GLOBALS['registry']->getAuth()) {
$owner_title = _("My Galleries");
} elseif (!empty($GLOBALS['conf']['gallery']['customlabel'])) {
$uprefs = Horde_Prefs::singleton($GLOBALS['conf']['prefs']['driver'],
$gallery_id = end($parts);
$galleries = $GLOBALS['ansel_storage']->getGalleries(array($gallery_id));
if (!isset($galleries[$gallery_id]) ||
- !$galleries[$gallery_id]->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ !$galleries[$gallery_id]->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_NotFound(_("Invalid gallery specified."));
}
}
if (in_array('browseable', $properties)) {
$results[$retpath]['browseable'] = $gallery->hasPermission(
- Horde_Auth::getAuth(), Horde_Perms::READ);
+ $GLOBALS['registry']->getAuth(), Horde_Perms::READ);
}
if (in_array('contenttype', $properties)) {
$results[$retpath]['contenttype'] = 'httpd/unix-directory';
throw new Horde_Exception_NotFound("Gallery does not exist");
}
$gallery = $GLOBALS['ansel_storage']->getGallery($gallery_id);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied(_("Access denied adding photos to \"%s\"."));
}
{
if (($GLOBALS['conf']['comments']['allow'] == 'all' ||
($GLOBALS['conf']['comments']['allow'] == 'authenticated' &&
- Horde_Auth::getAuth()))) {
+ $GLOBALS['registry']->getAuth()))) {
return true;
} else {
return false;
} elseif ($GLOBALS['ansel_storage']->galleryExists($gallery_id)) {
$gallery = $GLOBALS['ansel_storage']->getGallery($gallery_id);
}
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied adding photos to \"%s\"."), $gallery->get('name')));
}
if (!empty($gallery_data)) {
$image = $GLOBALS['ansel_storage']->getImage($image_id);
$gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied deleting photos from \"%s\"."), $gallery->get('name')));
}
return $gallery->removeImage($image);
public function createGallery($app = null, $attributes = array(), $perm = null, $parent = null)
{
if (!($GLOBALS['registry']->isAdmin() ||
- (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('ansel') && Horde_Auth::getAuth()) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT))) {
+ (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('ansel') && $GLOBALS['registry']->getAuth()) ||
+ $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('ansel', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT))) {
throw new Horde_Exception_PermissionDenied(_("Access denied creating new galleries."));
}
}
$gallery = $GLOBALS['ansel_storage']->getGallery($gallery_id);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied deleting gallery \"%s\"."), $gallery->get('name')));
} else {
$imageList = $gallery->listImages();
ensure the caller has at least Horde_Perms::READ on the galleries. */
$galleries = array();
foreach ($results as $gallery) {
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$galleries[$gallery->id] = array_merge($gallery->data, array('crumbs' => $gallery->getGalleryCrumbData()));
}
}
$GLOBALS['ansel_storage'] = new Ansel_Storage($app);
}
- return $GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), $perm,
+ return $GLOBALS['ansel_storage']->countGalleries($GLOBALS['registry']->getAuth(), $perm,
$attributes, $parent,
$allLevels);
}
'type' => 'checkbox',
'default' => true));
- if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+ if ($GLOBALS['ansel_storage']->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
foreach ($GLOBALS['ansel_storage']->listGalleries() as $gal) {
$params['gallery']['values'][$gal->id] = $gal->get('name');
}
$html .= '<noscript>';
$html .= $viewurl->link(array('title' => sprintf(_("View %s"), $gallery->get('name'))));
if ($iid = $gallery->getDefaultImage('ansel_default') &&
- $gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ $gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$html .= '<img src="' . Ansel::getImageUrl($gallery->getDefaultImage('ansel_default'), 'thumb', true) . '" alt="' . htmlspecialchars($gallery->get('name')) . '" />';
} else {
if (empty($this->_gallery)) {
throw new Horde_Exception_NotFound(_("Gallery does not exist."));
- } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) ||
+ } elseif (!$this->_gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW) ||
!$this->_gallery->isOldEnough() || $this->_gallery->hasPasswd()) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this gallery."));
}
{
return Ansel::getUrlFor('view',
array('groupby' => 'owner',
- 'owner' => Horde_Auth::getAuth(),
+ 'owner' => $GLOBALS['registry']->getAuth(),
'view' => 'List'))->link()
. _("My Galleries") . '</a>';
}
/* Get the top level galleries */
try {
$galleries = $GLOBALS['ansel_storage']->listGalleries(
- Horde_Perms::EDIT, Horde_Auth::getAuth(), null, false, 0,
+ Horde_Perms::EDIT, $GLOBALS['registry']->getAuth(), null, false, 0,
empty($this->_params['limit']) ? 0 : $this->_params['limit'],
'last_modified', 1);
'default' => '__random',
'values' => array('all' => 'All')));
- if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+ if ($GLOBALS['ansel_storage']->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
foreach ($GLOBALS['ansel_storage']->listGalleries(Horde_Perms::READ) as $id => $gal) {
$params['gallery']['values'][$id] = $gal->get('name');
}
if (empty($this->_gallery)) {
throw new Horde_Exception_NotFount(_("Gallery does not exist."));
- } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ } elseif (!$this->_gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this gallery."));
}
'default' => 10),
);
- if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+ if ($GLOBALS['ansel_storage']->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
foreach ($GLOBALS['ansel_storage']->listGalleries(Horde_Perms::READ) as $id => $gal) {
if (!$gal->hasPasswd() && $gal->isOldEnough()) {
$params['gallery']['values'][$id] = $gal->get('name');
if (empty($this->_gallery)) {
throw new Horde_Exception_NotFound(_("Gallery not found."));
- } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ } elseif (!$this->_gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this gallery."));
}
'default' => 250),
);
- if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+ if ($GLOBALS['ansel_storage']->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
foreach ($GLOBALS['ansel_storage']->listGalleries(Horde_Perms::READ) as $id => $gal) {
if (!$gal->hasPasswd() && $gal->isOldEnough()) {
$params['gallery']['values'][$id] = $gal->get('name');
if (empty($this->_gallery)) {
throw new Horde_Exception_NotFound(_("Gallery not found."));
- } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ } elseif (!$this->_gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this gallery."));
}
// an internally generated query string fragment. Will need to split
// this out into two seperate operations somehow.
$share = substr($GLOBALS['ansel_storage']->shares->getShareCriteria(
- Horde_Auth::getAuth(), Horde_Perms::READ), 5);
+ $GLOBALS['registry']->getAuth(), Horde_Perms::READ), 5);
$sql = 'SELECT f.face_id, f.gallery_id, f.image_id, f.face_name FROM ansel_faces f, '
. str_replace('WHERE', 'WHERE (', $share)
// add gallery permission
// FIXME: Ditto on the REALLY ugly hack comment from above!
$share = substr($GLOBALS['ansel_storage']->shares->getShareCriteria(
- Horde_Auth::getAuth(), Horde_Perms::READ), 5);
+ $GLOBALS['registry']->getAuth(), Horde_Perms::READ), 5);
$sql = 'SELECT COUNT(*) FROM ansel_faces f, '
. str_replace('WHERE', 'WHERE (', $share)
'order' => 'f.face_id DESC'
);
- if (!Horde_Auth::getAuth() || $owner != Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth() || $owner != $GLOBALS['registry']->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 (!Horde_Auth::getAuth() || $owner != Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth() || $owner != $GLOBALS['registry']->getAuth()) {
$info['filter'] .= ' AND s.gallery_passwd IS NULL';
}
{
$image = $GLOBALS['ansel_storage']->getImage($image);
$gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied('Access denied editing the photo.');
}
if (!($image instanceof Ansel_Image)) {
$image = $GLOBALS['ansel_storage']->getImage($image);
$gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied('Access denied editing the photo.');
}
}
public function getFromGallery($gallery_id, $create = false, $force = false)
{
$gallery = $GLOBALS['ansel_storage']->getGallery($gallery_id);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception(sprintf("Access denied editing gallery \"%s\".", $gallery->get('name')));
}
$this->addHidden('', 'image', 'text', false);
$this->addHidden('', 'image_desc', 'text', false);
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
if (empty($user)) {
$this->addVariable(_("Use the following return address:"), 'ecard_retaddr', 'text', true);
} else {
*/
public function canDownload()
{
- if (Horde_Auth::getAuth() &&
- (Horde_Auth::getAuth() == $this->data['share_owner'] ||
+ if ($GLOBALS['registry']->getAuth() &&
+ ($GLOBALS['registry']->getAuth() == $this->data['share_owner'] ||
$GLOBALS['registry']->isAdmin(array('permission' => 'ansel:admin')))) {
return true;
}
return $GLOBALS['registry']->isAuthenticated();
case 'edit':
- return $this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+ return $this->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
case 'hook':
return Horde::callHook('_ansel_hook_can_download', array($this->id));
*/
public function copyImagesTo($images, $gallery)
{
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied copying photos to \"%s\"."), $gallery->get('name')));
}
* @throws Horde_Exception
*/
public function getTags() {
- if ($this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if ($this->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
return Ansel_Tags::readTags($this->id, 'gallery');
} else {
throw new Horde_Exception(_("Access denied viewing this gallery."));
*/
public function setTags($tags)
{
- if ($this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($this->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
return Ansel_Tags::writeTags($this->id, $tags, 'gallery');
} else {
throw new Horde_Exception(_("Access denied adding tags to this gallery."));
*/
public function isOldEnough()
{
- if ((Horde_Auth::getAuth() &&
- $this->data['share_owner'] == Horde_Auth::getAuth()) ||
+ if (($GLOBALS['registry']->getAuth() &&
+ $this->data['share_owner'] == $GLOBALS['registry']->getAuth()) ||
empty($GLOBALS['conf']['ages']['limits']) ||
empty($this->data['attribute_age'])) {
*/
public function hasPasswd()
{
- if (Horde_Auth::getAuth() &&
- (Horde_Auth::getAuth() == $this->get('owner') ||
+ if ($GLOBALS['registry']->getAuth() &&
+ ($GLOBALS['registry']->getAuth() == $this->get('owner') ||
$GLOBALS['registry']->isAdmin(array('permission' => 'ansel:admin')))) {
return false;
}
*/
function moveImagesTo($images, $gallery)
{
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied moving photos to \"%s\"."), $newGallery->get('name')));
- } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ } elseif (!$this->_gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied removing photos from \"%s\"."), $gallery->get('name')));
}
}
/* Clear any comments */
- if (($GLOBALS['conf']['comments']['allow'] == 'all' || ($GLOBALS['conf']['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) &&
+ if (($GLOBALS['conf']['comments']['allow'] == 'all' || ($GLOBALS['conf']['comments']['allow'] == 'authenticated' && $GLOBALS['registry']->getAuth())) &&
$GLOBALS['registry']->hasMethod('forums/deleteForum')) {
$result = $GLOBALS['registry']->call('forums/deleteForum', array('ansel', $image->id));
*/
function countChildren($perm = Horde_Perms::SHOW, $allLevels = true)
{
- return $this->_gallery->getShareOb()->countShares(Horde_Auth::getAuth(), $perm, null, $this, $allLevels);
+ return $this->_gallery->getShareOb()->countShares($GLOBALS['registry']->getAuth(), $perm, null, $this, $allLevels);
}
/**
/* Get the number of images and galleries */
$numimages = $this->countImages();
$num_galleries = $GLOBALS['ansel_storage']->countGalleries(
- Horde_Auth::getAuth(), Horde_Perms::SHOW, null, $this->_gallery, false);
+ $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW, null, $this->_gallery, false);
/* Now fetch the subgalleries, but only if we need to */
if ($num_galleries > $from) {
return $this->_gallery->data['attribute_images'];
}
- $gCnt = $GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(),
+ $gCnt = $GLOBALS['ansel_storage']->countGalleries($GLOBALS['registry']->getAuth(),
$perm, null,
$this->_gallery, false);
*/
function moveImagesTo($images, $gallery)
{
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied moving photos to \"%s\"."), $newGallery->get('name')));
- } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ } elseif (!$this->_gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
throw new Horde_Exception_PermissionDenied(sprintf(_("Access denied removing photos from \"%s\"."), $gallery->get('name')));
}
}
/* Clear any comments */
- if (($GLOBALS['conf']['comments']['allow'] == 'all' || ($GLOBALS['conf']['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) &&
+ if (($GLOBALS['conf']['comments']['allow'] == 'all' || ($GLOBALS['conf']['comments']['allow'] == 'authenticated' && $GLOBALS['registry']->getAuth())) &&
$GLOBALS['registry']->hasMethod('forums/deleteForum')) {
$result = $GLOBALS['registry']->call('forums/deleteForum',
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (empty($name)) {
- $name = Horde_Auth::getAuth();
+ $name = $GLOBALS['registry']->getAuth();
}
$watermark = sprintf(_("(c) %s %s"), date('Y'), $name);
}
return $this->_tags;
}
$gallery = $ansel_storage->getGallery($this->gallery);
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
return Ansel_Tags::readTags($this->id);
} else {
throw new Horde_Exception_PermissionDenied(_("Access denied viewing this photo."));
global $ansel_storage;
$gallery = $ansel_storage->getGallery(abs($this->gallery));
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
// Clear the local cache.
$this->_tags = array();
Ansel_Tags::writeTags($this->id, $tags);
*/
function getMessage($message)
{
- $message .= "\n\n" . _("Report by user") . ': ' . Horde_Auth::getAuth()
+ $message .= "\n\n" . _("Report by user") . ': ' . $GLOBALS['registry']->getAuth()
. ' (' . $_SERVER['REMOTE_ADDR'] . ')';
return $message;
{
/* Required values. */
if (empty($attributes['owner'])) {
- $attributes['owner'] = Horde_Auth::getAuth();
+ $attributes['owner'] = $GLOBALS['registry']->getAuth();
}
if (empty($attributes['name'])) {
$attributes['name'] = _("Unnamed");
if ($perms) {
$groups = Horde_Group::singleton();
- $group_list = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $group_list = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
if (count($group_list)) {
foreach ($group_list as $group_id => $group_name) {
$perm->addGroupPermission($group_id, $perms, false);
global $conf, $registry;
/* Need to get comment counts if comments are enabled */
- if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) &&
+ if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && $GLOBALS['registry']->getAuth())) &&
$registry->hasMethod('forums/numMessagesBatch')) {
return $registry->call('forums/numMessagesBatch', array($ids, 'ansel'));
if (!count($galleries) && !count($slugs)) {
$sql = 'SELECT DISTINCT ' . $this->_getImageFields('i') . ' FROM ansel_images i, '
- . str_replace('WHERE' , ' WHERE i.gallery_id = s.share_id AND (', substr($this->_shares->getShareCriteria(Horde_Auth::getAuth()), 5)) . ')';
+ . str_replace('WHERE' , ' WHERE i.gallery_id = s.share_id AND (', substr($this->_shares->getShareCriteria($GLOBALS['registry']->getAuth()), 5)) . ')';
} elseif (!count($slugs) && count($galleries)) {
// Searching by gallery_id
$sql = 'SELECT ' . $this->_getImageFields() . ' FROM ansel_images '
$direction = 0)
{
try {
- $shares = $this->_shares->listShares(Horde_Auth::getAuth(), $perm, $attributes,
+ $shares = $this->_shares->listShares($GLOBALS['registry']->getAuth(), $perm, $attributes,
$from, $count, $sort_by, $direction,
$parent, $allLevels);
// image will not be incldued in the output.
if (!isset($galleries[$gallery_id]['perm'])) {
$galleries[$gallery_id]['perm'] =
- ($galleries[$gallery_id]['gallery']->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) &&
+ ($galleries[$gallery_id]['gallery']->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ) &&
$galleries[$gallery_id]['gallery']->isOldEnough() &&
!$galleries[$gallery_id]['gallery']->hasPasswd());
}
public function getRandomGallery($perm = Horde_Perms::SHOW, $attributes = null,
$parent = null, $allLevels = true)
{
- $num_galleries = $this->countGalleries(Horde_Auth::getAuth(), $perm,
+ $num_galleries = $this->countGalleries($GLOBALS['registry']->getAuth(), $perm,
$attributes, $parent,
$allLevels);
if (!$num_galleries) {
$skey = md5(serialize($ids) . $from . $resource_type . $max . $user);
if ($GLOBALS['conf']['ansel_cache']['usecache']) {
- $key = Horde_Auth::getAuth() . '__anseltagsearches';
+ $key = $GLOBALS['registry']->getAuth() . '__anseltagsearches';
$cvalue = $GLOBALS['injector']->getInstance('Horde_Cache')->get($key, 300);
$cvalue = @unserialize($cvalue);
if (!$cvalue) {
$img = $GLOBALS['ansel_storage']->getImage($id);
$gal = $GLOBALS['ansel_storage']->getGallery($img->gallery);
$owner = $gal->get('owner');
- if ($gal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) &&
+ if ($gal->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW) &&
(!isset($user) || (isset($user) && $owner && $owner == $user))) {
$imgs[] = $id;
}
Horde::logMessage($e->getMessage(), 'ERR');
continue;
}
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) && (!isset($user) || (isset($user) && $gallery->get('owner') && $gallery->get('owner') == $user))) {
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW) && (!isset($user) || (isset($user) && $gallery->get('owner') && $gallery->get('owner') == $user))) {
$results['galleries'][] = $id;
}
}
static public function clearCache()
{
if ($GLOBALS['conf']['ansel_cache']['usecache']) {
- $GLOBALS['injector']->getInstance('Horde_Cache')->expire(Horde_Auth::getAuth() . '__anseltagsearches');
+ $GLOBALS['injector']->getInstance('Horde_Cache')->expire($GLOBALS['registry']->getAuth() . '__anseltagsearches');
}
}
}
$this->_owner);
$images = count($iresults['images']) ? array_values($GLOBALS['ansel_storage']->getImages(array('ids' => $iresults['images']))) : array();
- if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) &&
+ if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && $GLOBALS['registry']->getAuth())) &&
$registry->hasMethod('forums/numMessagesBatch')) {
$ids = array_keys($images);
}
/* Check permissions on the gallery and get appropriate tile image */
- if ($dgallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if ($dgallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
if (is_null($style)) {
$style = $dgallery->getStyle();
}
}
/* Check gallery permissions and get appropriate tile image */
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
if (is_null($style)) {
$style = $gallery->getStyle();
}
$text_link = $view_link . htmlspecialchars($gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset())
. '</a>';
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT) && !$mini) {
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT) && !$mini) {
$properties_link = Horde::applicationUrl('gallery.php', true)->add(
array('gallery' => $gallery->id,
'actionID' => 'modify',
}
if ($showOwner && !$mini &&
- Horde_Auth::getAuth() != $gallery->get('owner')) {
+ $GLOBALS['registry']->getAuth() != $gallery->get('owner')) {
$owner_link = Ansel::getUrlFor('view',
array('view' => 'List',
'owner' => $gallery->get('owner'),
}
$thumb_url = Ansel::getImageUrl($image->id, $thumbstyle, true, $style['name']);
- $option_select = $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
- $option_edit = $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+ $option_select = $parent->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
+ $option_edit = $parent->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
$imgAttributes = (!empty($params['image_view_attributes']) ? $params['image_view_attributes'] : array());
$imgOnClick = (!empty($params['image_onclick'])
} else {
$gallery = $GLOBALS['ansel_storage']->getGallery($galleryId);
}
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception(sprintf(_("Access denied to gallery \"%s\"."), $gallery->get('name')));
}
Horde::logMessage($e, 'ERR');
exit;
}
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
return '';
}
// We don't allow age restricted or password locked galleries to be
// viewed via the mini embedded view since it shows *all* the images
- if (!$this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) ||
+ if (!$this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ) ||
!$this->gallery->isOldEnough() ||
$this->gallery->hasPasswd()) {
exit;
}
- if (!$this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if (!$this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception('Access denied viewing this gallery.');
}
/* Special case widgets - these are built in */
if (array_key_exists('Actions', $this->style['widgets'])) {
/* Don't show action widget if no actions */
- if (Horde_Auth::getAuth() ||
+ if ($GLOBALS['registry']->getAuth() ||
!empty($conf['report_content']['driver']) &&
(($conf['report_content']['allow'] == 'authenticated' &&
$GLOBALS['registry']->isAuthenticated()) ||
/* Only need these if not being called via the api */
if (empty($this->view->api)) {
- $option_edit = $this->view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
- $option_select = $option_delete = $this->view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
+ $option_edit = $this->view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
+ $option_select = $option_delete = $this->view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
$option_move = ($option_delete && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
$option_copy = ($option_edit && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
/* See if we requested a show_actions change */
/* Don't bother if we are being called from the api */
if (empty($this->view->api)) {
- $option_edit = $this->view->gallery->hasPermission(Horde_Auth::getAuth(),
+ $option_edit = $this->view->gallery->hasPermission($GLOBALS['registry']->getAuth(),
Horde_Perms::EDIT);
$option_select = $option_delete = $this->view->gallery->hasPermission(
- Horde_Auth::getAuth(), Horde_Perms::DELETE);
+ $GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
$option_move = ($option_delete && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
$option_copy = ($option_edit && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
/* See if we requested a show_actions change (fallback for non-js) */
$imageIndex = $this->_revList[$this->resource->id];
/* Get comments before any output in sent. */
- if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) &&
+ if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && $GLOBALS['registry']->getAuth())) &&
$registry->hasMethod('forums/doComments')) {
$hasComments = true;
if (!empty($this->_params['comment_url'])) {
$this->addWidget(Ansel_Widget::factory('Links', array()));
/* In line caption editing */
- if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$imple = Horde_Ajax_Imple::factory(array('ansel', 'EditCaption'),
array('id' => $this->resource->id,
'domid' => "Caption",
$try = $ansel_storage->getGalleries($getThese);
$this->_galleryList = array();
foreach ($try as $id => $gallery) {
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
$this->_galleryList[$id] = $gallery;
}
}
}
$this->_numGalleries = $ansel_storage->countGalleries(
- Horde_Auth::getAuth(), Horde_Perms::SHOW, $filter, null, false);
+ $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW, $filter, null, false);
if ($this->_numGalleries == 0 && empty($this->_params['api'])) {
- if ($this->_owner && $filter == $this->_owner && $this->_owner == Horde_Auth::getAuth()) {
+ if ($this->_owner && $filter == $this->_owner && $this->_owner == $GLOBALS['registry']->getAuth()) {
$notification->push(_("You have no photo galleries, add one!"),
'horde.message');
header('Location: ' .Horde::applicationUrl('gallery.php')->add('actionID', 'add'));
public function getTitle()
{
if ($this->_owner) {
- if ($this->_owner == Horde_Auth::getAuth() && empty($this->_params['api'])) {
+ if ($this->_owner == $GLOBALS['registry']->getAuth() && empty($this->_params['api'])) {
return _("My Galleries");
} elseif (!empty($GLOBALS['conf']['gallery']['customlabel'])) {
$uprefs = Horde_Prefs::singleton($GLOBALS['conf']['prefs']['driver'],
foreach ($images as $image) {
$img = $ansel_storage->getImage($image);
$gallery = $ansel_storage->getgallery($img->gallery);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(
sprintf(_("Access denied deleting photos from \"%s\"."), $image), 'horde.error');
} else {
}
$html .= '<li>' . $slideshow_url->link(array('class' => 'widget')) . Horde::img('slideshow_play.png', _("Start Slideshow")) . ' ' . _("Start Slideshow") . '</a></li>';
}
- if (!empty($uploadurl) && $this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!empty($uploadurl) && $this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$html .= '<li>' . $uploadurl->link(array('class' => 'widget')) . Horde::img('image_add.png') . ' ' . _("Upload photos") . '</a></li>';
/* Subgalleries */
}
/* Image upload, subgalleries, captions etc... */
- if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
/* Properties */
$html .= '<li>' . $galleryurl->copy()->add(array('actionID' => 'modify', 'url' => $selfurl))->link(array('class' => 'widget')) . Horde::img('edit.png') . ' ' . _("Change properties") . '</a></li>';
if ($count) {
}
}
- if (Horde_Auth::getAuth() &&
- $this->_view->gallery->get('owner') == Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth() &&
+ $this->_view->gallery->get('owner') == $GLOBALS['registry']->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') . ' ' . _("Set permissions") . '</a></li>';
} elseif (!empty($conf['report_content']['driver']) &&
(($conf['report_content']['allow'] == 'authenticated' &&
$html .= '<li>' . $reporturl->link(array('class' => 'widget')) . _("Report") . '</a></li>';
}
- if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if ($this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$html .= '<li>' . $galleryurl->copy()->add('actionID', 'empty')->link(array('class' => 'widget')) . Horde::img('delete.png') . ' ' . _("Delete All Photos") . '</a></li>';
$html .= '<li>' . $galleryurl->copy()->add('actionID', 'delete')->link(array('class' => 'widget')) . Horde::img('delete.png', 'horde') . ' ' . _("Delete Entire Gallery") . '</a></li>';
}
. ';width:100%;max-height:300px;overflow:auto;" id="faces_widget_content" >';
$images = $faces->getGalleryFaces($this->_view->resource->id);
- if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$link_text = (empty($images) ? _("Find faces") : _("Edit faces"));
$html .= Horde::applicationUrl('faces/gallery.php')->add('gallery', $this->_view->gallery->id)->link(
array('id' => 'edit_faces',
$imple = Horde_Ajax_Imple::factory(array('ansel', 'ImageSaveGeotag'), array());
$impleUrl = $imple->getUrl();
- $permsEdit = $this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+ $permsEdit = $this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
$viewType = $this->_view->viewType();
if (count($geodata) == 0 && $viewType != 'Image') {
// Image view, but no geotags, provide ability to add it.
$addurl = Horde::applicationUrl('map_edit.php')->add('image', $this->_params['images'][0]);
$addLink = $addurl->link(array('onclick' => Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $this->_params['images'][0]), 'urlencode' => true, 'width' => '750', 'height' => '600')) . 'return false;'));
- $imgs = $ansel_storage->getRecentImagesGeodata(Horde_Auth::getAuth());
+ $imgs = $ansel_storage->getRecentImagesGeodata($GLOBALS['registry']->getAuth());
if (count($imgs) > 0) {
$imgsrc = '<div class="ansel_location_sameas">';
foreach ($imgs as $id => $data) {
// back on going to the find all faces in gallery page if no js...
// although, currently, *that* page requires js as well so...
// TODO: A way to 'close', or go back to, the normal widget view.
- if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$link_text = (empty($images) ? _("Find faces") : _("Edit faces"));
$html .= Horde::applicationUrl('faces/gallery.php')->add('gallery', $this->_view->gallery->id)->link(
array('id' => 'edit_faces',
/* Build the tag widget */
$html = $this->_htmlBegin();
$html .= '<div id="tags">' . $this->_getTagHTML() . '</div>';
- if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
Horde::startBuffer();
/* Attach the Ajax action */
$imple = Horde_Ajax_Imple::factory(array('ansel', 'TagActions'),
Ansel_Tags::clearSearch();
}
- $hasEdit = $this->_view->gallery->hasPermission(Horde_Auth::getAuth(),
+ $hasEdit = $this->_view->gallery->hasPermission($GLOBALS['registry']->getAuth(),
Horde_Perms::EDIT);
$owner = $this->_view->gallery->get('owner');
$tags = $this->_view->resource->getTags();
}
$image = $ansel_storage->getImage($image_id);
$gallery = $ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
throw new Horde_Exception_PermissionDenied(_("Not Authorized. Details have been logged for the server administrator."));
}
$loadingImg = Horde::img('loading.gif', _("Loading..."));
/* Obtain other geotagged images to possibly locate this image at */
-$imgs = $GLOBALS['ansel_storage']->getRecentImagesGeodata(Horde_Auth::getAuth());
+$imgs = $GLOBALS['ansel_storage']->getRecentImagesGeodata($GLOBALS['registry']->getAuth());
if (count($imgs) > 0) {
$other_images = '<div class="ansel_location_sameas">' . _("Click on a thumbnail to locate at the same point.") . '<br />';
foreach ($imgs as $id => $data) {
}
}
- if (!Horde_Auth::getAuth() ||
- (isset($share) && Horde_Auth::getAuth() != $share->get('owner'))) {
+ if (!$GLOBALS['registry']->getAuth() ||
+ (isset($share) && $GLOBALS['registry']->getAuth() != $share->get('owner'))) {
exit('permission denied');
}
break;
}
if (!empty($share)) {
- if (!Horde_Auth::getAuth() ||
- Horde_Auth::getAuth() != $share->get('owner')) {
+ if (!$GLOBALS['registry']->getAuth() ||
+ $GLOBALS['registry']->getAuth() != $share->get('owner')) {
exit('permission denied');
}
$perm = $share->getPermission();
$old_owner = $share->get('owner');
$new_owner = Horde_Util::getFormData('owner', $old_owner);
if ($old_owner !== $new_owner && !empty($new_owner)) {
- if ($old_owner != Horde_Auth::getAuth() && !$registry->isAdmin()) {
+ if ($old_owner != $GLOBALS['registry']->getAuth() && !$registry->isAdmin()) {
$notification->push(_("Only the owner or system administrator may change ownership or owner permissions for a share"), 'horde.error');
} else {
$share->set('owner', $new_owner);
Horde::logMessage($e->getMessage(), 'ERR');
exit;
}
-if ($gal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) &&
+if ($gal->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW) &&
!$gal->hasPasswd() &&
$gal->isOldEnough()) {
$id = Horde_Util::getFormData('id');
$type = basename(Horde_Util::getFormData('type', 'rss2'));
$slug = Horde_Util::getFormData('slug');
-$uid = md5($stream_type . $id . $type . Horde_Auth::getAuth());
+$uid = md5($stream_type . $id . $type . $GLOBALS['registry']->getAuth());
$filename = 'ansel_feed_template_' . $uid;
if ($conf['ansel_cache']['usecache']) {
$cache_key = 'ansel_feed_template_' . $uid;
} elseif (is_numeric($id)) {
$gallery = $ansel_storage->getGallery($id);
}
- if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) &&
+ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW) &&
!$gallery->hasPasswd() && $gallery->isOldEnough()) {
if (!$gallery->countImages() && $gallery->hasSubGalleries()) {
}
if (!isset($galleries[$gallery_id]['perm'])) {
$galleries[$gallery_id]['perm'] =
- ($galleries[$gallery_id]['gallery']->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) &&
+ ($galleries[$gallery_id]['gallery']->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ) &&
$galleries[$gallery_id]['gallery']->isOldEnough() &&
!$galleries[$gallery_id]['gallery']->hasPasswd());
}
$cli->fatal($error);
} else {
$gallery = $ansel_storage->getGallery($galleryId);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$error = sprintf(_("Access denied adding photos to \"%s\"."), $galleryId);
Horde::logMessage($error, 'WARN');
$cli->fatal($error);
</td>
</tr>
<?php } ?>
-<?php if (Horde_Auth::getAuth() && !empty($gallery) && Horde_Auth::getAuth() == $gallery->get('owner')): ?>
+<?php if ($GLOBALS['registry']->getAuth() && !empty($gallery) && $GLOBALS['registry']->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>
<?php
$num_galleries = $GLOBALS['ansel_storage']->countGalleries(
- Horde_Auth::getAuth(), Horde_Perms::SHOW, array('category' => $group), null, false);
+ $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW, array('category' => $group), null, false);
if (empty($group)) {
$category_title = _("Unfiled");
<?php
-if ($group == Horde_Auth::getAuth()) {
+if ($group == $GLOBALS['registry']->getAuth()) {
$owner_title = _("My Galleries");
$custom = '';
} elseif (!empty($GLOBALS['conf']['gallery']['customlabel'])) {
'owner' => $group,
'view' => 'List')));
-$num_galleries = $ansel_storage->countGalleries(Horde_Auth::getAuth(), Horde_Perms::SHOW,
+$num_galleries = $ansel_storage->countGalleries($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW,
$group, null, false);
if ($num_galleries < 5) {
$mini_galleries = $ansel_storage->listGalleries(Horde_Perms::SHOW,
?>
<div class="control anselActions" style="text-align:center;">
<?php
-if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
echo $save_url->link(array('title' => _("Save Change")))
. Horde::img('save.png') . ' ' . _("Save Change") . '</a> ';
}
-if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
echo $edit_url->link(array('title' => _("Cancel Change")))
. Horde::img('delete.png') . ' ' . _("Cancel Change") . '</a>';
}
?>
<div class="control anselActions" style="text-align:center;">
<?php
-if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
echo $save_url->link(array('title' => _("Save Change")))
. Horde::img('save.png') . ' ' . _("Save Change") . '</a> ';
}
-if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
echo $edit_url->link(array('title' => _("Cancel Change")))
. Horde::img('delete.png') . ' ' . _("Cancel Change") . '</a>';
}
<?php echo '<div class="image-tile" id="imagetile_' . (int)$image->id . '">' . Horde::link($view_url, $image->filename, '', '', $imgOnClick, $title, '', $imgAttributes) . '<img src="' . $thumb_url . '" alt="' . htmlspecialchars($image->filename) . '" /></a>'; ?>
<div style="valign: bottom;">
<div class="image-tile-caption" id="<?php echo (int)$image->id . 'caption'?>"><?php echo $imageCaption ?></div>
-<?php if (Horde_Auth::getAuth() || $option_select): ?>
+<?php if ($GLOBALS['registry']->getAuth() || $option_select): ?>
<div><label><input type="checkbox" class="checkbox" name="image[<?php echo (int)$image->id ?>]" /> <?php echo _("Select for Action") ?></label></div>
<?php endif; ?>
<?php if ($view != 'Gallery'): ?>
<div><?php echo _("From: ") . Horde::link($gallery_url) . $parent->get('name') ?></a></div>
<?php endif; ?>
-<?php if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && Horde_Auth::getAuth())) && empty($params['hide_comments'])): ?>
+<?php if (($conf['comments']['allow'] == 'all' || ($conf['comments']['allow'] == 'authenticated' && $GLOBALS['registry']->getAuth())) && empty($params['hide_comments'])): ?>
<div><?php echo Horde::link($img_view_url . '#messagediv', _("View or leave comments")) ?> <?php printf(ngettext("%d comment", "%d comments", $image->commentCount), $image->commentCount) ?></a></div>
<?php endif;
if ($option_select): ?>
<?php
$needSeperator = false;
$actionHTML = '';
- if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT) && empty($this->_params['api'])) {
+ if ($this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT) && empty($this->_params['api'])) {
$needSeperator = true;
$actionHTML .= Horde::link('#', '', '', '_blank', $this->_urls['prop_popup'] . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . '</a>';
$actionHTML .= ' | ' . Horde::link($this->_urls['edit'], '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") . '</a>';
}
- if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE) && empty($this->_params['api'])) {
+ if ($this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE) && empty($this->_params['api'])) {
$actionHTML .= ' | ' . Horde::link($this->_urls['delete'], '', '', '', 'return window.confirm(\'' . addslashes(sprintf(_("Do you want to permanently delete ''%s''?"), $this->resource->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") . '</a>';
}
if (!empty($conf['ecard']['enable']) && !empty($this->_urls['ecard'])) {
$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']) &&
- (!Horde_Auth::getAuth() ||
- $this->gallery->get('owner') != Horde_Auth::getAuth()) &&
+ (!$GLOBALS['registry']->getAuth() ||
+ $this->gallery->get('owner') != $GLOBALS['registry']->getAuth()) &&
!empty($GLOBALS['conf']['report_content']['driver']) &&
(($conf['report_content']['allow'] == 'authenticated' &&
$GLOBALS['registry']->isAuthenticated()) ||
<table width="100%" cellspacing="0">
<tr class="control">
<td>
- <?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)): ?>
+ <?php if ($this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)): ?>
<?php echo Horde::link('#', '', '', '_blank', 'SlideController.pause();' . $this->_urls['prop_popup'], '', '', array('id' => 'image_properties_link')) . _("Properties") ?></a>
| <?php echo Horde::link(Horde::applicationUrl($this->_urls['edit']), '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") ?></a>
<?php endif; ?>
- <?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)): ?>
+ <?php if ($this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)): ?>
| <?php echo Horde::link($this->_urls['delete'], '', '', '', 'return window.confirm(\'' . addslashes(sprintf(_("Do you want to permanently delete \"%s\"?"), $this->resource->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") ?></a>
<?php endif; ?>
</td>
} else {
try {
$gallery = $ansel_storage->getGallery($galleryId);
- if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$error = sprintf(_("Access denied adding photos to \"%s\"."), $gallery->get('name'));
} else {
$error = false;
*/
function hasPermission($permission, $filter = null, $perm = null)
{
- $userId = Horde_Auth::getAuth();
+ $userId = $GLOBALS['registry']->getAuth();
$admin = ($userId == 'admin') ? true : false;
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
switch ($filter) {
case 'tabs':
if ($perm) {
- $allowed = $perms->hasPermission('babel:' . $permission, Horde_Auth::getAuth(), $perm);
+ $allowed = $perms->hasPermission('babel:' . $permission, $GLOBALS['registry']->getAuth(), $perm);
}
break;
}
if ($editmode && $cstring == $encstr) {
// Lock the current item for 5 minutes
- $locks->setLock(Horde_Auth::getAuth(), md5($encstr), $lockscope, 300);
+ $locks->setLock($GLOBALS['registry']->getAuth(), md5($encstr), $lockscope, 300);
echo '<form action="' . Horde::applicationUrl('view.php') . "#" . md5($encstr) . '" method="post" name="edit" id="edit">';
echo '<input type="hidden" name="module" value="' . $app . '">';
$user = 0;
$superadmin = 0;
- $superadmin = $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('beatnik:domains', Horde_Auth::getAuth(), $permmask);
+ $superadmin = $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('beatnik:domains', $GLOBALS['registry']->getAuth(), $permmask);
while ($numparents >= 0) {
- $tmpuser = $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission($permname, Horde_Auth::getAuth(), $permmask);
+ $tmpuser = $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission($permname, $GLOBALS['registry']->getAuth(), $permmask);
$user = $user | $tmpuser;
if ($numparents > 0) {
}
if (!$GLOBALS['registry']->isAdmin() &&
- !$GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('beatnik:domains', Horde_Auth::getAuth(), $perms)) {
+ !$GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('beatnik:domains', $GLOBALS['registry']->getAuth(), $perms)) {
foreach ($domains as $id => $domain) {
- if (!$GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('beatnik:domains:' . $domain['zonename'], Horde_Auth::getAuth(), $perms)) {
+ if (!$GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('beatnik:domains:' . $domain['zonename'], $GLOBALS['registry']->getAuth(), $perms)) {
unset($domains[$id]);
}
}
<p>
<?php
echo _("Domain Categories") . ' ';
-if (Horde_Auth::getAuth() && (!$prefs->isLocked('categories') || !$prefs->isLocked('category_colors'))) {
+if ($GLOBALS['registry']->getAuth() && (!$prefs->isLocked('categories') || !$prefs->isLocked('category_colors'))) {
$categoryUrl = Horde_Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/services/prefs.php'),
array('app' => 'horde', 'group' => 'categories'));
echo Horde::link($categoryUrl, _("Edit domain groups and colors"), 'widget', '_blank') .
static public function checkPerms($key)
{
return (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('chora:sourceroots:' . $key) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('chora:sourceroots:' . $key, Horde_Auth::getAuth(), Horde_Perms::READ | Horde_Perms::SHOW));
+ $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('chora:sourceroots:' . $key, $GLOBALS['registry']->getAuth(), Horde_Perms::READ | Horde_Perms::SHOW));
}
/**
case 'modify_account':
$account_id = $vars->get('account');
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("Access denied editing account."), 'horde.error');
} else {
$account = Fima::getAccount($account_id);
$vars = new Horde_Variables($account);
$vars->set('actionID', 'save_account');
$vars->set('number_new', $vars->get('number'));
- $form = new Fima_AccountForm($vars, sprintf(_("Edit: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE));
+ $form = new Fima_AccountForm($vars, sprintf(_("Edit: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE));
break;
}
}
}
$form->getInfo($vars, $info);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving account to %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('accounts.php', true));
exit;
case 'delete_account':
$account_id = $vars->get('account');
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(_("Access denied deleting account."), 'horde.error');
} else {
$account = Fima::getAccount($account_id);
$vars->set('actionID', 'purge_account');
$vars->set('dssubaccounts', array('type' => 'none', 'account' => $account_id));
$vars->set('dspostings', array('type' => 'delete', 'account' => $account_id));
- $form = new Fima_AccountDeleteForm($vars, sprintf(_("Delete: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT));
+ $form = new Fima_AccountDeleteForm($vars, sprintf(_("Delete: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT));
break;
}
}
}
$form->getInfo($vars, $info);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(sprintf(_("Access denied deleting account from %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('accounts.php', true));
exit;
$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'delete_all':
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(_("Access denied deleting all accounts and postings."), 'horde.error');
} else {
$storage = &Fima_Driver::singleton($ledger);
// active ledger
// Set locked to true if you don't want users to have multiple ledgers.
$_prefs['active_ledger'] = array(
- 'value' => Horde_Auth::getAuth() ? Horde_Auth::getAuth() : 0
+ 'value' => $GLOBALS['registry']->getAuth() ? $GLOBALS['registry']->getAuth() : 0
'type' => 'enum',
'shared' => true
);
// Exit if this isn't an authenticated user or if the user can't
// create new task lists (default share is locked).
-if (!Horde_Auth::getAuth() || $prefs->isLocked('active_ledger')) {
+if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('active_ledger')) {
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
}
require_once FIMA_BASE . '/lib/Forms/DeleteLedger.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
}
$vars = Horde_Variables::getDefaultVariables();
$ledger_id = $vars->get('l');
-if ($ledger_id == Horde_Auth::getAuth()) {
+if ($ledger_id == $GLOBALS['registry']->getAuth()) {
$notification->push(_("This ledger cannot be deleted."), 'horde.warning');
header('Location: ' . Horde::applicationUrl('ledgers/', true));
exit;
$notification->push($ledger, 'horde.error');
header('Location: ' . Horde::applicationUrl('ledgers/', true));
exit;
-} elseif ($ledger->get('owner') != Horde_Auth::getAuth()) {
+} elseif ($ledger->get('owner') != $GLOBALS['registry']->getAuth()) {
$notification->push(_("You are not allowed to delete this ledger."), 'horde.error');
header('Location: ' . Horde::applicationUrl('ledgers/', true));
exit;
require_once FIMA_BASE . '/lib/Forms/EditLedger.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
}
$notification->push($ledger, 'horde.error');
header('Location: ' . Horde::applicationUrl('ledgers/', true));
exit;
-} elseif ($ledger->get('owner') != Horde_Auth::getAuth()) {
+} elseif ($ledger->get('owner') != $GLOBALS['registry']->getAuth()) {
$notification->push(_("You are not allowed to change this ledger."), 'horde.error');
header('Location: ' . Horde::applicationUrl('ledgers/', true));
exit;
require_once FIMA_BASE . '/lib/base.php';
/* Exit if this isn't an authenticated user. */
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
require FIMA_BASE . '/postings.php';
exit;
}
'show_ledger' => array(
'type' => 'enum',
'name' => _("Show summary of this ledger"),
- 'default' => Horde_Auth::getAuth(),
+ 'default' => $GLOBALS['registry']->getAuth(),
'values' => $ledgers),
'show_months' => array(
'type' => 'enum',
*/
function listLedgers($owneronly = false, $permission = Horde_Perms::SHOW)
{
- $ledgers = $GLOBALS['fima_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null);
+ $ledgers = $GLOBALS['fima_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null);
if (is_a($ledgers, 'PEAR_Error')) {
Horde::logMessage($ledgers, 'ERR');
return array();
if (count($GLOBALS['display_ledgers']) == 0) {
$ledgerss = Fima::listLedgers(true);
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
/* All ledgers for guests. */
$GLOBALS['display_ledgers'] = array_keys($ledgers);
} else {
}
/* If the user's personal ledger doesn't exist, then create it. */
- if (!$GLOBALS['fima_shares']->exists(Horde_Auth::getAuth())) {
+ if (!$GLOBALS['fima_shares']->exists($GLOBALS['registry']->getAuth())) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getOriginalAuth();
+ $name = $GLOBALS['registry']->getAuth('original');
}
- $share = &$GLOBALS['fima_shares']->newShare(Horde_Auth::getAuth());
+ $share = &$GLOBALS['fima_shares']->newShare($GLOBALS['registry']->getAuth());
$share->set('name', sprintf(_("%s's Ledger"), $name));
$GLOBALS['fima_shares']->addShare($share);
/* Make sure the personal ledger is displayed by default. */
- if (!in_array(Horde_Auth::getAuth(), $GLOBALS['display_ledgers'])) {
- $GLOBALS['display_ledgers'][] = Horde_Auth::getAuth();
+ if (!in_array($GLOBALS['registry']->getAuth(), $GLOBALS['display_ledgers'])) {
+ $GLOBALS['display_ledgers'][] = $GLOBALS['registry']->getAuth();
}
}
}
$menu->add(Horde::applicationUrl('search.php'), _("Search"), 'search.png', $hordeimg);
$menu->add(Horde::applicationUrl('accounts.php'), _("_Accounts"), 'accounts.png');
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$menu->add(Horde::applicationUrl('ledgers/index.php'), _("_My Ledgers"), 'accounts.png');
}
return false;
}
- if ($this->_ledger->get('owner') != Horde_Auth::getAuth()) {
+ if ($this->_ledger->get('owner') != $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("Permission denied"));
}
// Make sure we still own at least one ledger.
if (count(Fima::listLedgers(true)) == 0) {
// If the default share doesn't exist then create it.
- if (!$GLOBALS['fima_shares']->exists(Horde_Auth::getAuth())) {
+ if (!$GLOBALS['fima_shares']->exists($GLOBALS['registry']->getAuth())) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getOriginalAuth();
+ $name = $GLOBALS['registry']->getAuth('original');
}
- $ledger = &$GLOBALS['fima_shares']->newShare(Horde_Auth::getAuth());
+ $ledger = &$GLOBALS['fima_shares']->newShare($GLOBALS['registry']->getAuth());
if (is_a($ledger, 'PEAR_Error')) {
return;
}
$postingset = Horde_Util::getFormData('posting_id');
$share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving postings to %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
$postingset = Horde_Util::getFormData('indices');
$share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(sprintf(_("Access denied deleting postings from %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
$postingset = Horde_Util::getFormData('posting_id');
$share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied shifting postings in %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
case 'copymove_postings':
$share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
- } elseif (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE) && (!Horde_Util::getFormData('keep') || Horde_Util::getFormData('delete'))) {
+ } elseif (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE) && (!Horde_Util::getFormData('keep') || Horde_Util::getFormData('delete'))) {
$notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
<?php
-$perm_edit = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
-$perm_delete = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
+$perm_edit = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
+$perm_delete = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
?>
<script type="text/javascript">
// We are already logged
if ($registry->isAuthenticated()) {
- header('Location: ' . Folks::getUrlFor('user', Horde_Auth::getAuth()));
+ header('Location: ' . Folks::getUrlFor('user', $GLOBALS['registry']->getAuth()));
exit;
}
return $GLOBALS['registry']->callByPackage('ansel', 'listGalleries', array('ansel', Horde_Perms::SHOW, null, true, 0, 3, $user));
case 'blogs':
- return $GLOBALS['registry']->callByPackage('thomas', 'getRecentPosts', array($user, Horde_Auth::getAuth(), '', 3));
+ return $GLOBALS['registry']->callByPackage('thomas', 'getRecentPosts', array($user, $GLOBALS['registry']->getAuth(), '', 3));
case 'classifieds':
return $GLOBALS['registry']->callByPackage('classified', 'listAds', array(array('user_uid' => $user), 0, 3));
public function prelogin($app)
{
$group = Horde_Group::singleton();
- $user_uid = Horde_Auth::getAuth();
+ $user_uid = $GLOBALS['registry']->getAuth();
switch ($app) {
return;
}
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
if ($user) {
return;
}
}
}
-$activities = $folks_driver->getActivity(Horde_Auth::getAuth());
+$activities = $folks_driver->getActivity($GLOBALS['registry']->getAuth());
if ($activities instanceof PEAR_Error) {
$notification->push($activities);
header('Location: ' . Folks::getUrlFor('list', 'list'));
if (Horde_Util::getFormData('submitbutton') == _("Delete all current comments")) {
try {
- $registry->call('forums/deleteForum', array('folks', Horde_Auth::getAuth()));
- $result = $folks_driver->updateComments(Horde_Auth::getAuth(), true);
+ $registry->call('forums/deleteForum', array('folks', $GLOBALS['registry']->getAuth()));
+ $result = $folks_driver->updateComments($GLOBALS['registry']->getAuth(), true);
if ($result instanceof PEAR_Error) {
$notification->push($result);
} else {
if ($vars->get('user_comments') == 'moderate' && $profile['user_comments'] != 'moderate' ||
$vars->get('user_comments') != 'moderate' && $profile['user_comments'] == 'moderate') {
- $info = array('author' => Horde_Auth::getAuth(),
- 'forum_name' => Horde_Auth::getAuth(),
+ $info = array('author' => $GLOBALS['registry']->getAuth(),
+ 'forum_name' => $GLOBALS['registry']->getAuth(),
'forum_moderated' => ($profile['user_comments'] == 'moderate'));
try {
$registry->call('forums/saveFrom', array('folks', '', $info));
$title = _("Edit my profile");
-$profile = $folks_driver->getRawProfile(Horde_Auth::getAuth());
+$profile = $folks_driver->getRawProfile($GLOBALS['registry']->getAuth());
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
header('Location: ' . Folks::getUrlFor('list', 'list'));
if ($registry->hasMethod('video/listVideos')) {
try {
- $result = $registry->call('video/listVideos', array(array('author' => Horde_Auth::getAuth()), 0, 100));
+ $result = $registry->call('video/listVideos', array(array('author' => $GLOBALS['registry']->getAuth()), 0, 100));
$videos = array();
foreach ($result as $video_id => $video) {
$videos[$video_id] = $video['video_title'] . ' - ' . Folks::format_date($video['video_created']);
break;
case _("Delete picture"):
- $result = $folks_driver->deleteImage(Horde_Auth::getAuth());;
+ $result = $folks_driver->deleteImage($GLOBALS['registry']->getAuth());;
if ($result instanceof PEAR_Error) {
$notification->push($result);
} else {
$notification->push($result);
} elseif ($friends->needsApproval($user)) {
$title = sprintf(_("%s added you as a friend on %s"),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$GLOBALS['registry']->get('name', 'horde'));
$body = sprintf(_("User %s added you to his firends list on %s. \nTo approve, go to: %s \nTo reject, go to: %s \nTo see to his profile, go to: %s \n"),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$registry->get('name', 'horde'),
- Horde_Util::addParameter(Horde::applicationUrl('edit/friends/approve.php', true, -1), 'user', Horde_Auth::getAuth()),
- Horde_Util::addParameter(Horde::applicationUrl('edit/friends/reject.php', true, -1), 'user', Horde_Auth::getAuth()),
- Folks::getUrlFor('user', Horde_Auth::getAuth(), true, -1));
+ Horde_Util::addParameter(Horde::applicationUrl('edit/friends/approve.php', true, -1), 'user', $GLOBALS['registry']->getAuth()),
+ Horde_Util::addParameter(Horde::applicationUrl('edit/friends/reject.php', true, -1), 'user', $GLOBALS['registry']->getAuth()),
+ Folks::getUrlFor('user', $GLOBALS['registry']->getAuth(), true, -1));
$result = $friends->sendNotification($user, $title, $body);
if ($result instanceof PEAR_Error) {
$notification->push($result);
$notification->push(sprintf(_("User \"%s\" was confirmed as a friend."), $user), 'horde.success');
$title = sprintf(_("%s approved you as a friend on %s"),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$registry->get('name', 'horde'));
$body = sprintf(_("User %s confirmed you as a friend on %s.. \nTo see to his profile, go to: %s \n"),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$registry->get('name', 'horde'),
- Folks::getUrlFor('user', Horde_Auth::getAuth(), true, -1));
+ Folks::getUrlFor('user', $GLOBALS['registry']->getAuth(), true, -1));
$friends->sendNotification($user, $title, $body);
$form->addVariable(_("Friend's e-mail"), 'email', 'email', true);
$v = &$form->addVariable(_("Subject"), 'subject', 'text', true);
-$v->setDefault(sprintf(_("%s Invited to join %s."), ucfirst(Horde_Auth::getAuth()), $registry->get('name', 'horde')));
+$v->setDefault(sprintf(_("%s Invited to join %s."), ucfirst($GLOBALS['registry']->getAuth()), $registry->get('name', 'horde')));
$v = &$form->addVariable(_("Body"), 'body', 'longtext', true);
try {
$body = Horde::loadConfiguration('invite.php', 'body', 'folks');
$body = sprintf($body, $registry->get('name', 'horde'),
- Folks::getUrlFor('user', Horde_Auth::getAuth(), true),
+ Folks::getUrlFor('user', $GLOBALS['registry']->getAuth(), true),
Horde::applicationUrl('account/signup.php', true),
- Horde_Auth::getAuth());
+ $GLOBALS['registry']->getAuth());
} catch (Horde_Exception $e) {
$body = $body->getMessage();
}
}
$friends = Folks_Friends::singleton(null, array('user' => $user));
-$result = $friends->removeFriend(Horde_Auth::getAuth());
+$result = $friends->removeFriend($GLOBALS['registry']->getAuth());
if ($result instanceof PEAR_Error) {
$notification->push($result);
header('Location: ' . Horde::applicationUrl('edit/friends/index.php'));
$notification->push(sprintf(_("User \"%s\" was rejected as a friend."), $user), 'horde.success');
$title = sprintf(_("%s rejected you as a friend on %s"),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$registry->get('name', 'horde'));
$body = sprintf(_("User %s rejected you as a friend on %s.. \nTo see to his profile, go to: %s \n"),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$registry->get('name', 'horde'),
- Folks::getUrlFor('user', Horde_Auth::getAuth(), true, -1));
+ Folks::getUrlFor('user', $GLOBALS['registry']->getAuth(), true, -1));
$friends->sendNotification($user, $title, $body);
}
// try to chage it
- $result = $folks_driver->changePassword($info['new'], Horde_Auth::getAuth());
+ $result = $folks_driver->changePassword($info['new'], $GLOBALS['registry']->getAuth());
if ($result instanceof PEAR_Error) {
$notification->push($result);
break;
$title = _("Privacy");
-$profile = $folks_driver->getRawProfile(Horde_Auth::getAuth());
+$profile = $folks_driver->getRawProfile($GLOBALS['registry']->getAuth());
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
header('Location: ' . Folks::getUrlFor('list', 'list'));
$firendActivities = array_slice($firendActivities, 0, 30);
// Own activities
-$activities = $folks_driver->getActivity(Horde_Auth::getAuth());
+$activities = $folks_driver->getActivity($GLOBALS['registry']->getAuth());
if ($activities instanceof PEAR_Error) {
$notification->push($activities);
header('Location: ' . Folks::getUrlFor('list', 'list'));
$friends = Folks_Friends::singleton('sql', array('user' => $user));
- return $friends->isBlacklisted(Horde_Auth::getAuth());
+ return $friends->isBlacklisted($GLOBALS['registry']->getAuth());
}
/**
public function logActivity($message, $scope = 'folks', $user = null)
{
if (empty($user)) {
- $user = Horde_Auth::getAuth();
- } elseif ($user !== Horde_Auth::getAuth() &&
+ $user = $GLOBALS['registry']->getAuth();
+ } elseif ($user !== $GLOBALS['registry']->getAuth() &&
!$GLOBALS['registry']->isAdmin(array('permission' => 'admin:' . $scope))) {
return PEAR::raiseError(_("You cannot log activities for other users."));
}
require_once dirname(__FILE__) . '/base.php';
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
if ($online) {
require_once dirname(__FILE__) . '/base.php';
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
return $GLOBALS['folks_driver']->isOnline($user);
try {
$threads = $GLOBALS['registry']->call('forums/getThreadsByForumOwner',
- array(Horde_Auth::getAuth(), 'message_timestamp', 1, false,
+ array($GLOBALS['registry']->getAuth(), 'message_timestamp', 1, false,
'folks', 0, $this->_params['limit']));
} catch (Horde_Exception $e) {
return $e->getMessage();
}
- $url = Folks::getUrlFor('user', Horde_Auth::getAuth());
+ $url = Folks::getUrlFor('user', $GLOBALS['registry']->getAuth());
foreach ($threads as $message) {
$html .= '<tr><td>'
. '<a href="' . $url . '" title="' . $message['message_date']. '">'
// Update profile
if ($GLOBALS['registry']->isAuthenticated()) {
- $this->_saveProfile(array('last_online_on' => $_SERVER['REQUEST_TIME']), Horde_Auth::getAuth());
+ $this->_saveProfile(array('last_online_on' => $_SERVER['REQUEST_TIME']), $GLOBALS['registry']->getAuth());
}
}
static $profiles;
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
if (empty($user)) {
public function changePassword($password, $user = null)
{
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$password = hash('md5', $password);
public function saveProfile($data, $user = null)
{
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$GLOBALS['cache']->expire('folksProfile' . $user);
// Delete groups
if ($GLOBALS['conf']['friends']) {
$shares = $GLOBALS['injector']->getInstance('Horde_Share')->getScope();
- $groups = $shares->listShares(Horde_Auth::getAuth(), Horde_Perms::SHOW, true);
+ $groups = $shares->listShares($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW, true);
foreach ($groups as $share) {
$result = $shares->removeShare($share);
if ($result instanceof PEAR_Error) {
public function getAttributes($user = null, $group = null)
{
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$attributes = $GLOBALS['cache']->get('folksUserAttributes' . $user, $GLOBALS['conf']['cache']['default_lifetime']);
public function saveAttributes($data, $group, $user = null)
{
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$GLOBALS['cache']->expire('folksAttributes' . $user);
*/
public function saveSearch($criteria, $name)
{
- $GLOBALS['cache']->expire('folksearch' . Horde_Auth::getAuth());
+ $GLOBALS['cache']->expire('folksearch' . $GLOBALS['registry']->getAuth());
return $this->_saveSearch($criteria, $name);
}
*/
public function getSavedSearch()
{
- $search = $GLOBALS['cache']->get('folksearch' . Horde_Auth::getAuth(), $GLOBALS['conf']['cache']['default_lifetime']);
+ $search = $GLOBALS['cache']->get('folksearch' . $GLOBALS['registry']->getAuth(), $GLOBALS['conf']['cache']['default_lifetime']);
if ($search) {
return unserialize($search);
}
return $search;
}
- $GLOBALS['cache']->set('folksearch' . Horde_Auth::getAuth(), serialize($search));
+ $GLOBALS['cache']->set('folksearch' . $GLOBALS['registry']->getAuth(), serialize($search));
return $search;
}
*/
public function deleteSavedSearch($name)
{
- $GLOBALS['cache']->expire('folksearch' . Horde_Auth::getAuth());
+ $GLOBALS['cache']->expire('folksearch' . $GLOBALS['registry']->getAuth());
return $this->_deleteSavedSearch($name);
}
public function logActivity($message, $scope = 'folks', $user = null)
{
if ($user == null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
if (empty($message)) {
*/
public function deleteActivity($scope, $date)
{
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
$GLOBALS['cache']->expire($user . '_activity');
return $this->_deleteActivity($scope, $date, $user);
}
protected function _updateOnlineStatus()
{
$query = 'REPLACE INTO ' . $this->_params['online'] . ' (user_uid, ip_address, time_last_click) VALUES (?, ?, ?)';
- return $this->_write_db->query($query, array(Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_TIME']));
+ return $this->_write_db->query($query, array($GLOBALS['registry']->getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_TIME']));
}
/**
protected function _logView($id)
{
$query = 'REPLACE INTO ' . $this->_params['views'] . ' (view_uid, user_uid, view_time) VALUES (?, ?, ?)';
- return $this->_write_db->query($query, array($id, Horde_Auth::getAuth(), $_SERVER['REQUEST_TIME']));
+ return $this->_write_db->query($query, array($id, $GLOBALS['registry']->getAuth(), $_SERVER['REQUEST_TIME']));
}
/**
public function getViews()
{
$query = 'SELECT user_uid FROM ' . $this->_params['views'] . ' WHERE view_uid = ?';
- return $this->_db->getCol($query, 0, array(Horde_Auth::getAuth()));
+ return $this->_db->getCol($query, 0, array($GLOBALS['registry']->getAuth()));
}
/**
{
$query = 'INSERT INTO ' . $this->_params['search'] . ' (user_uid, search_name, search_criteria) VALUES (?, ?, ?)';
- return $this->_write_db->query($query, array(Horde_Auth::getAuth(), $name, $criteria));
+ return $this->_write_db->query($query, array($GLOBALS['registry']->getAuth(), $name, $criteria));
}
/**
{
$query = 'SELECT search_name FROM ' . $this->_params['search'] . ' WHERE user_uid = ?';
- return $this->_db->getCol($query, 'search_name', Horde_Auth::getAuth());
+ return $this->_db->getCol($query, 'search_name', $GLOBALS['registry']->getAuth());
}
/**
{
$query = 'SELECT search_criteria FROM ' . $this->_params['search'] . ' WHERE user_uid = ? AND search_name = ?';
- return $this->_db->getOne($query, array(Horde_Auth::getAuth(), $name));
+ return $this->_db->getOne($query, array($GLOBALS['registry']->getAuth(), $name));
}
/**
{
$query = 'DELETE FROM ' . $this->_params['search'] . ' WHERE user_uid = ? AND search_name = ?';
- return $this->_write_db->query($query, array(Horde_Auth::getAuth(), $name));
+ return $this->_write_db->query($query, array($GLOBALS['registry']->getAuth(), $name));
}
/**
{
$img = Horde_Themes::img(null, 'horde');
$menu = new Horde_Menu(Horde_Menu::MASK_ALL);
- $menu->add(self::getUrlFor('user', Horde_Auth::getAuth()), _("My profile"), 'myaccount.png', $img);
+ $menu->add(self::getUrlFor('user', $GLOBALS['registry']->getAuth()), _("My profile"), 'myaccount.png', $img);
$menu->add(self::getUrlFor('list', 'friends'), _("Friends"), 'group.png', $img);
$menu->add(Horde::applicationUrl('edit/edit.php'), _("Edit profile"), 'edit.png', $img);
$menu->add(Horde::applicationUrl('services.php'), _("Services"), 'horde.png', $img);
static public function singleton($driver = null, $params = null)
{
if (empty($params['user'])) {
- $params['user'] = Horde_Auth::getAuth();
+ $params['user'] = $GLOBALS['registry']->getAuth();
}
$signature = $driver . ':' . $params['user'];
*/
protected function __construct($params)
{
- $this->_user = empty($params['user']) ? Horde_Auth::getAuth() : $params['user'];
+ $this->_user = empty($params['user']) ? $GLOBALS['registry']->getAuth() : $params['user'];
$this->_cache = $GLOBALS['injector']->getInstance('Horde_Cache');
}
private function _lists($type, $user = null)
{
if (empty($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$u_prefs = Horde_Prefs::singleton($GLOBALS['conf']['prefs']['driver'], $GLOBALS['registry']->getApp(), $user);
$share = $GLOBALS['folks_shares']->getShareById($group);
// Only owners of a group can delete them
- if (!Horde_Auth::getAuth() ||
- (Horde_Auth::getAuth() != $share->get('owner') &&
+ if (!$GLOBALS['registry']->getAuth() ||
+ ($GLOBALS['registry']->getAuth() != $share->get('owner') &&
!$GLOBALS['registry']->isAdmin(array('permission' => 'folks:admin')))) {
return PEAR::raiseError("You can rename only your own groups.");
}
}
// Only owners of a group can delete them
- if (!Horde_Auth::getAuth() ||
- (Horde_Auth::getAuth() != $share->get('owner') &&
+ if (!$GLOBALS['registry']->getAuth() ||
+ ($GLOBALS['registry']->getAuth() != $share->get('owner') &&
!$GLOBALS['registry']->isAdmin(array('permission' => 'folks:admin')))) {
return PEAR::raiseError("You can delete only your own groups.");
}
if (empty($user)) {
if ($GLOBALS['registry']->isAuthenticated()) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
} else {
return true;
}
if (empty($user)) {
if ($GLOBALS['registry']->isAuthenticated()) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
} else {
return true;
}
if (isset($_GET['logout_reason'])) {
setcookie('folks_login_user', '', $_SERVER['REQUEST_TIME'] - 1000, $conf['cookie']['path'], $conf['cookie']['domain']);
setcookie('folks_login_code', '', $_SERVER['REQUEST_TIME'] - 1000, $conf['cookie']['path'], $conf['cookie']['domain']);
- $folks_driver->deleteOnlineUser(Horde_Auth::getAuth());
+ $folks_driver->deleteOnlineUser($GLOBALS['registry']->getAuth());
@session_destroy();
if (!empty($_GET['redirect'])) {
* Special login for apps (gollem, imp)?
*/
if ($conf['login']['prelogin'] &&
- Horde_Auth::getAuth() &&
+ $GLOBALS['registry']->getAuth() &&
($app = Horde_Util::getGet('app'))) {
Horde::callHook('prelogin', array($app), 'folks');
}
*/
if ($registry->isAuthenticated()) {
if (empty($url_param)) {
- $url_param = Folks::getUrlFor('user', Horde_Auth::getAuth());
+ $url_param = Folks::getUrlFor('user', $GLOBALS['registry']->getAuth());
}
header('Location: ' . $url_param);
exit;
}
if (is_a($share, 'PEAR_Error')) {
$notification->push($share, 'horde.error');
- } elseif (!Horde_Auth::getAuth() ||
- (isset($share) && Horde_Auth::getAuth() != $share->get('owner'))) {
+ } elseif (!$GLOBALS['registry']->getAuth() ||
+ (isset($share) && $GLOBALS['registry']->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() ||
- Horde_Auth::getAuth() != $share->get('owner')) {
+ if (!$GLOBALS['registry']->getAuth() ||
+ $GLOBALS['registry']->getAuth() != $share->get('owner')) {
exit('permission denied');
}
$perm = &$share->getPermission();
$old_owner = $share->get('owner');
$new_owner = $registry->convertUsername(Horde_Util::getFormData('owner', $old_owner), true);
if ($old_owner !== $new_owner && !empty($new_owner)) {
- if ($old_owner != Horde_Auth::getAuth() && !$registry->isAdmin()) {
+ if ($old_owner != $GLOBALS['registry']->getAuth() && !$registry->isAdmin()) {
$notification->push(_("Only the owner or system administrator may change ownership or owner permissions for a share"), 'horde.error');
} else {
$share->set('owner', $new_owner);
$groupList = array();
try {
$groupList = empty($conf['share']['any_group'])
- ? $groups->getGroupMemberships(Horde_Auth::getAuth(), true)
+ ? $groups->getGroupMemberships($GLOBALS['registry']->getAuth(), true)
: $groups->listGroups();
asort($groupList);
} catch (Horde_Group_Exception $e) {
require_once dirname(__FILE__) . '/../lib/base.php';
$auth = $injector->getInstance('Horde_Auth')->getOb();
-if (!Horde_Auth::getAuth() &&
+if (!$GLOBALS['registry']->getAuth() &&
(!isset($_SERVER['PHP_AUTH_USER']) ||
!$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)))) {
header('WWW-Authenticate: Basic realm="Letter RSS Interface"');
require_once dirname(__FILE__) . '/../lib/base.php';
$auth = $injector->getInstance('Horde_Auth')->getOb();
-if (!Horde_Auth::getAuth() &&
+if (!$GLOBALS['registry']->getAuth() &&
(!isset($_SERVER['PHP_AUTH_USER']) ||
!$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)))) {
header('WWW-Authenticate: Basic realm="Letter RSS Interface"');
require_once dirname(__FILE__) . '/../lib/base.php';
$auth = $injector->getInstance('Horde_Auth')->getOb();
-if (!Horde_Auth::getAuth() &&
+if (!$GLOBALS['registry']->getAuth() &&
(!isset($_SERVER['PHP_AUTH_USER']) ||
!$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)))) {
header('WWW-Authenticate: Basic realm="Letter RSS Interface"');
continue;
}
foreach ($friend_friends as $friend_friend) {
- if ($friend_friend == Horde_Auth::getAuth() ||
+ if ($friend_friend == $GLOBALS['registry']->getAuth() ||
in_array($friend_friend, $my_list)) {
continue;
} elseif (isset($users[$friend_friend])) {
if (!isset($_COOKIE['online'])) {
// Add this to your tempalte file
- $sql = 'REPLACE INTO folks_online SET user_uid="' . Horde_Auth::getAuth() . '", ip_address="' . $_SERVER["REMOTE_ADDR"] . '", time_last_click="' . $_SERVER['REQUEST_TIME'] . '"';
+ $sql = 'REPLACE INTO folks_online SET user_uid="' . $GLOBALS['registry']->getAuth() . '", ip_address="' . $_SERVER["REMOTE_ADDR"] . '", time_last_click="' . $_SERVER['REQUEST_TIME'] . '"';
mysql_unbuffered_query($sql);
// If not using cront with online.sql
- // $sql = 'UPDATE folks_users SET last_online_on = "' . $_SERVER['REQUEST_TIME'] .'" WHERE user_uid = "' . Horde_Auth::getAuth() . '"';
+ // $sql = 'UPDATE folks_users SET last_online_on = "' . $_SERVER['REQUEST_TIME'] .'" WHERE user_uid = "' . $GLOBALS['registry']->getAuth() . '"';
// mysql_unbuffered_query($sql)
// If not using cront with online.sql
<h1><?php echo $title ?></h1>
<?php
-if ($user == Horde_Auth::getAuth()) {
+if ($user == $GLOBALS['registry']->getAuth()) {
echo $form->renderActive(null, null, '', 'post') . '<br />';
}
?>
($profile['last_online'] == 'all' ||
$GLOBALS['registry']->isAuthenticated() && (
$profile['last_online'] == 'authenticated' ||
- $profile['last_online'] == 'friends' && $friends_driver->isFriend(Horde_Auth::getAuth())))
+ $profile['last_online'] == 'friends' && $friends_driver->isFriend($GLOBALS['registry']->getAuth())))
) {
echo ' ' . _("Last time online") . ': ' . Folks::format_datetime($profile['last_online_on']);
}
<tr>
<td class="header" colspan="2">
<span style="float: right">
-<a href="<?php echo $path ?>/wishlist.php?wishlist=<?php echo Horde_Auth::getAuth() ?>" title="<?php echo _("Add your content") ?>"><img src="<?php echo Horde_Themes::img('plus.png') ?>" /></a>
+<a href="<?php echo $path ?>/wishlist.php?wishlist=<?php echo $GLOBALS['registry']->getAuth() ?>" title="<?php echo _("Add your content") ?>"><img src="<?php echo Horde_Themes::img('plus.png') ?>" /></a>
<a href="<?php echo $path ?>" title="<?php echo _("Preview") ?>"><img src="<?php echo Horde_Themes::img('nav/right.png') ?>" /></a>
</span>
<a href="<?php echo $path ?>/wishlist.php?wishlist=<?php echo $user ?>" title="<?php echo _("Others user content") ?>" ><?php echo $registry->get('name', 'genie') ?> (<?php echo $profile['count_wishes'] ?>)</a>
<tr>
<td class="header" colspan="2">
<span style="float: right">
-<a href="<?php echo $path ?>/view.php?groupby=owner&view=List&owner=<?php echo Horde_Auth::getAuth() ?>" title="<?php echo _("Add your content") ?>"><img src="<?php echo Horde_Themes::img('plus.png') ?>" /></a>
+<a href="<?php echo $path ?>/view.php?groupby=owner&view=List&owner=<?php echo $GLOBALS['registry']->getAuth() ?>" title="<?php echo _("Add your content") ?>"><img src="<?php echo Horde_Themes::img('plus.png') ?>" /></a>
<a href="<?php echo $path ?>" title="<?php echo _("Preview") ?>"><img src="<?php echo Horde_Themes::img('nav/right.png') ?>" /></a>
</span>
<a href="<?php echo $path ?>/view.php?groupby=owner&view=List&owner=<?php echo $user ?>" title="<?php echo _("Others user content") ?>" ><?php echo $registry->get('name', 'ansel') ?> (<?php echo $profile['count_galleries'] ?>)</a> |
case 'authenticated':
$allow_comments = $GLOBALS['registry']->isAuthenticated();
if ($allow_comments) {
- if ($friends_driver->isBlacklisted(Horde_Auth::getAuth())) {
+ if ($friends_driver->isBlacklisted($GLOBALS['registry']->getAuth())) {
$allow_comments = false;
$comments_reason = sprintf(_("You are on %s blacklist."), $user);
}
break;
case 'friends':
- $allow_comments = $friends_driver->isFriend(Horde_Auth::getAuth());
+ $allow_comments = $friends_driver->isFriend($GLOBALS['registry']->getAuth());
$comments_reason = _("Only authenticated users can post comments.");
break;
default:
$allow_comments = true;
- if ($GLOBALS['registry']->isAuthenticated() && $friends_driver->isBlacklisted(Horde_Auth::getAuth())) {
+ if ($GLOBALS['registry']->isAuthenticated() && $friends_driver->isBlacklisted($GLOBALS['registry']->getAuth())) {
$allow_comments = false;
$comments_reason = sprintf(_("You are on %s blacklist."), $user);
}
require_once dirname(__FILE__) . '/lib/base.php';
// Load profile
-$user = Horde_Util::getFormData('user', Horde_Auth::getAuth());
+$user = Horde_Util::getFormData('user', $GLOBALS['registry']->getAuth());
$profile = $folks_driver->getProfile($user);
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
}
// Prepare an process activity form
-if ($user == Horde_Auth::getAuth()) {
+if ($user == $GLOBALS['registry']->getAuth()) {
require_once FOLKS_BASE . '/lib/Forms/Activity.php';
$vars = Horde_Variables::getDefaultVariables();
$form = new Folks_Activity_Form($vars, _("What are you doing right now?"), 'short');
try {
$horde_groups = Horde_Group::singleton();
$groups = empty($GLOBALS['conf']['share']['any_group'])
- ? $horde_groups->getGroupMemberships(Horde_Auth::getAuth(), true)
+ ? $horde_groups->getGroupMemberships($GLOBALS['registry']->getAuth(), true)
: $horde_groups->listGroups();
asort($groups);
} catch (Horde_Group_Exception $e) {
}
/**
- * Returns the currently logged in user, if there is one. This is the
- * unique Horde ID.
- *
- * @see self::getOriginalAuth()
- *
- * @return mixed The userId of the current user, or false if no user is
- * logged in.
- */
- static public function getAuth()
- {
- return empty($_SESSION['horde_auth']['userId'])
- ? false
- : $_SESSION['horde_auth']['userId'];
- }
-
- /**
- * Get the authentication username. This is the username used to
- * originally login to Horde.
- *
- * @see self::getAuth()
- *
- * @return mixed The authentication backend's user name, or false if no
- * user is logged in.
- */
- static public function getOriginalAuth()
- {
- return empty($_SESSION['horde_auth']['authId'])
- ? false
- : $_SESSION['horde_auth']['authId'];
- }
-
- /**
* Return whether the authentication backend requested a password change.
*
* @return boolean Whether the backend requested a password change.
}
/**
- * Returns the curently logged-in user without any domain information
- * (e.g., foo@example.com would be returned as 'foo').
- *
- * @return mixed The user ID of the current user, or false if no user
- * is logged in.
- */
- static public function getBareAuth()
- {
- $user = self::getAuth();
- return ($user && (($pos = strpos($user, '@')) !== false))
- ? substr($user, 0, $pos)
- : $user;
- }
-
- /**
- * Returns the domain of currently logged-in user (e.g., foo@example.com
- * would be returned as 'example.com').
- *
- * @return mixed The domain suffix of the current user, or false.
- */
- static public function getAuthDomain()
- {
- $user = self::getAuth();
- return ($user && (($pos = strpos($user, '@')) !== false))
- ? substr($user, $pos + 1)
- : false;
- }
-
- /**
* Returns the requested credential for the currently logged in user, if
* present.
*
*/
static public function getCredential($credential = null, $app = null)
{
- if (!self::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
return false;
}
*/
static public function setCredential($credential, $value, $app = null)
{
- if (self::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$credentials = self::_getCredentials($app);
if ($credentials !== false) {
{
$app = empty($options['app']) ? 'horde' : $options['app'];
$authId = $userId = trim($authId);
- $is_auth = self::getAuth();
+ $is_auth = $GLOBALS['registry']->getAuth();
try {
if (!$is_auth) {
public function transparent()
{
$userId = empty($this->_credentials['userId'])
- ? Horde_Auth::getAuth()
+ ? $GLOBALS['registry']->getAuth()
: $this->_credentials['userId'];
$credentials = empty($this->_credentials['credentials'])
? Horde_Auth::getCredential()
/* Build a custom query, based on the config file. */
$query = str_replace(
'\L',
- $this->_db->quote(Horde_Auth::getAuth()),
+ $this->_db->quote($GLOBALS['registry']->getAuth()),
$this->_params['query_list']
);
public function checkExistingAuth()
{
return !empty($_SERVER[$this->_params['username_header']]) &&
- $this->_removeScope($_SERVER[$this->_params['username_header']]) == Horde_Auth::getAuth();
+ $this->_removeScope($_SERVER[$this->_params['username_header']]) == $GLOBALS['registry']->getAuth();
}
/**
* Moved signup code to horde/Core.
* Add ability to retrieve app-specific credentials via
Horde_Auth::getCredential().
- * Add Horde_Auth::getOriginalAuth().
* Split Horde_Auth:: into Horde_Auth:: and Horde_Auth_Base:: components.
* Initial Horde 4 package.
</notes>
/* If this application contains neither transparent nor
* authenticate capabilities, it does not require any
* authentication if already authenticated to Horde. */
- return (Horde_Auth::getAuth() &&
+ return ($GLOBALS['registry']->getAuth() &&
!$this->hasCapability('authenticate'));
}
if (($driver == 'smtp') &&
$params['auth'] &&
empty($params['username'])) {
- $params['username'] = Horde_Auth::getAuth();
+ $params['username'] = $GLOBALS['registry']->getAuth();
$params['password'] = Horde_Auth::getCredential('password');
}
$notify->addType('default', '*', 'Horde_Core_Notification_Status');
$notify->addType('status', 'horde.*', 'Horde_Core_Notification_Status');
- $notify->addDecorator(new Horde_Notification_Handler_Decorator_Alarm($injector->getInstance('Horde_Alarm'), Horde_Auth::getAuth()));
+ $notify->addDecorator(new Horde_Notification_Handler_Decorator_Alarm($injector->getInstance('Horde_Alarm'), $GLOBALS['registry']->getAuth()));
$notify->addDecorator(new Horde_Core_Notification_Hordelog());
return $notify;
}
$params = array(
- 'user' => is_null($user) ? Horde_Auth::getAuth() : $user,
+ 'user' => is_null($user) ? $GLOBALS['registry']->getAuth() : $user,
);
if (isset($GLOBALS['prefs']) &&
- ($params['user'] == Horde_Auth::getAuth())) {
+ ($params['user'] == $GLOBALS['registry']->getAuth())) {
$params['prefs'] = $GLOBALS['prefs'];
} else {
$params['prefs'] = Horde_Prefs::singleton($GLOBALS['conf']['prefs']['driver'], $GLOBALS['registry']->getApp(), $user, '', null, false);
$params = array(
'hostspec' => $session->getImapServer(),
- 'username' => Horde_Auth::getAuth(),
+ 'username' => $GLOBALS['registry']->getAuth(),
'password' => Horde_Auth::getCredential('password'),
'secure' => true
);
*/
public function isAuthenticated()
{
- return (Horde_Auth::getAuth() !== false);
+ return ($GLOBALS['registry']->getAuth() !== false);
}
/**
$auth_target = '_parent';
}
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
if ((!$prefs->getValue('show_sidebar') || $this->showService('logout')) &&
($logout_link = Horde::getServiceLink('logout', $app))) {
$this->add($logout_link, _("_Log out"), 'logout.png', null, $auth_target, null, '__noselection');
return true;
case 'authenticated':
- return (bool)Horde_Auth::getAuth();
+ return (bool)$GLOBALS['registry']->getAuth();
default:
case 'never':
* - To all authenticated users if no permission is set on $app.
* - To anyone who is allowed by an explicit ACL on $app. */
if ($checkPerms) {
- if (Horde_Auth::getAuth() && !Horde_Auth::checkExistingAuth()) {
+ if ($GLOBALS['registry']->getAuth() && !Horde_Auth::checkExistingAuth()) {
throw new Horde_Exception('User is not authorized', self::AUTH_FAILURE);
}
if (!$this->hasPermission($app, Horde_Perms::READ)) {
throw new Horde_Exception('User is not authorized', self::AUTH_FAILURE);
}
- Horde::logMessage(sprintf('%s does not have READ permission for %s', Horde_Auth::getAuth() ? 'User ' . Horde_Auth::getAuth() : 'Guest user', $app), 'DEBUG');
- throw new Horde_Exception(sprintf(_('%s is not authorized for %s.'), Horde_Auth::getAuth() ? 'User ' . Horde_Auth::getAuth() : 'Guest user', $this->applications[$app]['name']), self::PERMISSION_DENIED);
+ Horde::logMessage(sprintf('%s does not have READ permission for %s', $GLOBALS['registry']->getAuth() ? 'User ' . $GLOBALS['registry']->getAuth() : 'Guest user', $app), 'DEBUG');
+ throw new Horde_Exception(sprintf(_('%s is not authorized for %s.'), $GLOBALS['registry']->getAuth() ? 'User ' . $GLOBALS['registry']->getAuth() : 'Guest user', $this->applications[$app]['name']), self::PERMISSION_DENIED);
}
}
* explicit permissions, or for apps that allow the given permission. */
return $this->isAdmin() ||
($GLOBALS['injector']->getInstance('Horde_Perms')->exists($app)
- ? $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission($app, Horde_Auth::getAuth(), $perms)
- : (bool)Horde_Auth::getAuth());
+ ? $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission($app, $GLOBALS['registry']->getAuth(), $perms)
+ : (bool)$GLOBALS['registry']->getAuth());
}
/**
/* If there is no logged in user, return an empty Horde_Prefs::
* object with just default preferences. */
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
$GLOBALS['prefs'] = Horde_Prefs::factory('Session', $app, '', '', null, false);
} else {
if (!isset($GLOBALS['prefs']) ||
- ($GLOBALS['prefs']->getUser() != Horde_Auth::getAuth())) {
- $GLOBALS['prefs'] = Horde_Prefs::factory($GLOBALS['conf']['prefs']['driver'], $app, Horde_Auth::getAuth(), Horde_Auth::getCredential('password'));
+ ($GLOBALS['prefs']->getUser() != $GLOBALS['registry']->getAuth())) {
+ $GLOBALS['prefs'] = Horde_Prefs::factory($GLOBALS['conf']['prefs']['driver'], $app, $GLOBALS['registry']->getAuth(), Horde_Auth::getCredential('password'));
} else {
$GLOBALS['prefs']->retrieve($app);
}
/* Using cache while not authenticated isn't possible because,
* although storage is possible, retrieval isn't since there is no
* MD5 sum in the session to use to build the cache IDs. */
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
return;
}
/* Using cache while not authenticated isn't possible because,
* although storage is possible, retrieval isn't since there is no
* MD5 sum in the session to use to build the cache IDs. */
- if (Horde_Auth::getAuth() &&
+ if ($GLOBALS['registry']->getAuth() &&
($id = $this->_getCacheId($name))) {
$result = $GLOBALS['injector']->getInstance('Horde_Cache')->get($id, 86400);
if ($result !== false) {
{
$user = isset($options['user'])
? $options['user']
- : Horde_Auth::getAuth();
+ : $GLOBALS['registry']->getAuth();
if ($user &&
@is_array($GLOBALS['conf']['auth']['admins']) &&
public function isAuthenticated($options = array())
{
/* Check for cached authentication results. */
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$driver = (empty($options['app']) || ($options['app'] == 'horde'))
? $GLOBALS['conf']['auth']['driver']
: $options['app'];
}
}
+ /**
+ * Returns the currently logged in user, if there is one.
+ *
+ * @param string $format The return format:
+ * <pre>
+ * 'bare' - Horde ID without any domain information (e.g., foo@example.com
+ * would be returned as 'foo').
+ * 'default' - [DEFAULT] The unique Horde ID.
+ * 'domain' - Domain of the Horde ID (e.g., foo@example.com would be
+ * returned as 'example.com').
+ * 'original' - The username used to originally login to Horde.
+ * </pre>
+ *
+ * @return mixed The user ID or false if no user is logged in.
+ */
+ public function getAuth($format = 'default')
+ {
+ if ($format == 'original') {
+ return empty($_SESSION['horde_auth']['authId'])
+ ? false
+ : $_SESSION['horde_auth']['authId'];
+ }
+
+ if (empty($_SESSION['horde_auth']['userId'])) {
+ return false;
+ }
+
+ $user = $_SESSION['horde_auth']['userId'];
+
+ switch ($format) {
+ case 'bare':
+ return (($pos = strpos($user, '@')) === false)
+ ? $user
+ : substr($user, 0, $pos);
+
+ case 'domain':
+ return (($pos = strpos($user, '@')) === false)
+ ? false
+ : substr($user, $pos + 1);
+
+ case 'default':
+ return $user;
+ }
+ }
+
}
Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
is_null($order) ? NULL : (int)$order,
$data,
- (string)Horde_Auth::getAuth(),
+ (string)$GLOBALS['registry']->getAuth(),
(int)$ser,
$parents);
if (empty($contact_shares)) {
$scope = $GLOBALS['registry']->hasInterface('contacts');
$shares = $GLOBALS['injector']->getInstance('Horde_Share')->getScope($scope);
- $this->_contact_shares = $shares->listShares(Horde_Auth::getAuth(), Horde_Perms::SHOW, Horde_Auth::getAuth());
+ $this->_contact_shares = $shares->listShares($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW, $GLOBALS['registry']->getAuth());
}
// Contruct a list of owner ids to use
foreach ($this->_contact_shares as $id => $share) {
}
}
} else {
- $owners = array(Horde_Auth::getAuth());
+ $owners = array($GLOBALS['registry']->getAuth());
}
$owner_ids = array();
foreach ($owners as $owner) {
$history = $this->getHistory($guid);
if (!isset($attributes['who'])) {
- $attributes['who'] = Horde_Auth::getAuth();
+ $attributes['who'] = $GLOBALS['registry']->getAuth();
}
if (!isset($attributes['ts'])) {
$attributes['ts'] = time();
);
} else {
$params = array(
- 'user' => Horde_Auth::getAuth(),
+ 'user' => $GLOBALS['registry']->getAuth(),
'pass' => Horde_Auth::getCredential('password'),
);
}
*/
public function getCurrentUser()
{
- return Horde_Auth::getAuth();
+ return $GLOBALS['registry']->getAuth();
}
}
if (isset($this->_params['owner'])) {
$this->_owner = $this->_params['owner'];
} else if (class_exists('Horde_Auth')) {
- $this->_owner = Horde_Auth::getAuth();
+ $this->_owner = $GLOBALS['registry']->getAuth();
} else {
$this->_owner = '';
}
{
// Handle default shares
if (class_exists('Horde_Auth')
- && $share == Horde_Auth::getAuth()) {
+ && $share == $GLOBALS['registry']->getAuth()) {
$result = $this->getDefault($type);
if (!empty($result)) {
return $result->name;
$pos = strpos($this->_folder->name, $search_prefix);
if ($pos !== false && $pos == 0) {
- $key = 'user/' . Horde_Auth::getBareAuth() . '/'
+ $key = 'user/' . $GLOBALS['registry']->getAuth('bare') . '/'
. substr($this->_folder->name,
strlen($search_prefix))
. $this->_type_key;
*/
function getShareId()
{
- $current_user = Horde_Auth::getAuth();
+ $current_user = $GLOBALS['registry']->getAuth();
if ($this->isDefault() && $this->getOwner() == $current_user) {
return $current_user;
}
require_once 'HTTP/Request.php';
$http = new HTTP_Request($url, $options);
- $http->setBasicAuth(Horde_Auth::getAuth(), Horde_Auth::getCredential('password'));
+ $http->setBasicAuth($GLOBALS['registry']->getAuth(), Horde_Auth::getCredential('password'));
@$http->sendRequest();
if ($http->getResponseCode() != 200) {
return PEAR::raiseError(sprintf(_("Unable to trigger URL %s. Response: %s"),
}
}
- $shares = &$share_obj->listShares(Horde_Auth::getAuth());
+ $shares = &$share_obj->listShares($GLOBALS['registry']->getAuth());
// A share for each IMSP adress book we can see.
foreach ($abooks as $abook_uid) {
$found = false;
if (Net_IMSP_Utils::_isOwner($abook_uid,
$serverInfo['params']['username'],
$params['acl'])) {
- $params['owner'] = Horde_Auth::getAuth();
+ $params['owner'] = $GLOBALS['registry']->getAuth();
} else {
// TODO: What to do for the owner when it's not current user?
// We'd have to try to match the owner per IMSP
}
// Now prune any shares that no longer exist on the IMSP server.
- $existing = $share_obj->listShares(Horde_Auth::getAuth(), Horde_Perms::READ);
+ $existing = $share_obj->listShares($GLOBALS['registry']->getAuth(), Horde_Perms::READ);
foreach ($existing as $key => $share) {
$temp = unserialize($share->get('params'));
if (is_array($temp)) {
if (strpos($acl, 'l') !== false) {
$hPerms |= Horde_Perms::SHOW;
}
- $share->addUserPermission(Horde_Auth::getAuth(), $hPerms);
+ $share->addUserPermission($GLOBALS['registry']->getAuth(), $hPerms);
}
/**
}
if (is_null($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
// If this is a guest user, only check guest permissions.
* 'contacts.search',
* array(array('jan'), array('localsql'),
* array('name', 'email')),
- * array('user' => Horde_Auth::getAuth(),
+ * array('user' => $GLOBALS['registry']->getAuth(),
* 'pass' => Horde_Auth::getCredential('password')));
* </code>
*
$GLOBALS['__horde_rpc_PhpSoap']['lastMethodCalled'],
implode(', ', array_map(create_function('$a', 'return is_array($a) ? "Array" : $a;'),
$GLOBALS['__horde_rpc_PhpSoap']['lastMethodParams'])),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
time() - $beginTime,
ob_get_length()),
'INFO');
}
try {
- $lockid = $locks->setLock(Horde_Auth::getAuth(), 'webdav', $params['path'],
+ $lockid = $locks->setLock($GLOBALS['registry']->getAuth(), 'webdav', $params['path'],
$timeout, $locktype);
} catch (Horde_Lock_Exception $e) {
Horde::logMessage($e, 'ERR');
}
$params['locktoken'] = $lockid;
- $params['owner'] = Horde_Auth::getAuth();
+ $params['owner'] = $GLOBALS['registry']->getAuth();
$params['timeout'] = $timeout;
return "200";
}
$share = $this->_newShare($name);
$share->setShareOb($this);
- $share->set('owner', Horde_Auth::getAuth());
+ $share->set('owner', $GLOBALS['registry']->getAuth());
return $share;
}
}
/** Okay, no default folder yet */
- $share = $this->newShare(Horde_Auth::getAuth());
+ $share = $this->newShare($GLOBALS['registry']->getAuth());
/** The value does not matter here as the share will rewrite it */
$share->set('name', '');
return false;
}
// Try to place the item lock at app:shareid scope.
- return $locks->setLock(Horde_Auth::getAuth(), $itemscope, $item_uid,
+ return $locks->setLock($GLOBALS['registry']->getAuth(), $itemscope, $item_uid,
$timeout, $locktype);
} else {
// Share lock requested. Check for locked items.
return false;
}
// Try to place the share lock
- return $locks->setLock(Horde_Auth::getAuth(), $this->_shareOb->getApp(),
+ return $locks->setLock($GLOBALS['registry']->getAuth(), $this->_shareOb->getApp(),
$shareid, $timeout, $locktype);
}
}
// We actually ignore the random id string that all horde apps provide
// as initial name and wait for a set('name', 'xyz') call. But we want
// to know if we should create a default share.
- if ($id == Horde_Auth::getAuth()) {
+ if ($id == $GLOBALS['registry']->getAuth()) {
$this->_data['default'] = true;
} else {
$this->_data['default'] = false;
*/
public function countChildren($perm = Horde_Perms::SHOW, $allLevels = true)
{
- return $this->_shareOb->countShares(Horde_Auth::getAuth(), $perm, null, $this, $allLevels);
+ return $this->_shareOb->countShares($GLOBALS['registry']->getAuth(), $perm, null, $this, $allLevels);
}
/**
*/
public function getChildren($perm = Horde_Perms::SHOW, $allLevels = true)
{
- return $this->_shareOb->listShares(Horde_Auth::getAuth(), $perm, null, 0, 0,
+ return $this->_shareOb->listShares($GLOBALS['registry']->getAuth(), $perm, null, 0, 0,
null, 1, $this, $allLevels, is_null($perm));
}
/* If we are an existing share, check for any children */
if ($this->getId()) {
$children = $this->_shareOb->listShares(
- Horde_Auth::getAuth(), Horde_Perms::EDIT, null, 0, 0, null, 0,
+ $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT, null, 0, 0, null, 0,
$this->getId());
} else {
$children = array();
$share = $this->_newShare();
$share->setShareOb($this);
//@TODO: inject the Auth object
- $share->set('owner', Horde_Auth::getAuth());
+ $share->set('owner', $GLOBALS['registry']->getAuth());
return $share;
}
$from = 0, $count = 0)
{
$sql = 'SELECT DISTINCT(s.share_owner) '
- . $this->getShareCriteria(Horde_Auth::getAuth(), $perm, null,
+ . $this->getShareCriteria($GLOBALS['registry']->getAuth(), $perm, null,
$parent, $allLevels);
if ($count) {
$owners = array();
foreach ($allowners as $owner) {
- if ($this->countShares(Horde_Auth::getAuth(), $perm, $owner, $parent,
+ if ($this->countShares($GLOBALS['registry']->getAuth(), $perm, $owner, $parent,
$allLevels)) {
$owners[] = $owner;
public function countOwners($perm = Horde_Perms::SHOW, $parent = null, $allLevels = true)
{
$sql = 'SELECT COUNT(DISTINCT(s.share_owner)) '
- . $this->getShareCriteria(Horde_Auth::getAuth(), $perm, null, $parent,
+ . $this->getShareCriteria($GLOBALS['registry']->getAuth(), $perm, null, $parent,
$allLevels);
return $this->_db->queryOne($sql);
function &newPermission($name) {
$perms = array(
'users' => array(
- Horde_Auth::getAuth() => Horde_Perms::SHOW | Horde_Perms::READ |
+ $GLOBALS['registry']->getAuth() => Horde_Perms::SHOW | Horde_Perms::READ |
Horde_Perms::EDIT | Horde_Perms::DELETE));
$result = &new Horde_Perms_Permission($name, $perms);
return $result;
{
$auth = $GLOBALS['injector']->getInstance('Horde_Auth')->getOb();
return $auth->authenticate($username, array('password' => $password))
- ? Horde_Auth::getAuth()
+ ? $GLOBALS['registry']->getAuth()
: false;
}
function setAuthenticated($username, $credData)
{
Horde_Auth::setAuth($username, $credData);
- return Horde_Auth::getAuth();
+ return $GLOBALS['registry']->getAuth();
}
/**
$filenames = $this->_getAppUids($app);
}
- $owner = Horde_Auth::getAuth();
+ $owner = $GLOBALS['registry']->getAuth();
$file = $files = array();
foreach ($filenames as $filename) {
return $files;
}
- $owner = Horde_Auth::getAuth();
+ $owner = $GLOBALS['registry']->getAuth();
$file = $files = array();
$mime_message = Horde_Mime_Part::parseMessage($raw_message);
$parts = $mime_message->contentTypeMap();
- $owner = Horde_Auth::getAuth();
+ $owner = $GLOBALS['registry']->getAuth();
$file = $files = array();
$mime_message = Horde_Mime_Part::parseMessage($raw_message);
$parts = $mime_message->contentTypeMap();
- $owner = Horde_Auth::getAuth();
+ $owner = $GLOBALS['registry']->getAuth();
foreach ($parts as $part_id => $disposition) {
$part = $mime_message->getPart($part_id);
// ),
'loginparams' => array(),
'root' => '/home',
- 'home' => '/home/' . Horde_Auth::getAuth(),
+ 'home' => '/home/' . $GLOBALS['registry']->getAuth(),
// 'createhome' => false,
// 'filter' => '^regex$',
// 'quota' => false,
),
'loginparams' => array(),
'root' => '/',
- 'home' => Horde_Auth::getAuth(),
+ 'home' => $GLOBALS['registry']->getAuth(),
// 'createhome' => false,
// 'filter' => '^regex$',
// 'quota' => false,
}
return (((count($auto_server) == 1) || $force) &&
- Horde_Auth::getAuth() &&
+ $GLOBALS['registry']->getAuth() &&
empty($GLOBALS['gollem_backends'][$key]['loginparams']) &&
!empty($GLOBALS['gollem_backends'][$key]['hordeauth']));
}
/* Set username now. Don't set the current username if the backend
* already has a username defined. */
if (empty($ptr['params']['username'])) {
- $ptr['params']['username'] = ($user === null) ? Horde_Auth::getBareAuth() : $user;
+ $ptr['params']['username'] = ($user === null) ? $GLOBALS['registry']->getAuth('bare') : $user;
}
/* Set password now. The password should always be encrypted within
static protected function _getCacheID($dir)
{
global $prefs;
- return implode('|', array(Horde_Auth::getAuth(), $_SESSION['gollem']['backend_key'], $prefs->getValue('show_dotfiles'), $prefs->getValue('sortdirsfirst'), $prefs->getValue('sortby'), $prefs->getValue('sortdir'), $dir));
+ return implode('|', array($GLOBALS['registry']->getAuth(), $_SESSION['gollem']['backend_key'], $prefs->getValue('show_dotfiles'), $prefs->getValue('sortdirsfirst'), $prefs->getValue('sortby'), $prefs->getValue('sortdir'), $dir));
}
/**
static public function checkPermissions($filter, $permission = Horde_Perms::READ,
$backend = null)
{
- $userID = Horde_Auth::getAuth();
+ $userID = $GLOBALS['registry']->getAuth();
if ($backend === null) {
$backend = $_SESSION['gollem']['backend_key'];
}
{
return (!empty($GLOBALS['gollem_backends'][$backend]['hordeauth']) &&
(strcasecmp($GLOBALS['gollem_backends'][$backend]['hordeauth'], 'full') === 0))
- ? Horde_Auth::getAuth()
- : Horde_Auth::getBareAuth();
+ ? $GLOBALS['registry']->getAuth()
+ : $GLOBALS['registry']->getAuth('bare');
}
/**
// // in production, by virtue of demonstrating all those. :)
// public function prefs_hook_theme($username = null)
// {
-// if (Horde_Auth::getAuth() != 'chuck') {
+// if ($GLOBALS['registry']->getAuth() != 'chuck') {
// return 'mozilla';
// }
//
// {
// // Example #1
// if (is_null($name)) {
-// $name = Horde_Auth::getAuth();
+// $name = $GLOBALS['registry']->getAuth();
// }
//
// if (!empty($name)) {
// // You will probably need to replace cd= with uid=; this syntax
// // is for Netware 5.1 nldap.
// $cmd = '/usr/bin/ldapsearch -b ' . $base_context . ' -s ' . $scope . ' cn=' .
-// escapeShellCmd(Horde_Auth::getAuth()) .
+// escapeShellCmd($GLOBALS['registry']->getAuth()) .
// ' | /usr/bin/grep mail | /usr/bin/awk \'{print $2}\'';
// $mails = `$cmd`;
// $mail_array = explode("\n", $mails);
// $ds = @ldap_connect($ldapServer, $ldapPort);
//
// if (is_null($name)) {
-// $name = Horde_Auth::getAuth();
+// $name = $GLOBALS['registry']->getAuth();
// if ($name === false) {
// return '';
// }
// // Example #1: Set the fullname from the GECOS information in the
// // passwd file.
// if (is_null($user)) {
-// $user = Horde_Auth::getBareAuth();
+// $user = $GLOBALS['registry']->getAuth('bare');
// if ($user === false) {
// return '';
// }
// $ds = @ldap_connect($ldapServer, $ldapPort);
//
// if (is_null($user)) {
-// $user = Horde_Auth::getAuth();
+// $user = $GLOBALS['registry']->getAuth();
// if ($user === false) {
// return '';
// }
if (!$main_page) {
/* Always redirect to login page if there is no incoming URL and nobody
* is authenticated. */
- if (!Horde_Auth::getAuth()) {
+ if (!$registry->getAuth()) {
$main_page = Horde::applicationUrl('login.php', true);
} else {
/* Search for a user-specified initial application. */
* there is no authenticated user, and conf->menu->always is true; or if
* 'force_sidebar' GET parameter is set. */
if ((Horde_Util::getFormData('force_sidebar') ||
- !Horde_Util::nonInputVar('horde_login_nosidebar', Horde_Auth::getAuth())) &&
+ !Horde_Util::nonInputVar('horde_login_nosidebar', $registry->getAuth())) &&
($conf['menu']['always'] ||
- (Horde_Auth::getAuth() && $prefs->getValue('show_sidebar')))) {
+ ($registry->getAuth() && $prefs->getValue('show_sidebar')))) {
$scrollbar = $browser->hasQuirk('scrollbar_in_way') ? 'yes' : 'auto';
require HORDE_TEMPLATES . '/index/frames_index.inc';
} else {
public function removeUserData($user)
{
if (!$GLOBALS['registry']->isAdmin() &&
- $user != Horde_Auth::getAuth()) {
+ $user != $GLOBALS['registry']->getAuth()) {
throw new Horde_Exception(_("You are not allowed to remove user data."));
}
*/
function getUsername()
{
- return Horde_String::lower(Horde_Auth::getBareAuth());
+ return Horde_String::lower($GLOBALS['registry']->getAuth('bare'));
}
/**
*/
function getRealm()
{
- return (string)Horde_Auth::getAuthDomain();
+ return strval($GLOBALS['registry']->getAuth('domain'));
}
/**
*/
function getUsername()
{
- return $this->_params['strip'] ? Horde_Auth::getBareAuth() : Horde_Auth::getAuth();
+ return $GLOBALS['registry']->getAuth($this->_params['strip'] ? 'bare' : null);
}
/**
foreach ($apps as $a) {
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
if (file_exists($registry->get('fileroot', $a)) &&
- (($perms->exists($a) && ($perms->hasPermission($a, Horde_Auth::getAuth(), Horde_Perms::READ) || $registry->isAdmin())) ||
+ (($perms->exists($a) && ($perms->hasPermission($a, $GLOBALS['registry']->getAuth(), Horde_Perms::READ) || $registry->isAdmin())) ||
!$perms->exists($a))) {
$out[$a] = $registry->get('name', $a);
}
protected function _syncmlManagement($ui)
{
Horde::addScriptFile('syncmlprefs.js', 'horde');
- $devices = SyncML_Backend::factory('Horde')->getUserAnchors(Horde_Auth::getAuth());
+ $devices = SyncML_Backend::factory('Horde')->getUserAnchors($GLOBALS['registry']->getAuth());
$t = $GLOBALS['injector']->createInstance('Horde_Template');
$t->setOption('gettext', true);
$t->setOption('gettext', true);
$selfurl = $ui->selfUrl();
$t->set('reset', $selfurl->copy()->add('reset', 1));
- $devices = $stateMachine->listDevices(Horde_Auth::getAuth());
+ $devices = $stateMachine->listDevices($GLOBALS['registry']->getAuth());
$devs = array();
$i = 1;
foreach ($devices as $device) {
$device['class'] = fmod($i++, 2) ? 'rowOdd' : 'rowEven';
- $stateMachine->loadDeviceInfo($device['device_id'], Horde_Auth::getAuth());
+ $stateMachine->loadDeviceInfo($device['device_id'], $GLOBALS['registry']->getAuth());
$ts = $stateMachine->getLastSyncTimestamp();
$device['ts'] = empty($ts) ? _("None") : strftime($GLOBALS['prefs']->getValue('date_format') . ' %H:%M', $ts);
switch ($device['device_rwstatus']) {
$backend = SyncML_Backend::factory('Horde');
if ($ui->vars->removedb && $ui->vars->removedevice) {
- $res = $backend->removeAnchor(Horde_Auth::getAuth(), $ui->vars->removedevice, $ui->vars->removedb);
+ $res = $backend->removeAnchor($GLOBALS['registry']->getAuth(), $ui->vars->removedevice, $ui->vars->removedb);
if ($res instanceof PEAR_Error) {
$GLOBALS['notification']->push(_("Error deleting synchronization session:") . ' ' . $res->getMessage(), 'horde.error');
} else {
$GLOBALS['notification']->push(sprintf(_("Deleted synchronization session for device \"%s\" and database \"%s\"."), $ui->vars->deviceid, $ui->vars->db), 'horde.success');
}
} elseif ($ui->vars->deleteall) {
- $res = $backend->removeAnchor(Horde_Auth::getAuth());
+ $res = $backend->removeAnchor($GLOBALS['registry']->getAuth());
if ($res instanceof PEAR_Error) {
$GLOBALS['notification']->push(_("Error deleting synchronization sessions:") . ' ' . $res->getMessage(), 'horde.error');
} else {
$stateMachine = new Horde_ActiveSync_State_History($state_params);
$stateMachine->setLogger($GLOBALS['injector']->getInstance('Horde_Log_Logger'));
if ($ui->vars->wipeid) {
- $stateMachine->loadDeviceInfo($ui->vars->wipeid, Horde_Auth::getAuth());
+ $stateMachine->loadDeviceInfo($ui->vars->wipeid, $GLOBALS['registry']->getAuth());
$stateMachine->setDeviceRWStatus($ui->vars->wipeid, Horde_ActiveSync::RWSTATUS_PENDING);
$GLOBALS['notification']->push(sprintf(_("A Remote Wipe for device id %s has been initiated. The device will be wiped during the next SYNC request."), $ui->vars->wipe));
} elseif ($ui->vars->cancelwipe) {
- $stateMachine->loadDeviceInfo($ui->vars->cancelwipe, Horde_Auth::getAuth());
+ $stateMachine->loadDeviceInfo($ui->vars->cancelwipe, $GLOBALS['registry']->getAuth());
$stateMachine->setDeviceRWStatus($ui->vars->cancelwipe, Horde_ActiveSync::RWSTATUS_OK);
$GLOBALS['notification']->push(sprintf(_("The Remote Wipe for device id %s has been cancelled."), $ui->vars->wipe));
} elseif ($ui->vars->reset) {
- $devices = $stateMachine->listDevices(Horde_Auth::getAuth());
+ $devices = $stateMachine->listDevices($GLOBALS['registry']->getAuth());
foreach ($devices as $device) {
- $stateMachine->removeState(null, $device['device_id'], Horde_Auth::getAuth());
+ $stateMachine->removeState(null, $device['device_id'], $GLOBALS['registry']->getAuth());
}
$GLOBALS['notification']->push(_("All state removed for your devices. They will resynchronize next time they connect to the server."));
} elseif ($ui->vars->removedevice) {
- $stateMachine->removeState(null, $ui->vars->removedevice, Horde_Auth::getAuth());
+ $stateMachine->removeState(null, $ui->vars->removedevice, $GLOBALS['registry']->getAuth());
}
}
/* Initialize the Auth credentials key. */
if (!$is_auth) {
- $GLOBALS['injector']->getInstance('Horde_Secret')->setKey('auth');
+ $injector->getInstance('Horde_Secret')->setKey('auth');
}
/* Get an Auth object. */
$language = $prefs->getValue('language');
- $entry = sprintf('User %s [%s] logged out of Horde', Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
+ $entry = sprintf('User %s [%s] logged out of Horde', $registry->getAuth(), $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, 'NOTICE');
$registry->clearAuth();
}
if ($auth->authenticate(Horde_Util::getPost('horde_user'), $auth_params)) {
- $entry = sprintf('Login success for %s [%s] to %s.', Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR'], ($app && $is_auth) ? $app : 'horde');
+ $entry = sprintf('Login success for %s [%s] to %s.', $registry->getAuth(), $_SERVER['REMOTE_ADDR'], ($app && $is_auth) ? $app : 'horde');
Horde::logMessage($entry, 'NOTICE');
if (!empty($url_in)) {
/* Do password change request on initial login only. */
if (!$is_auth && Horde_Auth::passwordChangeRequested()) {
- $GLOBALS['notification']->push(_("Your password has expired."), 'horde.message');
+ $notification->push(_("Your password has expired."), 'horde.message');
if ($auth->hasCapability('update')) {
$change_url = Horde::applicationUrl('services/changepassword.php');
* $conf['auth']['password_policy']);
*/
try {
- $auth->updateUser(Horde_Auth::getAuth(), Horde_Auth::getAuth(), array('password' => $info['password_1']));
+ $auth->updateUser($registry->getAuth(), $registry->getAuth(), array('password' => $info['password_1']));
$notification->push(_("Password changed successfully."), 'horde.success');
$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
$fullname = $identity->getValue('fullname');
if (empty($fullname)) {
- $fullname = $registry->convertUsername(Horde_Auth::getAuth(), false);
+ $fullname = $registry->convertUsername($registry->getAuth(), false);
}
// Get refresh interval.
$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
$fullname = $identity->getValue('fullname');
if (empty($fullname)) {
- $fullname = Horde_Auth::getAuth();
+ $fullname = $registry->getAuth();
}
$links = array();
// the first call.
if (is_null($isAdmin)) {
$isAdmin = $registry->isAdmin();
- $user = Horde_Auth::getAuth();
+ $user = $registry->getAuth();
}
// Check if the current user has permisson to see this application, and if
}
}
- if (Horde_Auth::getAuth()) {
+ if ($registry->getAuth()) {
$menu['logout'] = array('name' => _("Log out"),
'status' => 'active',
'icon' => (string)Horde_Themes::img('logout.png'),
require_once dirname(__FILE__) . '/../../lib/Application.php';
Horde_Registry::appInit('horde', array('authentication' => 'none'));
-if (!Horde_Auth::getAuth() && !$conf['menu']['always']) {
+if (!$registry->getAuth() && !$conf['menu']['always']) {
$registry->authenticateFailure();
}
$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity();
$email = $identity->getValue('from_addr');
if (!$email) {
- $email = Horde_Util::getFormData('email', Horde_Auth::getAuth());
+ $email = Horde_Util::getFormData('email', $registry->getAuth());
}
$message = Horde_Util::getFormData('message', '');
$name = Horde_Util::getFormData('name', $identity->getValue('fullname'));
$attachment = null;
if (!empty($conf['problems']['attachments'])) {
try {
- $GLOBALS['browser']->wasFileUploaded('attachment', _("attachment"));
+ $browser->wasFileUploaded('attachment', _("attachment"));
$attachment = $_FILES['attachment'];
} catch (Horde_Browser_Exception $e) {
if ($e->getCode() != UPLOAD_ERR_NO_FILE) {
}
try {
- $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
+ $mail->send($injector->getInstance('Horde_Mail'));
/* We succeeded. */
Horde::logMessage(
);
$app = Horde_Util::getFormData('app');
-$shares = $GLOBALS['injector']->getInstance('Horde_Share')->getScope($app);
+$shares = $injector->getInstance('Horde_Share')->getScope($app);
$groups = Horde_Group::singleton();
$auth = $injector->getInstance('Horde_Auth')->getOb();
if ($registry->hasMethod('shareHelp', $app)) {
}
}
- if (!Horde_Auth::getAuth() ||
+ if (!$registry->getAuth() ||
(isset($share) &&
!$registry->isAdmin() &&
- Horde_Auth::getAuth() != $share->get('owner'))) {
+ $registry->getAuth() != $share->get('owner'))) {
exit('permission denied');
}
break;
}
if (!empty($share)) {
- if (!Horde_Auth::getAuth() ||
+ if (!$registry->getAuth() ||
(!$registry->isAdmin() &&
- Horde_Auth::getAuth() != $share->get('owner'))) {
+ $registry->getAuth() != $share->get('owner'))) {
exit('permission denied');
}
$perm = &$share->getPermission();
$new_owner_backend = Horde_Util::getFormData('owner_select', Horde_Util::getFormData('owner_input', $old_owner));
$new_owner = $registry->convertUsername($new_owner_backend, true);
if ($old_owner !== $new_owner && !empty($new_owner)) {
- if ($old_owner != Horde_Auth::getAuth() && !$registry->isAdmin()) {
+ if ($old_owner != $registry->getAuth() && !$registry->isAdmin()) {
$notification->push(_("Only the owner or system administrator may change ownership or owner permissions for a share"), 'horde.error');
} elseif ($auth->hasCapability('list') && !$auth->exists($new_owner_backend)) {
$notification->push(sprintf(_("The user \"%s\" does not exist."), $new_owner_backend), 'horde.error');
}
if ($registry->isAdmin() ||
- !empty($GLOBALS['conf']['share']['world'])) {
+ !empty($conf['share']['world'])) {
// Process default permissions.
if (Horde_Util::getFormData('default_show')) {
$perm->addDefaultPermission(Horde_Perms::SHOW, false);
try {
$groupList = empty($conf['share']['any_group'])
- ? $groups->getGroupMemberships(Horde_Auth::getAuth(), true)
+ ? $groups->getGroupMemberships($registry->getAuth(), true)
: $groups->listGroups();
asort($groupList);
} catch (Horde_Group_Exception $e) {
if ($id && $snooze) {
try {
- $alarm->snooze($id, Horde_Auth::getAuth(), (int)$snooze);
+ $alarm->snooze($id, $registry->getAuth(), (int)$snooze);
} catch (Horde_Alarm_Exception $e) {
header('HTTP/1.0 500 ' . $e->getMessage());
}
$sql = 'INSERT INTO swoosh_messages (message_id, user_uid, gateway_id, message_batch_id, message_text, message_params, message_submitted) VALUES (?, ?, ?, ?, ?, ?, ?)';
$values = array((int)$message_id,
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
(int)$gateway_id,
is_null($message_batch_id) ? 'NULL' : (int)$message_batch_id,
$message_text,
function _getMessages()
{
$sql = 'SELECT * FROM swoosh_messages WHERE user_uid = ?';
- $values = array(Horde_Auth::getAuth());
+ $values = array($GLOBALS['registry']->getAuth());
Horde::logMessage('SQL Query by Hylax_Storage_sql::_getMessages(): ' . $sql, 'DEBUG');
$result = $this->_db->getAssoc($sql, false, $values, DB_FETCHMODE_ASSOC);
if (is_a($result, 'PEAR_Error')) {
'mailbox' => htmlspecialchars(IMP::$mailbox),
'oldrtemode' => $rtemode,
'rtemode' => $rtemode,
- 'user' => Horde_Auth::getAuth()
+ 'user' => $registry->getAuth()
);
if ($_SESSION['imp']['file_upload']) {
if ($_SESSION['imp']['file_upload']) {
$localeinfo = Horde_Nls::getLocaleInfo();
try {
- $t->set('selectlistlink', $GLOBALS['registry']->call('files/selectlistLink', array(_("Attach Files"), 'widget', 'compose', true)));
+ $t->set('selectlistlink', $registry->call('files/selectlistLink', array(_("Attach Files"), 'widget', 'compose', true)));
} catch (Horde_Exception $e) {
$t->set('selectlistlink', null);
}
// {
// // Example #1: Create e-mail for DSPAM setup.
// $prefix = ($action == 'spam') ? 'spam-' : 'fp-';
-// return $prefix . Horde_Auth::getBareAuth() . '@example.com';
+// return $prefix . $GLOBALS['registry']->getAuth('bare') . '@example.com';
// }
* To restrict logging to a certain user ('foo'), and to log this
* output to the file '/tmp/imaplog', the following can be used:
*
- * ((Horde_Auth::getAuth() == 'foo') ? '/tmp/imaplog' : false)
+ * (($GLOBALS['registry']->getAuth() == 'foo') ? '/tmp/imaplog' : false)
*
* quota: (array) Use this if you want to display a user's quota status on
* various IMP pages. Set to an empty value to disable quota status
*/
public function authAuthenticateCallback()
{
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$this->init();
IMP_Auth::authenticateCallback();
}
$imp_app = $GLOBALS['registry']->getApiInstance('imp', 'application');
if (!empty($imp_app->initParams['authentication']) &&
($imp_app->initParams['authentication'] == 'horde')) {
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
return false;
}
throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED);
break;
}
- $auth_id = Horde_Auth::getAuth();
+ $auth_id = $GLOBALS['registry']->getAuth();
$imap_ob = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb();
$msg = sprintf(
}
if ((!empty($auto_server) || $force) &&
- Horde_Auth::getAuth() &&
+ $GLOBALS['registry']->getAuth() &&
!empty($servers[$server_key]['hordeauth'])) {
return array(
- 'userId' => ((strcasecmp($servers[$server_key]['hordeauth'], 'full') == 0)
- ? Horde_Auth::getAuth()
- : Horde_Auth::getBareAuth()),
+ 'userId' => $GLOBALS['registry']->getAuth((strcasecmp($servers[$server_key]['hordeauth'], 'full') == 0) ? null : 'bare'),
'password' => Horde_Auth::getCredential('password'),
'server' => $server_key
);
}
}
- $entry = sprintf("%s Message sent to %s from %s", $_SERVER['REMOTE_ADDR'], $recipients, Horde_Auth::getAuth());
+ $entry = sprintf("%s Message sent to %s from %s", $_SERVER['REMOTE_ADDR'], $recipients, $GLOBALS['registry']->getAuth());
Horde::logMessage($entry, 'INFO');
/* Should we save this message in the sent mail folder? */
throw new IMP_Compose_Exception($e);
}
- Horde::logMessage(sprintf("%s Redirected message sent to %s from %s", $_SERVER['REMOTE_ADDR'], $recipients, Horde_Auth::getAuth()), 'INFO');
+ Horde::logMessage(sprintf("%s Redirected message sent to %s from %s", $_SERVER['REMOTE_ADDR'], $recipients, $GLOBALS['registry']->getAuth()), 'INFO');
/* Store history information. */
if (!empty($GLOBALS['conf']['maillog']['use_maillog'])) {
throw new IMP_Compose_Exception(_("Linked attachments are forbidden."));
}
- $auth = Horde_Auth::getAuth();
+ $auth = $GLOBALS['registry']->getAuth();
$baseurl = Horde::applicationUrl('attachment.php', true)->setRaw(true);
try {
return;
}
- $filename = hash('md5', Horde_Auth::getAuth());
+ $filename = hash('md5', $GLOBALS['registry']->getAuth());
try {
$vfs = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs();
{
$cacheid = empty($GLOBALS['conf']['server']['cache_folders'])
? null
- : 'imp_folder_cache|' . Horde_Auth::getAuth() . '|' . $_SESSION['imp']['server_key'];
+ : 'imp_folder_cache|' . $GLOBALS['registry']->getAuth() . '|' . $_SESSION['imp']['server_key'];
return new IMP_Folder($cacheid);
}
if (empty($_SESSION['imp']['cache']['tree'])) {
if (!($cache instanceof Horde_Cache_Null)) {
- $_SESSION['imp']['cache']['tree'] = uniqid(mt_rand() . Horde_Auth::getAuth());
+ $_SESSION['imp']['cache']['tree'] = uniqid(mt_rand() . $GLOBALS['registry']->getAuth());
}
} else {
$instance = @unserialize($cache->get($_SESSION['imp']['cache']['tree'], 86400));
} catch (VFS_Exception $e) {
return false;
}
- $path = IMP_Compose::VFS_LINK_ATTACH_PATH . '/' . Horde_Auth::getAuth();
+ $path = IMP_Compose::VFS_LINK_ATTACH_PATH . '/' . $GLOBALS['registry']->getAuth();
/* Make sure cleaning is done recursively. */
try {
return '';
}
- return implode('.', array('imp', str_replace('.', '*', Horde_Auth::getAuth()), $msgid));
+ return implode('.', array('imp', str_replace('.', '*', $GLOBALS['registry']->getAuth()), $msgid));
}
}
if (!isset($this->_cached['fromList'][$ident])) {
$val = $this->getValue('from_addr', $ident);
if (empty($val)) {
- $val = Horde_Auth::getBareAuth();
+ $val = $GLOBALS['registry']->getAuth('bare');
}
if (!strstr($val, '@')) {
$GLOBALS['notification']->notify($e);
return '';
}
- $canEdit = $ACL->canEdit($folder, Horde_Auth::getAuth());
+ $canEdit = $ACL->canEdit($folder, $GLOBALS['registry']->getAuth());
$t = $GLOBALS['injector']->createInstance('Horde_Template');
$t->setOption('gettext', true);
/* Build the SQL query. */
$query = sprintf('INSERT INTO %s (sentmail_who, sentmail_ts, sentmail_messageid, sentmail_action, sentmail_recipient, sentmail_success) VALUES (?, ?, ?, ?, ?, ?)', $this->_params['table']);
$values = array(
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
time(),
$message_id,
$action,
$query = sprintf('SELECT sentmail_recipient, count(*) AS sentmail_count FROM %s WHERE sentmail_who = %s AND sentmail_success = 1%s GROUP BY sentmail_recipient ORDER BY sentmail_count DESC LIMIT %d',
$this->_params['table'],
- $this->_db->quote(Horde_Auth::getAuth()),
+ $this->_db->quote($GLOBALS['registry']->getAuth()),
$where,
$limit);
$query = sprintf('SELECT COUNT(*) FROM %s WHERE sentmail_ts > ?',
$this->_params['table']);
if ($user) {
- $query .= sprintf(' AND sentmail_who = %s', $this->_db->quote(Horde_Auth::getAuth()));
+ $query .= sprintf(' AND sentmail_who = %s', $this->_db->quote($GLOBALS['registry']->getAuth()));
}
/* Execute the query. */
* be secure. */
$prog = str_replace(array('%u','%l', '%d'),
array(
- escapeshellarg(Horde_Auth::getAuth()),
- escapeshellarg(Horde_Auth::getBareAuth()),
- escapeshellarg(Horde_Auth::getAuthDomain())
+ escapeshellarg($GLOBALS['registry']->getAuth()),
+ escapeshellarg($GLOBALS['registry']->getAuth('bare')),
+ escapeshellarg($GLOBALS['registry']->getAuth('domain'))
), $GLOBALS['conf'][$action]['program']);
$proc = proc_open($prog,
array(
if (!is_null($from_line)) {
$spam_headers->addHeader('From', $from_line);
}
- $spam_headers->addHeader('Subject', sprintf(_("%s report from %s"), $action, Horde_Auth::getAuth()));
+ $spam_headers->addHeader('Subject', sprintf(_("%s report from %s"), $action, $GLOBALS['registry']->getAuth()));
/* Send the message. */
try {
$user_identity = $injector->getInstance('IMP_Identity');
$headers[] = array(
'header' => htmlspecialchars(_("Printed By")),
- 'value' => htmlspecialchars($user_identity->getFullname() ? $user_identity->getFullname() : Horde_Auth::getAuth())
+ 'value' => htmlspecialchars($user_identity->getFullname() ? $user_identity->getFullname() : $registry->getAuth())
);
}
/* Remove empty lines. */
$info['addresses'] = preg_replace('/\n{2,}/', "\n", implode("\n", $identity->getAll('from_addr')));
if (empty($addresses)) {
- $info['addresses'] = Horde_Auth::getAuth();
+ $info['addresses'] = $GLOBALS['registry']->getAuth();
}
}
$GLOBALS['all_rulesets'] = Ingo::listRulesets();
/* If personal share doesn't exist then create it. */
- $signature = $_SESSION['ingo']['backend']['id'] . ':' . Horde_Auth::getAuth();
+ $signature = $_SESSION['ingo']['backend']['id'] . ':' . $GLOBALS['registry']->getAuth();
if (!$GLOBALS['ingo_shares']->exists($signature)) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getOriginalAuth();
+ $name = $GLOBALS['registry']->getAuth('original');
}
$share = $GLOBALS['ingo_shares']->newShare($signature);
$share->set('name', $name);
$_SESSION['ingo']['current_share'] = Horde_Util::getFormData('ruleset', @$_SESSION['ingo']['current_share']);
if (empty($_SESSION['ingo']['current_share']) ||
empty($GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]) ||
- !$GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ !$GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$_SESSION['ingo']['current_share'] = $signature;
}
} else {
public function removeUserData($user)
{
if (!$GLOBALS['registry']->isAdmin() &&
- ($user != Horde_Auth::getAuth())) {
+ ($user != $GLOBALS['registry']->getAuth())) {
throw new Horde_Auth_Exception(_("You are not allowed to remove user data."));
}
static public function getUser($full = true)
{
if (empty($GLOBALS['ingo_shares'])) {
- $user = ($full ||
- (isset($_SESSION['ingo']['backend']['hordeauth']) &&
- $_SESSION['ingo']['backend']['hordeauth'] === 'full'))
- ? Horde_Auth::getAuth()
- : Horde_Auth::getBareAuth();
+ $baseuser = ($full ||
+ (isset($_SESSION['ingo']['backend']['hordeauth']) &&
+ $_SESSION['ingo']['backend']['hordeauth'] === 'full'));
+ $user = $GLOBALS['registry']->getAuth($baseuser ? null : 'bare');
} else {
list(, $user) = explode(':', $_SESSION['ingo']['current_share'], 2);
}
// Set authentication parameters.
if (!empty($_SESSION['ingo']['backend']['hordeauth'])) {
- $params['username'] = ($_SESSION['ingo']['backend']['hordeauth'] === 'full')
- ? Horde_Auth::getAuth() : Horde_Auth::getBareAuth();
+ $params['username'] = $GLOBALS['registry']->getAuth(($_SESSION['ingo']['backend']['hordeauth'] === 'full') ? null : 'bare');
$params['password'] = Horde_Auth::getCredential('password');
} elseif (isset($_SESSION['ingo']['backend']['params']['username']) &&
isset($_SESSION['ingo']['backend']['params']['password'])) {
$params['username'] = $_SESSION['ingo']['backend']['params']['username'];
$params['password'] = $_SESSION['ingo']['backend']['params']['password'];
} else {
- $params['username'] = Horde_Auth::getBareAuth();
+ $params['username'] = $GLOBALS['registry']->getAuth('bare');
$params['password'] = Horde_Auth::getCredential('password');
}
$permission = Horde_Perms::SHOW)
{
try {
- $rulesets = $GLOBALS['ingo_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null);
+ $rulesets = $GLOBALS['ingo_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null);
} catch (Horde_Share_Exception $e) {
Horde::logMessage($e, 'ERR');
return array();
}
if (is_null(self::$_shareCache)) {
- self::$_shareCache = $GLOBALS['ingo_shares']->getPermissions($_SESSION['ingo']['current_share'], Horde_Auth::getAuth());
+ self::$_shareCache = $GLOBALS['ingo_shares']->getPermissions($_SESSION['ingo']['current_share'], $GLOBALS['registry']->getAuth());
}
return self::$_shareCache & $mask;
$menu->add(Horde::applicationUrl('script.php'), _("_Script"), 'script.png');
}
if (!empty($GLOBALS['ingo_shares']) && empty($GLOBALS['conf']['share']['no_sharing'])) {
- $menu->add('#', _("_Permissions"), 'perms.png', Horde_Themes::img(null, 'horde'), '', Horde::popupJs(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('params' => array('app' => 'ingo', 'share' => $_SESSION['ingo']['backend']['id'] . ':' . Horde_Auth::getAuth()), 'urlencode' => true)) . 'return false;');
+ $menu->add('#', _("_Permissions"), 'perms.png', Horde_Themes::img(null, 'horde'), '', Horde::popupJs(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('params' => array('app' => 'ingo', 'share' => $_SESSION['ingo']['backend']['id'] . ':' . $GLOBALS['registry']->getAuth()), 'urlencode' => true)) . 'return false;');
}
return $menu;
public function removeUserData($user)
{
if (!$GLOBALS['registry']->isAdmin() &&
- $user != Horde_Auth::getAuth()) {
+ $user != $GLOBALS['registry']->getAuth()) {
throw new Ingo_Exception(_("Permission Denied"));
}
/* Remove empty lines. */
$addresses = preg_replace('/\n+/', "\n", $addresses);
if (empty($addresses)) {
- $addresses = Horde_Auth::getAuth();
+ $addresses = $GLOBALS['registry']->getAuth();
}
$vacation->setVacationAddresses($addresses);
}
$params = array(
'config' => 'jta.conf',
'plugins' => 'Status,Socket,SSH,Terminal',
- 'SSH.user' => (empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? Horde_Auth::getAuth() : Horde_Auth::getBareAuth()
+ 'SSH.user' => $GLOBALS['registry']->getAuth((empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? null : 'bare');
);
foreach ($this->_jtaParams as $key => $val) {
public function generateAppletCode()
{
$params = array(
- 'sshapps.connection.userName' => (empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? Horde_Auth::getAuth() : Horde_Auth::getBareAuth()
+ 'sshapps.connection.userName' => $GLOBALS['registry']->getAuth((empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? null : 'bare');
);
foreach ($this->_sshtoolsParams as $key => $val) {
case 'internal_channels':
case 'external_channels':
if (empty($in) || !$perms->exists('jonah:news:' . $filter . ':' . $in)) {
- return $perms->hasPermission('jonah:news:' . $filter, Horde_Auth::getAuth(), $permission);
+ return $perms->hasPermission('jonah:news:' . $filter, $GLOBALS['registry']->getAuth(), $permission);
} elseif (!is_array($in)) {
- return $perms->hasPermission('jonah:news:' . $filter . ':' . $in, Horde_Auth::getAuth(), $permission);
+ return $perms->hasPermission('jonah:news:' . $filter . ':' . $in, $GLOBALS['registry']->getAuth(), $permission);
} else {
foreach ($in as $key => $val) {
- if ($perms->hasPermission('jonah:news:' . $filter . ':' . $val, Horde_Auth::getAuth(), $permission)) {
+ if ($perms->hasPermission('jonah:news:' . $filter . ':' . $val, $GLOBALS['registry']->getAuth(), $permission)) {
$out[$key] = $val;
}
}
case 'channels':
foreach ($in as $key => $val) {
$perm_name = Jonah::typeToPermName($val['channel_type']);
- if ($perms->hasPermission('jonah:news:' . $perm_name, Horde_Auth::getAuth(), $permission) ||
- $perms->hasPermission('jonah:news:' . $perm_name . ':' . $val['channel_id'], Horde_Auth::getAuth(), $permission)) {
+ if ($perms->hasPermission('jonah:news:' . $perm_name, $GLOBALS['registry']->getAuth(), $permission) ||
+ $perms->hasPermission('jonah:news:' . $perm_name . ':' . $val['channel_id'], $GLOBALS['registry']->getAuth(), $permission)) {
$out[$key] = $in[$key];
}
}
break;
default:
- return $perms->hasPermission($filter, Horde_Auth::getAuth(), Horde_Perms::EDIT);
+ return $perms->hasPermission($filter, $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
}
return $out;
$channel = $this->getChannel($info['channel_id']);
$permalink = $this->getStoryLink($channel, $info);
$sql = 'INSERT INTO jonah_stories (story_id, channel_id, story_title, story_desc, story_body_type, story_body, story_url, story_published, story_updated, story_read, story_permalink, story_author) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
- $values = array($permalink, Horde_Auth::getAuth());
+ $values = array($permalink, $GLOBALS['registry']->getAuth());
} else {
$sql = 'UPDATE jonah_stories SET story_id = ?, channel_id = ?, story_title = ?, story_desc = ?, story_body_type = ?, story_body = ?, story_url = ?, story_published = ?, story_updated = ?, story_read = ? WHERE story_id = ?';
$values = array((int)$info['story_id']);
$form->addHidden('', 'channel_id', 'int', false);
$form->addHidden('', 'story_id', 'int', false);
$v = &$form->addVariable(_("From"), 'from', 'email', true, false);
-if (Horde_Auth::getAuth()) {
+if ($GLOBALS['registry']->getAuth()) {
$v->setDefault($injector->getInstance('Horde_Prefs_Identity')->getIdentity()->getValue('from_addr'));
}
$form->addVariable(_("To"), 'recipients', 'email', true, false, _("Separate multiple email addresses with commas."), true);
-echo Horde_Auth::getAuth();
+echo $GLOBALS['registry']->getAuth();
-echo $registry->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
-if($registry->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+echo $registry->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
+if($registry->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
echo "TASTA";
exit(0);
}
public function getServer()
{
if (!isset(self::$server)) {
- self::$server = Horde_Kolab_Server::singleton(array('user' => Horde_Auth::getAuth(),
+ self::$server = Horde_Kolab_Server::singleton(array('user' => $GLOBALS['registry']->getAuth(),
'pass' => Horde_Auth::getCredential('password')));
}
$this->welcome = isset($this->koward->conf['koward']['greeting']) ? $this->koward->conf['koward']['greeting'] : _("Welcome.");
- $this->current_user = Horde_Auth::getAuth();
+ $this->current_user = $GLOBALS['registry']->getAuth();
$session = Horde_Kolab_Session::singleton();
if (!empty($session->user_uid)) {
$menu->add($this->urlFor(array('controller' => 'check', 'action' => 'show')),
_("_Test"), 'problem.png', Horde_Themes::img(null, 'horde'));
}
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$menu->add($this->urlFor(array('controller' => 'index', 'action' => 'logout')),
_("_Logout"), 'logout.png', Horde_Themes::img(null, 'horde'));
}
if (!$this->koward->hasAccess($id, $permission)) {
$this->koward->notification->push(_("Access denied."), 'horde.error');
- Horde::logMessage(sprintf('User %s does not have access to action %s!', Horde_Auth::getAuth(), $id), 'NOTICE');
- if (Horde_Auth::getAuth()) {
+ Horde::logMessage(sprintf('User %s does not have access to action %s!', $GLOBALS['registry']->getAuth(), $id), 'NOTICE');
+ if ($GLOBALS['registry']->getAuth()) {
$url = $this->urlFor(array('controller' => 'index', 'action' => 'index'));
} else {
$url = $this->urlFor(array('controller' => 'index', 'action' => 'login'));
public function login()
{
- $auth = Horde_Auth::getAuth();
+ $auth = $GLOBALS['registry']->getAuth();
if (!empty($auth)) {
header('Location: ' . $this->urlFor(array('controller' => 'index', 'action' => 'index')));
exit;
if ($this->koward->auth->authenticate(Horde_Util::getPost('horde_user'),
array('password' => Horde_Util::getPost('horde_pass')))) {
$entry = sprintf('Login success for %s [%s] to Horde',
- Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
+ $GLOBALS['registry']->getAuth(), $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, 'NOTICE');
$type = $this->koward->getType();
public function logout()
{
$entry = sprintf('User %s [%s] logged out of Horde',
- Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
+ $GLOBALS['registry']->getAuth(), $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, 'NOTICE');
$GLOBALS['registry']->clearAuth();
list($calendar_id, $user) = explode(':', $targetcalendar, 2);
} else {
$calendar_id = $targetcalendar;
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
try {
$share = Kronolith::getInternalCalendar($calendar_id);
- if ($user != Horde_Auth::getAuth() &&
- !$share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE, Horde_Auth::getAuth())) {
+ if ($user != $GLOBALS['registry']->getAuth() &&
+ !$share->hasPermission($GLOBALS['registry']->getAuth(), Kronolith::PERMS_DELEGATE, $GLOBALS['registry']->getAuth())) {
$notification->push(sprintf(_("You do not have permission to delegate events to %s."), Kronolith::getUserName($user)), 'horde.warning');
- } elseif ($user == Horde_Auth::getAuth() &&
- !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, Horde_Auth::getAuth())) {
+ } elseif ($user == $GLOBALS['registry']->getAuth() &&
+ !$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT, $GLOBALS['registry']->getAuth())) {
$notification->push(sprintf(_("You do not have permission to add events to %s."), $share->get('name')), 'horde.warning');
} elseif ($GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_events') === true ||
$GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_events') > Kronolith::countEvents()) {
if (!$cal) {
$cal = $prefs->getValue('default_share');
if (!$cal) {
- $cal = Horde_Auth::getAuth();
+ $cal = $GLOBALS['registry']->getAuth();
}
$cal = array($cal);
}
try {
- $vfb = Kronolith_FreeBusy::generate($cal, null, null, true, Horde_Auth::getAuth());
+ $vfb = Kronolith_FreeBusy::generate($cal, null, null, true, $GLOBALS['registry']->getAuth());
$attendee_view->addRequiredMember($vfb);
} catch (Exception $e) {
$notification->push(sprintf(_("Error retrieving your free/busy information: %s"), $e->getMessage()));
// Exit if this isn't an authenticated user or if the user can't
// create new calendars (default share is locked).
-if (!Horde_Auth::getAuth() || $prefs->isLocked('default_share')) {
+if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('default_share')) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
require_once KRONOLITH_BASE . '/lib/Forms/DeleteCalendar.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
$vars = Horde_Variables::getDefaultVariables();
$calendar_id = $vars->get('c');
-if ($calendar_id == Horde_Auth::getAuth()) {
+if ($calendar_id == $GLOBALS['registry']->getAuth()) {
$notification->push(_("This calendar cannot be deleted."), 'horde.warning');
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
}
-if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($calendar->get('owner')) || !$registry->isAdmin())) {
$notification->push(_("You are not allowed to delete this calendar."), 'horde.error');
header('Location: ' . Horde::applicationUrl('calendars/', true));
require_once KRONOLITH_BASE . '/lib/Forms/EditCalendar.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
}
-if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($calendar->get('owner')) || !$registry->isAdmin())) {
$notification->push(_("You are not allowed to change this calendar."), 'horde.error');
header('Location: ' . Horde::applicationUrl('calendars/', true));
Horde_Registry::appInit('kronolith');
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php'));
exit;
}
Horde_Registry::appInit('kronolith');
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
exit;
}
// Exit if this isn't an authenticated user or if the user can't
// subscribe to remote calendars (remote_cals is locked).
-if (!Horde_Auth::getAuth() || $prefs->isLocked('remote_cals')) {
+if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('remote_cals')) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
// Exit if this isn't an authenticated user or if the user can't
// subscribe to remote calendars (remote_cals is locked).
-if (!Horde_Auth::getAuth() || $prefs->isLocked('remote_cals')) {
+if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('remote_cals')) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
// Exit if this isn't an authenticated user or if the user can't
// subscribe to remote calendars (remote_cals is locked).
-if (!Horde_Auth::getAuth() || $prefs->isLocked('remote_cals')) {
+if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('remote_cals')) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
// default calendar
// Set locked to true if you don't want users to have multiple calendars.
$_prefs['default_share'] = array(
- 'value' => Horde_Auth::getAuth() ? Horde_Auth::getAuth() : 0,
+ 'value' => $GLOBALS['registry']->getAuth() ? $GLOBALS['registry']->getAuth() : 0,
'type' => 'enum',
'desc' => _("Your default calendar:")
);
);
$_prefs['fb_url'] = array(
- 'value' => '<strong>' . _("My Free/Busy URL") . '</strong><div class="fburl"><div>' . _("Copy this URL for use wherever you need your Free/Busy URL:") . '</div><div class="fixed">' . Horde::applicationUrl('fb.php', true, -1)->add('u', Horde_Auth::getAuth()) . '</div></div>',
+ 'value' => '<strong>' . _("My Free/Busy URL") . '</strong><div class="fburl"><div>' . _("Copy this URL for use wherever you need your Free/Busy URL:") . '</div><div class="fixed">' . Horde::applicationUrl('fb.php', true, -1)->add('u', $GLOBALS['registry']->getAuth()) . '</div></div>',
'type' => 'rawhtml'
);
require_once dirname(__FILE__) . '/lib/Application.php';
Horde_Registry::appInit('kronolith');
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
echo Horde::wrapInlineScript(array('window.close();'));
exit;
}
$cleanup = true;
try {
$share = $kronolith_shares->getShare($_SESSION['import_data']['import_cal']);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("You do not have permission to add events to the selected calendar."), 'horde.error');
} else {
$next_step = $data->nextStep($actionID, $param);
}
$import_calendars = $export_calendars = array();
-if (Horde_Auth::getAuth()) {
+if ($GLOBALS['registry']->getAuth()) {
$calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT);
foreach ($calendars as $id => $calendar) {
- if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
continue;
}
$calendars = Kronolith::listCalendars(false, Horde_Perms::READ);
foreach ($calendars as $id => $calendar) {
- if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
continue;
}
if ($driver != 'Resource') {
$share = $kronolith_shares->getShare($event->calendar);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE, $event->creator)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE, $event->creator)) {
$notification->push(_("You do not have permission to delete this event."), 'horde.warning');
} else {
$have_perms = true;
list($target, $user) = explode(':', $targetcalendar, 2);
} else {
$target = $targetcalendar;
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
try {
$share = Kronolith::getInternalCalendar($target);
// has permissions to do so.
try {
$sourceShare = Kronolith::getInternalCalendar($source);
- if ($sourceShare->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE) &&
- (($user == Horde_Auth::getAuth() &&
- $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) ||
- ($user != Horde_Auth::getAuth() &&
- $share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE)))) {
+ if ($sourceShare->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE) &&
+ (($user == $GLOBALS['registry']->getAuth() &&
+ $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) ||
+ ($user != $GLOBALS['registry']->getAuth() &&
+ $share->hasPermission($GLOBALS['registry']->getAuth(), Kronolith::PERMS_DELEGATE)))) {
$kronolith_driver->open($source);
try {
$res = $kronolith_driver->move(Horde_Util::getFormData('eventID'), $target);
if ($event) {
if (isset($sourceShare)
- && !$sourceShare->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ && !$sourceShare->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(_("You do not have permission to move this event."), 'horde.warning');
- } elseif ($user != Horde_Auth::getAuth() &&
- !$share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE, $event->creator)) {
+ } elseif ($user != $GLOBALS['registry']->getAuth() &&
+ !$share->hasPermission($GLOBALS['registry']->getAuth(), Kronolith::PERMS_DELEGATE, $event->creator)) {
$notification->push(sprintf(_("You do not have permission to delegate events to %s."), Kronolith::getUserName($user)), 'horde.warning');
- } elseif ($user == Horde_Auth::getAuth() &&
- !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $event->creator)) {
+ } elseif ($user == $GLOBALS['registry']->getAuth() &&
+ !$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT, $event->creator)) {
$notification->push(_("You do not have permission to edit this event."), 'horde.warning');
} else {
$event->readForm();
case 'EditEvent':
if ($view->event->private &&
- $view->event->creator != Horde_Auth::getAuth()) {
+ $view->event->creator != $GLOBALS['registry']->getAuth()) {
$url = $url = Horde_Util::getFormData('url');
if (!empty($url)) {
$url = new Horde_Url($url, true);
sprintf(_("The requested feed (%s) was not found on this server."),
htmlspecialchars($calendar)));
}
-if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
- if (Horde_Auth::getAuth()) {
+if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
+ if ($GLOBALS['registry']->getAuth()) {
_no_access(403, 'Forbidden',
sprintf(_("Permission denied for the requested feed (%s)."),
htmlspecialchars($calendar)));
$tagger = new Kronolith_Tagger();
$result = new stdClass;
$result->tags = array();
- $tags = $tagger->getCloud(Horde_Auth::getAuth(), 10);
+ $tags = $tagger->getCloud($GLOBALS['registry']->getAuth(), 10);
foreach ($tags as $tag) {
$result->tags[] = $tag['tag_name'];
}
// Create a calendar.
if (!$calendar_id) {
- if (!Horde_Auth::getAuth() ||
+ if (!$GLOBALS['registry']->getAuth() ||
$GLOBALS['prefs']->isLocked('default_share')) {
return $result;
}
// Create a task list.
if (!$calendar_id) {
- if (!Horde_Auth::getAuth() ||
+ if (!$GLOBALS['registry']->getAuth() ||
$GLOBALS['prefs']->isLocked('default_share')) {
return $result;
}
'bg' => Kronolith::backgroundColor($calendar),
'show' => false,
'perms' => $calendar->getPermission()->data,
- 'edit' => $calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT),
+ 'edit' => $calendar->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT),
'tg' => array_values($tagger->getTags($calendar->getName(), 'calendar')));
return $result;
}
// otherwise, make sure the resource owner is the current user
$perm = empty($owner)
? $GLOBALS['registry']->isAdmin()
- : $owner == Horde_Auth::getAuth();
+ : $owner == $GLOBALS['registry']->getAuth();
if ($perm) {
$tagger = Kronolith::getTagger();
if ($type == 'calendar') {
$cal = $GLOBALS['kronolith_shares']->getShare($id);
- $hasEdit = $cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+ $hasEdit = $cal->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
} elseif ($type == 'event') {
$event = Kronolith::getDriver()->getByUID($id);
- $hasEdit = $event->hasPermission(Horde_Perms::EDIT, Horde_Auth::getAuth());
+ $hasEdit = $event->hasPermission(Horde_Perms::EDIT, $GLOBALS['registry']->getAuth());
}
foreach ($tags as $tag_id => $tag) {
$calendars = Kronolith::listCalendars(false, Horde_Perms::READ);
$owners = array();
foreach ($calendars as $calendar) {
- if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
continue;
} elseif (count($parts) == 1) {
// This request is for all calendars owned by the requested user
- $calendars = $GLOBALS['kronolith_shares']->listShares(Horde_Auth::getAuth(),
+ $calendars = $GLOBALS['kronolith_shares']->listShares($GLOBALS['registry']->getAuth(),
Horde_Perms::SHOW,
$parts[0]);
$results = array();
$results[$retpath . '.ics']['icon'] = Horde_Themes::img('mime/icalendar.png');
}
if (in_array('browseable', $properties)) {
- $results[$retpath]['browseable'] = $calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ);
+ $results[$retpath]['browseable'] = $calendar->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ);
$results[$retpath . '.ics']['browseable'] = false;
}
if (in_array('contenttype', $properties)) {
$event = Kronolith::getDriver()->getByUID($uid);
if (!$event->hasPermission(Horde_Perms::EDIT) ||
- ($event->private && $event->creator != Horde_Auth::getAuth())) {
+ ($event->private && $event->creator != $GLOBALS['registry']->getAuth())) {
throw new Horde_Exception_PermissionDenied();
}
}
if (empty($event) ||
- ($event->private && $event->creator != Horde_Auth::getAuth())) {
+ ($event->private && $event->creator != $GLOBALS['registry']->getAuth())) {
throw new Horde_Exception_PermissionDenied();
}
*/
public function listAlarms($time, $user = null)
{
- $current_user = Horde_Auth::getAuth();
+ $current_user = $GLOBALS['registry']->getAuth();
if ((empty($user) || $user != $current_user) && !$GLOBALS['registry']->isAdmin()) {
throw new Horde_Exception_PermissionDenied();
}
foreach ($all_shares as $id => $share) {
if (!empty($conf['share']['hidden']) &&
- ($share->get('owner') != Horde_Auth::getAuth()) &&
+ ($share->get('owner') != $GLOBALS['registry']->getAuth()) &&
!in_array($share->getName(), $GLOBALS['display_calendars'])) {
continue;
}
public function removeUserData($user)
{
if (!$GLOBALS['registry']->isAdmin() &&
- $user != Horde_Auth::getAuth()) {
+ $user != $GLOBALS['registry']->getAuth()) {
throw new Kronolith_Exception(_("You are not allowed to remove user data."));
}
'default' => '__all'));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
- if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ if ($cal->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($cal->getName(), $GLOBALS['display_calendars'])) {
continue;
return _(sprintf("There was an error accessing the calendar: %s", $e->getMessage()));
}
}
- if (!$this->_share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ if (!$this->_share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
return _("Permission Denied");
}
}
'default' => 0));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
- if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ if ($cal->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($cal->getName(), $GLOBALS['display_calendars'])) {
continue;
} else {
try {
$calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
- if (!$calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ if (!$calendar->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
return _("Permission Denied");
}
} catch (Exception $e) {}
'default' => 0));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
- if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ if ($cal->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($cal->getName(), $GLOBALS['display_calendars'])) {
continue;
$this->_params['calendar'] != '__all') {
try {
$calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
- if (!$calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ if (!$calendar->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
return _("Permission Denied");
}
} catch (Exception $e) {
'default' => 0));
$params['calendar']['values']['__all'] = _("All Visible");
foreach (Kronolith::listCalendars() as $id => $cal) {
- if ($cal->get('owner') != Horde_Auth::getAuth() &&
+ if ($cal->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($cal->getName(), $GLOBALS['display_calendars'])) {
continue;
} else {
try {
$calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
- if (!$calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ if (!$calendar->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
return _("Permission Denied");
}
} catch (Exception $e) {
}
foreach ($alarms as $calId => $calAlarms) {
foreach ($calAlarms as $event) {
- if ($horde_alarm->isSnoozed($event->uid, Horde_Auth::getAuth())) {
+ if ($horde_alarm->isSnoozed($event->uid, $GLOBALS['registry']->getAuth())) {
continue;
}
$alarmCount++;
/* Log fetch at DEBUG level. */
Horde::logMessage(sprintf('Retrieved remote calendar for %s: url = "%s"',
- Horde_Auth::getAuth(), $url), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $url), 'DEBUG');
$data = $response->getBody();
$_SESSION['kronolith']['remote'][$signature] = new Horde_iCalendar();
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::exists(): user = "%s"; query = "%s"',
- Horde_Auth::getAuth(), $query), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query), 'DEBUG');
$event = $this->_db->getRow($query, $values, DB_FETCHMODE_ASSOC);
$this->handleError($event);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_listEventsConditional(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $q, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $q, implode(',', $values)), 'DEBUG');
/* Run the query. */
$qr = $this->_db->query($q, $values);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_listEventsConditional(): user = %s; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$result = $this->_write_db->query($query, $values);
if ($result instanceof PEAR_Error) {
$this->_params['table']);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_countEvents(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, $this->calendar), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, $this->calendar), 'DEBUG');
/* Run the query. */
$result = $this->_db->getOne($query, array($this->calendar));
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::getEvent(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$event = $this->_db->getRow($query, $values, DB_FETCHMODE_ASSOC);
$this->handleError($event);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::getByUID(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$events = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
$this->handleError($events);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::saveEvent(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$result = $this->_write_db->query($query, $values);
$this->handleError($result);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::saveEvent(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$result = $this->_write_db->query($query, $values);
$this->handleError($result);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::delete(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$result = $this->_write_db->query($query, $values);
$this->handleError($result);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::deleteEvent(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$result = $this->_write_db->query($query, $values);
$this->handleError($result);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::deleteEvent(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, implode(',', $values)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query, implode(',', $values)), 'DEBUG');
$result = $this->_db->getCol($query, 0, $values);
$this->handleError($result);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_initConn(): user = "%s"; query = "%s"',
- Horde_Auth::getAuth(), $query), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query), 'DEBUG');
$db->query($query);
break;
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_initConn(): user = "%s"; query = "%s"',
- Horde_Auth::getAuth(), $query), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query), 'DEBUG');
$db->query($query);
break;
switch ($name) {
case 'creator':
if (empty($this->_creator)) {
- $this->_creator = Horde_Auth::getAuth();
+ $this->_creator = $GLOBALS['registry']->getAuth();
}
// Fall through.
case 'id':
public function hasPermission($permission, $user = null)
{
if ($user === null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
try {
$share = $this->getShare();
/* Lock the resource and get the response */
if ($resource->get('response_type') == Kronolith_Resource::RESPONSETYPE_AUTO) {
$principle = 'calendar/' . $rcal;
- $lock[$resource->getId()] = $locks->setLock(Horde_Auth::getAuth(), 'kronolith', $principle, 5, Horde_Lock::TYPE_EXCLUSIVE);
+ $lock[$resource->getId()] = $locks->setLock($GLOBALS['registry']->getAuth(), 'kronolith', $principle, 5, Horde_Lock::TYPE_EXCLUSIVE);
$haveLock = true;
} else {
$haveLock = false;
$vEvent->setAttribute('ORGANIZER',
'mailto:' . Kronolith::getUserEmail($this->creator),
array('CN' => $name));
- if (!$this->private || $this->creator == Horde_Auth::getAuth()) {
+ if (!$this->private || $this->creator == $GLOBALS['registry']->getAuth()) {
if (!empty($this->description)) {
$vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, Horde_Nls::getCharset(), 'utf-8'));
}
/* New event? */
if ($this->id === null) {
- $this->creator = Horde_Auth::getAuth();
+ $this->creator = $GLOBALS['registry']->getAuth();
}
if ($title = Horde_String::convertCharset($message->getSubject(), 'utf-8', $charset)) {
$this->title = $title;
{
// See if it's a new event.
if ($this->id === null) {
- $this->creator = Horde_Auth::getAuth();
+ $this->creator = $GLOBALS['registry']->getAuth();
}
if (!empty($hash['title'])) {
$this->title = $hash['title'];
}
if (empty($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
if (empty($prefs)) {
$prefs = $GLOBALS['prefs'];
}
if ($user === null) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$twentyFour = $GLOBALS['prefs']->getValue('twentyFour');
if (strpos($targetcalendar, ':')) {
list(, $this->creator) = explode(':', $targetcalendar, 2);
} elseif (!isset($this->id)) {
- $this->creator = Horde_Auth::getAuth();
+ $this->creator = $GLOBALS['registry']->getAuth();
}
// Basic fields.
}
if (!$this->private ||
- $this->creator == Horde_Auth::getAuth()) {
+ $this->creator == $GLOBALS['registry']->getAuth()) {
$link .= $this->getEditUrl(
array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'),
'url' => $from_url))
public function getTooltip()
{
$tooltip = $this->getTimeRange()
- . "\n" . sprintf(_("Owner: %s"), ($this->creator == Horde_Auth::getAuth() ?
+ . "\n" . sprintf(_("Owner: %s"), ($this->creator == $GLOBALS['registry']->getAuth() ?
_("Me") : Kronolith::getUserName($this->creator)));
- if (!$this->private || $this->creator == Horde_Auth::getAuth()) {
+ if (!$this->private || $this->creator == $GLOBALS['registry']->getAuth()) {
if ($this->location) {
$tooltip .= "\n" . _("Location") . ': ' . $this->location;
}
}
if (isset($event['organizer']['smtp-address'])) {
- if (Kronolith::isUserEmail(Horde_Auth::getAuth(), $event['organizer']['smtp-address'])) {
- $this->creator = Horde_Auth::getAuth();
+ if (Kronolith::isUserEmail($GLOBALS['registry']->getAuth(), $event['organizer']['smtp-address'])) {
+ $this->creator = $GLOBALS['registry']->getAuth();
} else {
$this->creator = $event['organizer']['smtp-address'];
}
return;
}
- if (!($this->_resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE))) {
+ if (!($this->_resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE))) {
throw new Kronolith_Exception(_("Permission denied"));
}
return;
}
- if (!($this->_resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE))) {
+ if (!($this->_resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE))) {
throw new Kronolith_Exception(_("Permission denied"));
}
/* First make sure it doesn't already exist */
$sql = 'SELECT COUNT(*) FROM kronolith_events_geo WHERE event_id = ?';
Horde::logMessage(sprintf('Kronolith_Geo_Mysql::setLocation(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, $event_id), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, $event_id), 'DEBUG');
$count = $this->_db->getOne($sql, array($event_id));
if ($count instanceof PEAR_Error) {
Horde::logMessage($count, 'ERR');
$sql = sprintf('INSERT into kronolith_events_geo (event_id, event_coordinates) VALUES(?, GeomFromText(\'POINT(%F %F)\'))', $point['lat'], $point['lon']);
}
Horde::logMessage(sprintf('Kronolith_Geo_Mysql::setLocation(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, $event_id), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, $event_id), 'DEBUG');
$result = $this->_write_db->query($sql, array($event_id));
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, 'ERR');
{
$sql = 'SELECT x(event_coordinates) as lat, y(event_coordinates) as lon FROM kronolith_events_geo WHERE event_id = ?';
Horde::logMessage(sprintf('Kronolith_Geo_Mysql::getLocation(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, $event_id), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, $event_id), 'DEBUG');
$result = $this->_db->getRow($sql, array($event_id), DB_FETCHMODE_ASSOC);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, 'ERR');
. "x(event_coordinates) as lat, y(event_coordinates) as lon FROM kronolith_events_geo HAVING distance < ? ORDER BY distance ASC LIMIT ?";
Horde::logMessage(sprintf('Kronolith_Geo_Mysql::search(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, print_r($params, true)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, print_r($params, true)), 'DEBUG');
$results = $this->_db->getAssoc($sql, false, $params, DB_FETCHMODE_ASSOC);
if ($results instanceof PEAR_Error) {
/* First make sure it doesn't already exist */
$sql = 'SELECT COUNT(*) FROM kronolith_events_geo WHERE event_id = ?';
Horde::logMessage(sprintf('Kronolith_Geo_Sql::setLocation(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, $event_id), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, $event_id), 'DEBUG');
$count = $this->_db->getOne($sql, array($event_id));
if ($count instanceof PEAR_Error) {
Horde::logMessage($count, 'ERR');
$sql = 'INSERT into kronolith_events_geo (event_lat, event_lon, event_id) VALUES(?, ?, ?)';
}
Horde::logMessage(sprintf('Kronolith_Geo_Sql::setLocation(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, print_r($params, true)), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, print_r($params, true)), 'DEBUG');
$result = $this->_write_db->query($sql, $params);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, 'ERR');
{
$sql = 'SELECT event_lat as lat, event_lon as lon FROM kronolith_events_geo WHERE event_id = ?';
Horde::logMessage(sprintf('Kronolith_Geo_Sql::getLocation(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, $event_id), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, $event_id), 'DEBUG');
$result = $this->_db->getRow($sql, array($event_id), DB_FETCHMODE_ASSOC);
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, 'ERR');
{
$sql = 'DELETE FROM kronolith_events_geo WHERE event_id = ?';
Horde::logMessage(sprintf('Kronolith_Geo_Sql::deleteLocation(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $sql, $event_id), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $sql, $event_id), 'DEBUG');
$result = $this->_write_db->query($sql, array($event_id));
if ($result instanceof PEAR_Error) {
Horde::logMessage($result, 'ERR');
'URI_EVENT_EXPORT' => str_replace(array('%23', '%7B', '%7D'), array('#', '{', '}'), Horde::url('event.php', true)->add(array('view' => 'ExportEvent', 'eventID' => '#{id}', 'calendar' => '#{calendar}', 'type' => '#{type}'))),
'SESSION_ID' => defined('SID') ? SID : '',
- 'user' => Horde_Auth::getAuth(),
+ 'user' => $GLOBALS['registry']->getAuth(),
'prefs_url' => str_replace('&', '&', Horde::getServiceLink('options', 'kronolith')),
'app_urls' => $app_urls,
'name' => $registry->get('name'),
// Calendars
foreach (array(true, false) as $my) {
foreach ($GLOBALS['all_calendars'] as $id => $calendar) {
- if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
continue;
}
- $owner = Horde_Auth::getAuth() &&
- $calendar->get('owner') == Horde_Auth::getAuth();
+ $owner = $GLOBALS['registry']->getAuth() &&
+ $calendar->get('owner') == $GLOBALS['registry']->getAuth();
if (($my && $owner) || (!$my && !$owner)) {
$code['conf']['calendars']['internal'][$id] = array(
'name' => ($owner || !$calendar->get('owner') ? '' : '[' . $GLOBALS['registry']->convertUsername($calendar->get('owner'), false) . '] ')
'bg' => self::backgroundColor($calendar),
'show' => in_array($id, $GLOBALS['display_calendars']),
'perms' => $calendar->getPermission()->data,
- 'edit' => $calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT),
+ 'edit' => $calendar->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT),
'sub' => $subscriptionCals . ($calendar->get('owner') ? $calendar->get('owner') : '-system-') . '/' . $calendar->getName() . '.ics',
'feed' => (string)Kronolith::feedUrl($calendar->getName()),
'tg' => array_values($tagger->getTags($calendar->getName(), 'calendar')));
continue;
}
foreach ($registry->tasks->listTasklists($my, Horde_Perms::SHOW) as $id => $tasklist) {
- if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array('tasks/' . $id, $GLOBALS['display_external_calendars'])) {
continue;
}
- $owner = Horde_Auth::getAuth() &&
- $tasklist->get('owner') == Horde_Auth::getAuth();
+ $owner = $GLOBALS['registry']->getAuth() &&
+ $tasklist->get('owner') == $GLOBALS['registry']->getAuth();
if (($my && $owner) || (!$my && !$owner)) {
$code['conf']['calendars']['tasklists']['tasks/' . $id] = array(
'name' => ($owner || !$tasklist->get('owner') ? '' : '[' . $GLOBALS['registry']->convertUsername($tasklist->get('owner'), false) . '] ')
'bg' => self::backgroundColor($tasklist),
'show' => in_array('tasks/' . $id, $GLOBALS['display_external_calendars']),
'perms' => $tasklist->getPermission()->data,
- 'edit' => $tasklist->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT),
+ 'edit' => $tasklist->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT),
'sub' => $subscriptionTasks . ($tasklist->get('owner') ? $tasklist->get('owner') : '-system-') . '/' . $tasklist->getName() . '.ics');
}
}
/* If an authenticated user has no calendars visible and their
* personal calendar doesn't exist, create it. */
- if (Horde_Auth::getAuth() &&
+ if ($GLOBALS['registry']->getAuth() &&
!count($GLOBALS['display_calendars']) &&
- !$GLOBALS['kronolith_shares']->exists(Horde_Auth::getAuth())) {
+ !$GLOBALS['kronolith_shares']->exists($GLOBALS['registry']->getAuth())) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getOriginalAuth();
+ $name = $GLOBALS['registry']->getAuth('original');
}
- $share = &$GLOBALS['kronolith_shares']->newShare(Horde_Auth::getAuth());
+ $share = &$GLOBALS['kronolith_shares']->newShare($GLOBALS['registry']->getAuth());
$share->set('name', sprintf(_("%s's Calendar"), $name));
$GLOBALS['kronolith_shares']->addShare($share);
- $GLOBALS['all_calendars'][Horde_Auth::getAuth()] = &$share;
+ $GLOBALS['all_calendars'][$GLOBALS['registry']->getAuth()] = &$share;
/* Make sure the personal calendar is displayed by default. */
- if (!in_array(Horde_Auth::getAuth(), $GLOBALS['display_calendars'])) {
- $GLOBALS['display_calendars'][] = Horde_Auth::getAuth();
+ if (!in_array($GLOBALS['registry']->getAuth(), $GLOBALS['display_calendars'])) {
+ $GLOBALS['display_calendars'][] = $GLOBALS['registry']->getAuth();
}
/* Calendar auto-sharing with the user's groups */
try {
$groups = Horde_Group::singleton();
- $group_list = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $group_list = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
if (count($group_list)) {
$perm = $share->getPermission();
// Add the default perm, not added otherwise
- $perm->addUserPermission(Horde_Auth::getAuth(), Horde_Perms::ALL, false);
+ $perm->addUserPermission($GLOBALS['registry']->getAuth(), Horde_Perms::ALL, false);
foreach ($group_list as $group_id => $group_name) {
$perm->addGroupPermission($group_id, $perm_value, false);
}
*/
public static function listCalendars($owneronly = false, $permission = Horde_Perms::SHOW)
{
- if ($owneronly && !Horde_Auth::getAuth()) {
+ if ($owneronly && !$GLOBALS['registry']->getAuth()) {
return array();
}
try {
- $calendars = $GLOBALS['kronolith_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
+ $calendars = $GLOBALS['kronolith_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null, 0, 0, 'name');
} catch (Horde_Share_Exception $e) {
Horde::logMessage($e, 'ERR');
return array();
if (isset($calendars[$default_share]) ||
$prefs->isLocked('default_share')) {
return $default_share;
- } elseif (isset($GLOBALS['all_calendars'][Horde_Auth::getAuth()]) &&
- $GLOBALS['all_calendars'][Horde_Auth::getAuth()]->hasPermission(Horde_Auth::getAuth(), $permission)) {
- return Horde_Auth::getAuth();
+ } elseif (isset($GLOBALS['all_calendars'][$GLOBALS['registry']->getAuth()]) &&
+ $GLOBALS['all_calendars'][$GLOBALS['registry']->getAuth()]->hasPermission($GLOBALS['registry']->getAuth(), $permission)) {
+ return $GLOBALS['registry']->getAuth();
} elseif (count($calendars)) {
return key($calendars);
}
*/
public static function updateShare(&$calendar, $info)
{
- if (!Horde_Auth::getAuth() ||
- ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if (!$GLOBALS['registry']->getAuth() ||
+ ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($calendar->get('owner')) || !$GLOBALS['registry']->isAdmin()))) {
throw new Kronolith_Exception(_("You are not allowed to change this calendar."));
}
$calendar->set('name', $info['name']);
$calendar->set('color', $info['color']);
$calendar->set('desc', $info['description']);
- $calendar->set('owner', empty($info['system']) ? Horde_Auth::getAuth() : null);
+ $calendar->set('owner', empty($info['system']) ? $GLOBALS['registry']->getAuth() : null);
try {
$result = $calendar->save();
*/
public static function deleteShare($calendar)
{
- if ($calendar->getName() == Horde_Auth::getAuth()) {
+ if ($calendar->getName() == $GLOBALS['registry']->getAuth()) {
throw new Kronolith_Exception(_("This calendar cannot be deleted."));
}
- if (!Horde_Auth::getAuth() ||
- ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if (!$GLOBALS['registry']->getAuth() ||
+ ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($calendar->get('owner')) || !$GLOBALS['registry']->isAdmin()))) {
throw new Kronolith_Exception(_("You are not allowed to delete this calendar."));
}
$new_owner_backend = Horde_Util::getFormData('owner_select', Horde_Util::getFormData('owner_input', $old_owner));
$new_owner = $GLOBALS['registry']->convertUsername($new_owner_backend, true);
if ($old_owner !== $new_owner && !empty($new_owner)) {
- if ($old_owner != Horde_Auth::getAuth() && !$GLOBALS['registry']->isAdmin()) {
+ if ($old_owner != $GLOBALS['registry']->getAuth() && !$GLOBALS['registry']->isAdmin()) {
$errors[] = _("Only the owner or system administrator may change ownership or owner permissions for a share");
} elseif ($auth->hasCapability('list') && !$auth->exists($new_owner_backend)) {
$errors[] = sprintf(_("The user \"%s\" does not exist."), $new_owner_backend);
'df' => $prefs->getValue('date_format'));
if ($prefs->getValue('event_notification_exclude_self') &&
- $user == Horde_Auth::getAuth()) {
+ $user == $GLOBALS['registry']->getAuth()) {
return false;
}
/* We check for read permissions, because we can always save a copy if
* we can read the event. */
if ((!$event->private ||
- $event->creator == Horde_Auth::getAuth()) &&
+ $event->creator == $GLOBALS['registry']->getAuth()) &&
$event->hasPermission(Horde_Perms::READ)) {
$tabs->addTab(
$event->hasPermission(Horde_Perms::EDIT) ? _("_Edit") : _("Save As New"),
/* Check here for guest calendars so that we don't get multiple
* messages after redirects, etc. */
- if (!Horde_Auth::getAuth() && !count($GLOBALS['all_calendars'])) {
+ if (!$GLOBALS['registry']->getAuth() && !count($GLOBALS['all_calendars'])) {
$GLOBALS['notification']->push(_("No calendars are available to guests."));
}
$query->end = $del_time;
$query->status = null;
$query->calendars = array(Horde_String::ucfirst($GLOBALS['conf']['calendar']['driver']) => array_keys($calendars));
- $query->creator = Horde_Auth::getAuth();
+ $query->creator = $GLOBALS['registry']->getAuth();
/* Perform the search */
$days = Kronolith::search($query);
public static function factory($user = null, $driver = null, $params = null)
{
if (is_null($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
if (is_null($driver)) {
}
$http = new HTTP_Request($fb_url, $options);
- $http->setBasicAuth(Horde_Auth::getAuth(), Horde_Auth::getCredential('password'));
+ $http->setBasicAuth($GLOBALS['registry']->getAuth(), Horde_Auth::getCredential('password'));
@$http->sendRequest();
if ($http->getResponseCode() != 200) {
throw new Horde_Exception_NotFound();
/* Log the query at debug level. */
Horde::logMessage(sprintf('SQL search by %s: query = "%s"',
- Horde_Auth::getAuth(), $query), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query), 'DEBUG');
/* Execute the query. */
$result = $this->_db->query($query, $values);
/* Log the query at debug level. */
Horde::logMessage(sprintf('SQL insert by %s: query = "%s"',
- Horde_Auth::getAuth(), $query), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $query), 'DEBUG');
/* Execute the query. */
$result = $this->_write_db->query($query, $values);
$calendars = $GLOBALS['kronolith_shares']->listSystemShares();
$args['calendarId'] = array();
foreach ($calendars as $name => $share) {
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$args['calendarId'][] = $name;
}
}
public function listTags($token)
{
return $GLOBALS['injector']->getInstance('Content_Tagger')->getTags(
- array('q' => $token, 'userId' => Horde_Auth::getAuth()));
+ array('q' => $token, 'userId' => $GLOBALS['registry']->getAuth()));
}
/**
$url = Horde_Util::getFormData('url');
$perms = Horde_Perms::EDIT;
- if ($this->event->creator == Horde_Auth::getAuth()) {
+ if ($this->event->creator == $GLOBALS['registry']->getAuth()) {
$perms |= Kronolith::PERMS_DELEGATE;
}
$all_calendars = Kronolith::listCalendars(false, $perms);
$calendars = array();
foreach ($all_calendars as $id => $calendar) {
- if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
continue;
$createdby = '';
$modifiedby = '';
- $userId = Horde_Auth::getAuth();
+ $userId = $GLOBALS['registry']->getAuth();
if ($this->event->uid) {
/* Get the event's history. */
try {
$description = $this->event->description;
$location = $this->event->location;
$eventurl = $this->event->url;
- $private = $this->event->private && $creatorId != Horde_Auth::getAuth();
+ $private = $this->event->private && $creatorId != $GLOBALS['registry']->getAuth();
$owner = Kronolith::getUserName($creatorId);
$status = Kronolith::statusToString($this->event->status);
$attendees = $this->event->attendees;
$all_calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT | Kronolith::PERMS_DELEGATE);
$calendars = array();
foreach ($all_calendars as $id => $calendar) {
- if ($calendar->get('owner') != Horde_Auth::getAuth() &&
+ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($calendar->getName(), $GLOBALS['display_calendars'])) {
continue;
}
}
- if (!Horde_Auth::getAuth() ||
+ if (!$GLOBALS['registry']->getAuth() ||
(isset($share) &&
!$registry->isAdmin() &&
- Horde_Auth::getAuth() != $share->get('owner'))) {
+ $GLOBALS['registry']->getAuth() != $share->get('owner'))) {
exit('permission denied');
}
break;
case 'editform':
try {
$share = $shares->getShareById(Horde_Util::getFormData('cid'));
- if (!Horde_Auth::getAuth() ||
+ if (!$GLOBALS['registry']->getAuth() ||
(!$registry->isAdmin() &&
- Horde_Auth::getAuth() != $share->get('owner'))) {
+ $GLOBALS['registry']->getAuth() != $share->get('owner'))) {
exit('permission denied');
}
try {
$groupList = array();
try {
$groupList = empty($conf['share']['any_group'])
- ? $groups->getGroupMemberships(Horde_Auth::getAuth(), true)
+ ? $groups->getGroupMemberships($GLOBALS['registry']->getAuth(), true)
: $groups->listGroups();
asort($groupList);
} catch (Horde_Group_Exception $e) {
$vars = Horde_Variables::getDefaultVariables();
try {
$resource = Kronolith::getDriver('Resource')->getResource($vars->get('c'));
- if (!$resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(_("You are not allowed to delete this resource."), 'horde.error');
header('Location: ' . Horde::applicationUrl('resources/', true));
exit;
$vars = Horde_Variables::getDefaultVariables();
try {
$resource = Kronolith::getDriver('Resource')->getResource($vars->get('c'));
- if (!$resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("You are not allowed to change this resource."), 'horde.error');
header('Location: ' . Horde::applicationUrl('resources/', true));
exit;
$vars = Horde_Variables::getDefaultVariables();
try {
$resource = Kronolith::getDriver('Resource')->getResource($vars->get('c'));
- if (!$resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(_("You are not allowed to delete this resource group."), 'horde.error');
header('Location: ' . Horde::applicationUrl('resources/groups/', true));
exit;
$vars = Horde_Variables::getDefaultVariables();
try {
$group = Kronolith::getDriver('Resource')->getResource($vars->get('c'));
- if (!$group->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$group->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("You are not allowed to change this resource."), 'horde.error');
header('Location: ' . Horde::applicationUrl('resources/groups/', true));
exit;
require KRONOLITH_TEMPLATES . '/menu.inc';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php'));
exit;
}
require KRONOLITH_TEMPLATES . '/menu.inc';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php'));
exit;
}
}
$optgroup = $GLOBALS['browser']->hasFeature('optgroup');
- $current_user = Horde_Auth::getAuth();
+ $current_user = $GLOBALS['registry']->getAuth();
$calendars = array();
foreach (Kronolith::listCalendars(false, Horde_Perms::READ) as $id => $cal) {
if ($cal->get('owner') && $cal->get('owner') == $current_user) {
$groups = array();
try {
$groups = empty($GLOBALS['conf']['share']['any_group'])
- ? $horde_groups->getGroupMemberships(Horde_Auth::getAuth(), true)
+ ? $horde_groups->getGroupMemberships($GLOBALS['registry']->getAuth(), true)
: $horde_groups->listGroups();
asort($groups);
} catch (Horde_Group_Exception $e) {}
<select name="owner_select">
<option value=""><?php echo _("Select a new owner:") ?></option>
<?php foreach ($auth->listUsers() as $user): ?>
- <option value="<?php echo htmlspecialchars($user) ?>"<?php if ($user == Horde_Auth::getAuth()) echo ' selected="selected"' ?>><?php echo htmlspecialchars($user) ?></option>
+ <option value="<?php echo htmlspecialchars($user) ?>"<?php if ($user == $GLOBALS['registry']->getAuth()) echo ' selected="selected"' ?>><?php echo htmlspecialchars($user) ?></option>
<?php endforeach; ?>
</select>
<?php else: ?>
- <input type="text" name="owner_input" size="50" value="<?php echo htmlspecialchars(Horde_Auth::getAuth()) ?>" class="kronolithLongField" />
+ <input type="text" name="owner_input" size="50" value="<?php echo htmlspecialchars($GLOBALS['registry']->getAuth()) ?>" class="kronolithLongField" />
<?php endif; ?>
</td>
</tr>
<select id="kronolithC<?php echo $type ?>PUNew" name="u_names[||new]">
<option value=""><?php echo _("Select a user") ?></option>
<?php foreach ($auth->listUsers() as $user): ?>
- <?php if ($user != Horde_Auth::getAuth()): ?>
+ <?php if ($user != $GLOBALS['registry']->getAuth()): ?>
<option value="<?php echo htmlspecialchars($user) ?>"><?php echo htmlspecialchars($user) ?></option>
<?php endif; ?>
<?php endforeach; ?>
// Normal view
foreach ($calendars as $id => $cal) {
$delegates = array();
- if ($cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $event->creator)) {
+ if ($cal->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT, $event->creator)) {
$delegates[$id] = htmlspecialchars($cal->get('name'));
} else {
$delegates[$id . ':' . $cal->get('owner')] = htmlspecialchars($cal->get('name'). ' (' . sprintf(_("as %s"), Kronolith::getUserName($cal->get('owner'))) . ')');
<div id="kronolithMenuCalendars">
<h3 id="kronolithCalendarsFirst">
- <?php if (Horde_Auth::getAuth() && !$prefs->isLocked('default_share')): ?>
+ <?php if ($GLOBALS['registry']->getAuth() && !$prefs->isLocked('default_share')): ?>
<a href="#" id="kronolithAddinternal" class="kronolithAdd" title="<?php echo _("New Calendar") ?>">+</a>
<?php endif; ?>
<span><?php echo _("My Calendars") ?></span>
<?php if ($GLOBALS['registry']->hasInterface('tasks')): ?>
<h3>
- <?php if (Horde_Auth::getAuth() && !$prefs->isLocked('default_share')): ?>
+ <?php if ($GLOBALS['registry']->getAuth() && !$prefs->isLocked('default_share')): ?>
<a href="#" id="kronolithAddtasklists" class="kronolithAdd" title="<?php echo _("New Task List") ?>">+</a>
<?php endif; ?>
<span><?php echo _("My Task Lists") ?></span>
$info_img = Horde::img('info_icon.png', _("Calendar Information"), array('class' => 'calendar-info'));
-$current_user = Horde_Auth::getAuth();
+$current_user = $GLOBALS['registry']->getAuth();
$my_calendars = array();
$shared_calendars = array();
foreach (Kronolith::listCalendars() as $id => $cal) {
<a id="sbarShow" href="#" onclick="sbarToggle(); return false;"><?php echo _("Calendars") ?></a>
<a id="sbarHide" href="#" onclick="sbarToggle(); return false;"><?php echo _("Calendars") ?></a>
<?php if (!empty($_SESSION['kronolith']['display_cal'])): ?>
- <a id="sbarClose" href="<?php echo Horde::selfUrl(true)->add('display_cal', '') ?>"><?php echo Horde_Auth::getAuth() ? _("Return to my calendars") : _("Return to calendars") ?></a>
+ <a id="sbarClose" href="<?php echo Horde::selfUrl(true)->add('display_cal', '') ?>"><?php echo $GLOBALS['registry']->getAuth() ? _("Return to my calendars") : _("Return to calendars") ?></a>
<?php endif; ?>
<div id="pageControlsInner">
<?php if (!empty($_SESSION['kronolith']['display_cal'])): ?>
<input id="calendarSearch" type="text" for="mycalendars,sharedcalendars,remotecalendars,externalcalendars" />
</p>
-<?php if (Horde_Auth::getAuth()): ?>
+<?php if ($GLOBALS['registry']->getAuth()): ?>
<p>
<a href="<?php echo Horde::applicationUrl('calendars/') ?>"><?php echo _("[Manage Calendars]") ?></a><br />
<a href="<?php echo Horde::applicationUrl('resources/')?>"><?php echo ($GLOBALS['registry']->isAdmin() ? _("[Manage Resource Calendars]") : _("[Resource Calendars]"))?></a>
<li class="panel-tags">
<?php
echo htmlspecialchars($tag);
-if ($cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($cal->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
echo '<a href="#" id="remove' . md5($id . $tag_id) . '">'
. Horde::img('delete-small.png', _("Remove Tag"))
. '</a>';
// default notepad
// Set locked to true if you don't want users to have multiple notepads.
$_prefs['default_notepad'] = array(
- 'value' => Horde_Auth::getAuth() ? Horde_Auth::getAuth() : 0,
+ 'value' => $GLOBALS['registry']->getAuth() ? $GLOBALS['registry']->getAuth() : 0,
'type' => 'enum',
'desc' => _("Your default notepad:")
);
$exportID = Horde_Util::getFormData('exportID');
/* Create a Mnemo storage instance. */
- $storage = &Mnemo_Driver::singleton(Horde_Auth::getAuth());
+ $storage = &Mnemo_Driver::singleton($GLOBALS['registry']->getAuth());
$storage->retrieve();
/* Get the full, sorted memo list. */
*/
public function removeUserData($user)
{
- if (!$GLOBALS['registry']->isAdmin() && $user != Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->isAdmin() && $user != $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("You are not allowed to remove user data."));
}
'url' => $add));
foreach (Mnemo::listNotepads() as $name => $notepad) {
- if ($notepad->get('owner') != Horde_Auth::getAuth() &&
+ if ($notepad->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($notepad->getName(), $GLOBALS['display_notepads'])) {
continue;
function Mnemo_Driver_kolab($notepad, $params = array())
{
if (empty($notepad)) {
- $notepad = Horde_Auth::getAuth();
+ $notepad = $GLOBALS['registry']->getAuth();
}
$this->_notepad = $notepad;
if (count($split) == 2) {
list($id, $notepad) = $split;
} else if (count($split) == 1) {
- $notepad = Horde_Auth::getAuth();
+ $notepad = $GLOBALS['registry']->getAuth();
}
return array($id, $notepad);
}
*/
function _uniqueId($id)
{
- if ($this->_notepad == Horde_Auth::getAuth()) {
+ if ($this->_notepad == $GLOBALS['registry']->getAuth()) {
return $id;
}
return $id . '@' . $this->_notepad;
return false;
}
- if (!Horde_Auth::getAuth() ||
- $this->_notepad->get('owner') != Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth() ||
+ $this->_notepad->get('owner') != $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("Permission denied"));
}
// Make sure we still own at least one notepad.
if (count(Mnemo::listNotepads(true)) == 0) {
// If the default share doesn't exist then create it.
- if (!$GLOBALS['mnemo_shares']->exists(Horde_Auth::getAuth())) {
+ if (!$GLOBALS['mnemo_shares']->exists($GLOBALS['registry']->getAuth())) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getAuth();
+ $name = $GLOBALS['registry']->getAuth();
}
try {
- $notepad = $GLOBALS['mnemo_shares']->newShare(Horde_Auth::getAuth());
+ $notepad = $GLOBALS['mnemo_shares']->newShare($GLOBALS['registry']->getAuth());
} catch (Horde_Share_Exception $e) {
return;
}
*/
public static function listNotepads($owneronly = false, $permission = Horde_Perms::SHOW)
{
- if ($owneronly && !Horde_Auth::getAuth()) {
+ if ($owneronly && !$GLOBALS['registry']->getAuth()) {
return array();
}
try {
- $notepads = $GLOBALS['mnemo_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
+ $notepads = $GLOBALS['mnemo_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null, 0, 0, 'name');
} catch (Horde_Share_Exception $e) {
Horde::logMessage($e->getMessage(), 'ERR');
return array();
if (isset($notepads[$default_notepad])) {
return $default_notepad;
} elseif ($prefs->isLocked('default_notepad')) {
- return Horde_Auth::getAuth();
+ return $GLOBALS['registry']->getAuth();
} elseif (count($notepads)) {
reset($notepads);
return key($notepads);
if (count($GLOBALS['display_notepads']) == 0) {
$lists = Mnemo::listNotepads(true);
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
/* All notepads for guests. */
$GLOBALS['display_notepads'] = array_keys($lists);
} else {
}
/* If the user's personal notepad doesn't exist, then create it. */
- if (!$GLOBALS['mnemo_shares']->exists(Horde_Auth::getAuth())) {
+ if (!$GLOBALS['mnemo_shares']->exists($GLOBALS['registry']->getAuth())) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getAuth();
+ $name = $GLOBALS['registry']->getAuth();
}
- $share = $GLOBALS['mnemo_shares']->newShare(Horde_Auth::getAuth());
+ $share = $GLOBALS['mnemo_shares']->newShare($GLOBALS['registry']->getAuth());
$share->set('name', sprintf(_("%s's Notepad"), $name));
$GLOBALS['mnemo_shares']->addShare($share);
/* Make sure the personal notepad is displayed by default. */
- if (!in_array(Horde_Auth::getAuth(), $GLOBALS['display_notepads'])) {
- $GLOBALS['display_notepads'][] = Horde_Auth::getAuth();
+ if (!in_array($GLOBALS['registry']->getAuth(), $GLOBALS['display_notepads'])) {
+ $GLOBALS['display_notepads'][] = $GLOBALS['registry']->getAuth();
}
}
}
throw new Mnemo_Exception($e);
}
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving note to %s."), $share->get('name')), 'horde.error');
} elseif ($memo_passphrase != $memo_passphrase2) {
$notification->push(_("The passwords don't match."), 'horde.error');
} catch (Horde_Share_Exception $e) {
throw new Mnemo_Exception($e);
}
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
try {
$share = &$GLOBALS['mnemo_shares']->getShare($notepad_target);
} catch (Horde_Share_Exception $e) {
throw new Mnemo_Exception($e);
}
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$result = $storage->move($memo_id, $notepad_target);
$storage = &Mnemo_Driver::singleton($notepad_target);
} else {
} catch (Horde_Share_Exception $e) {
throw new Mnemo_Exception($e);
}
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$storage = &Mnemo_Driver::singleton($memolist_id);
$result = $storage->delete($memo_id);
if ($result instanceof PEAR_Error) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
-if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$notification->push(sprintf(_("You do not have permission to view the notepad %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
// Exit if this isn't an authenticated user or if the user can't
// create new notepads (default share is locked).
-if (!Horde_Auth::getAuth() || $prefs->isLocked('default_notepad')) {
+if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('default_notepad')) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
require_once MNEMO_BASE . '/lib/Forms/DeleteNotepad.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$vars = Horde_Variables::getDefaultVariables();
$notepad_id = $vars->get('n');
-if ($notepad_id == Horde_Auth::getAuth()) {
+if ($notepad_id == $GLOBALS['registry']->getAuth()) {
$notification->push(_("This notepad cannot be deleted"), 'horde.warning');
header('Location: ' . Horde::applicationUrl('notepads/', true));
exit;
header('Location: ' . Horde::applicationUrl('notepads/', true));
exit;
}
-if (!Horde_Auth::getAuth() || $notepad->get('owner') != Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth() || $notepad->get('owner') != $GLOBALS['registry']->getAuth()) {
$notification->push(_("You are not allowed to delete this notepad."), 'horde.error');
header('Location: ' . Horde::applicationUrl('notepads/', true));
exit;
require_once MNEMO_BASE . '/lib/Forms/EditNotepad.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
header('Location: ' . Horde::applicationUrl('notepads/', true));
exit;
}
-if (!Horde_Auth::getAuth() ||
- $notepad->get('owner') != Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth() ||
+ $notepad->get('owner') != $GLOBALS['registry']->getAuth()) {
$notification->push(_("You are not allowed to change this notepad."), 'horde.error');
header('Location: ' . Horde::applicationUrl('notepads/', true));
Horde_Registry::appInit('mnemo');
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
require MNEMO_BASE . '/list.php';
exit;
}
<th id="s<?php echo Mnemo::SORT_CATEGORY ?>"<?php if ($sortby == Mnemo::SORT_CATEGORY) echo ' class="' . $sortdirclass . '"' ?> width="15%">
<?php
echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter('list.php', 'sortby', Mnemo::SORT_CATEGORY)), _("Sort by Category"), 'sortlink', '', '', _("_Category"));
- if (Horde_Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
+ if ($GLOBALS['registry']->getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
!$GLOBALS['prefs']->isLocked('category_colors'))) {
$categoryUrl = Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'categories'));
echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', 'popup(this.href); return false;') . Horde::img('colorpicker.png', _("Edit categories and colors"), '') . '</a>';
<tr>
<td>
<?php
-if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$label = sprintf(_("Edit \"%s\""), $memo['desc']);
echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($memourl, 'actionID', 'modify_memo')), $label) .
Horde::img('edit.png', $label, '') . '</a>';
'memolist' => $memolist_id));
$share = $GLOBALS['mnemo_shares']->getShare($memolist_id);
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)): ?>
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)): ?>
<span class="rightFloat"><input type="button" class="button" value="<?php echo _("Delete this note") ?>" onclick="window.location='<?php echo addslashes(Horde::applicationUrl(Horde_Util::addParameter($memourl, 'actionID', 'delete_memos'))) ?>';" /></span>
<?php endif; endif; ?>
<?php
-$current_user = Horde_Auth::getAuth();
+$current_user = $GLOBALS['registry']->getAuth();
$my_notepads = array();
$shared_notepads = array();
$all_notepads = Mnemo::listNotepads();
<input id="notepadSearch" type="text" for="mynotepads,sharednotepads" />
</p>
-<?php if (Horde_Auth::getAuth()): ?>
+<?php if ($GLOBALS['registry']->getAuth()): ?>
<p>
<a href="<?php echo Horde::applicationUrl('notepads/') ?>"><?php echo _("[Manage Notepads]") ?></a>
</p>
<?php
if (!$print_view) {
echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter('note/pdf.php', array('note' => $memo_id, 'notepad' => $memolist_id))), _("Save as PDF"), 'smallheader');
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
echo ' | ' . Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($memourl, 'actionID', 'modify_memo')), _("Edit"), 'smallheader', '', '', _("_Edit"));
}
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
echo ' | ' . Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($memourl, 'actionID', 'delete_memos')), _("Delete"), 'smallheader', '', $prefs->getValue('delete_opt') ? 'return window.confirm(\'' . addslashes(_("Really delete this note?")) . '\');' : '', _("_Delete"));
}
}
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
-if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$notification->push(sprintf(_("You do not have permission to view the notepad %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
/* Get the note's history. */
-$userId = Horde_Auth::getAuth();
+$userId = $GLOBALS['registry']->getAuth();
$createdby = '';
$modifiedby = '';
if (!empty($memo['uid'])) {
// default tasklists
// Set locked to true if you don't want users to have multiple task lists.
$_prefs['default_tasklist'] = array(
- 'value' => Horde_Auth::getAuth() ? Horde_Auth::getAuth() : 0,
+ 'value' => $GLOBALS['registry']->getAuth() ? $GLOBALS['registry']->getAuth() : 0,
'type' => 'enum',
'desc' => _("Your default task list:")
);
$row['estimate'], $row['completed'],
$row['category'], $row['alarm'], $row['uid'],
isset($row['parent']) ? $row['parent'] : '',
- $row['private'], Horde_Auth::getAuth(),
+ $row['private'], $GLOBALS['registry']->getAuth(),
$row['assignee']);
if (is_a($result, 'PEAR_Error')) {
break;
}
$import_tasklists = $export_tasklists = array();
-if (Horde_Auth::getAuth()) {
+if ($GLOBALS['registry']->getAuth()) {
$tasklists = Nag::listTasklists(false, Horde_Perms::EDIT);
foreach ($tasklists as $id => $tasklist) {
- if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
}
$tasklists = Nag::listTasklists(false, Horde_Perms::READ);
foreach ($tasklists as $id => $tasklist) {
- if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
$tasklists = Nag::listTasklists(false, Horde_Perms::READ);
$owners = array();
foreach ($tasklists as $tasklist) {
- if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
$results[$retpath . '.ics']['icon'] = Horde_Themes::img('mime/icalendar.png');
}
if (in_array('browseable', $properties)) {
- $results[$retpath]['browseable'] = $tasklist->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ);
+ $results[$retpath]['browseable'] = $tasklist->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ);
$results[$retpath . '.ics']['browseable'] = false;
}
if (in_array('contenttype', $properties)) {
unset($uids_remove[$task->uid]);
}
if ($existing->private &&
- $existing->owner != Horde_Auth::getAuth()) {
+ $existing->owner != $GLOBALS['registry']->getAuth()) {
continue;
}
// Check if our task is newer then the existing - get
isset($task->uid) ? $task->uid : null,
isset($task->parent_id) ? $task->parent_id : '',
!empty($task->private),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
isset($task->assignee) ? $task->assignee : null);
if (is_a($newTask, 'PEAR_Error')) {
$newtask->code = 500;
isset($task->uid) ? $task->uid : null,
isset($task->parent_id) ? $task->parent_id : '',
!empty($task->private),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
isset($task->assignee) ? $task->assignee : null);
if (is_a($newTask, 'PEAR_Error')) {
return $newTask;
isset($task->uid) ? $task->uid : null,
isset($task->parent_id) ? $task->parent_id : '',
!empty($task->private),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
isset($task->assignee) ? $task->assignee : null);
/* array index 0 is id, 1 is uid */
isset($task['uid']) ? $task['uid'] : null,
isset($task['parent_id']) ? $task['parent_id'] : '',
!empty($task['private']),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
isset($task['assignee']) ? $task['assignee'] : null);
}
*/
public function listAlarms($time, $user = null)
{
- if ((empty($user) || $user != Horde_Auth::getAuth()) &&
+ if ((empty($user) || $user != $GLOBALS['registry']->getAuth()) &&
!$GLOBALS['registry']->isAdmin()) {
return PEAR::raiseError(_("Permission Denied"));
}
foreach ($all_tasklists as $id => $tasklist) {
if (!empty($conf['share']['hidden']) &&
- ($tasklist->get('owner') != Horde_Auth::getAuth()) &&
+ ($tasklist->get('owner') != $GLOBALS['registry']->getAuth()) &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
}
*/
public function removeUserData($user)
{
- if (!$GLOBALS['registry']->isAdmin() && $user != Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->isAdmin() && $user != $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("You are not allowed to remove user data."));
}
$tasklists = array();
foreach (Nag::listTasklists() as $id => $tasklist) {
- if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
'show_tasklists' => array(
'type' => 'multienum',
'name' => _("Show tasks from these tasklists"),
- 'default' => array(Horde_Auth::getAuth()),
+ 'default' => array($GLOBALS['registry']->getAuth()),
'values' => $tasklists),
'show_categories' => array(
'type' => 'multienum',
$alarmCount = 0;
foreach ($alarms as $taskId => $task) {
- if ($horde_alarm->isSnoozed($task->uid, Horde_Auth::getAuth())) {
+ if ($horde_alarm->isSnoozed($task->uid, $GLOBALS['registry']->getAuth())) {
continue;
}
$alarmCount++;
'url' => $add));
foreach (Nag::listTasklists() as $name => $tasklist) {
- if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
$uid = $this->generateUID();
}
if (is_null($owner)) {
- $owner = Horde_Auth::getAuth();
+ $owner = $GLOBALS['registry']->getAuth();
}
$taskId = $this->_add($name, $desc, $start, $due, $priority, $estimate,
throw new Nag_Exception($e);
}
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$GLOBALS['notification']->push(sprintf(_("Access denied removing task from %s."), $share->get('name')), 'horde.error');
return false;
}
throw new Nag_Exception($e);
}
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$GLOBALS['notification']->push(sprintf(_("Access denied moving the task to %s."), $share->get('name')), 'horde.error');
}
public function __construct($tasklist, $params = array())
{
if (empty($tasklist)) {
- $tasklist = Horde_Auth::getAuth();
+ $tasklist = $GLOBALS['registry']->getAuth();
}
$this->_tasklist = $tasklist;
'tasklist_id' => $this->_tasklist,
'task_id' => $this->_kolab->getUID(),
'uid' => $this->_kolab->getUID(),
- 'owner' => Horde_Auth::getAuth(),
+ 'owner' => $GLOBALS['registry']->getAuth(),
'name' => $this->_kolab->getStr('summary'),
'desc' => $this->_kolab->getStr('body'),
'category' => $this->_kolab->getStr('categories'),
if (count($split) == 2) {
list($id, $tasklist) = $split;
} else if (count($split) == 1) {
- $tasklist = Horde_Auth::getAuth();
+ $tasklist = $GLOBALS['registry']->getAuth();
}
return array($id, $tasklist);
}
*/
function _uniqueId($id)
{
- if ($this->_tasklist == Horde_Auth::getAuth()) {
+ if ($this->_tasklist == $GLOBALS['registry']->getAuth()) {
return $id;
}
return $id . '@' . $this->_tasklist;
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('SQL alarms list by %s: table = %s; query = "%s"',
- Horde_Auth::getAuth(), $this->_params['table'], $q), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $this->_params['table'], $q), 'DEBUG');
/* Run the query. */
$result = $this->_db->query($q, $values);
$tasklists = Nag::listTasklists(false, Horde_Perms::EDIT);
$tasklist_enums = array();
foreach ($tasklists as $tl_id => $tl) {
- if ($tl->get('owner') != Horde_Auth::getAuth() &&
+ if ($tl->get('owner') != $GLOBALS['registry']->getAuth() &&
!empty($GLOBALS['conf']['share']['hidden']) &&
!in_array($tl->getName(), $GLOBALS['display_tasklists'])) {
continue;
public static function listTasklists($owneronly = false,
$permission = Horde_Perms::SHOW)
{
- if ($owneronly && !Horde_Auth::getAuth()) {
+ if ($owneronly && !$GLOBALS['registry']->getAuth()) {
return array();
}
try {
- $tasklists = $GLOBALS['nag_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
+ $tasklists = $GLOBALS['nag_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null, 0, 0, 'name');
} catch (Horde_Share_Exception $e) {
Horde::logMessage($e->getMessage(), 'ERR');
return array();
if (isset($tasklists[$default_tasklist])) {
return $default_tasklist;
} elseif ($prefs->isLocked('default_tasklist')) {
- return Horde_Auth::getAuth();
+ return $GLOBALS['registry']->getAuth();
} elseif (count($tasklists)) {
reset($tasklists);
return key($tasklists);
*/
public static function updateTasklist(&$tasklist, $info)
{
- if (!Horde_Auth::getAuth() ||
- ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if (!$GLOBALS['registry']->getAuth() ||
+ ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($tasklist->get('owner')) || !$GLOBALS['registry']->isAdmin()))) {
return PEAR::raiseError(_("You are not allowed to change this task list."));
}
$tasklist->set('name', $info['name']);
$tasklist->set('color', $info['color']);
$tasklist->set('desc', $info['description']);
- $tasklist->set('owner', empty($info['system']) ? Horde_Auth::getAuth() : null);
+ $tasklist->set('owner', empty($info['system']) ? $GLOBALS['registry']->getAuth() : null);
$result = $tasklist->save();
if (is_a($result, 'PEAR_Error')) {
return PEAR::raiseError(sprintf(_("Unable to save task list \"%s\": %s"), $info['name'], $result->getMessage()));
*/
public static function deleteTasklist($tasklist)
{
- if ($tasklist->getName() == Horde_Auth::getAuth()) {
+ if ($tasklist->getName() == $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("This task list cannot be deleted."));
}
- if (!Horde_Auth::getAuth() ||
- ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+ if (!$GLOBALS['registry']->getAuth() ||
+ ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($tasklist->get('owner')) || !$GLOBALS['registry']->isAdmin()))) {
return PEAR::raiseError(_("You are not allowed to delete this task list."));
}
if (count($GLOBALS['display_tasklists']) == 0) {
$lists = Nag::listTasklists(true);
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
/* All tasklists for guests. */
$GLOBALS['display_tasklists'] = array_keys($lists);
} else {
}
/* If the user's personal tasklist doesn't exist, then create it. */
- if (!$GLOBALS['nag_shares']->exists(Horde_Auth::getAuth())) {
+ if (!$GLOBALS['nag_shares']->exists($GLOBALS['registry']->getAuth())) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getOriginalAuth();
+ $name = $GLOBALS['registry']->getAuth('original');
}
- $share = $GLOBALS['nag_shares']->newShare(Horde_Auth::getAuth());
+ $share = $GLOBALS['nag_shares']->newShare($GLOBALS['registry']->getAuth());
$share->set('name', sprintf(_("%s's Task List"), $name));
$GLOBALS['nag_shares']->addShare($share);
/* Make sure the personal tasklist is displayed by default. */
- if (!in_array(Horde_Auth::getAuth(), $GLOBALS['display_tasklists'])) {
- $GLOBALS['display_tasklists'][] = Horde_Auth::getAuth();
+ if (!in_array($GLOBALS['registry']->getAuth(), $GLOBALS['display_tasklists'])) {
+ $GLOBALS['display_tasklists'][] = $GLOBALS['registry']->getAuth();
}
}
}
// Check here for guest task lists so that we don't get multiple
// messages after redirects, etc.
- if (!Horde_Auth::getAuth() && !count(Nag::listTasklists())) {
+ if (!$GLOBALS['registry']->getAuth() && !count(Nag::listTasklists())) {
$notification->push(_("No task lists are available to guests."));
}
'df' => $prefs->getValue('date_format'));
if ($prefs->getValue('task_notification_exclude_self') &&
- $user == Horde_Auth::getAuth()) {
+ $user == $GLOBALS['registry']->getAuth()) {
return false;
}
}
/* Obscure private tasks. */
- if ($this->private && $this->owner != Horde_Auth::getAuth()) {
+ if ($this->private && $this->owner != $GLOBALS['registry']->getAuth()) {
$this->name = _("Private Task");
$this->desc = '';
$this->category = _("Private");
Horde::logMessage($e->getMessage(), 'ERR');
throw new Nag_Exception($e);
}
- $json->pe = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
- $json->pd = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
+ $json->pe = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
+ $json->pd = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
}
return $json;
}
if (empty($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
if (empty($prefs)) {
$prefs = $GLOBALS['prefs'];
} catch (Horde_Share_Exception $e) {
throw new Nag_Exception($e);
}
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$GLOBALS['notification']->push(_("Access denied deleting task."), 'horde.error');
} else {
$storage = Nag_Driver::singleton($tasklist_id);
} catch (Horde_Share_Exception $e) {
$notification->push(sprintf(_("Access denied editing task: %s"), $e->getMessage()), 'horde.error');
}
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("Access denied editing task."), 'horde.error');
} else {
$task = Nag::getTask($tasklist_id, $task_id);
if (!isset($task) || !isset($task->id)) {
$notification->push(_("Task not found."), 'horde.error');
- } elseif ($task->private && $task->owner != Horde_Auth::getAuth()) {
+ } elseif ($task->private && $task->owner != $GLOBALS['registry']->getAuth()) {
$notification->push(_("Access denied editing task."), 'horde.error');
} else {
$vars = new Horde_Variables($task->toHash());
$vars->set('actionID', 'save_task');
$vars->set('old_tasklist', $task->tasklist);
- $form = new Nag_TaskForm($vars, sprintf(_("Edit: %s"), $task->name), $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE));
+ $form = new Nag_TaskForm($vars, sprintf(_("Edit: %s"), $task->name), $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE));
break;
}
}
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied saving task to %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
$info['category']['value'],
$info['alarm'], $info['methods'],
$info['parent'], (int)$info['private'],
- Horde_Auth::getAuth(), $info['assignee'], null,
+ $GLOBALS['registry']->getAuth(), $info['assignee'], null,
$info['tasklist_id']);
} else {
/* Check permissions. */
$info['category']['value'],
$info['alarm'], $info['methods'], null,
$info['parent'], (int)$info['private'],
- Horde_Auth::getAuth(), $info['assignee']);
+ $GLOBALS['registry']->getAuth(), $info['assignee']);
}
/* Check our results. */
if (isset($task_id)) {
$share = $GLOBALS['nag_shares']->getShare($tasklist_id);
$task = Nag::getTask($tasklist_id, $task_id);
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(sprintf(_("Access denied completing task %s."), $task->name), 'horde.error');
} else {
$task->completed = !$task->completed;
// Exit if this isn't an authenticated user or if the user can't
// create new task lists (default share is locked).
-if (!Horde_Auth::getAuth() || $prefs->isLocked('default_tasklist')) {
+if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('default_tasklist')) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
require_once NAG_BASE . '/lib/Forms/DeleteTaskList.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$vars = Horde_Variables::getDefaultVariables();
$tasklist_id = $vars->get('t');
-if ($tasklist_id == Horde_Auth::getAuth()) {
+if ($tasklist_id == $GLOBALS['registry']->getAuth()) {
$notification->push(_("This task list cannot be deleted."), 'horde.warning');
header('Location: ' . Horde::applicationUrl('tasklists/', true));
exit;
header('Location: ' . Horde::applicationUrl('tasklists/', true));
exit;
}
-if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($tasklist->get('owner')) || !$GLOBALS['registry']->isAdmin())) {
$notification->push(_("You are not allowed to delete this task list."), 'horde.error');
header('Location: ' . Horde::applicationUrl('tasklists/', true));
require_once NAG_BASE . '/lib/Forms/EditTaskList.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
header('Location: ' . Horde::applicationUrl('tasklists/', true));
exit;
}
-if ($tasklist->get('owner') != Horde_Auth::getAuth() &&
+if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
(!is_null($tasklist->get('owner')) || !$GLOBALS['registry']->isAdmin())) {
$notification->push(_("You are not allowed to change this task list."), 'horde.error');
header('Location: ' . Horde::applicationUrl('tasklists/', true));
Horde_Registry::appInit('nag');
/* Exit if this isn't an authenticated user. */
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
require NAG_BASE . '/list.php';
exit;
}
Horde_Registry::appInit('nag');
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$registry->getAuth()) {
exit;
}
$identity = $injector->getInstance('Horde_Prefs_Identity')->getIdentity($tasklist->get('owner'));
$owner_name = $identity->getValue('fullname');
if (trim($owner_name) == '') {
- $owner_name = Horde_Auth::getOriginalAuth();
+ $owner_name = $registry->getAuth('original');
}
<th id="s<?php echo Nag::SORT_CATEGORY ?>"<?php if ($sortby == Nag::SORT_CATEGORY) echo ' class="' . $sortdirclass . '"' ?> width="10%">
<?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby', Nag::SORT_CATEGORY)), _("Sort by Category"), 'sortlink', '', '', _("Cat_egory")) ?>
<?php
- if (Horde_Auth::getAuth() &&
+ if ($GLOBALS['registry']->getAuth() &&
(!$GLOBALS['prefs']->isLocked('categories') ||
!$GLOBALS['prefs']->isLocked('category_colors'))) {
$categoryUrl = Horde_Util::addParameter(Horde::getServiceLink('options', 'horde'), array('group' => 'categories'));
<tr class="<?php echo $style ?>">
<td>
<?php
-if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
if (!$task->completed) {
if (!$task->childrenCompleted()) {
$label = _("Incomplete sub tasks, complete them first");
<?php endif; ?>
<td>
<?php
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT) &&
- (!$task->private || $task->owner == Horde_Auth::getAuth())) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT) &&
+ (!$task->private || $task->owner == $GLOBALS['registry']->getAuth())) {
$label = sprintf(_("Edit \"%s\""), $task->name);
echo Horde::link($task->edit_link, $label) . Horde::img('edit.png', $label) . '</a>';
}
$task_name = strlen($task->name)
? htmlspecialchars($task->name)
: _("[none]");
- if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
echo Horde::link($task->view_link, '', '', '', '', $task->desc)
. $task_name . '</a>';
} else {
$info_img = Horde::img('info_icon.png', _("Task List Information"), array('class' => 'tasklist-info'));
-$current_user = Horde_Auth::getAuth();
+$current_user = $GLOBALS['registry']->getAuth();
$my_tasklists = array();
$shared_tasklists = array();
foreach (Nag::listTasklists() as $id => $tl) {
<input id="tasklistSearch" type="text" for="mytasklists,sharedtasklists" />
</p>
-<?php if (Horde_Auth::getAuth()): ?>
+<?php if ($GLOBALS['registry']->getAuth()): ?>
<p>
<a href="<?php echo Horde::applicationUrl('tasklists/') ?>"><?php echo _("[Manage Task Lists]") ?></a>
</p>
<tr>
<td class="rightAlign" valign="top"><strong><?php echo _("Completed?") ?></strong></td>
<td>
- <?php if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ <?php if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
if (empty($task->completed)) {
echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'complete_task')), _("Complete Task"), 'widget') . Horde::img('unchecked.png', _("Complete Task")) . '</a>';
} else {
/* Check permissions on $tasklist_id. */
$share = $GLOBALS['nag_shares']->getShare($tasklist_id);
-if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$notification->push(_("You do not have permission to view this tasklist."), 'horde.error');
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
$created = null;
$modified = null;
$completed = null;
-$userId = Horde_Auth::getAuth();
+$userId = $GLOBALS['registry']->getAuth();
$createdby = '';
$modifiedby = '';
if (!empty($task->uid)) {
Horde::logMessage($e->getMessage(), 'ERR');
throw new Nag_Exception($e);
}
-if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
if (!$task->completed) {
$links[] = Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'complete_task')), _("Complete"), 'smallheader', '', '', _("_Complete"));
}
- if (!$task->private || $task->owner == Horde_Auth::getAuth()) {
+ if (!$task->private || $task->owner == $GLOBALS['registry']->getAuth()) {
$links[] = Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'modify_task')), _("Edit"), 'smallheader', '', '', _("_Edit"));
}
}
-if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$links[] = Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'delete_tasks')), _("Delete"), 'smallheader', '', $prefs->getValue('delete_opt') ? 'return window.confirm(\'' . addslashes(_("Really delete this task?")) . '\');' : '', _("_Delete"));
}
if (!empty($allowed_cats) &&
(in_array($info['category1'], $allowed_cats) || in_array($info['category2'], $allowed_cats))) {
- $info['editor'] = Horde_Auth::getAuth();
+ $info['editor'] = $GLOBALS['registry']->getAuth();
$info['status'] = News::CONFIRMED;
}
$data = array($info['sortorder'],
$info['status'],
$info['publish'],
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$info['editor'],
@$info['sourcelink'],
isset($info['source']) ? $info['source'] : '',
}
$version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id));
$result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid, content) VALUES (?, ?, ?, NOW(), ? ,?)',
- array($id, $version + 1, $status_version, Horde_Auth::getAuth(), serialize($info['body'])));
+ array($id, $version + 1, $status_version, $GLOBALS['registry']->getAuth(), serialize($info['body'])));
if ($result instanceof PEAR_Error) {
$notification->push($result);
}
if (!empty($actionID) && $id > 0) {
$version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id));
$result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, action, created, user_uid) VALUES (?,?,?,NOW(),?)',
- array($id, $version + 1, $actionID, Horde_Auth::getAuth()));
+ array($id, $version + 1, $actionID, $GLOBALS['registry']->getAuth()));
}
if ($id) {
/* save as future version */
$version = $news->db->getOne('SELECT MAX(version) FROM ' . $news->prefix . '_versions WHERE id = ?', array($id)) + 1;
$result = $news->write_db->query('INSERT INTO ' . $news->prefix . '_versions (id, version, created, user_uid, content) VALUES (?,?,NOW(),?,?)',
- array($id, $version, Horde_Auth::getAuth(), serialize($new_version)));
+ array($id, $version, $GLOBALS['registry']->getAuth(), serialize($new_version)));
$notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("renewed")), 'horde.success');
header('Location: ' . $browse_url);
try {
$threads = $GLOBALS['registry']->call('forums/getThreadsByForumOwner',
- array(Horde_Auth::getAuth(), 'message_timestamp', 1, false,
+ array($GLOBALS['registry']->getAuth(), 'message_timestamp', 1, false,
'news', 0, $this->_params['limit']));
} catch (Horde_Exception $e) {
return $e->getMessage();
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
if ($GLOBALS['registry']->isAdmin(array('permission' => 'news:admin')) ||
- $perms->hasPermission('news', Horde_Auth::getAuth(), $perm)) {
+ $perms->hasPermission('news', $GLOBALS['registry']->getAuth(), $perm)) {
return $cats;
}
foreach ($cats as $key => $value) {
// user has access?
- if (!$perms->hasPermission('news:categories', Horde_Auth::getAuth(), $perm) && // master
- !$perms->hasPermission('news:categories:' . $key, Horde_Auth::getAuth(), $perm) && // child
- !$perms->hasPermission('news:categories:' . $this->_nodes[$key]['category_parentid'], Horde_Auth::getAuth(), $perm) // father
+ if (!$perms->hasPermission('news:categories', $GLOBALS['registry']->getAuth(), $perm) && // master
+ !$perms->hasPermission('news:categories:' . $key, $GLOBALS['registry']->getAuth(), $perm) && // child
+ !$perms->hasPermission('news:categories:' . $this->_nodes[$key]['category_parentid'], $GLOBALS['registry']->getAuth(), $perm) // father
) {
unset($cats[$key]);
}
/* Log it */
$sql = 'INSERT INTO ' . $this->prefix . '_user_reads (id,user,ip,useragent,readdate) VALUES (?, ?, ? , ?, NOW())';
- $result = $this->write_db->query($sql, array($id, Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
+ $result = $this->write_db->query($sql, array($id, $GLOBALS['registry']->getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
if ($result instanceof PEAR_Error) {
return $result;
}
}
$body = sprintf(_("%s would you like to invite you to read the news\n Title: %s\n\n Published: %s \nLink: %s"),
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
$row['title'],
$row['publish'],
News::getUrlFor('news', $id, true, -1));
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
if ($GLOBALS['registry']->isAdmin() ||
$perms->hasPermission('operator:accountcodes',
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
Horde_Perms::READ) ||
- $perms->hasPermission($permentry, Horde_Auth::getAuth(),
+ $perms->hasPermission($permentry, $GLOBALS['registry']->getAuth(),
Horde_Perms::READ)) {
return $this->_getRecords($start, $end, $accountcode, $dcontext,
$rowstart, $rowlimit);
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
if ($GLOBALS['registry']->isAdmin() ||
$perms->hasPermission('operator:accountcodes',
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
Horde_Perms::READ) ||
- $perms->hasPermission($permentry, Horde_Auth::getAuth(),
+ $perms->hasPermission($permentry, $GLOBALS['registry']->getAuth(),
Horde_Perms::READ)) {
return $this->_getMonthlyCallStats($start, $end, $accountcode,
$dcontext);
if ($GLOBALS['registry']->isAdmin() ||
$perms->hasPermission('operator:accountcodes',
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
Horde_Perms::READ)) {
$permfilter = false;
}
if (!$permfilter ||
$perms->hasPermission('operator:accountcodes:%',
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
Horde_Perms::READ)) {
// Add an option to select all accounts
}
if ($GLOBALS['registry']->isAdmin() ||
- $perms->hasPermission($permitem, Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ $perms->hasPermission($permitem, $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
$accountcodes[$accountcode] = $values[$index];
}
}
$userid = Horde::callHook('_passwd_hook_default_username',
array(Auth::getAuth()),
'passwd');
- } elseif ($conf['hooks']['full_name']) {
- $userid = Auth::getAuth();
} else {
- $userid = Auth::getBareAuth();
+ $userid = $registry->getAuth($conf['hooks']['full_name'] ? null : 'bare');
}
}
$userid = Horde::callHook('_passwd_hook_default_username',
array(Auth::getAuth()),
'passwd');
- } elseif ($conf['hooks']['full_name']) {
- $userid = Auth::getAuth();
} else {
- $userid = Auth::getBareAuth();
- }
- if (is_a($userid, 'PEAR_Error')) {
- Horde::logMessage($userid, __FILE__, __LINE__);
- $userid = '';
+ $userid = $registry->getAuth($conf['hooks']['full_name'] ? null : 'bare');
}
}
$title,
$syntax,
$paste,
- Horde_Auth::getAuth(),
+ $GLOBALS['registry']->getAuth(),
time()
);
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
$superadmin = $perms->hasPermission('shout:superadmin',
- Horde_Auth::getAuth(), $permmask);
+ $GLOBALS['registry']->getAuth(), $permmask);
while ($numparents >= 0) {
$tmpuser = $perms->hasPermission($permname,
- Horde_Auth::getAuth(), $permmask);
+ $GLOBALS['registry']->getAuth(), $permmask);
$user = $user | $tmpuser;
if ($numparents > 0) {
require_once SKOLI_BASE . '/lib/Forms/Entry.php';
/* Redirect to create a new class if we don't have access to any class */
-if (count(Skoli::listClasses(false, Horde_Perms::EDIT)) == 0 && Horde_Auth::getAuth()) {
+if (count(Skoli::listClasses(false, Horde_Perms::EDIT)) == 0 && $GLOBALS['registry']->getAuth()) {
$notification->push(_("Please create a new Class first."), 'horde.message');
header('Location: ' . Horde::applicationUrl('classes/create.php', true));
exit;
require_once SKOLI_BASE . '/lib/Forms/CreateClass.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
require_once SKOLI_BASE . '/lib/Forms/DeleteClass.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$notification->push($class, 'horde.error');
header('Location: ' . Horde::applicationUrl('classes/', true));
exit;
-} elseif (!$class->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+} elseif (!$class->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notification->push(_("You are not allowed to delete this class."), 'horde.error');
header('Location: ' . Horde::applicationUrl('classes/', true));
exit;
require_once SKOLI_BASE . '/lib/Forms/EditClass.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$notification->push($class, 'horde.error');
header('Location: ' . Horde::applicationUrl('classes/', true));
exit;
-} elseif (!$class->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+} elseif (!$class->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$notification->push(_("You are not allowed to change this class."), 'horde.error');
header('Location: ' . Horde::applicationUrl('classes/', true));
exit;
require_once SKOLI_BASE . '/lib/base.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
require_once SKOLI_BASE . '/lib/base.php';
// Exit if this isn't an authenticated user.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$share = $GLOBALS['skoli_shares']->getShare($entry['class_id']);
// Check permissions
-if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$notification->push(_("You are not allowed to view this entry."), 'horde.error');
header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
exit;
$url = Horde_Util::addParameter(Horde::applicationUrl('entry.php'), 'entry', $entry['object_id']);
$tabs = new Horde_Ui_Tabs('view', $vars);
$tabs->addTab(_("View"), $url, array('tabname' => 'Entry', 'id' => 'tabEntry'));
-if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$tabs->addTab(_("Edit"), $url, array('tabname' => 'EditEntry', 'id' => 'tabEditEntry'));
}
-if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$tabs->addTab(_("Delete"), $url, array('tabname' => 'DeleteEntry', 'id' => 'tabDeleteEntry'));
}
' VALUES (?, ?, ?, ?, ?, ?, ?)';
$entryId = md5(uniqid(mt_rand(), true));
$date = new Horde_Date($vars->get('object_time'));
- $values = array($entryId, Horde_Auth::getAuth(), $this->generateUID(), $this->_class, $studentid, $date->datestamp(), $vars->get('object_type'));
+ $values = array($entryId, $GLOBALS['registry']->getAuth(), $this->generateUID(), $this->_class, $studentid, $date->datestamp(), $vars->get('object_type'));
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Skoli_Driver_sql::addEntry(): %s', $query), 'DEBUG');
return false;
}
- if (!Horde_Auth::getAuth() ||
- $this->_class->get('owner') != Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth() ||
+ $this->_class->get('owner') != $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("Permission denied"));
}
$classes = Skoli::listClasses(false, Horde_Perms::EDIT);
$classes_enums = array();
foreach ($classes as $class) {
- if ($class->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($class->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$classes_enums[$class->getName()] = $class->get('name');
}
}
*/
function listClasses($owneronly = false, $permission = Horde_Perms::SHOW)
{
- if ($owneronly && !Horde_Auth::getAuth()) {
+ if ($owneronly && !$GLOBALS['registry']->getAuth()) {
return array();
}
- $classes = $GLOBALS['skoli_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
+ $classes = $GLOBALS['skoli_shares']->listShares($GLOBALS['registry']->getAuth(), $permission, $owneronly ? $GLOBALS['registry']->getAuth() : null, 0, 0, 'name');
if (is_a($classes, 'PEAR_Error')) {
Horde::logMessage($classes, 'ERR');
return array();
$share = $GLOBALS['skoli_shares']->getShare($class);
/* Check permissions */
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
continue;
}
$list[$i] = $share->datatreeObject->data;
$list[$i]['_id'] = $class;
- $list[$i]['_edit'] = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+ $list[$i]['_edit'] = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
/* Add all students to the list */
$driver = &Skoli_Driver::singleton($class);
$addressbooks = $registry->call('contacts/sources');
foreach ($classes as $class_id=>$share) {
/* Check permissions */
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
+ if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
continue;
}
- $share_permissions_edit = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
- $share_permissions_delete = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
+ $share_permissions_edit = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
+ $share_permissions_delete = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
$driver = &Skoli_Driver::singleton($class_id);
$entries = $driver->getEntries($studentid, $type, $searchparams);
}
/* Redirect to create a new class if we don't have access to any class */
-if (count(Skoli::listClasses()) == 0 && Horde_Auth::getAuth()) {
+if (count(Skoli::listClasses()) == 0 && $GLOBALS['registry']->getAuth()) {
$notification->push(_("Please create a new Class first."), 'horde.message');
header('Location: ' . Horde::applicationUrl('classes/create.php', true));
exit;
<th id="s<?php echo SKOLI_SORT_CATEGORY ?>"<?php if ($sortby_class == SKOLI_SORT_CATEGORY) echo ' class="' . $sortdirclass_class . '"' ?> width="10%">
<?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_CATEGORY)), _("Sort by Category"), 'sortlink', '', '', _("Category")) ?>
<?php
- if (Horde_Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
+ if ($GLOBALS['registry']->getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
!$GLOBALS['prefs']->isLocked('category_colors'))) {
$categoryUrl = Horde_Util::addParameter(Horde::getServiceLink('options', 'horde'), array('group' => 'categories'));
echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', Horde::popupJs($categoryUrl, array('urlencode' => true)) . 'return false;') . Horde::img('colorpicker.png', _("Edit categories and colors")) . '</a>';
<?php
Horde::addScriptFile('quickfinder.js', 'horde');
-$current_user = Horde_Auth::getAuth();
+$current_user = $GLOBALS['registry']->getAuth();
$my_classes = array();
$shared_classes = array();
foreach (Skoli::listClasses() as $id => $cl) {
<label><input type="checkbox" class="checkbox" name="show_students" value="1"<?php echo ($prefs->getValue('show_students') ? ' checked="checked"' : '') . ' /> ' . _("Show students?") ?></label>
</p>
-<?php if (Horde_Auth::getAuth()): ?>
+<?php if ($GLOBALS['registry']->getAuth()): ?>
<p>
<a href="<?php echo Horde::applicationUrl('classes/') ?>"><?php echo _("[Manage Classes]") ?></a>
</p>
// Exit if this isn't an authenticated user, or if there's no source
// configured for shares.
-if (!Horde_Auth::getAuth() || empty($_SESSION['turba']['has_share'])) {
+if (!$GLOBALS['registry']->getAuth() || empty($_SESSION['turba']['has_share'])) {
require TURBA_BASE . '/'
. ($browse_source_count ? basename($prefs->getValue('initial_page')) : 'search.php');
exit;
// Exit if this isn't an authenticated user, or if there's no source
// configured for shares.
-if (!Horde_Auth::getAuth() || empty($_SESSION['turba']['has_share'])) {
+if (!$GLOBALS['registry']->getAuth() || empty($_SESSION['turba']['has_share'])) {
require TURBA_BASE . '/'
. ($browse_source_count ? basename($prefs->getValue('initial_page')) : 'search.php');
exit;
$vars = Horde_Variables::getDefaultVariables();
$addressbook_id = $vars->get('a');
-if ($addressbook_id == Horde_Auth::getAuth()) {
+if ($addressbook_id == $GLOBALS['registry']->getAuth()) {
$notification->push(_("This addressbook cannot be deleted"), 'horde.warning');
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
exit;
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
exit;
}
-if (!Horde_Auth::getAuth() ||
- $addressbook->get('owner') != Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth() ||
+ $addressbook->get('owner') != $GLOBALS['registry']->getAuth()) {
$notification->push(_("You are not allowed to delete this addressbook."), 'horde.error');
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
// Exit if this isn't an authenticated user, or if there's no source
// configured for shares.
-if (!Horde_Auth::getAuth() || empty($_SESSION['turba']['has_share'])) {
+if (!$GLOBALS['registry']->getAuth() || empty($_SESSION['turba']['has_share'])) {
require TURBA_BASE . '/'
. ($browse_source_count ? basename($prefs->getValue('initial_page')) : 'search.php');
exit;
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
exit;
}
-if (!Horde_Auth::getAuth() ||
- $addressbook->get('owner') != Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth() ||
+ $addressbook->get('owner') != $GLOBALS['registry']->getAuth()) {
$notification->push(_("You are not allowed to change this addressbook."), 'horde.error');
header('Location: ' . Horde::applicationUrl('addressbooks/', true));
// Exit if this isn't an authenticated user, or if there's no source
// configured for shares.
-if (!Horde_Auth::getAuth() || empty($_SESSION['turba']['has_share'])) {
+if (!$GLOBALS['registry']->getAuth() || empty($_SESSION['turba']['has_share'])) {
require TURBA_BASE . '/'
. ($browse_source_count ? basename($prefs->getValue('initial_page')) : 'search.php');
exit;
* turba/scripts/ldap/rfc2739.schema in your LDAP configuration.
*/
/* First we need to get the uid. */
-// $_ldap_uid = Horde_Auth::getBareAuth();
+// $_ldap_uid = $GLOBALS['registry']->getAuth('bare');
// $_ldap_basedn = 'dc=example,dc=com';
// $cfgSources['personal_ldap'] = array(
// 'title' => _("My Address Book"),
//);
//$_group_driver = &Group::singleton();
-//$_group_list = $_group_driver->getGroupMemberships(Horde_Auth::getAuth());
+//$_group_list = $_group_driver->getGroupMemberships($GLOBALS['registry']->getAuth());
//foreach ($_group_list as $_group_id => $_group_name) {
// $cfgSources['group_' . $_group_id] = $grpSource;
// $cfgSources['group_' . $_group_id]['params'] = array('gid' => $_group_id);
$_imsp_auth_user = $GLOBALS['prefs']->getValue('imsp_auth_user');
$_imsp_auth_pass = $GLOBALS['prefs']->getValue('imsp_auth_pass');
if (!strlen($_imsp_auth_user)) {
- $_imsp_auth_user = Horde_Auth::getBareAuth();
+ $_imsp_auth_user = $GLOBALS['registry']->getAuth('bare');
$_imsp_auth_pass = Horde_Auth::getCredential('password');
}
$cfgSources['imsp'] = array(
$ob->setValue($field, $value);
$ob->store();
} else {
- return $driver->add(array('email' => $address, 'name' => $name, $field => $value, '__owner' => Horde_Auth::getAuth()));
+ return $driver->add(array('email' => $address, 'name' => $name, $field => $value, '__owner' => $GLOBALS['registry']->getAuth()));
}
return;
public function removeUserData($user)
{
if (!$GLOBALS['registry']->isAdmin() &&
- $user != Horde_Auth::getAuth()) {
+ $user != $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("You are not allowed to remove user data."));
}
{
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
return $perms->exists('turba:sources:' . $this->name)
- ? $perms->hasPermission('turba:sources:' . $this->name, Horde_Auth::getAuth(), $perm)
+ ? $perms->hasPermission('turba:sources:' . $this->name, $GLOBALS['registry']->getAuth(), $perm)
// Assume we have permissions if they're not explicitly set.
: true;
}
function _getContactOwner()
{
- return Horde_Auth::getAuth();
+ return $GLOBALS['registry']->getAuth();
}
/**
{
$params = @unserialize($share->get('params'));
if (!isset($params['default'])) {
- $params['default'] = ($params['name'] == Horde_Auth::getAuth());
+ $params['default'] = ($params['name'] == $GLOBALS['registry']->getAuth());
$share->set('params', serialize($params));
$share->save();
}
$temp['fullname'] = $temp['name'];
$isIMSPGroup = false;
if (!isset($temp['__owner'])) {
- $temp['__owner'] = Horde_Auth::getAuth();
+ $temp['__owner'] = $GLOBALS['registry']->getAuth();
}
if ((isset($temp[$this->_groupField])) &&
function createShare($share_id, $params)
{
if (isset($params['params']['default']) && $params['params']['default'] === true) {
- $share_id = Horde_Auth::getAuth();
+ $share_id = $GLOBALS['registry']->getAuth();
}
$result = Turba::createShare($share_id, $params);
$contact = array(
'uid' => $k->getUID(),
- 'owner' => Horde_Auth::getAuth(),
+ 'owner' => $GLOBALS['registry']->getAuth(),
'job-title' => $k->getStr('job-title'),
'organization' => $k->getStr('organization'),
'body' => $k->getStr('body'),
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('LDAP query by Turba_Driver_ldap::_search(): user = %s, root = %s (%s); filter = "%s"; attributes = "%s"; deref = "%s" ; sizelimit = %d',
- Horde_Auth::getAuth(), $this->_params['root'], $this->_params['server'], $filter, implode(', ', $attr), $this->_params['deref'], $sizelimit), 'DEBUG');
+ $GLOBALS['registry']->getAuth(), $this->_params['root'], $this->_params['server'], $filter, implode(', ', $attr), $this->_params['deref'], $sizelimit), 'DEBUG');
/* Send the query to the LDAP server and fetch the matching
* entries. */
*/
function hasPermission($perm)
{
- return $this->_share->hasPermission(Horde_Auth::getAuth(), $perm);
+ return $this->_share->hasPermission($GLOBALS['registry']->getAuth(), $perm);
}
/**
*/
function _deleteAll($sourceName = null)
{
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
return PEAR::raiseError('permission denied');
}
/* Get owner id */
if (empty($sourceName)) {
- $values = array(Horde_Auth::getAuth());
+ $values = array($GLOBALS['registry']->getAuth());
} else {
$values = array($sourceName);
}
return false;
}
- if (!Horde_Auth::getAuth() ||
- $this->_addressbook->get('owner') != Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth() ||
+ $this->_addressbook->get('owner') != $GLOBALS['registry']->getAuth()) {
return PEAR::raiseError(_("You do not have permissions to delete this address book."));
}
if (isset($sortedSources[$source])) {
$newSources = array_merge($newSources, $sortedSources[$source]);
}
- if (Horde_Auth::getAuth() && empty($defaults[$source])) {
+ if ($GLOBALS['registry']->getAuth() && empty($defaults[$source])) {
// User's default share is missing.
$driver = Turba_Driver::singleton($source);
if (!($driver instanceof PEAR_Error)) {
$sourceKey,
array('params' => array('source' => $source,
'default' => true,
- 'name' => Horde_Auth::getAuth())));
+ 'name' => $GLOBALS['registry']->getAuth())));
} catch (Horde_Share_Exception $e) {
Horde::logMessage($e, 'ERR');
continue;
// No backends are configured to provide shares
return array();
}
- if ($owneronly && !Horde_Auth::getAuth()) {
+ if ($owneronly && !$GLOBALS['registry']->getAuth()) {
return array();
}
try {
$sources = $GLOBALS['turba_shares']->listShares(
- Horde_Auth::getAuth(), $permission,
- $owneronly ? Horde_Auth::getAuth() : null);
+ $GLOBALS['registry']->getAuth(), $permission,
+ $owneronly ? $GLOBALS['registry']->getAuth() : null);
} catch (Horde_Share_Exception $e) {
Horde::logMessage($e, 'ERR');
return array();
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Horde_Auth::getOriginalAuth();
+ $name = $GLOBALS['registry']->getAuth('original');
}
$name = sprintf(_("%s's Address Book"), $name);
} else {
$vars = new Horde_Variables();
$form = new Turba_ContactForm($vars, $this->contact);
- $userId = Horde_Auth::getAuth();
+ $userId = $GLOBALS['registry']->getAuth();
/* Get the contact's history. */
if ($this->contact->getValue('__uid')) {
* state. */
$_SESSION['__auth'] = array('authenticated' => true,
'userId' => '1');
- $this->assertEqual('1', Horde_Auth::getAuth());
+ $this->assertEqual('1', $GLOBALS['registry']->getAuth());
}
/**
$perms = $GLOBALS['injector']->getInstance('Horde_Perms');
$superadmin = $perms->hasPermission('vilma:domains',
- Horde_Auth::getAuth(), $permmask);
+ $GLOBALS['registry']->getAuth(), $permmask);
- $user = $perms->hasPermission($permname, Horde_Auth::getAuth(), $permmask);
+ $user = $perms->hasPermission($permname, $GLOBALS['registry']->getAuth(), $permmask);
return ($superadmin | $user);
}
require WHUPS_BASE . '/config/templates.php';
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
header('Location: ' . Horde::applicationUrl('search.php', true));
exit;
}
{
global $whups_driver;
- $info = array('owner' => 'user:' . Horde_Auth::getAuth(), 'nores' => true);
+ $info = array('owner' => 'user:' . $GLOBALS['registry']->getAuth(), 'nores' => true);
$tickets = $whups_driver->getTicketsByProperties($info);
if (is_a($tickets, 'PEAR_Error')) {
return $tickets;
{
global $whups_driver;
- $info = array('requester' => Horde_Auth::getAuth(), 'nores' => true);
+ $info = array('requester' => $GLOBALS['registry']->getAuth(), 'nores' => true);
$tickets = $whups_driver->getTicketsByProperties($info);
if (is_a($tickets, 'PEAR_Error')) {
return $tickets;
$form3->getInfo($vars, $info);
// More checks if we're assigning the ticket at create-time.
- if (Horde_Auth::getAuth() && $whups_driver->isCategory('assigned', $vars->get('state'))) {
+ if ($GLOBALS['registry']->getAuth() && $whups_driver->isCategory('assigned', $vars->get('state'))) {
$form4 = new CreateStep4Form($vars);
}
if (Auth::getAuth() && $whups_driver->isCategory('assigned', $vars->get('state'))) {
$form4->getInfo($vars, $info);
}
- $ticket = Whups_Ticket::newTicket($info, Horde_Auth::getAuth());
+ $ticket = Whups_Ticket::newTicket($info, $GLOBALS['registry']->getAuth());
if (is_a($ticket, 'PEAR_Error')) {
return $ticket;
} else {
}
// Check that we have permission to update the ticket
- if (!Horde_Auth::getAuth() ||
+ if (!$GLOBALS['registry']->getAuth() ||
!Whups::hasPermission($ticket->get('queue'), 'queue', 'update')) {
return PEAR::raiseError(_('You do not have permission to update this ticket.'));
}
switch ($type) {
case 'taskHash':
global $whups_driver;
- $info = array('owner' => 'user:' . Horde_Auth::getAuth(),
+ $info = array('owner' => 'user:' . $GLOBALS['registry']->getAuth(),
'nores' => true);
$tickets = $whups_driver->getTicketsByProperties($info);
if (is_a($tickets, 'PEAR_Error')) {
$info = array();
if (!empty($criteria['user'])) {
- $info['owner'] = 'user:' . Horde_Auth::getAuth();
+ $info['owner'] = 'user:' . $GLOBALS['registry']->getAuth();
}
if (!empty($criteria['active'])) {
$info['nores'] = true;
$end = new Horde_Date($end);
$end_ts = $end->timestamp();
- $criteria['owner'] = Whups::getOwnerCriteria(Horde_Auth::getAuth());
+ $criteria['owner'] = Whups::getOwnerCriteria($GLOBALS['registry']->getAuth());
/* @TODO Use $categories */
$category = 'due';
require_once WHUPS_BASE . '/lib/Query.php';
$qManager = new Whups_QueryManager();
- $queries = $qManager->listQueries(Horde_Auth::getAuth(), true);
+ $queries = $qManager->listQueries($GLOBALS['registry']->getAuth(), true);
if (is_a($queries, 'PEAR_Error')) {
return $queries;
}
global $whups_driver, $prefs;
$queue_ids = array_keys(Whups::permissionsFilter($whups_driver->getQueues(), 'queue', Horde_Perms::READ));
- $info = array('requester' => Horde_Auth::getAuth(),
- 'notowner' => 'user:' . Horde_Auth::getAuth(),
+ $info = array('requester' => $GLOBALS['registry']->getAuth(),
+ 'notowner' => 'user:' . $GLOBALS['registry']->getAuth(),
'nores' => true,
'queue' => $queue_ids);
$requests = $whups_driver->getTicketsByProperties($info);
global $whups_driver, $prefs;
$queue_ids = array_keys(Whups::permissionsFilter($whups_driver->getQueues(), 'queue', Horde_Perms::READ));
- $info = array('owner' => Whups::getOwnerCriteria(Horde_Auth::getAuth()),
+ $info = array('owner' => Whups::getOwnerCriteria($GLOBALS['registry']->getAuth()),
'nores' => true,
'queue' => $queue_ids);
$assigned = $whups_driver->getTicketsByProperties($info);
$qManager = new Whups_QueryManager();
$qDefault = null;
- $qParams = $qManager->listQueries(Horde_Auth::getAuth());
+ $qParams = $qManager->listQueries($GLOBALS['registry']->getAuth());
if (count($qParams)) {
$qType = 'enum';
} else {
if (is_a($query, 'PEAR_Error')) {
return false;
}
- if (!$query->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if (!$query->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
return false;
}
$attribute_id = (int)substr($name, 10);
$ticket->change($name, $value);
$this->_setAttributeValue($ticket_id, $attribute_id, $value);
- $this->updateLog($ticket_id, Horde_Auth::getAuth(), array('attribute' => $attribute_id . ':' . $value));
+ $this->updateLog($ticket_id, $GLOBALS['registry']->getAuth(), array('attribute' => $attribute_id . ':' . $value));
}
}
}
$seen_email_addresses = array();
foreach ($recipients as $user) {
- if ($user == $from && $user == Horde_Auth::getAuth() &&
+ if ($user == $from && $user == $GLOBALS['registry']->getAuth() &&
$prefs->getValue('email_others_only')) {
continue;
}
$mail->send($GLOBALS['injector']->getInstance('Horde_Mail'), true);
$entry = sprintf('%s Message sent to %s from "%s"',
$_SERVER['REMOTE_ADDR'], $to,
- Horde_Auth::getAuth());
+ $GLOBALS['registry']->getAuth());
Horde::logMessage($entry, 'INFO');
} catch (Horde_Mime_Exception $e) {
Horde::logMessage($e, 'ERR');
$ticket));
} else {
$queues = Whups::permissionsFilter(
- $this->getQueues(), 'queue', Horde_Perms::READ, Horde_Auth::getAuth(),
+ $this->getQueues(), 'queue', Horde_Perms::READ, $GLOBALS['registry']->getAuth(),
$result[0]['user_id_requester']);
if ($checkPerms &&
!in_array($result[0]['queue'], array_flip($queues))) {
$this->addHidden('', 'id', 'int', true, true);
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
$this->addVariable(_("Your Email Address"), 'user_email', 'email', true);
if (!empty($conf['guests']['captcha'])) {
$this->addVariable(_("Spam protection"), 'captcha', 'figlet', true, null, null, array(Whups::getCAPTCHA(!$this->isSubmitted()), $conf['guests']['figlet_font']));
/* Group restrictions. */
if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin')) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:hiddenComments', Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:hiddenComments', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$groups = Horde_Group::singleton();
- $mygroups = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
if ($mygroups) {
foreach (array_keys($mygroups) as $gid) {
$grouplist[$gid] = $groups->getGroupName($gid, true);
global $conf;
if (!parent::validate($vars, $canAutoFill)) {
- if (!Horde_Auth::getAuth() && !empty($conf['guests']['captcha'])) {
+ if (!$GLOBALS['registry']->getAuth() && !empty($conf['guests']['captcha'])) {
$vars->remove('captcha');
$this->removeVariable($varname = 'captcha');
$this->insertVariableBefore('newcomment', _("Spam protection"), 'captcha', 'figlet', true, null, null, array(Whups::getCAPTCHA(true), $conf['guests']['figlet_font']));
$queue = $vars->get('queue');
$info = $whups_driver->getQueue($queue);
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$states2 = $whups_driver->getStates($vars->get('type'),
array('new', 'assigned'));
if (is_array($states2)) {
if (Whups::hasPermission($queue, 'queue', 'requester')) {
$this->addVariable(_("The Requester's Email Address"), 'user_email',
'whups_email', false);
- } elseif (!Horde_Auth::getAuth()) {
+ } elseif (!$GLOBALS['registry']->getAuth()) {
$this->addVariable(_("Your Email Address"), 'user_email', 'email',
true);
if (!empty($conf['guests']['captcha'])) {
global $conf;
if (!parent::validate($vars, $canAutoFill)) {
- if (!Horde_Auth::getAuth() && !empty($conf['guests']['captcha'])) {
+ if (!$GLOBALS['registry']->getAuth() && !empty($conf['guests']['captcha'])) {
$vars->remove('captcha');
$this->removeVariable($varname = 'captcha');
$this->insertVariableBefore(
if ($conf['prefs']['assign_all_groups']) {
$mygroups = $groups->listGroups();
} else {
- $mygroups = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
}
$users = $whups_driver->getQueueUsers($vars->get('queue'));
if ($GLOBALS['conf']['prefs']['assign_all_groups']) {
$mygroups = $groups->listGroups();
} else {
- $mygroups = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
}
$f_users = array();
/* Comment permissions. */
$groups = Horde_Group::singleton();
- $mygroups = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
if ($mygroups) {
foreach (array_keys($mygroups) as $gid) {
$grouplist[$gid] = $groups->getGroupName($gid, true);
function validate(&$vars)
{
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
$this->setError('_auth', _("Permission Denied."));
}
parent::Horde_Form($vars, _("Load Query"));
$qManager = new Whups_QueryManager();
- $qParams = $qManager->listQueries(Horde_Auth::getAuth());
+ $qParams = $qManager->listQueries($GLOBALS['registry']->getAuth());
if (count($qParams)) {
$qType = 'enum';
} else {
global $notification;
if ($vars->get('yesno')) {
- if (!$GLOBALS['whups_query']->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
+ if (!$GLOBALS['whups_query']->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
$notifications->push(sprintf(_("Permission denied.")), 'horde.error');
} else {
$result = $GLOBALS['whups_query']->delete();
parent::getInfo($vars, $info);
if (empty($info['queue'])) {
- $info['queue'] = array_keys(Whups::permissionsFilter($GLOBALS['whups_driver']->getQueues(), 'queue', Horde_Perms::READ, Horde_Auth::getAuth(), Horde_Auth::getAuth()));
+ $info['queue'] = array_keys(Whups::permissionsFilter($GLOBALS['whups_driver']->getQueues(), 'queue', Horde_Perms::READ, $GLOBALS['registry']->getAuth(), $GLOBALS['registry']->getAuth()));
}
if (empty($info['states'])) {
* @param string $auth_user This will be the Horde user that creates the
* ticket. If null, we will try to deduce from
* the message's From: header. We do NOT default
- * to Horde_Auth::getAuth().
+ * to $GLOBALS['registry']->getAuth().
*
* @return Whups_Ticket | PEAR_Error Ticket or Error object.
*/
}
// Authenticate as the correct Horde user.
- if (!empty($auth_user) && $auth_user != Horde_Auth::getAuth()) {
+ if (!empty($auth_user) && $auth_user != $GLOBALS['registry']->getAuth()) {
Horde_Auth::setAuth($auth_user, array());
}
{
// Create a few variables that are reused.
$queryurl = Horde::applicationUrl('query/index.php');
- $edit = $this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
- $delete = $this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
+ $edit = $this->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
+ $delete = $this->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
$tabs = new Horde_Ui_Tabs('action', $vars);
$tabs->addTab(_("Ne_w Query"), $queryurl, 'new');
}
$tabs->addTab(_("E_xecute Query"), Horde::applicationUrl('query/run.php'), 'run');
$tabs->addTab(_("_Load Query"), $queryurl, 'load');
- if ((!$this->id && Horde_Auth::getAuth()) ||
+ if ((!$this->id && $GLOBALS['registry']->getAuth()) ||
($this->id && $edit)) {
$tabs->addTab(_("Sa_ve Query"), $queryurl, 'save');
}
function getQueryBySlug($slug)
{
try {
- $shares = $this->_shareManager->listShares(Horde_Auth::getAuth(), Horde_Perms::READ,
+ $shares = $this->_shareManager->listShares($GLOBALS['registry']->getAuth(), Horde_Perms::READ,
array('slug' => $slug));
} catch (Horde_Share_Exception $e) {
throw new Whups_Exception($e);
static $canUpdate, $comment_count = 0;
if (!isset($canUpdate)) {
- $canUpdate = Horde_Auth::getAuth() &&
+ $canUpdate = $GLOBALS['registry']->getAuth() &&
Whups::hasPermission($vars->get('queue'), 'queue', 'update');
}
}
if (is_null($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$author_email = isset($this->_changes['comment-email']['to'])
? $this->_changes['comment-email']['to']
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$name = $identity->getValue('fullname');
if (empty($name)) {
- $name = Horde_Auth::getBareAuth();
+ $name = $GLOBALS['registry']->getAuth('bare');
}
/* Get queue specific notification message text, if available. */
function hasPermission($in, $filter, $permission, $user = null)
{
if (is_null($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
if ($permission == 'update' ||
// If the sub-permission doesn't exist, use the queue
// permission at an EDIT level and lock out guests.
if ($permission != 'requester' &&
- Horde_Auth::getAuth() &&
+ $GLOBALS['registry']->getAuth() &&
$perms->hasPermission('whups:queues:' . $in, $user,
Horde_Perms::EDIT)) {
return true;
$user = null, $creator = null)
{
if (is_null($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
}
$admin = $GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin', 'permlevel' => $permission, 'user' => $user));
{
$criteria = array('user:' . $user);
$groups = Horde_Group::singleton();
- $mygroups = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
foreach ($mygroups as $id => $group) {
$criteria[] = 'group:' . $id;
}
static $results;
if (is_null($user)) {
- $user = Horde_Auth::getAuth();
+ $user = $GLOBALS['registry']->getAuth();
} elseif (empty($user)) {
return array('user' => '',
'name' => '',
{
$menu = new Horde_Menu();
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$menu->add(Horde::applicationUrl('mybugs.php'), sprintf(_("_My %s"), $GLOBALS['registry']->get('name')), 'whups.png', null, null, null, $GLOBALS['prefs']->getValue('whups_default_view') == 'mybugs' && strpos($_SERVER['PHP_SELF'], $GLOBALS['registry']->get('webroot') . '/index.php') !== false ? 'current' : null);
}
$menu->add(Horde::applicationUrl('search.php'), _("_Search"), 'search.png', null, null, null, $GLOBALS['prefs']->getValue('whups_default_view') == 'search' && strpos($_SERVER['PHP_SELF'], $GLOBALS['registry']->get('webroot') . '/index.php') !== false ? 'current' : null);
// @TODO: remove this when there are blocks useful to guests
// available.
-if (!Horde_Auth::getAuth()) {
+if (!$GLOBALS['registry']->getAuth()) {
require WHUPS_BASE . '/search.php';
exit;
}
// Find our current query.
if (isset($_SESSION['whups']['query'])) {
$whups_query = unserialize($_SESSION['whups']['query']);
- if (!$whups_query->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if (!$whups_query->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$notification->push(_("Permission denied."), 'horde.error');
header('Location: ' . Horde::applicationUrl($prefs->getValue('whups_default_view') . '.php', true));
exit;
if (!isset($whups_query) ||
is_a($whups_query, 'PEAR_Error') ||
$whups_query->parameters ||
- !$whups_query->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ !$whups_query->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
exit;
}
// read permissions on the requested query, go to the initial Whups page.
if (!isset($whups_query) ||
is_a($whups_query, 'PEAR_Error') ||
- !$whups_query->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ !$whups_query->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
if (is_a($whups_query, 'PEAR_Error')) {
$notification->push($whups_query);
} elseif (isset($whups_query)) {
$qManager = new Whups_QueryManager();
$myqueries = Whups_View::factory(
'SavedQueries',
- array('title' => Horde_Auth::getAuth() ? _("My Queries") : _("Public Queries"),
- 'results' => $qManager->listQueries(Horde_Auth::getAuth(), true)));
+ array('title' => $GLOBALS['registry']->getAuth() ? _("My Queries") : _("Public Queries"),
+ 'results' => $qManager->listQueries($GLOBALS['registry']->getAuth(), true)));
$myqueries->html();
require $registry->get('templates', 'horde') . '/common-footer.inc';
?>
</tbody>
</table>
-<?php if (Horde_Auth::getAuth()): ?>
+<?php if ($GLOBALS['registry']->getAuth()): ?>
<table width="100%" cellspacing="0">
<tr>
<td class="smallheader nowrap">
$private = false;
foreach ($history[$tid]['changes'] as $change) {
if (!empty($change['private'])) {
- if (!$GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:comments:' . $change['value'], Horde_Auth::getAuth(), Horde_Perms::READ)) {
+ if (!$GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:comments:' . $change['value'], $GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$private = true;
break;
}
$valid3 = $form3->validate($vars, true);
$valid2 = $form2->validate($vars, !$form1->isSubmitted());
$valid1 = $form1->validate($vars, true);
-$doAssignForm = Horde_Auth::getAuth() &&
+$doAssignForm = $GLOBALS['registry']->getAuth() &&
$whups_driver->isCategory('assigned', $vars->get('state'));
if ($valid1 && $valid2 && $valid3 &&
$form4->getInfo($vars, $info);
}
- $ticket = Whups_Ticket::newTicket($info, Horde_Auth::getAuth());
+ $ticket = Whups_Ticket::newTicket($info, $GLOBALS['registry']->getAuth());
if (is_a($ticket, 'PEAR_Error')) {
Horde::logMessage($ticket, 'ERR');
$notification->push(sprintf(_("Adding your ticket failed: %s."),
/* Group restrictions. */
if ($GLOBALS['registry']->isAdmin(array('permission' => 'whups:admin', 'permlevel' => Horde_Perms::EDIT)) ||
$GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('whups:hiddenComments',
- Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
$groups = Horde_Group::singleton();
- $mygroups = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
if ($mygroups) {
foreach (array_keys($mygroups) as $gid) {
$grouplist[$gid] = $groups->getGroupName($gid, true);
/* Group restrictions. */
$groups = Horde_Group::singleton();
- $mygroups = $groups->getGroupMemberships(Horde_Auth::getAuth());
+ $mygroups = $groups->getGroupMemberships($GLOBALS['registry']->getAuth());
if ($mygroups) {
foreach (array_keys($mygroups) as $gid) {
$grouplist[$gid] = $groups->getGroupName($gid, true);
}
if (!isset($file['change_author'])) {
- $file['change_author'] = Horde_Auth::getAuth();
+ $file['change_author'] = $GLOBALS['registry']->getAuth();
}
$result = $this->_attachFile($file);
return PEAR::raiseError(_("Robots are not allowed to create pages"));
}
- $author = Horde_Auth::getAuth();
+ $author = $GLOBALS['registry']->getAuth();
if ($author === false) {
$author = null;
}
$versionchange = 'page_majorversion = page_majorversion + 1, page_minorversion = 0';
}
- $author = Horde_Auth::getAuth();
+ $author = $GLOBALS['registry']->getAuth();
if ($author === false) {
$author = null;
}
} elseif ($perms->exists('wicked:pages')) {
return $perms->getPermissions('wicked:pages');
} else {
- if (!Horde_Auth::getAuth()) {
+ if (!$GLOBALS['registry']->getAuth()) {
return Horde_Perms::SHOW | Horde_Perms::READ;
} else {
return Horde_Perms::SHOW | Horde_Perms::READ | Horde_Perms::EDIT | Horde_Perms::DELETE;
if ($perms->exists($permName)) {
return $perms->getPermissions($permName) & Horde_Perms::EDIT;
} else {
- return Horde_Auth::getAuth();
+ return $GLOBALS['registry']->getAuth();
}
break;
$notification->push(sprintf(_("You don't have permission to edit \"%s\"."), $page->pageName()));
} else {
if (!empty($GLOBALS['conf']['wicked']['captcha']) &&
- !Horde_Auth::getAuth() &&
+ !$GLOBALS['registry']->getAuth() &&
(Horde_String::lower(Horde_Util::getFormData('wicked_captcha')) != Horde_String::lower(Wicked::getCAPTCHA()))) {
$notification->push(_("Random string did not match."), 'horde.error');
return;
}
if (empty($params['user'])) {
- $params['user'] = Horde_Auth::getAuth();
+ $params['user'] = $GLOBALS['registry']->getAuth();
}
if (empty($params['password'])) {
return;
}
- if (Horde_Auth::getAuth()) {
- $prefix = Horde_Auth::getAuth();
+ if ($GLOBALS['registry']->getAuth()) {
+ $prefix = $GLOBALS['registry']->getAuth();
} else {
$prefix = 'guest [' . $_SERVER['REMOTE_ADDR'] . ']';
}
$default_from_addr = !empty($conf['wicked']['guest_address']) ?
$conf['wicked']['guest_address'] :
$conf['wicked']['notify_address'];
- if (Horde_Auth::getAuth()) {
+ if ($GLOBALS['registry']->getAuth()) {
$identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity();
$from = $identity->getValue('fullname');
if (empty($from)) {
*/
function lockUser()
{
- return Horde_Auth::getAuth() ? Horde_Auth::getAuth() : $GLOBALS['browser']->getIPAddress();
+ return $GLOBALS['registry']->getAuth() ? $GLOBALS['registry']->getAuth() : $GLOBALS['browser']->getIPAddress();
}
}
</div>
<?php
-if (!empty($GLOBALS['conf']['wicked']['captcha']) && !Horde_Auth::getAuth()):
+if (!empty($GLOBALS['conf']['wicked']['captcha']) && !$GLOBALS['registry']->getAuth()):
require_once 'Text/Figlet.php';
$figlet = new Text_Figlet();
$result = $figlet->loadFont($GLOBALS['conf']['wicked']['figlet_font']);