*/
public function getRecentVisitors($limit = 10)
{
- $recent = $GLOBALS['cache']->get('folksRecentVisitors', $GLOBALS['conf']['online']['ttl']);
+ $recent = $GLOBALS['cache']->get('folksRecentVisitors' . $limit, $GLOBALS['conf']['online']['ttl']);
if ($recent) {
$recent = unserialize($recent);
} else {
if ($recent instanceof PEAR_Error) {
return $recent;
}
- $GLOBALS['cache']->set('folksRecentVisitors', serialize($recent));
+ $GLOBALS['cache']->set('folksRecentVisitors' . $limit, serialize($recent));
}
return $recent;
* The table structure can be created by the scripts/sql/folks_foo.sql
* script.
*
- * $Id: sql.php 984 2008-10-09 09:38:16Z duck $
+ * $Id: sql.php 1074 2008-11-29 09:04:26Z duck $
*
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
+ * Copyright 2008-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
/**
* Get last visitors
+ *
+ * @param integer $limit Username to check
+ *
+ * @return array users
*/
protected function _getRecentVisitors($limit = 10)
{
$sql = 'SELECT user_uid FROM ' . $this->_params['online']
- . ' WHERE user_uid <> "" ORDER BY time_last_click DESC LIMIT 0, ' . (int)$limit;
+ . ' WHERE user_uid <> "" AND user_uid <> "0" '
+ . ' ORDER BY time_last_click DESC LIMIT 0, ' . (int)$limit;
return $this->_db->getCol($sql);
}
}
/* Connect to the SQL server using the supplied parameters. */
+ require_once 'DB.php';
$this->_write_db = DB::connect($this->_params,
array('persistent' => !empty($this->_params['persistent'])));
if ($this->_write_db instanceof PEAR_Error) {
// Load the Horde Framework core, and set up inclusion paths and autoloading.
require_once HORDE_BASE . '/lib/core.php';
-require_once 'Horde/Loader.php';
+require_once 'Horde/Autoloader.php';
// Registry.
$registry = &Registry::singleton();
<?php
/**
- * $Id: login.php 954 2008-09-30 19:09:25Z duck $
+ * $Id: login.php 1076 2008-11-29 09:33:19Z duck $
*
* Copyright Obala d.o.o. (www.obala.si)
*
/*
* Special login for apps (gollem, imp)?
*/
-if ($conf['login']['prelogin'] &&
+if ($conf['login']['prelogin'] &&
Auth::getAuth() &&
($app = Util::getGet('app'))) {
Horde::callHook('_folks_hook_prelogin', array($app), 'folks');
}
/*
- * Form
+ * Form
*/
$title = sprintf(_("Login to %s"), $registry->get('name', 'horde'));
$vars = Variables::getDefaultVariables();
/*
* Check time between one login and anther
*/
-$username = strtolower(Util::getPost('username'));
+$username = strtolower(trim(Util::getPost('username')));
if ($username && $conf['login']['diff']) {
$last_try = $cache->get('login_last_try_' . $username, $conf['cache']['default_lifetime']);
if ($last_try && $_SERVER['REQUEST_TIME'] - $last_try <= $conf['login']['diff']) {
break;
case 'unconfirmed':
+ case 'inactive':
$notification->push(_("This account was still not activated. Check your inbox, we send you the activation code there."), 'horde.warning');
header('Location: ' . Horde::selfUrl(true));
exit;
/**
* This script parses MIME messages and deactivates users with returned emails.
*
- * $Id: mail-filter.php 1019 2008-10-31 08:18:10Z duck $
+ * $Id: mail-filter.php 1020 2008-10-31 09:25:56Z duck $
*
* Copyright 2008-2009 The Horde Project (http://www.horde.org/)
*
// Get usernames
$query = 'SELECT DISTINCT user_uid FROM folks_users WHERE user_email'
. ' IN (' . implode(', ', array_unique($mails)) . ') ';
-$users = $db->getOne($query, $mail);
+$users = $db->getCol($query);
if ($user_uid instanceof PEAR_Error) {
$cli->fatal($user_uid);
continue;
$auth->setAuth($opts_hash['--username'], array('transparent' => 1));
// Send messages
-$result = $registry->callByPackage(
- 'letter', 'sendMessage', array($users,
- array('title' => $title,
- 'content' => sprintf($body, $user_uid, $edit_url))));
-
-if ($result instanceof PEAR_Error) {
- $cli->message($result, 'cli.error');
-} else {
- $cli->message('', 'cli.sucess');
+foreach ($users as $user) {
+ $result = $registry->callByPackage(
+ 'letter', 'sendMessage', array($user,
+ array('title' => $title,
+ 'content' => sprintf($body, $user_uid, $edit_url))));
+ if ($result instanceof PEAR_Error) {
+ $cli->message($result, 'cli.error');
+ } else {
+ $cli->message($user, 'cli.sucess');
+ }
}
exit(0);
<ul class="notices">
<li><img src="<?php echo $registry->getImageDir('horde')?>/alerts/warning.png"><?php echo sprintf(_("User %s would like to his profile remains visible only to authenticated users."), $user) ?></li>
-<?php
- echo '<li><?php echo $registry->getImageDir('horde')?>/alerts/success.png">'
- . _("Click here to login.")
- . ' <a href="' . Auth::getLoginScreen('letter', Util::addParameter(Horde::applicationUrl('user.php'), 'user', $user)) . '">' . _("Click here to login.") . '</a>'
- . '</li>';
-}
+<?php
+echo '<li><img src="' . $registry->getImageDir('horde') . '/alerts/success.png">'
+ . _("Click here to login.")
+ . ' <a href="' . Auth::getLoginScreen('letter', Util::addParameter(Horde::applicationUrl('user.php'), 'user', $user)) . '">' . _("Click here to login.") . '</a>'
+ . '</li>';
?>
</ul>
<?php
/**
- * $Id: user.php 987 2008-10-09 12:23:30Z duck $
+ * $Id: user.php 1076 2008-11-29 09:33:19Z duck $
*
* Copyright Obala d.o.o. (www.obala.si)
*
break;
case 'deleted':
+case 'deactivated':
require FOLKS_TEMPLATES . '/user/deleted.php';
break;