{
global $perms;
- $userId = Auth::getAuth();
+ $userId = Horde_Auth::getAuth();
$admin = ($userId == 'admin') ? true : false;
if ($admin || !$perms->exists('babel:' . $permission)) {
switch ($filter) {
case 'tabs':
if ($perm) {
- $allowed = $perms->hasPermission('babel:' . $permission, Auth::getAuth(), $perm);
+ $allowed = $perms->hasPermission('babel:' . $permission, Horde_Auth::getAuth(), $perm);
}
break;
}
if ($editmode && $cstring == $encstr) {
// Lock the current item for 5 minutes
- $locks->setLock(Auth::getAuth(), md5($encstr), $lockscope, 300);
+ $locks->setLock(Horde_Auth::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 . '">';
static public function checkPerms($key)
{
return (!$GLOBALS['perms']->exists('chora:sourceroots:' . $key) ||
- $GLOBALS['perms']->hasPermission('chora:sourceroots:' . $key, Auth::getAuth(), PERMS_READ | PERMS_SHOW));
+ $GLOBALS['perms']->hasPermission('chora:sourceroots:' . $key, Horde_Auth::getAuth(), PERMS_READ | PERMS_SHOW));
}
/**
require_once 'Horde/Loader.php';
require_once './lib/Block/Layout/View/js.php';
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
require_once HORDE_BASE . '/lib/base.php';
require_once 'Horde/Loader.php';
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
case 'modify_account':
$account_id = $vars->get('account');
- if (!$share->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_DELETE));
+ $form = new Fima_AccountForm($vars, sprintf(_("Edit: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE));
break;
}
}
}
$form->getInfo($vars, $info);
- if (!$share->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_DELETE)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_EDIT));
+ $form = new Fima_AccountDeleteForm($vars, sprintf(_("Delete: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT));
break;
}
}
}
$form->getInfo($vars, $info);
- if (!$share->hasPermission(Auth::getAuth(), PERMS_DELETE)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_DELETE)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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' => Auth::getAuth() ? Auth::getAuth() : 0,
+ 'value' => Horde_Auth::getAuth() ? Horde_Auth::getAuth() : 0,
'locked' => false,
'shared' => true,
'type' => 'implicit'
// Exit if this isn't an authenticated user or if the user can't
// create new task lists (default share is locked).
-if (!Auth::getAuth() || $prefs->isLocked('active_ledger')) {
+if (!Horde_Auth::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 (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
}
$vars = Horde_Variables::getDefaultVariables();
$ledger_id = $vars->get('l');
-if ($ledger_id == Auth::getAuth()) {
+if ($ledger_id == Horde_Auth::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') != Auth::getAuth()) {
+} elseif ($ledger->get('owner') != Horde_Auth::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 (!Auth::getAuth()) {
+if (!Horde_Auth::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') != Auth::getAuth()) {
+} elseif ($ledger->get('owner') != Horde_Auth::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 (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
require FIMA_BASE . '/postings.php';
exit;
}
'show_ledger' => array(
'type' => 'enum',
'name' => _("Show summary of this ledger"),
- 'default' => Auth::getAuth(),
+ 'default' => Horde_Auth::getAuth(),
'values' => $ledgers),
'show_months' => array(
'type' => 'enum',
*/
function listLedgers($owneronly = false, $permission = PERMS_SHOW)
{
- $ledgers = $GLOBALS['fima_shares']->listShares(Auth::getAuth(), $permission, $owneronly ? Auth::getAuth() : null);
+ $ledgers = $GLOBALS['fima_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null);
if (is_a($ledgers, 'PEAR_Error')) {
Horde::logMessage($ledgers, __FILE__, __LINE__, PEAR_LOG_ERR);
return array();
if (count($GLOBALS['display_ledgers']) == 0) {
$ledgerss = Fima::listLedgers(true);
- if (!Auth::getAuth()) {
+ if (!Horde_Auth::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(Auth::getAuth())) {
+ if (!$GLOBALS['fima_shares']->exists(Horde_Auth::getAuth())) {
require_once 'Horde/Identity.php';
$identity = &Identity::singleton();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Auth::removeHook(Auth::getAuth());
+ $name = Horde_Auth::removeHook(Horde_Auth::getAuth());
}
- $share = &$GLOBALS['fima_shares']->newShare(Auth::getAuth());
+ $share = &$GLOBALS['fima_shares']->newShare(Horde_Auth::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(Auth::getAuth(), $GLOBALS['display_ledgers'])) {
- $GLOBALS['display_ledgers'][] = Auth::getAuth();
+ if (!in_array(Horde_Auth::getAuth(), $GLOBALS['display_ledgers'])) {
+ $GLOBALS['display_ledgers'][] = Horde_Auth::getAuth();
}
}
}
$menu->add(Horde::applicationUrl('search.php'), _("Search"), 'search.png', $registry->getImageDir('horde'));
$menu->add(Horde::applicationUrl('accounts.php'), _("_Accounts"), 'accounts.png');
- if (Auth::getAuth()) {
+ if (Horde_Auth::getAuth()) {
$menu->add(Horde::applicationUrl('ledgers/index.php'), _("_My Ledgers"), 'accounts.png');
}
return false;
}
- if ($this->_ledger->get('owner') != Auth::getAuth()) {
+ if ($this->_ledger->get('owner') != Horde_Auth::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(Auth::getAuth())) {
+ if (!$GLOBALS['fima_shares']->exists(Horde_Auth::getAuth())) {
require_once 'Horde/Identity.php';
$identity = &Identity::singleton();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Auth::removeHook(Auth::getAuth());
+ $name = Horde_Auth::removeHook(Horde_Auth::getAuth());
}
- $ledger = &$GLOBALS['fima_shares']->newShare(Auth::getAuth());
+ $ledger = &$GLOBALS['fima_shares']->newShare(Horde_Auth::getAuth());
if (is_a($ledger, 'PEAR_Error')) {
return;
}
$postingset = Horde_Util::getFormData('posting_id');
$share = &$GLOBALS['fima_shares']->getShare($ledger);
- if (!$share->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_DELETE)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_EDIT)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_EDIT)) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_DELETE) && (!Horde_Util::getFormData('keep') || Horde_Util::getFormData('delete'))) {
+ } elseif (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_EDIT);
-$perm_delete = $share->hasPermission(Auth::getAuth(), PERMS_DELETE);
+$perm_edit = $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+$perm_delete = $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE);
?>
<script type="text/javascript">
$ledgers = Fima::listLedgers();
if (($active_ledger = $prefs->getValue('active_ledger')) == null ||
!isset($ledgers[$active_ledger])) {
- $active_ledger = Auth::getAuth();
+ $active_ledger = Horde_Auth::getAuth();
}
?>
$code = Horde_Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$user = Horde_Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$profile = $folks_driver->getProfile($user);
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
// This pages is only to activate users
if ($profile['user_status'] != 'inactive') {
$notification->push(_("User \"%s\" was already activated."));
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$internal_code = $folks_driver->getConfirmationCode($user, 'activate');
if ($internal_code instanceof PEAR_Error) {
$notification->push($internal_code);
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$notification->push(_("The code is not right. If you copy and paste the link from your email, please check if you copied the whole string."), 'horde.warning');
}
-header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
$code = Horde_Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$user = Horde_Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$profile = $folks_driver->getProfile($user);
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
// This pages is only to activate users
if ($profile['user_status'] != 'deleted') {
$notification->push(_("User \"%s\" is not market to be in the removal process."));
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$internal_code = $folks_driver->getConfirmationCode($user, 'renew');
if ($internal_code instanceof PEAR_Error) {
$notification->push($internal_code);
- header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
$notification->push(_("The code is not right. If you copy and paste the link from your email, please check if you copied the whole string."), 'horde.warning');
}
-header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
exit;
}
// We are already logged
-if (Auth::isAuthenticated()) {
- header('Location: ' . Folks::getUrlFor('user', Auth::getAuth()));
+if (Horde_Auth::isAuthenticated()) {
+ header('Location: ' . Folks::getUrlFor('user', Horde_Auth::getAuth()));
exit;
}
// Make sure auth backend allows passwords to be reset.
-$auth = Auth::singleton($conf['auth']['driver']);
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
if (!$auth->hasCapability('resetpassword')) {
$notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error');
- header('Location: ' . Auth::getLoginScreen('', Horde_Util::getFormData('url')));
+ header('Location: ' . Horde_Auth::getLoginScreen('', Horde_Util::getFormData('url')));
exit;
}
// Get user security pass
$user = Horde_Util::getFormData('username');
if ($user) {
- $u_prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', Auth::addHook($user), '', null, false);
+ $u_prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', Horde_Auth::addHook($user), '', null, false);
$u_prefs->retrieve();
$answer = $u_prefs->getValue('security_answer');
$question = $u_prefs->getValue('security_question');
$email = Folks::getUserEmail($info['username']);
if ($email instanceof PEAR_Error) {
$notification->push($email);
- header('Location: ' . Auth::getLoginScreen('', $info['url']));
+ header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
exit;
}
$password = $auth->resetPassword($info['username']);
if ($password instanceof PEAR_Error) {
$notification->push($password);
- header('Location: ' . Auth::getLoginScreen('', $info['url']));
+ header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
exit;
}
Folks::sendMail($email, _("Your password has been reset"), $body);
$notification->push(sprintf(_("Your password has been reset, check your email (%s) and log in with your new password."), $email), 'horde.success');
- header('Location: ' . Auth::getLoginScreen('', $info['url']));
+ header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
exit;
} else {
/* Info submitted does not match what is in prefs, redirect user back
require_once dirname(__FILE__) . '/tabs.php';
require_once 'Horde/Auth/Signup.php';
-$auth = Auth::singleton($conf['auth']['driver']);
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
// Make sure signups are enabled before proceeding
if ($conf['signup']['allow'] !== true ||
!$auth->hasCapability('add')) {
$notification->push(_("User Registration has been disabled for this site."), 'horde.error');
- header('Location: ' . Auth::getLoginScreen());
+ header('Location: ' . Horde_Auth::getLoginScreen());
exit;
}
$notification->push(sprintf(_("There was a problem adding \"%s\" to the system: %s"), $info['user_name'], $success->getMessage()), 'horde.error');
} else {
$notification->push($success_message, 'horde.success');
- $url = Auth::getLoginScreen('', $info['url']);
+ $url = Horde_Auth::getLoginScreen('', $info['url']);
header('Location: ' . $url);
exit;
}
define('FOLKS_BASE', dirname(__FILE__) . '/..');
require_once FOLKS_BASE . '/lib/base.php';
-$auth = Auth::singleton($conf['auth']['driver']);
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
$vars = Horde_Variables::getDefaultVariables();
$tabs = new Horde_UI_Tabs('what', $vars);
Folks::sendMail($info['email'], _("Your username was requested"), $body);
$notification->push(sprintf(_("Your username was sent, check your email (%s)."), $users['user_email']), 'horde.success');
- header('Location: ' . Auth::getLoginScreen('', $info['url']));
+ header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
exit;
}
}
return $GLOBALS['registry']->callByPackage('ansel', 'listGalleries', array('ansel', PERMS_SHOW, null, true, 0, 3, $user));
case 'blogs':
- return $GLOBALS['registry']->callByPackage('thomas', 'getRecentPosts', array($user, Auth::getAuth(), '', 3));
+ return $GLOBALS['registry']->callByPackage('thomas', 'getRecentPosts', array($user, Horde_Auth::getAuth(), '', 3));
case 'classifieds':
return $GLOBALS['registry']->callByPackage('classified', 'listAds', array(array('user_uid' => $user), 0, 3));
{
require_once 'Horde/Group.php';
$group = Group::singleton();
- $user_uid = Auth::getAuth();
+ $user_uid = Horde_Auth::getAuth();
switch ($app) {
case 'gollem':
- if (Auth::isAdmin() || $group->userIsInGroup($user_uid, 1, false)) {
+ if (Horde_Auth::isAdmin() || $group->userIsInGroup($user_uid, 1, false)) {
$_GET['backend_key'] = 'kjbnzi78';
require $GLOBALS['registry']->get('fileroot', 'gollem') . '/redirect.php';
exit;
case 'imp':
- if (Auth::isAdmin()
+ if (Horde_Auth::isAdmin()
|| $group->userIsInGroup($user_uid, 1, false)
|| $group->userIsInGroup($user_uid, 2, false)) {
return;
}
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
if ($user) {
return;
}
return;
}
- $auth = &Auth::singleton('folks');
- return $auth->setAuth($_COOKIE['folks_login_user'], array('transparent' => 1, 'password' => null));
+ return Horde_Auth::setAuth($_COOKIE['folks_login_user'], array('transparent' => 1, 'password' => null));
}
}
}
}
-$activities = $folks_driver->getActivity(Auth::getAuth());
+$activities = $folks_driver->getActivity(Horde_Auth::getAuth());
if ($activities instanceof PEAR_Error) {
$notification->push($activities);
header('Location: ' . Folks::getUrlFor('list', 'list'));
if (Horde_Util::getFormData('submitbutton') == _("Delete all current comments")) {
- $result = $registry->call('forums/deleteForum', array('folks', Auth::getAuth()));
+ $result = $registry->call('forums/deleteForum', array('folks', Horde_Auth::getAuth()));
if ($result instanceof PEAR_Error) {
$notification->push($result);
} else {
- $result = $folks_driver->updateComments(Auth::getAuth(), true);
+ $result = $folks_driver->updateComments(Horde_Auth::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' => Auth::getAuth(),
- 'forum_name' => Auth::getAuth(),
+ $info = array('author' => Horde_Auth::getAuth(),
+ 'forum_name' => Horde_Auth::getAuth(),
'forum_moderated' => ($profile['user_comments'] == 'moderate'));
$result = $registry->call('forums/saveFrom', array('folks', '', $info));
if ($result instanceof PEAR_Error) {
$title = _("Edit my profile");
-$profile = $folks_driver->getRawProfile(Auth::getAuth());
+$profile = $folks_driver->getRawProfile(Horde_Auth::getAuth());
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
header('Location: ' . Folks::getUrlFor('list', 'list'));
$form->addVariable(_("Homepage"), 'user_url', 'text', false);
if ($registry->hasMethod('video/listVideos')) {
- $result = $registry->call('video/listVideos', array(array('author' => Auth::getAuth()), 0, 100));
+ $result = $registry->call('video/listVideos', array(array('author' => Horde_Auth::getAuth()), 0, 100));
if ($result instanceof PEAR_Error) {
$notification->push($result);
} else {
break;
case _("Delete picture"):
- $result = $folks_driver->deleteImage(Auth::getAuth());;
+ $result = $folks_driver->deleteImage(Horde_Auth::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"),
- Auth::getAuth(),
+ Horde_Auth::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"),
- Auth::getAuth(),
+ Horde_Auth::getAuth(),
$registry->get('name', 'horde'),
- Horde_Util::addParameter(Horde::applicationUrl('edit/friends/approve.php', true, -1), 'user', Auth::getAuth()),
- Horde_Util::addParameter(Horde::applicationUrl('edit/friends/reject.php', true, -1), 'user', Auth::getAuth()),
- Folks::getUrlFor('user', Auth::getAuth(), true, -1));
+ 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));
$result = $friends->sendNotification($user, $title, $body);
if ($result instanceof PEAR_Error) {
$notification->push($result);
require_once dirname(__FILE__) . '/../../lib/base.php';
require_once FOLKS_BASE . '/lib/Friends.php';
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
$notification->push(sprintf(_("User \"%s\" was confirmed as a friend."), $user), 'horde.success');
$title = sprintf(_("%s approved you as a friend on %s"),
- Auth::getAuth(),
+ Horde_Auth::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"),
- Auth::getAuth(),
+ Horde_Auth::getAuth(),
$registry->get('name', 'horde'),
- Folks::getUrlFor('user', Auth::getAuth(), true, -1));
+ Folks::getUrlFor('user', Horde_Auth::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(Auth::getAuth()), $registry->get('name', 'horde')));
+$v->setDefault(sprintf(_("%s Invited to join %s."), ucfirst(Horde_Auth::getAuth()), $registry->get('name', 'horde')));
$v = &$form->addVariable(_("Body"), 'body', 'longtext', true);
$body = Horde::loadConfiguration('invite.php', 'body', 'folks');
$body = $body->getMessage();
} else {
$body = sprintf($body, $registry->get('name', 'horde'),
- Folks::getUrlFor('user', Auth::getAuth(), true),
+ Folks::getUrlFor('user', Horde_Auth::getAuth(), true),
Horde::applicationUrl('account/signup.php', true),
- Auth::getAuth());
+ Horde_Auth::getAuth());
}
$v->setDefault($body);
require_once dirname(__FILE__) . '/../../lib/base.php';
require_once FOLKS_BASE . '/lib/Friends.php';
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
}
$friends = Folks_Friends::singleton(null, array('user' => $user));
-$result = $friends->removeFriend(Auth::getAuth());
+$result = $friends->removeFriend(Horde_Auth::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"),
- Auth::getAuth(),
+ Horde_Auth::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"),
- Auth::getAuth(),
+ Horde_Auth::getAuth(),
$registry->get('name', 'horde'),
- Folks::getUrlFor('user', Auth::getAuth(), true, -1));
+ Folks::getUrlFor('user', Horde_Auth::getAuth(), true, -1));
$friends->sendNotification($user, $title, $body);
require_once 'tabs.php';
// Make sure auth backend allows passwords to be updated.
-$auth = Auth::singleton($conf['auth']['driver']);
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
if (!$auth->hasCapability('resetpassword')) {
$notification->push(_("Cannot update password, contact your administrator."), 'horde.error');
- header('Location: ' . Auth::getLoginScreen('', Horde_Util::getFormData('url')));
+ header('Location: ' . Horde_Auth::getLoginScreen('', Horde_Util::getFormData('url')));
exit;
}
}
// try to chage it
- $result = $folks_driver->changePassword($info['new'], Auth::getAuth());
+ $result = $folks_driver->changePassword($info['new'], Horde_Auth::getAuth());
if ($result instanceof PEAR_Error) {
$notification->push($result);
break;
$notification->push(_("Password changed."), 'horde.success');
// reset credentials so user is not forced to relogin
- if (Auth::getCredential('password') == $info['old']) {
- Auth::setCredential('password', $info['new']);
- if (Auth::getProvider() == 'imp' || !empty($_SESSION['imp']['pass'])) {
+ if (Horde_Auth::getCredential('password') == $info['old']) {
+ Horde_Auth::setCredential('password', $info['new']);
+ if (Horde_Auth::getProvider() == 'imp' || !empty($_SESSION['imp']['pass'])) {
$_SESSION['imp']['pass'] = Horde_Secret::write(Horde_Secret::getKey('imp'),
$info['new']);
- } elseif (Auth::getProvider() == 'mimp' || !empty($_SESSION['mimp']['pass'])) {
+ } elseif (Horde_Auth::getProvider() == 'mimp' || !empty($_SESSION['mimp']['pass'])) {
$_SESSION['mimp']['pass'] = Horde_Secret::write(Horde_Secret::getKey('mimp'),
$info['new']);
}
$title = _("Privacy");
-$profile = $folks_driver->getRawProfile(Auth::getAuth());
+$profile = $folks_driver->getRawProfile(Horde_Auth::getAuth());
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
header('Location: ' . Folks::getUrlFor('list', 'list'));
* @package Folks
*/
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
require_once dirname(__FILE__) . '/lib/base.php';
require_once FOLKS_BASE . '/lib/Forms/Activity.php';
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
$firendActivities = array_slice($firendActivities, 0, 30);
// Own activities
-$activities = $folks_driver->getActivity(Auth::getAuth());
+$activities = $folks_driver->getActivity(Horde_Auth::getAuth());
if ($activities instanceof PEAR_Error) {
$notification->push($activities);
header('Location: ' . Folks::getUrlFor('list', 'list'));
<?php
/**
- * The Auth_folks class provides a sql implementation of the Horde
- * authentication system with use of folks app
+ * The Folks_Auth_Folks class provides a sql implementation of the Horde
+ * authentication system with use of folks app.
*
- * $Id: folks.php 930 2008-09-26 09:14:36Z duck $
+ * $Horde$
*
* Copyright 2008 Obala d.o.o. (http://www.obala.si/)
*
*
* @author Duck <duck@obala.net>
*/
-class Auth_folks extends Auth_application {
-
+class Folks_Auth_Folks extends Horde_Auth_Application
+{
/**
* An array of capabilities, so that the driver can report which
* operations it supports and which it doesn't.
*
* @var array
*/
- var $capabilities = array('add' => false,
- 'update' => false,
- 'resetpassword' => true,
- 'remove' => false,
- 'list' => false,
- 'transparent' => false);
+ protected $capabilities = array(
+ 'resetpassword' => true
+ );
/**
* Constructs a new Application authentication object.
*
* @param array $params A hash containing connection parameters.
*/
- function Auth_folks($params = array())
+ public function __construct($params = array())
{
- $this->_params = array('app' => 'folks');
+ $params['app'] = 'folks';
+ parent::__construct($params);
}
/**
* Returns the URI of the login screen for this authentication object.
*
- * @access private
- *
* @param string $app The application to use.
* @param string $url The URL to redirect to after login.
*
* @return string The login screen URI.
*/
- function _getLoginScreen($app = 'folks', $url = '')
+ public function getLoginScreen($app = 'folks', $url = '')
{
$webroot = $GLOBALS['registry']->get('webroot', 'folks');
if ($webroot instanceof PEAR_Error) {
/**
* Checks if $userId exists in the system.
*
- * @abstract
- *
* @param string $userId User ID for which to check
*
* @return boolean Whether or not $userId already exists.
*/
- function exists($userId)
+ public function exists($userId)
{
return $GLOBALS['registry']->callByPackage('folks',
'userExists',
*
* @param string $userId The user id for which to reset the password.
*
- * @return mixed The new password on success or a PEAR_Error object on
- * failure.
+ * @return string The new password on success.
+ * @throws Horde_Exception
*/
- function resetPassword($userId)
+ public function resetPassword($userId)
{
/* Get a new random password. */
- $password = Auth::genRandomPassword();
+ $password = Horde_Auth::genRandomPassword();
/* Process. */
$fileroot = $GLOBALS['registry']->get('fileroot', 'folks');
if ($fileroot instanceof PEAR_Error) {
- return $fileroot;
+ throw new Horde_Exception($fileroot);
}
require_once $fileroot . '/lib/base.php';
$result = $GLOBALS['folks_driver']->changePassword($password, $userId);
if ($result instanceof PEAR_Error) {
- return $result;
+ throw new Horde_Exception($result);
}
return $password;
* Automatic authentication: Finds out if the client matches an allowed IP
* block.
*
- * @return boolean Whether or not the client is allowed.
+ * @return boolean
+ * @throws Horde_Exception
*/
- function transparent()
+ protected function _transparent()
{
if (!isset($_COOKIE['folks_login_code']) ||
!isset($_COOKIE['folks_login_user'])) {
$fileroot = $GLOBALS['registry']->get('webroot', 'folks');
if ($fileroot instanceof PEAR_Error) {
- return $fileroot;
+ throw new Horde_Exception($fileroot);
}
require_once $fileroot . '/lib/base.php';
if ($this->setAuth($_COOKIE['folks_login_user'], array('transparent' => 1, 'password' => null))) {
$GLOBALS['folks_driver']->resetOnlineUsers();
return true;
- } else {
- return false;
}
+
+ return false;
}
/**
*/
function _content()
{
- if (!Auth::isAuthenticated()) {
+ if (!Horde_Auth::isAuthenticated()) {
return '';
}
. '<th>' . _("User") . '</th></tr></thead>';
$threads = $GLOBALS['registry']->call('forums/getThreadsByForumOwner',
- array(Auth::getAuth(), 'message_timestamp', 1, false,
+ array(Horde_Auth::getAuth(), 'message_timestamp', 1, false,
'folks', 0, $this->_params['limit']));
if ($threads instanceof PEAR_Error) {
return $threads->getMessage();
}
- $url = Folks::getUrlFor('user', Auth::getAuth());
+ $url = Folks::getUrlFor('user', Horde_Auth::getAuth());
foreach ($threads as $message) {
$html .= '<tr><td>'
. '<a href="' . $url . '" title="' . $message['message_date']. '">'
$this->_updateOnlineStatus();
// Update profile
- if (Auth::isAuthenticated()) {
- $this->_saveProfile(array('last_online_on' => $_SERVER['REQUEST_TIME']), Auth::getAuth());
+ if (Horde_Auth::isAuthenticated()) {
+ $this->_saveProfile(array('last_online_on' => $_SERVER['REQUEST_TIME']), Horde_Auth::getAuth());
}
}
static $profiles;
if ($user == null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
if (empty($user)) {
}
$profile = $GLOBALS['cache']->get('folksProfile' . $user, $GLOBALS['conf']['cache']['default_lifetime']);
- if ($profile || (Auth::isAdmin() && Horde_Util::getGet('debug'))) {
+ if ($profile || (Horde_Auth::isAdmin() && Horde_Util::getGet('debug'))) {
$profile = unserialize($profile);
public function changePassword($password, $user = null)
{
if ($user == null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$password = hash('md5', $password);
public function saveProfile($data, $user = null)
{
if ($user == null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$GLOBALS['cache']->expire('folksProfile' . $user);
*/
function logView($id)
{
- if (!Auth::isAuthenticated() || Auth::getAUth() == $id) {
+ if (!Horde_Auth::isAuthenticated() || Horde_Auth::getAUth() == $id) {
return false;
}
*/
public function deleteUser($user)
{
- if (!Auth::isAdmin()) {
+ if (!Horde_Auth::isAdmin()) {
return false;
}
// Delete groups
if ($GLOBALS['conf']['friends']) {
$shares = Horde_Share::singleton('folks');
- $groups = $shares->listShares(Auth::getAuth(), PERMS_SHOW, true);
+ $groups = $shares->listShares(Horde_Auth::getAuth(), 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 = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$attributes = $GLOBALS['cache']->get('folksUserAttributes' . $user, $GLOBALS['conf']['cache']['default_lifetime']);
public function saveAttributes($data, $group, $user = null)
{
if ($user == null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$GLOBALS['cache']->expire('folksAttributes' . $user);
*/
public function saveSearch($criteria, $name)
{
- $GLOBALS['cache']->expire('folksearch' . Auth::getAuth());
+ $GLOBALS['cache']->expire('folksearch' . Horde_Auth::getAuth());
return $this->_saveSearch($criteria, $name);
}
*/
public function getSavedSearch()
{
- $search = $GLOBALS['cache']->get('folksearch' . Auth::getAuth(), $GLOBALS['conf']['cache']['default_lifetime']);
+ $search = $GLOBALS['cache']->get('folksearch' . Horde_Auth::getAuth(), $GLOBALS['conf']['cache']['default_lifetime']);
if ($search) {
return unserialize($search);
}
return $search;
}
- $GLOBALS['cache']->set('folksearch' . Auth::getAuth(), serialize($search));
+ $GLOBALS['cache']->set('folksearch' . Horde_Auth::getAuth(), serialize($search));
return $search;
}
*/
public function deleteSavedSearch($name)
{
- $GLOBALS['cache']->expire('folksearch' . Auth::getAuth());
+ $GLOBALS['cache']->expire('folksearch' . Horde_Auth::getAuth());
return $this->_deleteSavedSearch($name);
}
public function logActivity($message, $scope = 'folks', $user = null)
{
if ($user == null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
if (empty($message)) {
*/
public function deleteActivity($scope, $date)
{
- $user = Auth::getAuth();
+ $user = Horde_Auth::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(Auth::getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_TIME']));
+ return $this->_write_db->query($query, array(Horde_Auth::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, Auth::getAuth(), $_SERVER['REQUEST_TIME']));
+ return $this->_write_db->query($query, array($id, Horde_Auth::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(Auth::getAuth()));
+ return $this->_db->getCol($query, 0, array(Horde_Auth::getAuth()));
}
/**
{
$query = 'INSERT INTO ' . $this->_params['search'] . ' (user_uid, search_name, search_criteria) VALUES (?, ?, ?)';
- return $this->_write_db->query($query, array(Auth::getAuth(), $name, $criteria));
+ return $this->_write_db->query($query, array(Horde_Auth::getAuth(), $name, $criteria));
}
/**
{
$query = 'SELECT search_name FROM ' . $this->_params['search'] . ' WHERE user_uid = ?';
- return $this->_db->getCol($query, 'search_name', Auth::getAuth());
+ return $this->_db->getCol($query, 'search_name', Horde_Auth::getAuth());
}
/**
{
$query = 'SELECT search_criteria FROM ' . $this->_params['search'] . ' WHERE user_uid = ? AND search_name = ?';
- return $this->_db->getOne($query, array(Auth::getAuth(), $name));
+ return $this->_db->getOne($query, array(Horde_Auth::getAuth(), $name));
}
/**
{
$query = 'DELETE FROM ' . $this->_params['search'] . ' WHERE user_uid = ? AND search_name = ?';
- return $this->_write_db->query($query, array(Auth::getAuth(), $name));
+ return $this->_write_db->query($query, array(Horde_Auth::getAuth(), $name));
}
/**
static public function getUserEmail($user)
{
// We should always realy on registration data
- // $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'horde', Auth::addHook($user), '', null, false);
+ // $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'horde', Horde_Auth::addHook($user), '', null, false);
// $prefs->retrieve();
// $email = $prefs->getValue('alternate_email') ? $prefs->getValue('alternate_email') : $prefs->getValue('from_addr');
// If there is no email set use the registration one
if (empty($email)) {
- if (Auth::isAuthenticated()) {
+ if (Horde_Auth::isAuthenticated()) {
$profile = $GLOBALS['folks_driver']->getProfile($user);
} else {
$profile = $GLOBALS['folks_driver']->getRawProfile($user);
{
$img = $GLOBALS['registry']->getImageDir('horde');
$menu = new Horde_Menu(Horde_Menu::MASK_ALL);
- $menu->add(self::getUrlFor('user', Auth::getAuth()), _("My profile"), 'myaccount.png', $img);
+ $menu->add(self::getUrlFor('user', Horde_Auth::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'] = Auth::getAuth();
+ $params['user'] = Horde_Auth::getAuth();
}
$signature = $driver . ':' . $params['user'];
*/
protected function __construct($params)
{
- $this->_user = empty($params['user']) ? Auth::getAuth() : $params['user'];
+ $this->_user = empty($params['user']) ? Horde_Auth::getAuth() : $params['user'];
$this->_cache = Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
return (boolean)$GLOBALS['prefs']->getValue('friends_approval');
}
- $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'folks', Auth::addHook($user), '', null, false);
+ $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'folks', Horde_Auth::addHook($user), '', null, false);
$prefs->retrieve();
return (boolean)$prefs->getValue('friends_approval');
}
// Check if users exits
- $auth = Auth::singleton($GLOBALS['conf']['auth']['driver']);
+ $auth = Horde_Auth::singleton($GLOBALS['conf']['auth']['driver']);
if (!$auth->exists($user)) {
return PEAR::raiseError(sprintf(_("User \"%s\" does not exits"), $user));
}
}
// Check if users exits
- $auth = Auth::singleton($GLOBALS['conf']['auth']['driver']);
+ $auth = Horde_Auth::singleton($GLOBALS['conf']['auth']['driver']);
if (!$auth->exists($friend)) {
return PEAR::raiseError(sprintf(_("User \"%s\" does not exits"), $friend));
}
private function _lists($type, $user = null)
{
if (empty($user)) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$u_prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], $GLOBALS['registry']->getApp(), $user);
}
// Only owners of a group can delete them
- if (Auth::getAuth() != $share->get('owner') &&
- !Auth::isAdmin('folks:admin')) {
+ if (Horde_Auth::getAuth() != $share->get('owner') &&
+ !Horde_Auth::isAdmin('folks:admin')) {
return PEAR::raiseError("You can rename only your own groups.");
}
}
// Only owners of a group can delete them
- if (Auth::getAuth() != $share->get('owner') &&
- !Auth::isAdmin('folks:admin')) {
+ if (Horde_Auth::getAuth() != $share->get('owner') &&
+ !Horde_Auth::isAdmin('folks:admin')) {
return PEAR::raiseError("You can delete only your own groups.");
}
$result = false;
if (empty($user)) {
- if (Auth::isAuthenticated()) {
- $user = Auth::getAuth();
+ if (Horde_Auth::isAuthenticated()) {
+ $user = Horde_Auth::getAuth();
} else {
return true;
}
$result = false;
if (empty($user)) {
- if (Auth::isAuthenticated()) {
- $user = Auth::getAuth();
+ if (Horde_Auth::isAuthenticated()) {
+ $user = Horde_Auth::getAuth();
} else {
return true;
}
'type' => 'string'
);
-if (Auth::isAdmin()) {
+if (Horde_Auth::isAdmin()) {
$_services['userList'] = array(
'type' => '{urn:horde}stringArray'
);
$friends = Folks_Friends::singleton('sql', array('user' => $user));
- return $friends->isBlacklisted(Auth::getAuth());
+ return $friends->isBlacklisted(Horde_Auth::getAuth());
}
/**
function _folks_logActivity($message, $scope = 'folks', $user = null)
{
if (empty($user)) {
- $user = Auth::getAuth();
- } elseif ($user !== Auth::getAuth() && !Auth::isAdmin('admin:' . $scope)) {
+ $user = Horde_Auth::getAuth();
+ } elseif ($user !== Horde_Auth::getAuth() && !Horde_Auth::isAdmin('admin:' . $scope)) {
return PEAR::raiseError(_("You cannot log activities for other users."));
}
require_once dirname(__FILE__) . '/base.php';
if ($user == null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
if ($online) {
require_once dirname(__FILE__) . '/base.php';
if ($user == null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
return $GLOBALS['folks_driver']->isOnline($user);
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(Auth::getAuth());
+ $folks_driver->deleteOnlineUser(Horde_Auth::getAuth());
@session_destroy();
if (!empty($_GET['redirect'])) {
* Special login for apps (gollem, imp)?
*/
if ($conf['login']['prelogin'] &&
- Auth::getAuth() &&
+ Horde_Auth::getAuth() &&
($app = Horde_Util::getGet('app'))) {
Horde::callHook('_folks_hook_prelogin', array($app), 'folks');
}
* Login parameters
*/
$url_param = Horde_Util::getFormData('url');
-$login_url = Auth::getLoginScreen('folks', $url_param);
+$login_url = Horde_Auth::getLoginScreen('folks', $url_param);
/*
* We are already logged in?
*/
-if (Auth::isAuthenticated()) {
+if (Horde_Auth::isAuthenticated()) {
if (empty($url_param)) {
- $url_param = Folks::getUrlFor('user', Auth::getAuth());
+ $url_param = Folks::getUrlFor('user', Horde_Auth::getAuth());
}
header('Location: ' . $url_param);
exit;
$_COOKIE['folks_login_code'] == $folks_driver->getCookie($_COOKIE['folks_login_user'])) {
// Horde Auto login
- $auth = Auth::singleton('auto', array('username' => $_COOKIE['folks_login_user']));
- $auth->setAuth($_COOKIE['folks_login_user'], array('transparent' => 1));
+ Horde_Auth::setAuth($_COOKIE['folks_login_user'], array('transparent' => 1));
if (empty($url_param)) {
$url_param = Folks::getUrlFor('user', $_COOKIE['folks_login_user']);
}
// Horde Auto login
- $auth = &Auth::singleton('auto', array('username' => $username));
- $auth->setAuth($username, array('transparent' => 1, 'password' => $info['password']));
+ Horde_Auth::setAuth($username, array('transparent' => 1, 'password' => $info['password']));
// Save user last login info.
// We ignore last_login pref as it can be turned off by user
$shares = &Horde_Share::singleton('folks');
$groups = &Group::singleton();
-$auth = &Auth::singleton($conf['auth']['driver']);
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
$reload = false;
$actionID = Horde_Util::getFormData('actionID', 'edit');
}
if (is_a($share, 'PEAR_Error')) {
$notification->push($share, 'horde.error');
- } elseif (isset($share) && Auth::getAuth() != $share->get('owner')) {
+ } elseif (isset($share) && Horde_Auth::getAuth() != $share->get('owner')) {
exit('permission denied');
}
break;
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent share."), 'horde.error');
} else {
- if (Auth::getAuth() != $share->get('owner')) {
+ if (Horde_Auth::getAuth() != $share->get('owner')) {
exit('permission denied');
}
$perm = &$share->getPermission();
// Process owner and owner permissions.
$old_owner = $share->get('owner');
- $new_owner = Auth::addHook(Horde_Util::getFormData('owner', $old_owner));
+ $new_owner = Horde_Auth::addHook(Horde_Util::getFormData('owner', $old_owner));
if ($old_owner !== $new_owner && !empty($new_owner)) {
- if ($old_owner != Auth::getAuth() && !Auth::isAdmin()) {
+ if ($old_owner != Horde_Auth::getAuth() && !Horde_Auth::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);
foreach ($u_names as $key => $user) {
// Apply backend hooks
- $user = Auth::addHook($user);
+ $user = Horde_Auth::addHook($user);
// If the user is empty, or we've already set permissions
// via the owner_ options, don't do anything here.
if (empty($user) || $user == $new_owner) {
if (!empty($conf['share']['any_group'])) {
$groupList = $groups->listGroups();
} else {
- $groupList = $groups->getGroupMemberships(Auth::getAuth(), true);
+ $groupList = $groups->getGroupMemberships(Horde_Auth::getAuth(), true);
}
if (is_a($groupList, 'PEAR_Error')) {
Horde::logMessage($groupList, __FILE__, __LINE__, PEAR_LOG_NOTICE);
require_once dirname(__FILE__) . '/lib/base.php';
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
define('AUTH_HANDLER', true);
require_once dirname(__FILE__) . '/../lib/base.php';
-$auth = Auth::singleton($conf['auth']['driver']);
-if (!Auth::getAuth() &&
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
+if (!Horde_Auth::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"');
define('AUTH_HANDLER', true);
require_once dirname(__FILE__) . '/../lib/base.php';
-$auth = Auth::singleton($conf['auth']['driver']);
-if (!Auth::getAuth() &&
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
+if (!Horde_Auth::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"');
define('AUTH_HANDLER', true);
require_once dirname(__FILE__) . '/../lib/base.php';
-$auth = Auth::singleton($conf['auth']['driver']);
-if (!Auth::getAuth() &&
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
+if (!Horde_Auth::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 == Auth::getAuth() ||
+ if ($friend_friend == Horde_Auth::getAuth() ||
in_array($friend_friend, $my_list)) {
continue;
} elseif (isset($users[$friend_friend])) {
$body = _("Dear %s, we tried to send you an email, but if turns out that the mail is usable any more. Maybe you run over quota. If your mail is discontinued, please update your profile with the email you are using now at %s.");
// Horde Auto login to send messages with
-$auth = Auth::singleton('auto', array('username' => $opts_hash['--username']));
-$auth->setAuth($opts_hash['--username'], array('transparent' => 1));
+Horde_Auth::setAuth($opts_hash['--username'], array('transparent' => 1));
// Send messages
foreach ($users as $user) {
// Login to horde if username & password are set.
if (!empty($username) && !empty($password)) {
- $auth = Auth::singleton($conf['auth']['driver']);
+ $auth = Horde_Auth::singleton($conf['auth']['driver']);
if (!$auth->authenticate($username, array('password' => $password))) {
$error = _("Login is incorrect.");
Horde::logMessage($error, __FILE__, __LINE__, PEAR_LOG_ERR);
}
// Only admins can run this operation
-if (!Auth::isAdmin('folks:admin')) {
+if (!Horde_Auth::isAdmin('folks:admin')) {
$cli->fatal('ADMIN ONLY');
}
if (!isset($_COOKIE['online'])) {
// Add this to your tempalte file
- $sql = 'REPLACE INTO folks_online SET user_uid="' . Auth::getAuth() . '", ip_address="' . $_SERVER["REMOTE_ADDR"] . '", time_last_click="' . $_SERVER['REQUEST_TIME'] . '"';
+ $sql = 'REPLACE INTO folks_online SET user_uid="' . Horde_Auth::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 = "' . Auth::getAuth() . '"';
+ // $sql = 'UPDATE folks_users SET last_online_on = "' . $_SERVER['REQUEST_TIME'] .'" WHERE user_uid = "' . Horde_Auth::getAuth() . '"';
// mysql_unbuffered_query($sql)
// If not using cront with online.sql
$users = array();
}
-if (Auth::isAuthenticated()) {
+if (Horde_Auth::isAuthenticated()) {
$queries = $folks_driver->getSavedSearch();
if ($queries instanceof PEAR_Error) {
$notification->push($queries);
echo '<br />';
$form->renderActive(null, null, null, 'post');
-if (Auth::isAuthenticated()) {
+if (Horde_Auth::isAuthenticated()) {
require FOLKS_TEMPLATES . '/list/search.php';
}
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'online') ?>" title="<?php echo _("Online users") ?>" />
-<?php if (Auth::isAuthenticated()): ?>
+<?php if (Horde_Auth::isAuthenticated()): ?>
<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'friends') ?>" title="<?php echo _("Online friends") ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'activity') ?>" title="<?php echo _("Friends activity") ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'know') ?>" title="<?php echo _("People you might know") ?>" />
<?php
echo '<li><img src="' . $registry->getImageDir('horde') . '/alerts/success.png">'
. _("Click here to login.")
- . ' <a href="' . Auth::getLoginScreen('letter', Horde_Util::addParameter(Horde::applicationUrl('user.php'), 'user', $user)) . '">' . _("Click here to login.") . '</a>'
+ . ' <a href="' . Horde_Auth::getLoginScreen('letter', Horde_Util::addParameter(Horde::applicationUrl('user.php'), 'user', $user)) . '">' . _("Click here to login.") . '</a>'
. '</li>';
?>
</ul>
<h1><?php echo $title ?></h1>
<?php
-if ($user == Auth::getAuth()) {
+if ($user == Horde_Auth::getAuth()) {
echo $form->renderActive(null, null, '', 'post') . '<br />';
}
?>
echo '<span class="offline">' . _("Offline") . '</span>';
if ($profile['last_online_on'] &&
($profile['last_online'] == 'all' ||
- Auth::isAuthenticated() && (
+ Horde_Auth::isAuthenticated() && (
$profile['last_online'] == 'authenticated' ||
- $profile['last_online'] == 'friends' && $friends_driver->isFriend(Auth::getAuth())))
+ $profile['last_online'] == 'friends' && $friends_driver->isFriend(Horde_Auth::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 Auth::getAuth() ?>" title="<?php echo _("Add your content") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/plus.png" /></a>
+<a href="<?php echo $path ?>/wishlist.php?wishlist=<?php echo Horde_Auth::getAuth() ?>" title="<?php echo _("Add your content") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/plus.png" /></a>
<a href="<?php echo $path ?>" title="<?php echo _("Preview") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/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 Auth::getAuth() ?>" title="<?php echo _("Add your content") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/plus.png" /></a>
+<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 $registry->getImageDir('horde') ?>/plus.png" /></a>
<a href="<?php echo $path ?>" title="<?php echo _("Preview") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/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> |
break;
case 'authenticated':
- $allow_comments = Auth::isAuthenticated();
+ $allow_comments = Horde_Auth::isAuthenticated();
if ($allow_comments) {
- if ($friends_driver->isBlacklisted(Auth::getAuth())) {
+ if ($friends_driver->isBlacklisted(Horde_Auth::getAuth())) {
$allow_comments = false;
$comments_reason = sprintf(_("You are on %s blacklist."), $user);
}
break;
case 'friends':
- $allow_comments = $friends_driver->isFriend(Auth::getAuth());
+ $allow_comments = $friends_driver->isFriend(Horde_Auth::getAuth());
$comments_reason = _("Only authenticated users can post comments.");
break;
default:
$allow_comments = true;
- if (Auth::isAuthenticated() && $friends_driver->isBlacklisted(Auth::getAuth())) {
+ if (Horde_Auth::isAuthenticated() && $friends_driver->isBlacklisted(Horde_Auth::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', Auth::getAuth());
+$user = Horde_Util::getFormData('user', Horde_Auth::getAuth());
$profile = $folks_driver->getProfile($user);
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
// Get user activity
if ($profile['activity_log'] == 'all' ||
- Auth::isAuthenticated() && (
+ Horde_Auth::isAuthenticated() && (
$profile['activity_log'] == 'authenticated' ||
$profile['activity_log'] == 'friends' && $friends_driver->isFriend($user))
) {
}
// Prepare an process activity form
-if ($user == Auth::getAuth()) {
+if ($user == Horde_Auth::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');
break;
case 'public_authenticated':
- if (Auth::isAuthenticated()) {
+ if (Horde_Auth::isAuthenticated()) {
require FOLKS_TEMPLATES . '/user/user.php';
} else {
require FOLKS_TEMPLATES . '/user/authenticated.php';
@define('HORDE_BASE', dirname(__FILE__) . '/../../');
require_once HORDE_BASE . '/lib/base.php';
-if (!Auth::isAdmin()) {
+if (!Horde_Auth::isAdmin()) {
die('Permission denied');
}
@define('HORDE_BASE', dirname(__FILE__) . '/../../');
require_once HORDE_BASE . '/lib/base.php';
-if (!Auth::isAdmin()) {
+if (!Horde_Auth::isAdmin()) {
die('Permission denied');
}
// // Where does SpamAssassin live, and what username should we use
// // for preferences?
// $cmd = '/usr/local/bin/spamc';
-// $username = Auth::getAuth();
+// $username = Horde_Auth::getAuth();
//
// // If you use the _sam_hook_username() hook, uncomment the next line
// //$username = _sam_hook_username($username);
// function _imp_hook_spam_email($action)
// {
// $prefix = ($action == 'spam') ? 'spam-' : 'fp-';
-// return $prefix . Auth::getBareAuth() . '@example.com';
+// return $prefix . Horde_Auth::getBareAuth() . '@example.com';
// }
// }
{
$host = $_SESSION['imp']['server'];
$user = $_SESSION['imp']['user'];
- $pass = Auth::getCredential('password');
+ $pass = Horde_Auth::getCredential('password');
$command = $params[0];
$session = ssh2_connect($host);
--- /dev/null
+<?php
+/**
+ * The Horde_Auth_Imp:: class provides an IMP implementation of the Horde
+ * authentication system.
+ *
+ * Required parameters: NONE
+ * Optional parameters: NONE
+ *
+ * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Michael Slusarz <slusarz@horde.org>
+ * @package Horde_Auth
+ */
+class IMP_Auth_Imp extends Horde_Auth_Driver
+{
+ /**
+ * Find out if a set of login credentials are valid, and if
+ * requested, mark the user as logged in in the current session.
+ *
+ * @param string $userID The userID to check.
+ * @param array $credentials The credentials to check.
+ * @param boolean $login Whether to log the user in. If false, we'll
+ * only test the credentials and won't modify
+ * the current session.
+ *
+ * @return boolean Whether or not the credentials are valid.
+ */
+ public function authenticate($userID = null, $credentials = array(),
+ $login = false)
+ {
+ return parent::authenticate($userID, $credentials, $login && (Horde_Auth::getProvider() == 'imp'));
+ }
+
+ /**
+ * Find out if a set of login credentials are valid.
+ *
+ * @param string $userID The userID to check.
+ * @param array $credentials An array of login credentials.
+ *
+ * @throws Horde_Exception
+ */
+ protected function _authenticate($userID, $credentials)
+ {
+ // Check for valid IMAP Client object.
+ if (!$GLOBALS['imp_imap']->ob) {
+ // Attempt to create IMAP Client object
+ $key = isset($credentials['server']) ? $credentials['server'] : IMP_Session::getAutoLoginServer();
+ if (is_null($key) ||
+ !isset($credentials['password']) ||
+ !$GLOBALS['imp_imap']->createImapObject($userID, $credentials['password'], $key)) {
+ IMP::loginLogMessage('failed', __FILE__, __LINE__);
+ throw new Horde_Exception('', Horde_Auth::REASON_FAILED);
+ }
+ }
+
+ try {
+ $GLOBALS['imp_imap']->ob->login();
+ } catch (Horde_Imap_Client_Exception $e) {
+ IMP::loginLogMessage($e->getMessage(), __FILE__, __LINE__);
+ if ($e->getCode() == Horde_Imap_Client_Exception::SERVER_CONNECT) {
+ throw new Horde_Exception(_("Could not connect to the remote server."));
+ }
+
+ throw new Horde_Exception('', Horde_Auth::REASON_BADLOGIN);
+ }
+ }
+}
+++ /dev/null
-<?php
-/**
- * The Auth_imp:: class provides an IMP implementation of the Horde
- * authentication system.
- *
- * Required parameters: NONE
- * Optional parameters: NONE
- *
- * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author Michael Slusarz <slusarz@horde.org>
- * @package Horde_Auth
- */
-class Auth_imp extends Auth
-{
- /**
- * Find out if a set of login credentials are valid, and if
- * requested, mark the user as logged in in the current session.
- *
- * @param string $userID The userID to check.
- * @param array $credentials The credentials to check.
- * @param boolean $login Whether to log the user in. If false, we'll
- * only test the credentials and won't modify
- * the current session.
- *
- * @return boolean Whether or not the credentials are valid.
- */
- function authenticate($userID = null, $credentials = array(),
- $login = false)
- {
- return parent::authenticate($userID, $credentials, $login && ($this->getProvider() == 'imp'));
- }
-
- /**
- * Find out if a set of login credentials are valid.
- *
- * @param string $userID The userID to check.
- * @param array $credentials An array of login credentials.
- *
- * @return boolean Whether or not the credentials are valid.
- */
- function _authenticate($userID, $credentials)
- {
- // Check for valid IMAP Client object.
- if (!$GLOBALS['imp_imap']->ob) {
- // Attempt to create IMAP Client object
- $key = isset($credentials['server']) ? $credentials['server'] : IMP_Session::getAutoLoginServer();
- if (is_null($key) ||
- !isset($credentials['password']) ||
- !$GLOBALS['imp_imap']->createImapObject($userID, $credentials['password'], $key)) {
- IMP::loginLogMessage('failed', __FILE__, __LINE__);
- $this->_setAuthError(AUTH_REASON_FAILED);
- return false;
- }
- }
-
- try {
- $GLOBALS['imp_imap']->ob->login();
- return true;
- } catch (Horde_Imap_Client_Exception $e) {
- IMP::loginLogMessage($e->getMessage(), __FILE__, __LINE__);
- if ($e->getCode() == Horde_Imap_Client_Exception::SERVER_CONNECT) {
- $this->_setAuthError(AUTH_REASON_MESSAGE, _("Could not connect to the remote server."));
- } else {
- $this->_setAuthError(AUTH_REASON_BADLOGIN);
- }
- return false;
- }
- }
-}
if (($this->_linkAttach &&
$GLOBALS['conf']['compose']['link_attachments']) ||
!empty($GLOBALS['conf']['compose']['link_all_attachments'])) {
- $base = $this->linkAttachments(Horde::applicationUrl('attachment.php', true), $textpart, Auth::getAuth());
+ $base = $this->linkAttachments(Horde::applicationUrl('attachment.php', true), $textpart, Horde_Auth::getAuth());
if ($this->_pgpAttachPubkey || $this->_attachVCard) {
$new_body = new Horde_Mime_Part();
protected function __construct()
{
if (!empty($GLOBALS['conf']['server']['cache_folders'])) {
- $this->_cacheid = 'imp_folder_cache|' . Auth::getAuth();
+ $this->_cacheid = 'imp_folder_cache|' . Horde_Auth::getAuth();
}
}
$hordeauth = false)
{
if ($hordeauth) {
- $reason = Auth::isAuthenticated();
+ $reason = Horde_Auth::isAuthenticated();
} else {
- $auth_imp = Auth::singleton(array('imp', 'imp'));
+ $auth_imp = Horde_Auth::singleton(array('imp', 'imp'));
$reason = $auth_imp->authenticate(null, array(), false);
}
* then we only show the logout link if the sidebar isn't shown or if
* the configuration says to always show the current user a logout
* link. */
- $impAuth = ((Auth::getProvider() == 'imp') || $_SESSION['imp']['autologin']);
+ $impAuth = ((Horde_Auth::getProvider() == 'imp') || $_SESSION['imp']['autologin']);
if (!$impAuth ||
!$prefs->getValue('show_sidebar') ||
Horde::showService('logout')) {
));
if ($force ||
- !((Auth::getProvider() != 'imp') || !$_SESSION['imp']['autologin'])) {
+ !((Horde_Auth::getProvider() != 'imp') || !$_SESSION['imp']['autologin'])) {
$url = $GLOBALS['registry']->get('webroot', 'imp') . '/login.php';
} else {
$url = Horde::getServiceLink('logout', 'horde', true);
}
$url = (!is_null($reason) && is_array($reason))
- ? Auth::addLogoutParameters($url, $reason[0], $reason[1])
- : Auth::addLogoutParameters($url, $reason);
+ ? Horde_Auth::addLogoutParameters($url, $reason[0], $reason[1])
+ : Horde_Auth::addLogoutParameters($url, $reason);
if (!empty($params)) {
$url = Horde_Util::addParameter($url, $params, null, false);
$key = &self::$_authkey;
if (is_null($key)) {
- $key = Horde_Secret::getKey(Auth::getProvider() == 'imp' ? 'auth' : 'imp');
+ $key = Horde_Secret::getKey(Horde_Auth::getProvider() == 'imp' ? 'auth' : 'imp');
}
return $key;
}
if (!isset($_SESSION['imp']['cache']['tree'])) {
$imp_cache = IMP::getCache();
$_SESSION['imp']['cache']['tree'] = $imp_cache
- ? uniqid(mt_rand() . Auth::getAuth())
+ ? uniqid(mt_rand() . Horde_Auth::getAuth())
: null;
}
$del_time = gmmktime(0, 0, 0, date('n') - $GLOBALS['prefs']->getValue('delete_attachments_monthly_keep'), 1, date('Y'));
$vfs = VFS::singleton($GLOBALS['conf']['vfs']['type'], Horde::getDriverConfig('vfs', $GLOBALS['conf']['vfs']['type']));
- $path = IMP_Compose::VFS_LINK_ATTACH_PATH . '/' . Auth::getAuth();
+ $path = IMP_Compose::VFS_LINK_ATTACH_PATH . '/' . Horde_Auth::getAuth();
/* Make sure cleaning is done recursively. */
$files = $vfs->listFolder($path, null, true, false, true);
// if ($options_link = Horde::getServiceLink('options', 'mimp')) {
// $items[Horde_Util::addParameter($options_link, 'mobile', 1, false)] = _("Options");
// }
- $logout_link = IMP::getLogoutUrl(AUTH_REASON_LOGOUT);
+ $logout_link = IMP::getLogoutUrl(Horde_Auth::REASON_LOGOUT);
if (!empty($logout_link)) {
$items[$logout_link] = _("Log out");
}
return '';
}
- return implode('.', array('imp', str_replace('.', '*', Auth::getAuth()), $msgid));
+ return implode('.', array('imp', str_replace('.', '*', Horde_Auth::getAuth()), $msgid));
}
}
/* For dimp, don't capture notification messages if we are logging
* out or accessing the options pages. */
if (($this->_viewmode == 'dimp') &&
- Auth::getAuth() && !strstr($_SERVER['PHP_SELF'], '/prefs.php')) {
+ Horde_Auth::getAuth() && !strstr($_SERVER['PHP_SELF'], '/prefs.php')) {
$options['store'] = true;
}
parent::notify($messageStack, $options);
$query = sprintf('INSERT INTO %s (sentmail_id, sentmail_who, sentmail_ts, sentmail_messageid, sentmail_action, sentmail_recipient, sentmail_success) VALUES (?, ?, ?, ?, ?, ?, ?)',
$this->_params['table']);
$values = array($this->_db->nextId($this->_params['table']),
- Auth::getAuth(),
+ Horde_Auth::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(Auth::getAuth()),
+ $this->_db->quote(Horde_Auth::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(Auth::getAuth()));
+ $query .= sprintf(' AND sentmail_who = %s', $this->_db->quote(Horde_Auth::getAuth()));
}
/* Log the query at a DEBUG log level. */
}
/* Determine the unique user name. */
- if (Auth::isAuthenticated()) {
- $sess['uniquser'] = Auth::removeHook(Auth::getAuth());
+ if (Horde_Auth::isAuthenticated()) {
+ $sess['uniquser'] = Horde_Auth::removeHook(Horde_Auth::getAuth());
} else {
$sess['uniquser'] = $imapuser;
if (!empty($ptr['realm'])) {
return false;
}
- /* Do necessary authentication now (since Auth:: may need to set
+ /* Do necessary authentication now (since Horde_Auth:: may need to set
* values in Horde-land). */
- $auth_imp = &Auth::singleton(array('imp', 'imp'));
+ $auth_imp = Horde_Auth::singleton(array('imp', 'imp'));
if ($auth_imp->authenticate($sess['uniquser'], array('password' => $password), true) !== true) {
unset($_SESSION['imp']);
return false;
}
if ((!empty($auto_server) || $force) &&
- Auth::getAuth() &&
+ Horde_Auth::getAuth() &&
!empty($servers[$server_key]['hordeauth'])) {
return (strcasecmp($servers[$server_key]['hordeauth'], 'full') == 0)
- ? Auth::getAuth()
- : Auth::getBareAuth();
+ ? Horde_Auth::getAuth()
+ : Horde_Auth::getBareAuth();
}
return false;
* be secure. */
$prog = str_replace(array('%u','%l', '%d'),
array(
- escapeshellarg(Auth::getAuth()),
- escapeshellarg(Auth::getBareAuth()),
- escapeshellarg(Auth::getAuthDomain())
+ escapeshellarg(Horde_Auth::getAuth()),
+ escapeshellarg(Horde_Auth::getBareAuth()),
+ escapeshellarg(Horde_Auth::getAuthDomain())
), $GLOBALS['conf'][$action]['program']);
$proc = proc_open($prog,
array(
// If IMP isn't responsible for Horde auth, and no one is logged into
// Horde, redirect to the login screen. If this is a compose window
// that just timed out, store the draft.
-if (!(Auth::isAuthenticated() || (Auth::getProvider() == 'imp'))) {
+if (!(Horde_Auth::isAuthenticated() || (Horde_Auth::getProvider() == 'imp'))) {
if ($compose_page) {
$imp_compose = IMP_Compose::singleton();
$imp_compose->sessionExpireDraft();
}
/* Get an Auth object. */
-$imp_auth = (Auth::getProvider() == 'imp');
-$auth = &Auth::singleton($conf['auth']['driver']);
-$logout_reason = $auth->getLogoutReason();
+$imp_auth = (Horde_Auth::getProvider() == 'imp');
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
+$logout_reason = Horde_Auth::getLogoutReason();
$actionID = (Horde_Util::getFormData('action') == 'compose') ? 'login_compose' : Horde_Util::getFormData('actionID');
$url_param = Horde_Util::getFormData('url');
if (!empty($_SESSION['imp']) && is_array($_SESSION['imp'])) {
if ($logout_reason) {
/* Log logout requests now. */
- if ($logout_reason == AUTH_REASON_LOGOUT) {
+ if ($logout_reason == Horde_Auth::REASON_LOGOUT) {
IMP::loginLogMessage('logout', __FILE__, __LINE__, PEAR_LOG_NOTICE);
} else {
- Horde::logMessage($_SERVER['REMOTE_ADDR'] . ' ' . $auth->getLogoutReasonString(), __FILE__, __LINE__, PEAR_LOG_NOTICE);
+ Horde::logMessage($_SERVER['REMOTE_ADDR'] . ' ' . Horde_Auth::getLogoutReasonString(), __FILE__, __LINE__, PEAR_LOG_NOTICE);
}
$language = (isset($prefs)) ? $prefs->getValue('language') : NLS::select();
}
if ($imp_auth) {
- Auth::clearAuth();
+ Horde_Auth::clearAuth();
@session_destroy();
Horde::setupSessionHandler();
@session_start();
}
/* Log session timeouts. */
-if ($logout_reason == AUTH_REASON_SESSION) {
+if ($logout_reason == Horde_Auth::REASON_SESSION) {
$entry = sprintf('Session timeout for client [%s]', $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_NOTICE);
/* Make sure everything is really cleared. */
- Auth::clearAuth();
+ Horde_Auth::clearAuth();
unset($_SESSION['imp']);
}
/* Redirect the user on logout if redirection is enabled. */
-if ($logout_reason == AUTH_REASON_LOGOUT &&
+if ($logout_reason == Horde_Auth::REASON_LOGOUT &&
($conf['user']['redirect_on_logout'] ||
!empty($conf['auth']['redirect_on_logout']))) {
if (!empty($conf['auth']['redirect_on_logout'])) {
- $url = Auth::addLogoutParameters($conf['auth']['redirect_on_logout'], AUTH_REASON_LOGOUT);
+ $url = Horde_Auth::addLogoutParameters($conf['auth']['redirect_on_logout'], Horde_Auth::REASON_LOGOUT);
} else {
- $url = Auth::addLogoutParameters($conf['user']['redirect_on_logout'], AUTH_REASON_LOGOUT);
+ $url = Horde_Auth::addLogoutParameters($conf['user']['redirect_on_logout'], Horde_Auth::REASON_LOGOUT);
}
if (!isset($_COOKIE[session_name()])) {
$url = Horde_Util::addParameter($url, session_name(), session_id());
/* Redirect the user if an alternate login page has been specified. */
if (!empty($conf['auth']['alternate_login'])) {
- $url = Auth::addLogoutParameters($conf['auth']['alternate_login']);
+ $url = Horde_Auth::addLogoutParameters($conf['auth']['alternate_login']);
if (!isset($_COOKIE[session_name()])) {
$url = Horde_Util::addParameter($url, session_name(), session_id(), false);
}
header('Location: ' . $url);
exit;
} elseif ($conf['user']['alternate_login']) {
- $url = Auth::addLogoutParameters($conf['user']['alternate_login']);
+ $url = Horde_Auth::addLogoutParameters($conf['user']['alternate_login']);
if (!isset($_COOKIE[session_name()])) {
$url = Horde_Util::addParameter($url, session_name(), session_id(), false);
}
exit;
}
-$reason = $auth->getLogoutReasonString();
$title = sprintf(_("Welcome to %s"), $registry->get('name', ($imp_auth) ? 'horde' : null));
-if ($reason) {
- $notification->push(str_replace('<br />', ' ', $reason), 'horde.message');
+if ($logout_reason) {
+ $notification->push(str_replace('<br />', ' ', $logout_reason), 'horde.message');
}
/* Build the <select> widget for the servers and hordeauth servers lists. */
$show_list = ($conf['server']['server_list'] == 'shown');
if ($show_list) {
$hordeauth_servers_list = $servers_list = array();
- $isAuth = Auth::isAuthenticated();
+ $isAuth = Horde_Auth::isAuthenticated();
foreach ($servers as $key => $val) {
$entry = array(
'sel' => ($server_key == $key) || IMP_Session::isPreferredServer($val, $key),
$t->set('server_key', (!$display_list) ? htmlspecialchars($server_key) : null);
/* Do we need to do IE version detection? */
-$t->set('ie_clientcaps', (!Auth::getAuth() && ($browser->getBrowser() == 'msie') && ($browser->getMajor() >= 5)));
+$t->set('ie_clientcaps', (!Horde_Auth::getAuth() && ($browser->getBrowser() == 'msie') && ($browser->getMajor() >= 5)));
$extra_hidden = array();
foreach (IMP::getComposeArgs() as $arg => $value) {
}
if (IMP::$printMode && !empty($conf['print']['add_printedby'])) {
- $hdrs[] = array('name' => _("Printed By"), 'val' => $user_identity->getFullname() ? $user_identity->getFullname() : Auth::getAuth(), 'i' => (++$i % 2));
+ $hdrs[] = array('name' => _("Printed By"), 'val' => $user_identity->getFullname() ? $user_identity->getFullname() : Horde_Auth::getAuth(), 'i' => (++$i % 2));
}
$m_template->set('headers', $hdrs);
if ($GLOBALS['url_in']) {
$url = Horde::url(Horde_Util::removeParameter($GLOBALS['url_in'], session_name()), true);
- } elseif (Auth::getProvider() == 'imp') {
+ } elseif (Horde_Auth::getProvider() == 'imp') {
$url = Horde::applicationUrl($GLOBALS['registry']->get('webroot', 'horde') . '/', true);
/* Force the initial page to IMP if we're logging in to compose a
$pass = Horde_Util::getPost('pass');
if (!empty($autologin)) {
$imapuser = IMP_Session::canAutoLogin();
- $pass = Auth::getCredential('password');
+ $pass = Horde_Auth::getCredential('password');
}
$isLogin = empty($_SESSION['imp']['logintasks']);
(!is_null($pass) && ($pass != $GLOBALS['imp_imap']->ob->getParam('password')))) {
/* Disable the old session. */
unset($_SESSION['imp']);
- _redirect(IMP::getLogoutUrl(AUTH_REASON_FAILED, true));
+ _redirect(IMP::getLogoutUrl(Horde_Auth::REASON_FAILED, true));
}
$url = $url_in;
/* Create a new session if we're given the proper parameters. */
if (!is_null($imapuser) && !is_null($pass)) {
- if (Auth::getProvider() == 'imp') {
+ if (Horde_Auth::getProvider() == 'imp') {
/* Destroy any existing session on login and make sure to use a new
* session ID, to avoid session fixation issues. */
Horde::getCleanSession();
@define('AUTH_HANDLER', true);
require_once dirname(__FILE__) . '/lib/base.php';
-$auth = &Auth::singleton($conf['auth']['driver']);
-if ((!Auth::getAuth() || !IMP::checkAuthentication(true)) &&
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
+if ((!Horde_Auth::getAuth() || !IMP::checkAuthentication(true)) &&
(!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="IMP RSS Interface"');
require_once '/lib/base.php';
/* Set up the password encryption token. */
-Horde_Secret::setKey(Auth::getProvider() == 'imp' ? 'auth' : 'imp');
+Horde_Secret::setKey(Horde_Auth::getProvider() == 'imp' ? 'auth' : 'imp');
/* Use the first server defined in servers.php. */
// CUSTOMIZE THIS
'URI_MESSAGE' => Horde::applicationUrl('message-dimp.php'),
'URI_PREFS' => Horde::url($horde_webroot . '/services/prefs/', true, -1),
'URI_PREFS_IMP' => str_replace('&', '&', Horde_Util::addParameter(Horde::getServiceLink('options', 'imp'), array('nomenu' => 1))),
- 'URI_TIMEOUT' => Auth::addLogoutParameters($horde_webroot . '/login.php', AUTH_REASON_SESSION),
+ 'URI_TIMEOUT' => Horde_Auth::addLogoutParameters($horde_webroot . '/login.php', Horde_Auth::REASON_SESSION),
'URI_VIEW' => Horde::applicationUrl('view.php', true, -1),
'SESSION_ID' => defined('SID') ? SID : '',
$user = ($full ||
(isset($_SESSION['ingo']['backend']['hordeauth']) &&
$_SESSION['ingo']['backend']['hordeauth'] === 'full')) ?
- Auth::getAuth() :
- Auth::getBareAuth();
+ Horde_Auth::getAuth() :
+ Horde_Auth::getBareAuth();
} 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')
- ? Auth::getAuth() : Auth::getBareAuth();
- $params['password'] = Auth::getCredential('password');
+ ? Horde_Auth::getAuth() : Horde_Auth::getBareAuth();
+ $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'] = Auth::getBareAuth();
- $params['password'] = Auth::getCredential('password');
+ $params['username'] = Horde_Auth::getBareAuth();
+ $params['password'] = Horde_Auth::getCredential('password');
}
return Ingo_Driver::factory($_SESSION['ingo']['backend']['driver'], $params);
static public function listRulesets($owneronly = false,
$permission = PERMS_SHOW)
{
- $rulesets = $GLOBALS['ingo_shares']->listShares(Auth::getAuth(), $permission, $owneronly ? Auth::getAuth() : null);
+ $rulesets = $GLOBALS['ingo_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null);
if (is_a($rulesets, 'PEAR_Error')) {
Horde::logMessage($rulesets, __FILE__, __LINE__, PEAR_LOG_ERR);
return array();
}
static $all_perms;
if (!isset($all_perms)) {
- $all_perms = $GLOBALS['ingo_shares']->getPermissions($_SESSION['ingo']['current_share'], Auth::getAuth());
+ $all_perms = $GLOBALS['ingo_shares']->getPermissions($_SESSION['ingo']['current_share'], Horde_Auth::getAuth());
}
return $all_perms & $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', $GLOBALS['registry']->getImageDir('horde'), '', 'popup(\'' . Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('app' => 'ingo', 'share' => htmlspecialchars($_SESSION['ingo']['backend']['id'] . ':' . Auth::getAuth())), null, false) . '\');return false;');
+ $menu->add('#', _("_Permissions"), 'perms.png', $GLOBALS['registry']->getImageDir('horde'), '', 'popup(\'' . Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('app' => 'ingo', 'share' => htmlspecialchars($_SESSION['ingo']['backend']['id'] . ':' . Horde_Auth::getAuth())), null, false) . '\');return false;');
}
if ($returnType == 'object') {
/* Remove empty lines. */
$info['addresses'] = preg_replace('/\n+/', "\n", $info['addresses']);
if (empty($addresses)) {
- $info['addresses'] = Auth::getAuth();
+ $info['addresses'] = Horde_Auth::getAuth();
}
}
$notification->attach('status');
// Redirect the user to the Horde login page if they haven't authenticated.
-if (!Auth::isAuthenticated() && !defined('AUTH_HANDLER')) {
+if (!Horde_Auth::isAuthenticated() && !defined('AUTH_HANDLER')) {
Horde::authenticationFailureRedirect();
}
$GLOBALS['all_rulesets'] = Ingo::listRulesets();
/* If personal share doesn't exist then create it. */
- $signature = $_SESSION['ingo']['backend']['id'] . ':' . Auth::getAuth();
+ $signature = $_SESSION['ingo']['backend']['id'] . ':' . Horde_Auth::getAuth();
if (!$GLOBALS['ingo_shares']->exists($signature)) {
require_once 'Horde/Identity.php';
$identity = &Identity::singleton();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Auth::removeHook(Auth::getAuth());
+ $name = Horde_Auth::removeHook(Horde_Auth::getAuth());
}
$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(Auth::getAuth(), PERMS_READ)) {
+ !$GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
$_SESSION['ingo']['current_share'] = $signature;
}
} else {
require_once dirname(dirname(__FILE__)) . '/lib/base.php';
// Initialize authentication manager.
-$auth = &Auth::singleton($conf['auth']['driver']);
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
// Initialize storage backend.
$rules_storage = Ingo_Storage::factory();
/* Initialize the needed libraries. */
require_once dirname(dirname(dirname(__FILE__))) . '/lib/base.php';
-/* Initialize authentication backend. */
-$auth = &Auth::singleton($conf['auth']['driver']);
-
/* Initialize storage backends. */
if ($conf['storage']['driver'] != 'sql') {
$cli->fatal('You need to configure an SQL storage backend in Ingo\'s configuration', __FILE__, __LINE__);
echo 'Converting filters for user: ' . $user;
- $auth->setAuth($user, array());
+ Horde_Auth::setAuth($user, array());
$_SESSION['ingo']['current_share'] = ':' . $user;
foreach ($rules as $rule) {
/* Remove empty lines. */
$addresses = preg_replace('/\n+/', "\n", $addresses);
if (empty($addresses)) {
- $addresses = Auth::getAuth();
+ $addresses = Horde_Auth::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')) ? Auth::getAuth() : Auth::getBareAuth()
+ 'SSH.user' => (empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? Horde_Auth::getAuth() : Horde_Auth::getBareAuth()
);
foreach ($this->_jtaParams as $key => $val) {
public function generateAppletCode()
{
$params = array(
- 'sshapps.connection.userName' => (empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? Auth::getAuth() : Auth::getBareAuth()
+ 'sshapps.connection.userName' => (empty($GLOBALS['conf']['user']['hordeauth']) || ($GLOBALS['conf']['user']['hordeauth'] === 'full')) ? Horde_Auth::getAuth() : Horde_Auth::getBareAuth()
);
foreach ($this->_sshtoolsParams as $key => $val) {
-echo Auth::getAuth();
+echo Horde_Auth::getAuth();
-echo $registry->hasPermission(Auth::getAuth(), PERMS_EDIT);
-if($registry->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+echo $registry->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+if($registry->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
echo "TASTA";
exit(0);
}
$this->registry = &$registry;
$this->notification = &$notification;
- $this->auth = &Auth::singleton($conf['auth']['driver']);
+ $this->auth = Horde_Auth::singleton($conf['auth']['driver']);
$this->conf = Horde::loadConfiguration('conf.php', 'conf');
$this->objects = Horde::loadConfiguration('objects.php', 'objects');
public function getServer()
{
if (!isset(self::$server)) {
- self::$server = Horde_Kolab_Server::singleton(array('user' => Auth::getAuth(),
- 'pass' => Auth::getCredential('password')));
+ self::$server = Horde_Kolab_Server::singleton(array('user' => Horde_Auth::getAuth(),
+ 'pass' => Horde_Auth::getCredential('password')));
}
return self::$server;
/* Authenticate the user if possible. */
if ($this->_argv->user) {
require_once 'Horde/Auth.php';
- $auth = &Auth::singleton($conf['auth']['driver']);
+ $auth = Horde_Auth::singleton($conf['auth']['driver']);
if (!$auth->authenticate($this->_argv->user,
array('password' => $this->_argv->pass))) {
throw new InvalidArgumentException('Failed to log in!');
$this->welcome = isset($this->koward->conf['koward']['greeting']) ? $this->koward->conf['koward']['greeting'] : _("Welcome.");
- $this->current_user = Auth::getAuth();
+ $this->current_user = Horde_Auth::getAuth();
$session = Horde_Kolab_Session::singleton();
if (!empty($session->user_uid)) {
$menu->add($this->urlFor(array('controller' => 'check', 'action' => 'show')),
_("_Test"), 'problem.png', $registry->getImageDir('horde'));
}
- if (Auth::getAuth()) {
+ if (Horde_Auth::getAuth()) {
$menu->add($this->urlFor(array('controller' => 'index', 'action' => 'logout')),
_("_Logout"), 'logout.png', $registry->getImageDir('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!', Auth::getAuth(), $id),
+ Horde::logMessage(sprintf('User %s does not have access to action %s!', Horde_Auth::getAuth(), $id),
__FILE__, __LINE__, PEAR_LOG_NOTICE);
- if (Auth::getAuth()) {
+ if (Horde_Auth::getAuth()) {
$url = $this->urlFor(array('controller' => 'index', 'action' => 'index'));
} else {
$url = $this->urlFor(array('controller' => 'index', 'action' => 'login'));
public function login()
{
- $auth = Auth::getAuth();
+ $auth = Horde_Auth::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',
- Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
+ Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_NOTICE);
$type = $this->koward->getType();
public function logout()
{
$entry = sprintf('User %s [%s] logged out of Horde',
- Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
+ Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_NOTICE);
- Auth::clearAuth();
+ Horde_Auth::clearAuth();
@session_destroy();
header('Location: ' . $this->urlFor(array('controller' => 'index', 'action' => 'login')));
'members' => array('credentialsui'),
);
-$auth = &Auth::singleton($GLOBALS['conf']['auth']['driver']);
+$auth = Horde_Auth::singleton($GLOBALS['conf']['auth']['driver']);
if (is_a($auth, 'Auth') && $auth->hasCapability('update')) {
$prefGroups['forgotpass'] = array(
'column' => _("Your Information"),
list($calendar_id, $user) = explode(':', $targetcalendar, 2);
} else {
$calendar_id = $targetcalendar;
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$share = &$kronolith_shares->getShare($calendar_id);
if (is_a($share, 'PEAR_Error')) {
$notification->push(sprintf(_("There was an error accessing the calendar: %s"), $share->getMessage()), 'horde.error');
- } elseif ($user != Auth::getAuth() &&
- !$share->hasPermission(Auth::getAuth(), PERMS_DELEGATE, Auth::getAuth())) {
+ } elseif ($user != Horde_Auth::getAuth() &&
+ !$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELEGATE, Horde_Auth::getAuth())) {
$notification->push(sprintf(_("You do not have permission to delegate events to %s."), Kronolith::getUserName($user)), 'horde.warning');
- } elseif ($user == Auth::getAuth() &&
- !$share->hasPermission(Auth::getAuth(), PERMS_EDIT, Auth::getAuth())) {
+ } elseif ($user == Horde_Auth::getAuth() &&
+ !$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT, Horde_Auth::getAuth())) {
$notification->push(sprintf(_("You do not have permission to add events to %s."), $share->get('name')), 'horde.warning');
} elseif (Kronolith::hasPermission('max_events') === true ||
Kronolith::hasPermission('max_events') > Kronolith::countEvents()) {
$tagger = new Kronolith_Tagger();
$result = new stdClass;
$result->tags = array();
- $tags = $tagger->getCloud(Auth::getAuth(), 10);
+ $tags = $tagger->getCloud(Horde_Auth::getAuth(), 10);
foreach ($tags as $tag) {
$result->tags[] = $tag['tag_name'];
}
if (!$cal) {
$cal = $prefs->getValue('default_share');
if (!$cal) {
- $cal = Auth::getAuth();
+ $cal = Horde_Auth::getAuth();
}
$cal = array($cal);
}
-$vfb = Kronolith_FreeBusy::generate($cal, null, null, true, Auth::getAuth());
+$vfb = Kronolith_FreeBusy::generate($cal, null, null, true, Horde_Auth::getAuth());
if (!is_a($vfb, 'PEAR_Error')) {
$attendee_view->addRequiredMember($vfb);
} else {
// Exit if this isn't an authenticated user or if the user can't
// create new calendars (default share is locked).
-if (!Auth::getAuth() || $prefs->isLocked('default_share')) {
+if (!Horde_Auth::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 (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
$vars = Horde_Variables::getDefaultVariables();
$calendar_id = $vars->get('c');
-if ($calendar_id == Auth::getAuth()) {
+if ($calendar_id == Horde_Auth::getAuth()) {
$notification->push(_("This calendar cannot be deleted."), 'horde.warning');
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
$notification->push($calendar, 'horde.error');
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
-} elseif ($calendar->get('owner') != Auth::getAuth()) {
+} elseif ($calendar->get('owner') != Horde_Auth::getAuth()) {
$notification->push(_("You are not allowed to delete this calendar."), 'horde.error');
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
require_once KRONOLITH_BASE . '/lib/Forms/EditCalendar.php';
// Exit if this isn't an authenticated user.
-if (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
$notification->push($calendar, 'horde.error');
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
-} elseif ($calendar->get('owner') != Auth::getAuth()) {
+} elseif ($calendar->get('owner') != Horde_Auth::getAuth()) {
$notification->push(_("You are not allowed to change this calendar."), 'horde.error');
header('Location: ' . Horde::applicationUrl('calendars/', true));
exit;
}
// Exit if this isn't an authenticated user.
-if (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php'));
exit;
}
require_once KRONOLITH_BASE . '/lib/base.php';
// Exit if this isn't an authenticated user.
-if (!Auth::getAuth()) {
+if (!Horde_Auth::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 (!Auth::getAuth() || $prefs->isLocked('remote_cals')) {
+if (!Horde_Auth::getAuth() || $prefs->isLocked('remote_cals')) {
header('Location: ' . Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true));
exit;
}
exit;
}
-$key = Auth::getCredential('password');
+$key = Horde_Auth::getCredential('password');
$username = $calendar['user'];
$password = $calendar['password'];
if ($key) {
// Exit if this isn't an authenticated user or if the user can't
// subscribe to remote calendars (remote_cals is locked).
-if (!Auth::getAuth() || $prefs->isLocked('remote_cals')) {
+if (!Horde_Auth::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 (!Auth::getAuth() || $prefs->isLocked('remote_cals')) {
+if (!Horde_Auth::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' => Auth::getAuth() ? Auth::getAuth() : 0,
+ 'value' => Horde_Auth::getAuth() ? Horde_Auth::getAuth() : 0,
'locked' => false,
'shared' => false,
'type' => 'implicit',
require_once dirname(__FILE__) . '/lib/base.php';
-if (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
Horde_Util::closeWindowJS();
exit;
}
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("You have specified an invalid calendar."), 'horde.error');
$next_step = $data->cleanup();
- } elseif (!$share->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+ } elseif (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
$notification->push(_("You do not have permission to add events to the selected calendar."), 'horde.error');
$next_step = $data->cleanup();
} else {
exit;
}
$share = &$kronolith_shares->getShare($event->getCalendar());
- if (!$share->hasPermission(Auth::getAuth(), PERMS_DELETE, $event->getCreatorID())) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE, $event->getCreatorID())) {
$notification->push(_("You do not have permission to delete this event."), 'horde.warning');
} else {
$notification_type = Kronolith::ITIP_CANCEL;
list($target, $user) = explode(':', $targetcalendar, 2);
} else {
$target = $targetcalendar;
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$share = &$kronolith_shares->getShare($target);
$sourceShare = &$kronolith_shares->getShare($source);
if (!is_a($share, 'PEAR_Error') &&
!is_a($sourceShare, 'PEAR_Error') &&
- $sourceShare->hasPermission(Auth::getAuth(), PERMS_DELETE) &&
- (($user == Auth::getAuth() &&
- $share->hasPermission(Auth::getAuth(), PERMS_EDIT)) ||
- ($user != Auth::getAuth() &&
- $share->hasPermission(Auth::getAuth(), PERMS_DELEGATE)))) {
+ $sourceShare->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE) &&
+ (($user == Horde_Auth::getAuth() &&
+ $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) ||
+ ($user != Horde_Auth::getAuth() &&
+ $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELEGATE)))) {
$kronolith_driver->open($source);
$res = $kronolith_driver->move(Horde_Util::getFormData('eventID'), $target);
if (is_a($res, 'PEAR_Error')) {
if ($event && !is_a($event, 'PEAR_Error')) {
if (isset($sourceShare) && !is_a($sourceShare, 'PEAR_Error')
- && !$sourceShare->hasPermission(Auth::getAuth(), PERMS_DELETE)) {
+ && !$sourceShare->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
$notification->push(_("You do not have permission to move this event."), 'horde.warning');
- } elseif ($user != Auth::getAuth() &&
- !$share->hasPermission(Auth::getAuth(), PERMS_DELEGATE, $event->getCreatorID())) {
+ } elseif ($user != Horde_Auth::getAuth() &&
+ !$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELEGATE, $event->getCreatorID())) {
$notification->push(sprintf(_("You do not have permission to delegate events to %s."), Kronolith::getUserName($user)), 'horde.warning');
- } elseif ($user == Auth::getAuth() &&
- !$share->hasPermission(Auth::getAuth(), PERMS_EDIT, $event->getCreatorID())) {
+ } elseif ($user == Horde_Auth::getAuth() &&
+ !$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT, $event->getCreatorID())) {
$notification->push(_("You do not have permission to edit this event."), 'horde.warning');
} else {
$event->readForm();
case 'EditEvent':
if ($view->event->isPrivate() &&
- $view->event->getCreatorId() != Auth::getAuth()) {
+ $view->event->getCreatorId() != Horde_Auth::getAuth()) {
$url = Horde_Util::getFormData('url');
if (empty($url)) {
$url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true);
sprintf(_("The requested feed (%s) was not found on this server."),
htmlspecialchars($calendar)));
}
-if (!$share->hasPermission(Auth::getAuth(), PERMS_READ)) {
- if (Auth::getAuth()) {
+if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+ if (Horde_Auth::getAuth()) {
_no_access(403, 'Forbidden',
sprintf(_("Permission denied for the requested feed (%s)."),
htmlspecialchars($calendar)));
} else {
- $auth = &Auth::singleton($conf['auth']['driver']);
+ $auth = Horde_Auth::singleton($conf['auth']['driver']);
if (isset($_SERVER['PHP_AUTH_USER'])) {
$user = $_SERVER['PHP_AUTH_USER'];
$pass = $_SERVER['PHP_AUTH_PW'];
}
$today = Kronolith::currentDate();
$remote_calendars = @unserialize($prefs->getValue('remote_cals'));
-$current_user = Auth::getAuth();
+$current_user = Horde_Auth::getAuth();
$my_calendars = array();
$shared_calendars = array();
foreach (Kronolith::listCalendars() as $id => $cal) {
if (is_a($this->_share, 'PEAR_Error')) {
return $this->_share;
}
- if (!$this->_share->hasPermission(Auth::getAuth(), PERMS_SHOW)) {
+ if (!$this->_share->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
return _("Permission Denied");
}
}
if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
$calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
- if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Auth::getAuth(), PERMS_SHOW)) {
+ if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
return _("Permission Denied");
}
$all_events = Kronolith::listEvents($startDate, $endDate, array($this->_params['calendar']), true, false, false);
if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
$calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
- if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Auth::getAuth(), PERMS_SHOW)) {
+ if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
return _("Permission Denied");
}
$all_events = Kronolith::listEvents($startDate, $endDate, array($this->_params['calendar']), true, false, false);
$this->_params['calendar'] != '__all') {
$calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
- if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Auth::getAuth(), PERMS_SHOW)) {
+ if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
return _("Permission Denied");
}
}
foreach ($alarms as $calId => $calAlarms) {
foreach ($calAlarms as $event) {
- if ($horde_alarm && $horde_alarm->isSnoozed($event->getUID(), Auth::getAuth())) {
+ if ($horde_alarm && $horde_alarm->isSnoozed($event->getUID(), Horde_Auth::getAuth())) {
continue;
}
$alarmCount++;
/* Log fetch at DEBUG level. */
Horde::logMessage(sprintf('Retrieved remote calendar for %s: url = "%s"',
- Auth::getAuth(), $url),
+ Horde_Auth::getAuth(), $url),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$data = $http->getResponseBody();
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::exists(): user = "%s"; query = "%s"',
- Auth::getAuth(), $query),
+ Horde_Auth::getAuth(), $query),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$event = $this->_db->getRow($query, $values, DB_FETCHMODE_ASSOC);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_listEventsConditional(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $q, implode(',', $values)),
+ Horde_Auth::getAuth(), $q, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
/* Run the query. */
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_listEventsConditional(): user = %s; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, implode(',', $values)),
+ Horde_Auth::getAuth(), $query, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$result = $this->_write_db->query($query, $values);
$this->_params['table']);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_countEvents(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, $this->_calendar),
+ Horde_Auth::getAuth(), $query, $this->_calendar),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
/* Run the query. */
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::getEvent(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, implode(',', $values)),
+ Horde_Auth::getAuth(), $query, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$event = $this->_db->getRow($query, $values, DB_FETCHMODE_ASSOC);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::getByUID(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, implode(',', $values)),
+ Horde_Auth::getAuth(), $query, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$events = $this->_db->getAll($query, $values, DB_FETCHMODE_ASSOC);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::saveEvent(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, implode(',', $values)),
+ Horde_Auth::getAuth(), $query, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$result = $this->_write_db->query($query, $values);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::saveEvent(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, implode(',', $values)),
+ Horde_Auth::getAuth(), $query, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$result = $this->_write_db->query($query, $values);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::delete(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, implode(',', $values)),
+ Horde_Auth::getAuth(), $query, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
return $this->_write_db->query($query, $values);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::deleteEvent(): user = "%s"; query = "%s"; values = "%s"',
- Auth::getAuth(), $query, implode(',', $values)),
+ Horde_Auth::getAuth(), $query, implode(',', $values)),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$result = $this->_write_db->query($query, $values);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_initConn(): user = "%s"; query = "%s"',
- Auth::getAuth(), $query),
+ Horde_Auth::getAuth(), $query),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$db->query($query);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_initConn(): user = "%s"; query = "%s"',
- Auth::getAuth(), $query),
+ Horde_Auth::getAuth(), $query),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
$db->query($query);
{
return PEAR::raiseError('to be refactored');
- if (!Auth::isAdmin()) {
+ if (!Horde_Auth::isAdmin()) {
return PEAR::raiseError(_("Permission Denied"));
}
public function hasPermission($permission, $user = null)
{
if ($user === null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
if ($this->remoteCal) {
$vEvent->setAttribute('ORGANIZER',
'mailto:' . Kronolith::getUserEmail($this->getCreatorId()),
array('CN' => $name));
- if (!$this->isPrivate() || $this->getCreatorId() == Auth::getAuth()) {
+ if (!$this->isPrivate() || $this->getCreatorId() == Horde_Auth::getAuth()) {
if (!empty($this->description)) {
$vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, NLS::getCharset(), 'utf-8'));
}
{
// See if it's a new event.
if ($this->getId() === null) {
- $this->setCreatorId(Auth::getAuth());
+ $this->setCreatorId(Horde_Auth::getAuth());
}
if (!empty($hash['title'])) {
$this->setTitle($hash['title']);
}
if (empty($user)) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
if (empty($prefs)) {
$prefs = $GLOBALS['prefs'];
*/
public function getCreatorId()
{
- return !empty($this->creatorID) ? $this->creatorID : Auth::getAuth();
+ return !empty($this->creatorID) ? $this->creatorID : Horde_Auth::getAuth();
}
/**
}
if ($user === null) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
$twentyFour = $GLOBALS['prefs']->getValue('twentyFour');
$end = $this->end->format($twentyFour ? 'G:i' : 'g:ia');
// We explicitly allow admin access here for the alarms notifications.
- if (!Auth::isAdmin() && $this->isPrivate() &&
+ if (!Horde_Auth::isAdmin() && $this->isPrivate() &&
$this->getCreatorId() != $user) {
return _("busy");
- } elseif (Auth::isAdmin() || $this->hasPermission(PERMS_READ, $user)) {
+ } elseif (Horde_Auth::isAdmin() || $this->hasPermission(PERMS_READ, $user)) {
return strlen($this->title) ? $this->title : _("[Unnamed event]");
} else {
return _("busy");
if (strpos($targetcalendar, ':')) {
list(, $creator) = explode(':', $targetcalendar, 2);
} else {
- $creator = isset($this->eventID) ? $this->getCreatorId() : Auth::getAuth();
+ $creator = isset($this->eventID) ? $this->getCreatorId() : Horde_Auth::getAuth();
}
$this->setCreatorId($creator);
$edit = '';
$delete = '';
- if ((!$this->isPrivate() || $this->getCreatorId() == Auth::getAuth())
+ if ((!$this->isPrivate() || $this->getCreatorId() == Horde_Auth::getAuth())
&& $this->hasPermission(PERMS_EDIT)) {
$editurl = $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->getCreatorId() == Auth::getAuth() ?
+ . "\n" . sprintf(_("Owner: %s"), ($this->getCreatorId() == Horde_Auth::getAuth() ?
_("Me") : Kronolith::getUserName($this->getCreatorId())));
- if (!$this->isPrivate() || $this->getCreatorId() == Auth::getAuth()) {
+ if (!$this->isPrivate() || $this->getCreatorId() == Horde_Auth::getAuth()) {
if ($this->location) {
$tooltip .= "\n" . _("Location") . ': ' . $this->location;
}
}
if (isset($event['organizer']['smtp-address'])) {
- if (Kronolith::isUserEmail(Auth::getAuth(), $event['organizer']['smtp-address'])) {
- $this->creatorID = Auth::getAuth();
+ if (Kronolith::isUserEmail(Horde_Auth::getAuth(), $event['organizer']['smtp-address'])) {
+ $this->creatorID = Horde_Auth::getAuth();
} else {
$this->creatorID = $event['organizer']['smtp-address'];
}
return false;
}
- if ($this->_calendar->get('owner') != Auth::getAuth()) {
+ if ($this->_calendar->get('owner') != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("Permission denied"));
}
// Make sure we still own at least one calendar.
if (count(Kronolith::listCalendars(true)) == 0) {
// If the default share doesn't exist then create it.
- if (!$GLOBALS['kronolith_shares']->exists(Auth::getAuth())) {
+ if (!$GLOBALS['kronolith_shares']->exists(Horde_Auth::getAuth())) {
require_once 'Horde/Identity.php';
$identity = &Identity::singleton();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Auth::removeHook(Auth::getAuth());
+ $name = Horde_Auth::removeHook(Horde_Auth::getAuth());
}
- $calendar = &$GLOBALS['kronolith_shares']->newShare(Auth::getAuth());
+ $calendar = &$GLOBALS['kronolith_shares']->newShare(Horde_Auth::getAuth());
if (is_a($calendar, 'PEAR_Error')) {
return;
}
}
if (strlen($username) || strlen($password)) {
- $key = Auth::getCredential('password');
+ $key = Horde_Auth::getCredential('password');
if ($key) {
$username = base64_encode(Horde_Secret::write($key, $username));
$password = base64_encode(Horde_Secret::write($key, $password));
}
if (strlen($username) || strlen($password)) {
- $key = Auth::getCredential('password');
+ $key = Horde_Auth::getCredential('password');
if ($key) {
$username = base64_encode(Horde_Secret::write($key, $username));
$password = base64_encode(Horde_Secret::write($key, $password));
// Check perms
if ($args['type'] == 'calendar') {
$cal = $GLOBALS['kronolith_shares']->getShare($args['resource']);
- $perm = $cal->hasPermission(Auth::getAuth(), PERMS_EDIT);
+ $perm = $cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
} elseif($args['type'] == 'event') {
$event = Kronolith::getDriver()->getByUID($args['resource']);
- $perm = $event->hasPermission(PERMS_EDIT, Auth::getAuth());
+ $perm = $event->hasPermission(PERMS_EDIT, Horde_Auth::getAuth());
}
if ($perm) {
if ($type == 'calendar') {
$cal = $GLOBALS['kronolith_shares']->getShare($id);
- $hasEdit = $cal->hasPermission(Auth::getAuth(), PERMS_EDIT);
+ $hasEdit = $cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
} elseif ($type == 'event') {
$event = Kronolith::getDriver()->getByUID($id);
- $hasEdit = $event->hasPermission(PERMS_EDIT, Auth::getAuth());
+ $hasEdit = $event->hasPermission(PERMS_EDIT, Horde_Auth::getAuth());
}
foreach ($tags as $tag_id => $tag) {
'debug' => !empty($conf['js']['debug']),
);
foreach ($GLOBALS['all_calendars'] as $id => $calendar) {
- $owner = $calendar->get('owner') == Auth::getAuth();
+ $owner = $calendar->get('owner') == Horde_Auth::getAuth();
$code['conf']['calendars']['internal'][$id] = array(
- 'name' => ($owner ? '' : '[' . Auth::removeHook($calendar->get('owner')) . '] ')
+ 'name' => ($owner ? '' : '[' . Horde_Auth::removeHook($calendar->get('owner')) . '] ')
. $calendar->get('name'),
'owner' => $owner,
'fg' => self::foregroundColor($calendar),
/* If an authenticated user has no calendars visible and their
* personal calendar doesn't exist, create it. */
- if (Auth::getAuth() &&
+ if (Horde_Auth::getAuth() &&
!count($GLOBALS['display_calendars']) &&
- !$GLOBALS['kronolith_shares']->exists(Auth::getAuth())) {
+ !$GLOBALS['kronolith_shares']->exists(Horde_Auth::getAuth())) {
require_once 'Horde/Identity.php';
$identity = &Identity::singleton();
$name = $identity->getValue('fullname');
if (trim($name) == '') {
- $name = Auth::removeHook(Auth::getAuth());
+ $name = Horde_Auth::removeHook(Horde_Auth::getAuth());
}
- $share = &$GLOBALS['kronolith_shares']->newShare(Auth::getAuth());
+ $share = &$GLOBALS['kronolith_shares']->newShare(Horde_Auth::getAuth());
$share->set('name', sprintf(_("%s's Calendar"), $name));
$GLOBALS['kronolith_shares']->addShare($share);
$GLOBALS['all_calendars'][Auth::getAuth()] = &$share;
/* Make sure the personal calendar is displayed by default. */
- if (!in_array(Auth::getAuth(), $GLOBALS['display_calendars'])) {
- $GLOBALS['display_calendars'][] = Auth::getAuth();
+ if (!in_array(Horde_Auth::getAuth(), $GLOBALS['display_calendars'])) {
+ $GLOBALS['display_calendars'][] = Horde_Auth::getAuth();
}
/* Calendar auto-sharing with the user's groups */
break;
}
$groups = &Group::singleton();
- $group_list = $groups->getGroupMemberships(Auth::getAuth());
+ $group_list = $groups->getGroupMemberships(Horde_Auth::getAuth());
if (!is_a($group_list, 'PEAR_Error') && count($group_list)) {
$perm = $share->getPermission();
// Add the default perm, not added otherwise
- $perm->addUserPermission(Auth::getAuth(), PERMS_ALL, false);
+ $perm->addUserPermission(Horde_Auth::getAuth(), 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 = PERMS_SHOW)
{
- $calendars = $GLOBALS['kronolith_shares']->listShares(Auth::getAuth(), $permission, $owneronly ? Auth::getAuth() : null, 0, 0, 'name');
+ $calendars = $GLOBALS['kronolith_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
if (is_a($calendars, 'PEAR_Error')) {
Horde::logMessage($calendars, __FILE__, __LINE__, PEAR_LOG_ERR);
return array();
$prefs->isLocked('default_share')) {
return $default_share;
} elseif (isset($GLOBALS['all_calendars'][Auth::getAuth()]) &&
- $GLOBALS['all_calendars'][Auth::getAuth()]->hasPermission(Auth::getAuth(), $permission)) {
- return Auth::getAuth();
+ $GLOBALS['all_calendars'][Auth::getAuth()]->hasPermission(Horde_Auth::getAuth(), $permission)) {
+ return Horde_Auth::getAuth();
} elseif (count($calendars)) {
return key($calendars);
}
$mail_params = $conf['mailer']['params'];
if ($mail_driver == 'smtp' && $mail_params['auth'] &&
empty($mail_params['username'])) {
- $mail_params['username'] = Auth::getAuth();
- $mail_params['password'] = Auth::getCredential('password');
+ $mail_params['username'] = Horde_Auth::getAuth();
+ $mail_params['password'] = Horde_Auth::getCredential('password');
}
$share = &$GLOBALS['kronolith_shares']->getShare($event->getCalendar());
$mail_params = $conf['mailer']['params'];
if ($mail_driver == 'smtp' && $mail_params['auth'] &&
empty($mail_params['username'])) {
- $mail_params['username'] = Auth::getAuth();
- $mail_params['password'] = Auth::getCredential('password');
+ $mail_params['username'] = Horde_Auth::getAuth();
+ $mail_params['password'] = Horde_Auth::getCredential('password');
}
foreach ($addresses as $lang => $twentyFour) {
'df' => $prefs->getValue('date_format'));
if ($prefs->getValue('event_notification_exclude_self') &&
- $user == Auth::getAuth()) {
+ $user == Horde_Auth::getAuth()) {
return false;
}
'id' => 'tabEvent',
'onclick' => 'return ShowTab(\'Event\');'));
if ((!$event->isPrivate() ||
- $event->getCreatorId() == Auth::getAuth()) &&
+ $event->getCreatorId() == Horde_Auth::getAuth()) &&
$event->hasPermission(PERMS_EDIT)) {
$tabs->addTab(
$event->isRemote() ? _("Save As New") : _("_Edit"),
if ($cal['url'] == $calendar) {
$user = isset($cal['user']) ? $cal['user'] : '';
$password = isset($cal['password']) ? $cal['password'] : '';
- $key = Auth::getCredential('password');
+ $key = Horde_Auth::getCredential('password');
if ($key && $user) {
$user = Horde_Secret::read($key, base64_decode($user));
$password = Horde_Secret::read($key, base64_decode($password));
/* Check here for guest calendars so that we don't get multiple
* messages after redirects, etc. */
- if (!Auth::getAuth() && !count($GLOBALS['all_calendars'])) {
+ if (!Horde_Auth::getAuth() && !count($GLOBALS['all_calendars'])) {
$GLOBALS['notification']->push(_("No calendars are available to guests."));
}
$query->end = $del_time;
$query->status = null;
$query->calendars = array_keys($calendars);
- $query->creatorID = Auth::getAuth();
+ $query->creatorID = Horde_Auth::getAuth();
/* Perform the search */
$events = Kronolith::search($query);
{
/* Don't capture notification messages if we are logging out are
* accessing the options pages. */
- if (Auth::getAuth() && !strstr($_SERVER['PHP_SELF'], '/prefs.php')) {
+ if (Horde_Auth::getAuth() && !strstr($_SERVER['PHP_SELF'], '/prefs.php')) {
$options['store'] = true;
}
parent::notify($messageStack, $options);
function &factory($user = null, $driver = null, $params = null)
{
if (is_null($user)) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
if (is_null($driver)) {
static $instances = array();
if (is_null($user)) {
- $user = Auth::getAuth();
+ $user = Horde_Auth::getAuth();
}
if (is_null($driver)) {
require_once 'HTTP/Request.php';
$http = new HTTP_Request($fb_url, $options);
- $http->setBasicAuth(Auth::getAuth(), Auth::getCredential('password'));
+ $http->setBasicAuth(Horde_Auth::getAuth(), Horde_Auth::getCredential('password'));
@$http->sendRequest();
if ($http->getResponseCode() != 200) {
return PEAR::raiseError(sprintf(_("Unable to retrieve free/busy information for %s"),
/* Log the query at debug level. */
Horde::logMessage(sprintf('SQL search by %s: query = "%s"',
- Auth::getAuth(), $query),
+ Horde_Auth::getAuth(), $query),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
/* Execute the query. */
/* Log the query at debug level. */
Horde::logMessage(sprintf('SQL insert by %s: query = "%s"',
- Auth::getAuth(), $query),
+ Horde_Auth::getAuth(), $query),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
/* Execute the query. */
$tags = self::$_tagger->splitTags($tags);
}
- self::$_tagger->tag(Auth::getAuth(),
+ self::$_tagger->tag(Horde_Auth::getAuth(),
array('object' => $localId,
'type' => self::$_type_ids[$content_type]),
$tags);
*/
public function listTags($token)
{
- return self::$_tagger->getTags(array('q' => $token, 'userId' => Auth::getAuth()));
+ return self::$_tagger->getTags(array('q' => $token, 'userId' => Horde_Auth::getAuth()));
}
/**
$url = Horde_Util::getFormData('url');
$perms = PERMS_EDIT;
- if ($this->event->getCreatorId() == Auth::getAuth()) {
+ if ($this->event->getCreatorId() == Horde_Auth::getAuth()) {
$perms |= PERMS_DELEGATE;
}
$calendars = Kronolith::listCalendars(false, $perms);
$createdby = '';
$modifiedby = '';
- $userId = Auth::getAuth();
+ $userId = Horde_Auth::getAuth();
if ($this->event->getUID()) {
/* Get the event's history. */
$history = &Horde_History::singleton();
$creatorId = $this->event->getCreatorId();
$description = $this->event->getDescription();
$location = $this->event->getLocation();
- $private = $this->event->isPrivate() && $creatorId != Auth::getAuth();
+ $private = $this->event->isPrivate() && $creatorId != Horde_Auth::getAuth();
$owner = Kronolith::getUserName($creatorId);
$status = Kronolith::statusToString($this->event->getStatus());
$attendees = $this->event->getAttendees();
*/
function _kronolith_removeUserData($user)
{
- if (!Auth::isAdmin() && $user != Auth::getAuth()) {
+ if (!Horde_Auth::isAdmin() && $user != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("You are not allowed to remove user data."));
}
//
// This request is for all calendars owned by the requested user
//
- $calendars = $GLOBALS['kronolith_shares']->listShares(Auth::getAuth(),
+ $calendars = $GLOBALS['kronolith_shares']->listShares(Horde_Auth::getAuth(),
PERMS_SHOW,
$parts[0]);
$results = array();
$results[$retpath . '.ics']['icon'] = $registry->getImageDir() . '/mime/icalendar.png';
}
if (in_array('browseable', $properties)) {
- $results[$retpath]['browseable'] = $calendar->hasPermission(Auth::getAuth(), PERMS_READ);
+ $results[$retpath]['browseable'] = $calendar->hasPermission(Horde_Auth::getAuth(), PERMS_READ);
$results[$retpath . '.ics']['browseable'] = false;
}
if (in_array('contenttype', $properties)) {
}
$event = null;
- if (Auth::isAdmin()) {
+ if (Horde_Auth::isAdmin()) {
$event = $events[0];
}
if (empty($event)) {
$ownerCalendars = Kronolith::listCalendars(true, PERMS_DELETE);
foreach ($events as $ev) {
- if (Auth::isAdmin() || isset($ownerCalendars[$ev->getCalendar()])) {
+ if (Horde_Auth::isAdmin() || isset($ownerCalendars[$ev->getCalendar()])) {
$event = $ev;
break;
}
}
if (!$event->hasPermission(PERMS_EDIT) ||
- ($event->isPrivate() && $event->getCreatorId() != Auth::getAuth())) {
+ ($event->isPrivate() && $event->getCreatorId() != Horde_Auth::getAuth())) {
return PEAR::raiseError(_("Permission Denied"));
}
}
if (empty($event) ||
- ($event->isPrivate() && $event->getCreatorId() != Auth::getAuth())) {
+ ($event->isPrivate() && $event->getCreatorId() != Horde_Auth::getAuth())) {
return PEAR::raiseError(_("Permission Denied"));
}
require_once dirname(__FILE__) . '/base.php';
require_once 'Horde/Group.php';
- $current_user = Auth::getAuth();
- if ((empty($user) || $user != $current_user) && !Auth::isAdmin()) {
+ $current_user = Horde_Auth::getAuth();
+ if ((empty($user) || $user != $current_user) && !Horde_Auth::isAdmin()) {
return PEAR::raiseError(_("Permission Denied"));
}
$calUser = trim(Horde_Util::getFormData('remote_user'));
$calPasswd = trim(Horde_Util::getFormData('remote_password'));
- $key = Auth::getCredential('password');
+ $key = Horde_Auth::getCredential('password');
if ($key) {
$calUser = base64_encode(Secret::write($key, $calUser));
$calPasswd = base64_encode(Secret::write($key, $calPasswd));
$shares = &Horde_Share::singleton('kronolith');
$groups = &Group::singleton();
-$auth = &Auth::singleton($conf['auth']['driver']);
+$auth = Horde_Auth::singleton($conf['auth']['driver']);
$reload = false;
$actionID = Horde_Util::getFormData('actionID', 'edit');
}
if (is_a($share, 'PEAR_Error')) {
$notification->push($share, 'horde.error');
- } elseif (isset($share) && Auth::getAuth() != $share->get('owner')) {
+ } elseif (isset($share) && Horde_Auth::getAuth() != $share->get('owner')) {
exit('permission denied');
}
break;
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent share."), 'horde.error');
} else {
- if (Auth::getAuth() != $share->get('owner')) {
+ if (Horde_Auth::getAuth() != $share->get('owner')) {
exit('permission denied');
}
$perm = &$share->getPermission();
// Process owner and owner permissions.
$old_owner = $share->get('owner');
- $new_owner = Auth::addHook(Horde_Util::getFormData('owner', $old_owner));
+ $new_owner = Horde_Auth::addHook(Horde_Util::getFormData('owner', $old_owner));
if ($old_owner !== $new_owner && !empty($new_owner)) {
- if ($old_owner != Auth::getAuth() && !Auth::isAdmin()) {
+ if ($old_owner != Horde_Auth::getAuth() && !Horde_Auth::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);
foreach ($u_names as $key => $user) {
// Apply backend hooks
- $user = Auth::addHook($user);
+ $user = Horde_Auth::addHook($user);
// If the user is empty, or we've already set permissions
// via the owner_ options, don't do anything here.
if (empty($user) || $user == $new_owner) {
if (!empty($conf['share']['any_group'])) {
$groupList = $groups->listGroups();
} else {
- $groupList = $groups->getGroupMemberships(Auth::getAuth(), true);
+ $groupList = $groups->getGroupMemberships(Horde_Auth::getAuth(), true);
}
if (is_a($groupList, 'PEAR_Error')) {
Horde::logMessage($groupList, __FILE__, __LINE__, PEAR_LOG_NOTICE);
}
// Registry.
-$registry = &Registry::singleton();
+$registry = Registry::singleton();
// Set user.
-$auth = &Auth::singleton($conf['auth']['driver']);
-$auth->setAuth($user, array());
+Horde_Auth::setAuth($user, array());
// Import data.
$result = $registry->call('calendar/import',
// Make sure we load Horde base to get the auth config
require_once HORDE_BASE . '/lib/base.php';
if ($conf['auth']['admins']) {
- $auth = Auth::singleton($conf['auth']['driver']);
- $auth->setAuth($conf['auth']['admins'][0], array());
+ Horde_Auth::setAuth($conf['auth']['admins'][0], array());
}
// Now that we are authenticated, we can load Kronolith's base. Otherwise, the
if (is_a($handle, 'PEAR_Error')) {
$cli->fatal($handle->toString());
}
-$auth = &Auth::singleton($conf['auth']['driver']);
while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) {
$user = $row['owner_name'];
- $auth->setAuth($user, array());
+ Horde_Auth::setAuth($user, array());
$cli->message('Creating calendar ' . $row['name']);
$share = $kronolith_shares->newShare($row['id']);
$share->set('name', $row['name']);
if (is_a($handle, 'PEAR_Error')) {
$cli->fatal($handle->toString());
}
-$auth = &Auth::singleton($conf['auth']['driver']);
$ical = new Horde_iCalendar();
$tz = $calendar = $user = $count = null;
while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) {
// Set user.
if ($user != $row['owner_name']) {
$user = $row['owner_name'];
- $auth->setAuth($user, array());
+ Horde_Auth::setAuth($user, array());
}
- // Parse event.
- $parsed = $ical->parsevCalendar($row['ical_raw']);
- if (is_a($parsed, 'PEAR_Error')) {
- $cli->message(' ' . $parsed->getMessage(), 'cli.warning');
- continue;
- }
- $components = $ical->getComponents();
- if (!count($components)) {
- $cli->message(' No iCalendar data was found.', 'cli.warning');
- continue;
- }
-
- // Save event.
- $event = &$kronolith_driver->getEvent();
- $event->fromiCalendar($components[0]);
- $result = $event->save();
- if (is_a($result, 'PEAR_Error')) {
- $cli->message(' ' . $result->getMessage(), 'cli.error');
+ // Parse event.
+ $parsed = $ical->parsevCalendar($row['ical_raw']);
+ if (is_a($parsed, 'PEAR_Error')) {
+ $cli->message(' ' . $parsed->getMessage(), 'cli.warning');
+ continue;
+ }
+ $components = $ical->getComponents();
+ if (!count($components)) {
+ $cli->message(' No iCalendar data was found.', 'cli.warning');
+ continue;
+ }
+
+ // Save event.
+ $event = &$kronolith_driver->getEvent();
+ $event->fromiCalendar($components[0]);
+ $result = $event->save();
+ if (is_a($result, 'PEAR_Error')) {
+ $cli->message(' ' . $result->getMessage(), 'cli.error');
continue;
}
$count++;
}
$optgroup = $GLOBALS['browser']->hasFeature('optgroup');
- $current_user = Auth::getAuth();
+ $current_user = Horde_Auth::getAuth();
$calendars = array();
foreach (Kronolith::listCalendars(false, PERMS_READ) as $id => $cal) {
if ($cal->get('owner') == $current_user) {
$creator = $event->getCreatorId();
foreach ($calendars as $id => $cal) {
$delegates = array();
- if ($cal->hasPermission(Auth::getAuth(), PERMS_EDIT, $creator)) {
+ if ($cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT, $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'))) . ')');
$info_img = Horde::img('info_icon.png', _("Calendar Information"), array('class' => 'calendar-info'), $registry->getImageDir('horde'));
-$current_user = Auth::getAuth();
+$current_user = Horde_Auth::getAuth();
$my_calendars = array();
$shared_calendars = array();
foreach (Kronolith::listCalendars() as $id => $cal) {
<input id="calendarSearch" type="text" for="mycalendars,sharedcalendars,remotecalendars,externalcalendars" />
</p>
-<?php if (Auth::getAuth()): ?>
+<?php if (Horde_Auth::getAuth()): ?>
<p>
<a href="<?php echo Horde::applicationUrl('calendars/') ?>"><?php echo _("[Manage Calendars]") ?></a>
</p>
<li class="panel-tags">
<?php
echo $tag;
-if ($cal->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+if ($cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
echo '<a href="#" id="remove' . md5($id . $tag_id) . '">'
. Horde::img('delete-small.png', _("Remove Tag"), '', $registry->getImageDir('horde'))
. '</a>';
<h4><?php echo _("Shared Calendars:") ?></h4>
<ul id="sharedcalendars">
<?php foreach ($shared_calendars as $id => $cal): ?>
- <li<?php echo Kronolith::getCSSColors($cal) ?>><label><input type="checkbox" class="checkbox" name="display_cal[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_calendars) ? ' checked="checked"' : '') . ' /> [' . htmlspecialchars(Auth::removeHook($cal->get('owner'))) . '] ' . htmlspecialchars($cal->get('name')) ?></label> <?php echo $info_img ?></li>
+ <li<?php echo Kronolith::getCSSColors($cal) ?>><label><input type="checkbox" class="checkbox" name="display_cal[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_calendars) ? ' checked="checked"' : '') . ' /> [' . htmlspecialchars(Horde_Auth::removeHook($cal->get('owner'))) . '] ' . htmlspecialchars($cal->get('name')) ?></label> <?php echo $info_img ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<label for="owner" class="hidden"><?php echo _("Owner:") ?></label>
<select id="owner" name="owner">
<option value=""><?php echo _("Select a new owner:") ?></option>
- <option value="<?php echo htmlspecialchars(Auth::removeHook($owner)) ?>" selected="selected"><?php echo htmlspecialchars(Auth::removeHook($owner)) ?></option>
-<?php foreach ($userList as $user) { if ($user != Auth::removeHook($owner)) { ?>
+ <option value="<?php echo htmlspecialchars(Horde_Auth::removeHook($owner)) ?>" selected="selected"><?php echo htmlspecialchars(Horde_Auth::removeHook($owner)) ?></option>
+<?php foreach ($userList as $user) { if ($user != Horde_Auth::removeHook($owner)) { ?>
<option value="<?php echo htmlspecialchars($user) ?>"><?php echo htmlspecialchars($user) ?></option>
<?php } } ?>
</select>
<?php else: ?>
<td class="light">
<label for="owner" class="hidden"><?php echo _("Owner:") ?></label>
- <input type="text" id="owner" name="owner" value="<?php echo htmlspecialchars(Auth::removeHook($owner)) ?>" />
+ <input type="text" id="owner" name="owner" value="<?php echo htmlspecialchars(Horde_Auth::removeHook($owner)) ?>" />
</td>
<?php endif; ?>
</tr>
<?php
foreach ($userperms as $user => $uperm) {
if ($user != $owner) {
- $user = Auth::removeHook($user);
+ $user = Horde_Auth::removeHook($user);
?>
<tr>
<td class="light"><?php echo htmlspecialchars($user) ?><input type="hidden" name="u_names[<?php echo htmlspecialchars($user) ?>]" value="<?php echo htmlspecialchars($user) ?>" /></td>
<?php
foreach ($userList as $user) {
if (!isset($userperms[Auth::addHook($user)]) &&
- $user != Auth::removeHook($owner)) {
+ $user != Horde_Auth::removeHook($owner)) {
?>
<option value="<?php echo htmlspecialchars($user) ?>"><?php echo htmlspecialchars($user) ?></option>
<?php } } ?>
<?php echo _("Copy this URL for use wherever you need your Free/Busy URL:") ?>
</div>
<p class="text">
- <?php echo Horde_Util::addParameter(Horde::applicationUrl('fb.php', true, -1), 'u', Auth::getAuth()) ?>
+ <?php echo Horde_Util::addParameter(Horde::applicationUrl('fb.php', true, -1), 'u', Horde_Auth::getAuth()) ?>
</p>
</div>
$sharelist = Kronolith::listCalendars();
if (($default_share = $prefs->getValue('default_share')) == null ||
!isset($sharelist[$default_share])) {
- $default_share = Auth::getAuth();
+ $default_share = Horde_Auth::getAuth();
}
?>
}
// Is logged it?
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
$notification->push(_("Only authenticated users can post news."), 'horde.warning');
Horde::authenticationFailureRedirect();
}
}
}
-if (Auth::isAdmin('news:admin')) {
+if (Horde_Auth::isAdmin('news:admin')) {
$form->setSection('admin', _("Admin"), '', true);
$form->addVariable(_("News administrator options"), 'content', 'header', false);
if (!empty($allowed_cats) &&
(in_array($info['category1'], $allowed_cats) || in_array($info['category2'], $allowed_cats))) {
- $info['editor'] = Auth::getAuth();
+ $info['editor'] = Horde_Auth::getAuth();
$info['status'] = News::CONFIRMED;
}
$data = array($info['sortorder'],
$info['status'],
$info['publish'],
- Auth::getAuth(),
+ Horde_Auth::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, Auth::getAuth(), serialize($info['body'])));
+ array($id, $version + 1, $status_version, Horde_Auth::getAuth(), serialize($info['body'])));
if ($result instanceof PEAR_Error) {
$notification->push($result);
}
*/
/* Only admin should be using this. */
-if (!Auth::isAdmin('news:admin')) {
+if (!Horde_Auth::isAdmin('news:admin')) {
$notification->push(_("You are not authorised for this action."), 'horde.warning');
Horde::authenticationFailureRedirect();
}
require_once dirname(__FILE__) . '/lib/base.php';
-if (!Auth::isAdmin('news:admin')) {
+if (!Horde_Auth::isAdmin('news:admin')) {
$notification->push(_("Only admin can delete a news."));
header('Location: ' . Horde::applicationUrl('edit.php'));
exit;
require_once dirname(__FILE__) . '/lib/base.php';
-if (!Auth::isAdmin('news:admin')) {
+if (!Horde_Auth::isAdmin('news:admin')) {
$notification->push(_("Only admin can delete a news."));
header('Location: ' . Horde::applicationUrl('edit.php'));
exit;
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, Auth::getAuth()));
+ array($id, $version + 1, $actionID, Horde_Auth::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, Auth::getAuth(), serialize($new_version)));
+ array($id, $version, Horde_Auth::getAuth(), serialize($new_version)));
$notification->push(sprintf(_("News \"%s\" (%s): %s"), $article['title'], $id, _("renewed")), 'horde.success');
header('Location: ' . $browse_url);
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
- if (Auth::isAdmin('news:admin')) {
+ if (Horde_Auth::isAdmin('news:admin')) {
Horde::fatal($data, __FILE__, __LINE__);
} else {
header('HTTP/1.0 404 Not Found');
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
- if (Auth::isAdmin('news:admin')) {
+ if (Horde_Auth::isAdmin('news:admin')) {
Horde::fatal($data, __FILE__, __LINE__);
} else {
header('HTTP/1.0 404 Not Found');
$data = News::getFile($file_id);
if ($data instanceof PEAR_Error) {
- if (Auth::isAdmin('news:admin')) {
+ if (Horde_Auth::isAdmin('news:admin')) {
Horde::fatal($data, __FILE__, __LINE__);
} else {
header('HTTP/1.0 404 Not Found');
*/
function _content()
{
- if (!Auth::isAuthenticated()) {
+ if (!Horde_Auth::isAuthenticated()) {
return '';
}
. '<th>' . _("User") . '</th></tr></thead>';
$threads = $GLOBALS['registry']->call('forums/getThreadsByForumOwner',
- array(Auth::getAuth(), 'message_timestamp', 1, false,
+ array(Horde_Auth::getAuth(), 'message_timestamp', 1, false,
'news', 0, $this->_params['limit']));
if ($threads instanceof PEAR_Error) {
return $threads->getMessage();
public function getAllowed($perm = PERMS_SHOW)
{
$cats = $this->getCategories();
- if (Auth::isAdmin('news:admin') ||
- $GLOBALS['perms']->hasPermission('news', Auth::getAuth(), $perm)) {
+ if (Horde_Auth::isAdmin('news:admin') ||
+ $GLOBALS['perms']->hasPermission('news', Horde_Auth::getAuth(), $perm)) {
return $cats;
}
foreach ($cats as $key => $value) {
// user has access?
- if (!$GLOBALS['perms']->hasPermission('news:categories', Auth::getAuth(), $perm) && // master
- !$GLOBALS['perms']->hasPermission('news:categories:' . $key, Auth::getAuth(), $perm) && // child
- !$GLOBALS['perms']->hasPermission('news:categories:' . $this->_nodes[$key]['category_parentid'], Auth::getAuth(), $perm) // father
+ if (!$GLOBALS['perms']->hasPermission('news:categories', Horde_Auth::getAuth(), $perm) && // master
+ !$GLOBALS['perms']->hasPermission('news:categories:' . $key, Horde_Auth::getAuth(), $perm) && // child
+ !$GLOBALS['perms']->hasPermission('news:categories:' . $this->_nodes[$key]['category_parentid'], Horde_Auth::getAuth(), $perm) // father
) {
unset($cats[$key]);
}
public function get($id)
{
// Admins bypass the cache (can read nonpublished and locked news)
- if (!Auth::isAdmin('news:admin')) {
+ if (!Horde_Auth::isAdmin('news:admin')) {
$key = 'news_' . News::getLang() . '_' . $id;
$data = $GLOBALS['cache']->get($key, $GLOBALS['conf']['cache']['default_lifetime']);
if ($data) {
return $data;
}
- if (!Auth::isAdmin('news:admin')) {
+ if (!Horde_Auth::isAdmin('news:admin')) {
$GLOBALS['cache']->set($key, serialize($data));
}
' WHERE n.id = ? AND n.id=l.id AND l.lang = ?';
/** TODO Allow for now to allow static linked news, but not shown in list
- if (!Auth::isAdmin('news:admin')) {
+ if (!Horde_Auth::isAdmin('news:admin')) {
$query .= ' AND n.status = ' . News::CONFIRMED;
}
*/
/* Log it */
$sql = 'INSERT INTO ' . $this->prefix . '_user_reads (id,user,ip,useragent,readdate) VALUES (?, ?, ? , ?, NOW())';
- $result = $this->write_db->query($sql, array($id, Auth::getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
+ $result = $this->write_db->query($sql, array($id, Horde_Auth::getAuth(), $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']));
if ($result instanceof PEAR_Error) {
return $result;
}
$this->addVariable(_("Unpublish"), 'unpublish', 'datetime', false, false, false, $GLOBALS['news']->datetimeParams());
$this->addVariable(_("User"), 'user', 'text', false, false, false);
- if (Auth::isAdmin()) {
+ if (Horde_Auth::isAdmin()) {
$this->addVariable(_("Editor"), 'editor', 'text', false, false, false);
}
return '';
}
- if (Auth::isAdmin('news:admin')) {
+ if (Horde_Auth::isAdmin('news:admin')) {
$delete_img = Horde::img('delete.png', _("Delete"), ' style="width: 16px height: 16px"', $GLOBALS['registry']->getImageDir('horde'));
$delete_url = Horde::applicationUrl('delete_file.php');
}
$html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'download_file'), sprintf(_("Dowload %s"), $file['file_name'])) . $dowload_img . '</a> ' . "\n";
$html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'view_file'), sprintf(_("Preview %s"), $file['file_name']), '', '_file_view');
$html .= Horde::img(Horde_Mime_Viewer::getIcon($file['file_type']), $file['file_name'], 'width="16" height="16"', '') . ' ';
- if (Auth::isAdmin('news:admin')) {
+ if (Horde_Auth::isAdmin('news:admin')) {
$html .= Horde::link(Horde_Util::addParameter($delete_url, $file), sprintf(_("Delete %s"), $file['file_name'])) . $delete_img . '</a> ' . "\n";
}
$html .= $file['file_name'] . '</a> ' . "\n";
$menu->add(Horde::applicationUrl('cloud.php'), _("Tag cloud"), 'colorpicker.png', $img_dir);
}
- if (Auth::isAdmin('news:admin')) {
+ if (Horde_Auth::isAdmin('news:admin')) {
$menu->add(Horde::applicationUrl('edit.php'), _("Editorship"), 'config.png', $img_dir);
$menu->add(Horde::applicationUrl('admin/categories/index.php'), _("Administration"), 'administration.png', $img_dir);
}
$this->addVariable(_("Unpublish"), 'unpublish', 'datetime', false, false, false, News::datetimeParams());
$this->addVariable(_("User"), 'user', 'text', false, false, false);
- if (Auth::isAdmin()) {
+ if (Horde_Auth::isAdmin()) {
$this->addVariable(_("Editor"), 'editor', 'text', false, false, false);
}
exit;
}
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
_error(_("Only authenticated users can send mails."));
}
}
$body = sprintf(_("%s would you like to invite you to read the news\n Title: %s\n\n Published: %s \nLink: %s"),
- Auth::getAuth(),
+ Horde_Auth::getAuth(),
$row['title'],
$row['publish'],
News::getUrlFor('news', $id, true, -1));
require_once dirname(__FILE__) . '/lib/base.php';
-if (!Auth::isAuthenticated()) {
+if (!Horde_Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
Horde::img('devel.png', _("Info"), '', $img_dir). '</a> ';
/* admins options */
-if (Auth::isAdmin() || isset($allowed_cats[$row['category1']]) || isset($allowed_cats[$row['category2']])) {
+if (Horde_Auth::isAdmin() || isset($allowed_cats[$row['category1']]) || isset($allowed_cats[$row['category2']])) {
if ($row['status'] == News::CONFIRMED) {
$url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'deactivate', 'id' => $row['id']));
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, PERMS_EDIT)) == 0 && Auth::getAuth()) {
+if (count(Skoli::listClasses(false, PERMS_EDIT)) == 0 && Horde_Auth::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 (!Auth::getAuth()) {
+if (!Horde_Auth::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 (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$notification->push($class, 'horde.error');
header('Location: ' . Horde::applicationUrl('classes/', true));
exit;
-} elseif (!$class->hasPermission(Auth::getAuth(), PERMS_DELETE)) {
+} elseif (!$class->hasPermission(Horde_Auth::getAuth(), 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 (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$notification->push($class, 'horde.error');
header('Location: ' . Horde::applicationUrl('classes/', true));
exit;
-} elseif (!$class->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+} elseif (!$class->hasPermission(Horde_Auth::getAuth(), 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 (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
require_once 'Horde/UI/Tabs.php';
// Exit if this isn't an authenticated user.
-if (!Auth::getAuth()) {
+if (!Horde_Auth::getAuth()) {
header('Location: ' . Horde::applicationUrl('list.php', true));
exit;
}
$share = $GLOBALS['skoli_shares']->getShare($entry['class_id']);
// Check permissions
-if (!$share->hasPermission(Auth::getAuth(), PERMS_READ)) {
+if (!$share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_EDIT)) {
+if ($share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
$tabs->addTab(_("Edit"), $url, array('tabname' => 'EditEntry', 'id' => 'tabEditEntry'));
}
-if ($share->hasPermission(Auth::getAuth(), PERMS_DELETE)) {
+if ($share->hasPermission(Horde_Auth::getAuth(), 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, Auth::getAuth(), $this->generateUID(), $this->_class, $studentid, $date->datestamp(), $vars->get('object_type'));
+ $values = array($entryId, Horde_Auth::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),
return false;
}
- if ($this->_class->get('owner') != Auth::getAuth()) {
+ if ($this->_class->get('owner') != Horde_Auth::getAuth()) {
return PEAR::raiseError(_("Permission denied"));
}
$classes = Skoli::listClasses(false, PERMS_EDIT);
$classes_enums = array();
foreach ($classes as $class) {
- if ($class->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
+ if ($class->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
$classes_enums[$class->getName()] = $class->get('name');
}
}
{
global $registry;
- $classes = $GLOBALS['skoli_shares']->listShares(Auth::getAuth(), $permission, $owneronly ? Auth::getAuth() : null, 0, 0, 'name');
+ $classes = $GLOBALS['skoli_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
if (is_a($classes, 'PEAR_Error')) {
Horde::logMessage($classes, __FILE__, __LINE__, PEAR_LOG_ERR);
return array();
$share = $GLOBALS['skoli_shares']->getShare($class);
/* Check permissions */
- if (!$share->hasPermission(Auth::getAuth(), PERMS_READ) || !isset($addressbooks[$share->get('address_book')])) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ) || !isset($addressbooks[$share->get('address_book')])) {
continue;
}
$list[$i] = $share->datatreeObject->data;
$list[$i]['_id'] = $class;
- $list[$i]['_edit'] = $share->hasPermission(Auth::getAuth(), PERMS_EDIT);
+ $list[$i]['_edit'] = $share->hasPermission(Horde_Auth::getAuth(), 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(Auth::getAuth(), PERMS_READ) || !isset($addressbooks[$share->get('address_book')])) {
+ if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ) || !isset($addressbooks[$share->get('address_book')])) {
continue;
}
- $share_permissions_edit = $share->hasPermission(Auth::getAuth(), PERMS_EDIT);
- $share_permissions_delete = $share->hasPermission(Auth::getAuth(), PERMS_DELETE);
+ $share_permissions_edit = $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+ $share_permissions_delete = $share->hasPermission(Horde_Auth::getAuth(), 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 && Auth::getAuth()) {
+if (count(Skoli::listClasses()) == 0 && Horde_Auth::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 (Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
+ if (Horde_Auth::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"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
-$current_user = Auth::getAuth();
+$current_user = Horde_Auth::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 (Auth::getAuth()): ?>
+<?php if (Horde_Auth::getAuth()): ?>
<p>
<a href="<?php echo Horde::applicationUrl('classes/') ?>"><?php echo _("[Manage Classes]") ?></a>
</p>
<h4><?php echo _("Shared Classes:") ?></h4>
<ul id="sharedclasses">
<?php foreach ($shared_classes as $id => $cl): ?>
- <li><label><input type="checkbox" class="checkbox" name="display_class[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_classes) ? ' checked="checked"' : '') . ' /> [' . htmlspecialchars(Auth::removeHook($cl->get('owner'))) . '] ' . htmlspecialchars($cl->get('name')) ?></label></li>
+ <li><label><input type="checkbox" class="checkbox" name="display_class[]" value="<?php echo htmlspecialchars($id) ?>"<?php echo (in_array($id, $display_classes) ? ' checked="checked"' : '') . ' /> [' . htmlspecialchars(Horde_Auth::removeHook($cl->get('owner'))) . '] ' . htmlspecialchars($cl->get('name')) ?></label></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>