--- /dev/null
+[Dolphin]
+Timestamp=2008,9,22,18,45,3
+ViewMode=1
--- /dev/null
+<?php
+/**
+ * $Id: approve.php 947 2008-09-29 12:21:47Z duck $
+ *
+ * Copyright 2007 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+
+require_once dirname(__FILE__) . '/tabs.php';
+
+$title = _("Confirm email");
+
+// Get supplied code
+$code = Util::getGet('code');
+if (empty($code)) {
+ $notification->push(_("You must supply a confirmation code."));
+ header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ exit;
+}
+
+// Get supplied username
+$user = Util::getGet('user');
+if (empty($code)) {
+ $notification->push(_("You must supply a username."));
+ header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ exit;
+}
+
+// Get user profile
+$profile = $folks_driver->getProfile($user);
+if ($profile instanceof PEAR_Error) {
+ $notification->push($profile);
+ header('Location: ' . 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')));
+ exit;
+}
+
+// Get internal confirmation code
+$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')));
+ exit;
+}
+
+// Check code
+if ($internal_code == $code) {
+ $update = $folks_driver->saveProfile(array('user_status' => 'active'), $user);
+ if ($update instanceof PEAR_Error) {
+ $notification->push($update);
+ } else {
+ $notification->push(_("You account is activated, you can login now."), 'horde.success');
+ }
+} else {
+ $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')));
+exit;
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: renew.php 918 2008-09-25 02:18:59Z duck $
+ *
+ * Copyright 2007 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+
+require_once dirname(__FILE__) . '/tabs.php';
+
+$title = _("Renew account");
+
+// Get supplied code
+$code = Util::getGet('code');
+if (empty($code)) {
+ $notification->push(_("You must supply a confirmation code."));
+ header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ exit;
+}
+
+// Get supplied username
+$user = Util::getGet('user');
+if (empty($code)) {
+ $notification->push(_("You must supply a username."));
+ header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
+ exit;
+}
+
+// Get user profile
+$profile = $folks_driver->getProfile($user);
+if ($profile instanceof PEAR_Error) {
+ $notification->push($profile);
+ header('Location: ' . 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')));
+ exit;
+}
+
+// Get internal confirmation code
+$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')));
+ exit;
+}
+
+// Check code
+if ($internal_code == $code) {
+ $update = $folks_driver->saveProfile(array('user_status' => 'active', $user));
+ if ($update instanceof PEAR_Error) {
+ $notification->push($update);
+ } else {
+ $notification->push(_("You account is activated, you can login now."), 'horde.success');
+ }
+} else {
+ $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')));
+exit;
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: resetpassword.php 935 2008-09-27 09:37:38Z duck $
+ *
+ * Copyright 2007 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+
+require_once dirname(__FILE__) . '/tabs.php';
+require_once 'Horde/String.php';
+
+// Make sure auth backend allows passwords to be reset.
+$auth = Auth::singleton($conf['auth']['driver']);
+if (!$auth->hasCapability('resetpassword')) {
+ $notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error');
+ header('Location: ' . Auth::getLoginScreen('', Util::getFormData('url')));
+ exit;
+}
+
+$vars = Variables::getDefaultVariables();
+
+$title = _("Reset Your Password");
+$form = new Horde_Form($vars, $title);
+$form->setButtons(_("Continue"));
+
+// Get user security pass
+$user = Util::getFormData('username');
+if ($user) {
+ $u_prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', Auth::addHook($user), '', null, false);
+ $u_prefs->retrieve();
+ $answer = $u_prefs->getValue('security_answer');
+ $question = $u_prefs->getValue('security_question');
+} else {
+ $answer = $prefs->getValue('security_answer');
+ $question = $prefs->getValue('security_question');
+}
+/* Set up the fields for the username and alternate email. */
+$form->addHidden('', 'url', 'text', false);
+$form->addVariable(_("Username"), 'username', 'text', true);
+
+if (!empty($answer)) {
+ if (!empty($question)) {
+ $form->addVariable(_("Please respond to your security question: ") . $question, 'security_question', 'description', true);
+ }
+ $form->addVariable(_("Security answer"), 'security_answer', 'text', true);
+}
+
+/* Validate the form. */
+if ($form->validate()) {
+ $form->getInfo(null, $info);
+
+ /* Get user email. */
+ $email = Folks::getUserEmail($info['username']);
+ if ($email instanceof PEAR_Error) {
+ $notification->push($email);
+ header('Location: ' . Auth::getLoginScreen('', $info['url']));
+ exit;
+ }
+
+ /* Check the given values with the prefs stored ones. */
+ if ((!empty($answer) && String::lower($answer) == String::lower($info['security_answer'])) ||
+ empty($answer)) {
+
+ /* Info matches, so reset the password. */
+ $password = $auth->resetPassword($info['username']);
+ if ($password instanceof PEAR_Error) {
+ $notification->push($password);
+ header('Location: ' . Auth::getLoginScreen('', $info['url']));
+ exit;
+ }
+
+ $body = sprintf(_("Your new password for %s is: %s. \n\n It was requested by %s on %s"),
+ $registry->get('name', 'horde'),
+ $password,
+ $_SERVER['REMOTE_ADDR'],
+ date('Ymd H:i:s'));
+
+ 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']));
+ exit;
+ } else {
+ /* Info submitted does not match what is in prefs, redirect user back
+ * to login. */
+ $notification->push(_("Could not reset the password for the requested user. Some or all of the details are not correct. Try again or contact your administrator if you need further help."), 'horde.error');
+ }
+}
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+require FOLKS_TEMPLATES . '/login/signup.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: signup.php 918 2008-09-25 02:18:59Z duck $
+ *
+ * Copyright 2007 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+
+require_once dirname(__FILE__) . '/tabs.php';
+require_once 'Horde/Auth/Signup.php';
+
+$auth = 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());
+ exit;
+}
+
+$vars = Variables::getDefaultVariables();
+$form = new HordeSignupForm($vars);
+if ($form->validate()) {
+ $form->getInfo(null, $info);
+
+ $signup = new Auth_Signup();
+ $success_message = null;
+
+ if (!$conf['signup']['approve']) {
+ /* User can sign up directly, no intervention necessary. */
+ $success = $signup->addSignup($info);
+ if (!($success instanceof PEAR_Error)) {
+ $success_message = sprintf(_("Added \"%s\" to the system. You can log in now."), $info['user_name']);
+ }
+ } elseif ($conf['signup']['approve']) {
+ /* Insert this user into a queue for admin approval. */
+ $success = $signup->queueSignup($info);
+ if (!($success instanceof PEAR_Error)) {
+ $success_message = sprintf(_("Submitted request to add \"%s\" to the system. You cannot log in until your request has been approved."), $info['user_name']);
+ }
+ }
+
+ if ($info instanceof PEAR_Error) {
+ $username = $vars->get('user_name') ? $vars->get('user_name') : $vars->get('extra[user_name]');
+ $notification->push(sprintf(_("There was a problem adding \"%s\" to the system: %s"), $username, $info->getMessage()), 'horde.error');
+ } elseif ($success instanceof PEAR_Error) {
+ $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']);
+ header('Location: ' . $url);
+ exit;
+ }
+}
+
+$title = _("Sign up");
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+require FOLKS_TEMPLATES . '/login/signup.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: tabs.php 918 2008-09-25 02:18:59Z duck $
+ *
+ * Copyright 2007 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+
+define('AUTH_HANDLER', true);
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+$auth = Auth::singleton($conf['auth']['driver']);
+
+$vars = Variables::getDefaultVariables();
+$tabs = new Horde_UI_Tabs('what', $vars);
+$tabs->addTab(_("Login"), Horde::applicationUrl('login.php'), 'login');
+
+if ($conf['signup']['allow'] === true && $auth->hasCapability('add')) {
+ $tabs->addTab(_("Don't have an account? Sign up."), Horde::applicationUrl('account/signup.php'), 'signup');
+}
+
+if ($auth->hasCapability('resetpassword')) {
+ $tabs->addTab(_("Forgot your password?"), Horde::applicationUrl('account/resetpassword.php'), 'resetpassword');
+}
+
+$tabs->addTab(_("Forgot your username?"), Horde::applicationUrl('account/username.php'), 'username');
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: username.php 915 2008-09-25 01:36:49Z duck $
+ *
+ * Copyright 2007 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+
+require_once dirname(__FILE__) . '/tabs.php';
+
+$vars = Variables::getDefaultVariables();
+
+$title = _("Forgot your username?");
+$form = new Horde_Form($vars, $title);
+$form->setButtons(_("Send me my username"));
+$form->addVariable(_("Your email"), 'email', 'email', true);
+
+/* Validate the form. */
+if ($form->validate()) {
+ $form->getInfo(null, $info);
+
+ $users = $folks_driver->getUsers(array('email' => $info['email']));
+ if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ } elseif (empty($users) || count($users) != 1) {
+ $notification->push(_("Could not find any username with this email."), 'horde.warning');
+ } else {
+ $users = current($users);
+
+ $body = sprintf(_("Your username on %s %s is: %s. \n\n It was requested by %s on %s"),
+ $registry->get('name', 'horde'),
+ Horde::url($registry->get('webroot', 'horde'), true),
+ $users['user_uid'],
+ $_SERVER['REMOTE_ADDR'],
+ date('Ymd H:i:s'));
+
+ 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']));
+ exit;
+ }
+}
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+require FOLKS_TEMPLATES . '/login/signup.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: activity.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+$title = _("Activity");
+
+$count = $folks_driver->countUsers();
+if ($count instanceof PEAR_Error) {
+ $notification->push($count);
+ $count = 0;
+}
+
+$page = Util::getGet('page', 0);
+$perpage = $prefs->getValue('per_page');
+$criteria = array('sort_by' => 'activity', 'sort_dir' => 0);
+$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
+if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ $users = array();
+}
+
+$vars = Variables::getDefaultVariables();
+$pager = new Horde_UI_Pager('page',
+ $vars, array('num' => $count,
+ 'url' => 'activity.php',
+ 'perpage' => $perpage));
+
+$pager->preserve($criteria);
+$list_url = Folks::getUrlFor('list', 'activity');
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+require FOLKS_TEMPLATES . '/list/list.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: birthday.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+$title = _("Birthday");
+
+$count = $folks_driver->countUsers(array('birthday' => date('-m-d')));
+if ($count instanceof PEAR_Error) {
+ $notification->push($count);
+ $count = 0;
+}
+
+if (($sort_by = Util::getFormData('sort_by')) !== null) {
+ $prefs->setValue('sort_by', $sort_by);
+} else {
+ $sort_by = $prefs->getValue('sort_by');
+}
+
+if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+ $prefs->setValue('sort_dir', $sort_dir);
+} else {
+ $sort_dir = $prefs->getValue('sort_dir');
+}
+
+$page = Util::getGet('page', 0);
+$perpage = $prefs->getValue('per_page');
+$criteria = array('birthday' => date('-m-d'), 'sort_by' => $sort_by, 'sort_dir' => $sort_dir);
+$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
+if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ $users = array();
+}
+
+$vars = Variables::getDefaultVariables();
+$pager = new Horde_UI_Pager('page',
+ $vars, array('num' => $count,
+ 'url' => 'birthday.php',
+ 'perpage' => $perpage));
+
+$pager->preserve($criteria);
+$list_url = Folks::getUrlFor('list', 'birthday');
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+require FOLKS_TEMPLATES . '/list/list.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<!-- $Horde: folks/config/conf.xml,v 1.3 2005/02/23 17:28:43 jan Exp $ -->
+<configuration>
+ <configtab name="storage" desc="Storage">
+ <configsection name="storage">
+ <configswitch name="driver" desc="What storage driver should we use?">sql
+ <case name="sql" desc="SQL">
+ <configsection name="params">
+ <configsql switchname="driverconfig">
+ <configstring name="table" desc="Database
+ table">folks_users</configstring>
+ <configstring name="friends" desc="Database
+ friends table">folks_friends</configstring>
+ <configstring name="online" desc="Database
+ online table">folks_online</configstring>
+ <configstring name="search" desc="Database
+ search table">folks_search</configstring>
+ <configstring name="search" desc="Database
+ search table">folks_search</configstring>
+ <configstring name="activity" desc="Database
+ activity table">folks_activity</configstring>
+ </configsql>
+ </configsection>
+ </case>
+ </configswitch>
+ </configsection>
+</configtab>
+
+<configtab name="general" desc="General">
+ <configstring name="support" desc="Email from which support messages will be sent">support@example.com</configstring>
+ <configenum name="friends" desc="Driver for friends storage">sql
+ <values>
+ <value desc="Internal - friends and blacklist only">sql</value>
+ <value desc="Internal - shared lists">shared</value>
+ <value desc="Letter app">letter</value>
+ </values>
+ </configenum>
+
+ <configsection name="images">
+ <configheader>Images</configheader>
+ <configvfs switchname="type">horde
+ </configvfs>
+ <configstring name="direct" desc="If should images be viewed directly out of
+ the VFS, specify the alias pointing to the right place on your filesystem
+ defined in your webserver. Example: /folks-images">/folks-images</configstring>
+ <configenum name="image_type" desc="What format should images be generated in? Make
+ sure that your server supports whichever format you choose!">png
+ <values>
+ <value desc="JPEG">jpeg</value>
+ <value desc="PNG">png</value>
+ </values>
+ </configenum>
+ <configinteger name="thumbnail_width" desc="Thumbnail width">80</configinteger>
+ <configinteger name="thumbnail_height" desc="Thumbnail height">80</configinteger>
+ <configinteger name="screen_width" desc="Screen width">300</configinteger>
+ <configinteger name="screen_height" desc="Screen height">300</configinteger>
+ </configsection>
+ </configtab>
+
+ <configsection name="online">
+ <configheader>Online users</configheader>
+ <configinteger name="ttl" desc="How long (in seconds) should we cache the user list?">300</configinteger>
+ <configboolean name="autoupdate" desc="Auto update users' last-click time?">false</configboolean>
+ <configboolean name="autodelete" desc="Use the application internally (rather than Cron) to delete users?">true</configboolean>
+ </configsection>
+
+ <configsection name="services">
+ <configheader>Services</configheader>
+ <configboolean name="countcron" desc="Is Cron set to update user counts?
+ Content will not be counted during page loads.">false</configboolean>
+ <configmultienum name="ignore" desc="Select applications that should be
+ ignored in services">
+ <values>
+ <configspecial name="list-horde-apps" />
+ </values>
+ </configmultienum>
+ </configsection>
+
+ <configtab name="comments" desc="Comments">
+ <configsection name="comments">
+ <configenum name="allow" desc="Can users comment on news stories?">authenticated
+ <values>
+ <value desc="Authenticated users">authenticated</value>
+ <value desc="No one">never</value>
+ <value desc="All">all</value>
+ </values>
+ </configenum>
+ <configstring name="comment_template" desc="Template file to use for rendering comments." required="false"></configstring>
+ </configsection>
+ </configtab>
+
+ <configtab name="login" desc="Login">
+ <configsection name="login">
+ <configheader>Login System</configheader>
+ <configinteger name="tries" desc="Login tries after which show CAPTCHA?" required="false">3</configinteger>
+ <configinteger name="diff" desc="Minumum number of seconds between logins attempts?" required="false">2</configinteger>
+ <configboolean name="prelogin" desc="Pass the app submitted information
+ through the prelogin function in hooks.php before
+ processing the login?">false</configboolean>
+ </configsection>
+ </configtab>
+
+ <configtab name="report_content" desc="Content Reporting">
+ <configsection name="report_content">
+ <configheader>Content Reporting Settings</configheader>
+ <configswitch name="driver" desc="Driver to use">false
+ <case name="false" desc="Disable">
+ </case>
+ <case name="tickets" desc="Tickets (Whups)">
+ <configphp name="ticket_params" desc="Enter as a PHP array any
+ additional arguments for the created ticket (queue, state, priority,
+ etc). Example for Whups: array('queue' => 2, 'state' => 1, 'priority' => 1,
+ 'type' => 1). You will need to look up the appropriate IDs in Whups's
+ database, or whatever is appropriate for the ticket system you are
+ using.">array()</configphp>
+ <configenum name="allow" desc="Who should be allowed to report
+ inappropriate content?">all
+ <values>
+ <value desc="All users">all</value>
+ <value desc="Authenticated users">authenticated</value>
+ <value desc="Never">never</value>
+ </values>
+ </configenum>
+ </case>
+ <case name="mail" desc="Email">
+ <configstring name="email" desc="Where should problem report emails be
+ sent?">webmaster@example.com</configstring>
+ <configstring name="maildomain" desc="If Horde cannot determine a user's
+ email address, this domain will be appended to their
+ username.">example.com</configstring>
+ <configstring name="username" required="false" desc="If requiring SMTP
+ authentication without a global SMTP user (in section "Mailer"
+ and allowing problem reporting for not authenticated users (in section
+ "Menu Settings"), what username should be use for SMTP
+ authentication?"/>
+ <configstring name="password" required="false" desc="The password to use"/>
+ <configenum name="allow" desc="Who should be allowed to report problems?">all
+ <values>
+ <value desc="All users">all</value>
+ <value desc="Authenticated users">authenticated</value>
+ <value desc="Never">never</value>
+ </values>
+ </configenum>
+ </case>
+ <case name="letter" desc="Send internal messages (Letter)">
+ <configlist name="users" desc="Username to receive these messages. If none, Folks admins will be used." />
+ <configenum name="allow" desc="Who should be allowed to report problems?">all
+ <values>
+ <value desc="All users">all</value>
+ <value desc="Authenticated users">authenticated</value>
+ <value desc="Never">never</value>
+ </values>
+ </configenum>
+ </case>
+ </configswitch>
+ </configsection>
+ </configtab>
+
+ <configtab name="menu" desc="Menu">
+ <configsection name="menu">
+ <configmultienum name="apps" desc="Select any applications that should be linked in Folks's menu">
+ <values>
+ <configspecial name="list-horde-apps" />
+ </values>
+ </configmultienum>
+ </configsection>
+ </configtab>
+
+</configuration>
--- /dev/null
+<?php
+/**
+ * $Id: hooks.php 747 2008-08-18 07:46:33Z duck $
+ *
+ * Folks Hooks configuration file.
+ *
+ * THE HOOKS PROVIDED IN THIS FILE ARE EXAMPLES ONLY. DO NOT ENABLE THEM
+ * BLINDLY IF YOU DO NOT KNOW WHAT YOU ARE DOING. YOU HAVE TO CUSTOMIZE THEM
+ * TO MATCH YOUR SPECIFIC NEEDS AND SYSTEM ENVIRONMENT.
+ *
+ * For more information please see the horde/config/hooks.php.dist file.
+ */
+
+// Example count used data hook function. Thera are two examples. One as
+// registry calls and one much faster with direct DB access but requres your
+// monitorig for application structure changes.
+
+// if (!function_exists('_folks_hook_countService')) {
+//
+// function _folks_hook_countService($service, $user)
+// {
+// switch ($service) {
+//
+// case 'videos':
+// return $GLOBALS['registry']->callByPackage('oscar', 'countVideos', array(array('author' => $user)));
+//
+// case 'attendances':
+// return $GLOBALS['registry']->callByPackage('schedul', 'countUserAttendances', array(array('user' => $user)));
+//
+// case 'news':
+// return $GLOBALS['registry']->callByPackage('news', 'countNews', array(array('user' => $user)));
+//
+// case 'wishes':
+// $result = $GLOBALS['registry']->callByPackage('genie', 'listUserItems', array($user));
+// if ($result instanceof PEAR_Error) {
+// return $result;
+// } else {
+// return count($result);
+// }
+//
+// case 'galleries':
+// return $GLOBALS['registry']->callByPackage('ansel', 'countGalleries', array('ansel', PERMS_SHOW, $user));
+//
+// case 'blogs':
+// return $GLOBALS['registry']->callByPackage('thomas', 'countPosts', array(array('user' => $user)));
+//
+// case 'classifieds':
+// return $GLOBALS['registry']->callByPackage('classified', 'countAds', array(array('user_uid' => $user)));
+//
+// default:
+// return 0;
+// }
+//
+// }
+// }
+//
+// if (!function_exists('_folks_hook_countService')) {
+//
+// function _folks_hook_countService($service, $user)
+// {
+// switch ($service) {
+//
+// case 'videos':
+// $query = 'SELECT COUNT(*) AS count FROM oscar_videos WHERE video_user = "' . $user . '" AND video_status = 6 ORDER BY video_user DESC LIMIT 1';
+// $result = mysql_query($query);
+// $count = mysql_fetch_row($result);
+// return $count[0];
+//
+// case 'attendances':
+// $query = 'SELECT COUNT(*) FROM schedul s, schedul_attendance a WHERE s.ondate >= NOW() AND a.user_id = "' . $user . '" AND s.id = a.schedul_id';
+// $result = mysql_query($query);
+// $count = mysql_fetch_row($result);
+// return $count[0];
+//
+// case 'news':
+// $query = 'SELECT COUNT(*) AS count FROM news WHERE user = "' . $user . '" AND status = 1';
+// $result = mysql_query($query);
+// $count = mysql_fetch_row($result);
+// return $count[0];;
+//
+// case 'wishes':
+// $query = 'SELECT COUNT(*) AS count FROM genie_wishes WHERE wish_owner = "' . $user . '" AND wish_purchased = 0';
+// $result = mysql_query($query);
+// $count = mysql_fetch_row($result);
+// return $count[0];
+//
+// case 'galleries':
+// $query = 'SELECT COUNT(*) AS count FROM ansel_shares WHERE share_owner = "' . $user . '" AND attribute_passwd IS NULL AND perm_default = 6';
+// $result = mysql_query($query);
+// $count = mysql_fetch_row($result);
+// return $count[0];
+//
+// case 'blogs':
+// $query = 'SELECT COUNT(*) AS count FROM thomas_blogs WHERE user_uid = "' . $user . '" AND status = 1 AND created <= NOW() ORDER BY user_uid DESC LIMIT 1';
+// $result = mysql_query($query);
+// $count = mysql_fetch_row($result);
+// return $count[0];
+//
+// case 'classifieds':
+// $query = 'SELECT COUNT(*) AS count FROM classified_ads WHERE user_uid = "' . $user . '"'
+// . ' AND ad_active = 4 AND ad_validto > UNIX_TIMESTAMP() ORDER BY user_uid DESC LIMIT 1';
+// $result = mysql_query($query);
+// $count = mysql_fetch_row($result);
+// return $count[0];
+//
+// default:
+// return 0;
+// }
+//
+// }
+// }
+
+// Example get data hook function. Thera are two examples. One as
+// registry calls and one much faster with direct DB access but requres your
+// monitorig for application structure changes.
+
+// if (!function_exists('_folks_hook_getService')) {
+// function _folks_hook_getService($service, $user)
+// {
+// switch ($service) {
+//
+// case 'videos':
+// return $GLOBALS['registry']->callByPackage('oscar', 'listVideos', array(array('author' => $user, 0, 3)));
+//
+// case 'attendances':
+// return $GLOBALS['registry']->callByPackage('schedul', 'getUserAttendances', array($user));
+//
+// case 'news':
+// return $GLOBALS['registry']->callByPackage('news', 'listNews', array(array('user' => $user), 0, 3));
+//
+// case 'wishes':
+// return $GLOBALS['registry']->callByPackage('genie', 'listUserItems', array($user));
+//
+// case 'galleries':
+// 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));
+//
+// case 'classifieds':
+// return $GLOBALS['registry']->callByPackage('classified', 'listAds', array(array('user_uid' => $user), 0, 3));
+//
+// default:
+// return array();
+// }
+//
+//
+// if (!function_exists('_folks_hook_getService')) {
+// function _folks_hook_getService($service, $user)
+// {
+// switch ($service) {
+//
+// case 'videos':
+// $query = 'SELECT video_id, video_title, video_comments, video_description FROM oscar_videos WHERE video_user = "' . $user . '"'
+// . ' AND video_status = 6 AND video_created <= ' . $_SERVER["REQUEST_TIME"]
+// . ' ORDER BY video_id DESC LIMIT 6';
+// break;
+//
+// case 'attendances':
+// $query = 'SELECT s.id, UNIX_TIMESTAMP(s.ondate) AS ondate, b.place, b.city, b.short '
+// . ' FROM schedul s, schedul_attendance a, schedul_body b '
+// . ' WHERE s.ondate >= NOW() AND a.user_id = "' . $user . '" AND s.id = a.schedul_id AND b.lang = "sl_SI" AND s.id=b.id LIMIT 3';
+// break;
+//
+// case 'news':
+// $query = 'SELECT n.id, n.publish, n.user, n.category1, n.category2, n.comments, n.picture,'
+// . ' n.chars, l.title, l.abbreviation FROM news AS n, news_body AS l '
+// . ' WHERE n.id = l.id AND l.lang = "sl_SI" AND n.publish <= NOW() AND n.status = 1 '
+// . ' AND n.user = "' . $user . '" ORDER BY n.publish DESC LIMIT 3';
+// break;
+//
+// case 'wishes':
+// $query = 'SELECT wish_id as id, wish_name as `name`, wish_desc as `desc` FROM genie_wishes WHERE wish_owner = "' . $user . '" AND wish_purchased = 0 ORDER BY wish_id DESC LIMIT 3';
+// break;
+//
+// case 'galleries':
+// $query = 'SELECT * FROM ansel_shares WHERE share_owner = "' . $user . '" AND attribute_passwd IS NULL AND perm_default = 6 ORDER BY share_id DESC LIMIT 6';
+// break;
+//
+// case 'blogs':
+// $query = 'SELECT id, title, created, trackbacks, summary, tags, comments, view_count, chars, '
+// . ' category, rating_sum, rating_count FROM thomas_blogs WHERE user_uid = "' . $user . '" ORDER BY created DESC LIMIT 3';
+// break;
+//
+// case 'classifieds':
+// $query = 'SELECT ad_id, ad_title, ad_type, ad_price, ad_active, ad_image, ad_category,'
+// . ' ad_validto, created, updated, sponsored FROM classified_ads WHERE user_uid = "' . $user . '"'
+// . ' AND ad_active = 4 AND ad_validto > UNIX_TIMESTAMP() ORDER BY updated DESC LIMIT 3';
+// break;
+//
+// default:
+// return array();
+// }
+//
+// global $conf;
+// $conn = mysql_connect($conf['sql']['hostspec'], $conf['sql']['username']);
+// mysql_select_db('horde', $conn);
+//
+// $result = mysql_query($query);
+// $data = array();
+// while ($r = mysql_fetch_assoc($result)) {
+// $data[] = $r;
+// }
+//
+// return $data;
+// }
+// }
+
+// This hook is called when a user tries to login
+// Perorm some actions before redirecting to various services
+// In the example checks if users is in a group that allows this
+// paid service and perform autologin or redirect to a wikipage with
+// additional information
+
+// if (!function_exists('_folks_hook_prelogin')) {
+//
+// function _folks_hook_prelogin($app)
+// {
+// require_once 'Horde/Group.php';
+// $group = Group::singleton();
+// $user_uid = Auth::getAuth();
+//
+// switch ($app) {
+//
+// case 'gollem':
+//
+// if (Auth::isAdmin() || $group->userIsInGroup($user_uid, 1, false)) {
+// $_GET['backend_key'] = 'kjbnzi78';
+// require $GLOBALS['registry']->get('fileroot', 'gollem') . '/redirect.php';
+// exit;
+// } else {
+// header('Location: ' . $GLOBALS['registry']->link('wiki/show', array('page' => 'PaidFiles')));
+// exit;
+// }
+// break;
+//
+// case 'imp':
+//
+// if (Auth::isAdmin()
+// || $group->userIsInGroup($user_uid, 1, false)
+// || $group->userIsInGroup($user_uid, 2, false)) {
+//
+// $db = DB::connect($GLOBALS['conf']['sql']);
+// $password = $db->getOne('SELECT password FROM mails.accountuser WHERE username = ?', array($user_uid . '@HOST'));
+//
+// $GLOBALS['authentication'] = 'none';
+// $GLOBALS['noset_view'] = true;
+// require_once $GLOBALS['registry']->get('fileroot', 'imp') . '/lib/base.php';
+// require_once IMP_BASE . '/lib/Session.php';
+// $server = IMP_Session::getAutoLoginServer(true);
+//
+// $try = IMP_Session::createSession($user_uid, $password, $server);
+// if ($try === true) {
+// if ($GLOBALS['browser']->isMobile()) {
+// require $GLOBALS['registry']->get('fileroot', 'mimp') . '/mailbox.php';
+// } else {
+// require $GLOBALS['registry']->get('fileroot', 'imp') . '/redirect.php';
+// }
+// } else {
+// $notification->push(_("There was an error login into your mail account."));
+// header('Location: ' . $GLOBALS['registry']->get('webroot', 'folks') . 'login.php');
+// }
+// } else {
+// header('Location: ' . $GLOBALS['registry']->link('wiki/show', array('page' => 'MailAccount')));
+// }
+//
+// exit;
+//
+// break;
+// }
+// }
+// }
+
+
+// This hook is called when a user submits a signup request. It allows
+// a chance to alter or validate the data submitted by a user before any
+// attempts are made to add them to the system. Here we lowecase the useranme
+// and check if username or email is already taken
+
+// if (!function_exists('_horde_hook_signup_preprocess')) {
+// function _horde_hook_signup_preprocess($info)
+// {
+// if (isset($info['extra']['username'])) {
+// $info['extra']['username'] = String::lower($info['extra']['username']);
+// $username = $info['extra']['username'];
+// } else {
+// $info['user_name'] = String::lower($info['user_name']);
+// $username = $info['user_name'];
+// }
+//
+// if (!eregi("^[_a-z0-9-]*$", $username)) {
+// return PEAR::raiseError(_("Username can contain only alphanumeric characters, underscore and minus."));
+// }
+//
+// $_db = DB::connect($GLOBALS['conf']['sql'], true);
+//
+// $query = 'SELECT user_uid, user_email FROM folks_users WHERE user_uid = ? OR user_email = ?';
+// $result = $_db->getRow($query, array($username, $info['extra']['email']), DB_FETCHMODE_ASSOC);
+//
+// if ($result instanceof PEAR_Error) {
+// return $result;
+// } elseif (empty($result)) {
+// return $info;
+// } elseif ($result['user_uid'] == $username) {
+// return PEAR::raiseError(_("There is already an user registered with this username"));
+// } elseif ($result['user_email'] == $info['extra']['email']) {
+// return PEAR::raiseError(_("There is already an user registered with this email"));
+// }
+//
+// return $info;
+// }
+// }
+
+// Following on from the example in the above function, this is how a sample
+// _horde_hook_signup_addextra function would look like.
+// Here we connect to the database and update folks user table
+// with additional user data and send confirmation code to check his email
+
+// if (!function_exists('_horde_hook_signup_addextra')) {
+// function _horde_hook_signup_addextra($userID, $extra)
+// {
+// global $conf;
+//
+// $_db = DB::connect($conf['sql']);
+// $fields = array();
+// $values = array();
+// foreach ($extra as $field => $value) {
+// if ($field == 'user_name') {
+// continue;
+// }
+// if ($field == 'password') {
+// $value = md5($value);
+// }
+// $fields[] = 'user_' . String::lower($field);
+// $values[] = String::convertCharset($value, NLS::getCharset(), $conf['sql']['charset']);
+// }
+//
+// $values[] = $userID;
+// $query = 'UPDATE folks_users SET ' . implode(' = ?, ', $fields) . ' = ? '
+// . ' WHERE user_uid = ?';
+//
+// $result = $_db->query($query, $values);
+// if ($result instanceof PEAR_Error) {
+// return $result;
+// }
+//
+// require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/Folks.php';
+// $code = Folks::encodeString($userID, 'activate' . md5($extra['password']));
+// $link = Util::addParameter(Horde::applicationUrl('account/approve.php', true, -1),
+// array('user' => $userID, 'code' => $code),
+// null, false);
+//
+// $body = sprintf(_("Your username on %s %s is: %s. \n\n Please confirm the registration by going to this link \n %s"),
+// $GLOBALS['registry']->get('name', 'horde'),
+// Horde::url($GLOBALS['registry']->get('webroot', 'horde'), true),
+// $user['user_uid'],
+// $link);
+//
+// $result = Folks::sendMail($extra['email'], _("Confirmation code"), $body);
+// if ($result instanceof PEAR_Error) {
+// $_db->query('DELETE FROM folks_users WHERE user_uid = ?', array($userID));
+// }
+//
+// return $result;
+// }
+// }
+
+// This is an example of a post-push hook; it is called right after an
+// application is pushed successfully onto the app stack. Here we check
+// If the user has a authentication cookie code. Compara it with one in DB
+// and autologin the user.
+
+// if (!function_exists('_horde_hook_post_pushapp')) {
+// function _horde_hook_post_pushapp($app)
+// {
+// if ($app != 'horde' ||
+// !isset($_COOKIE['folks_login_code']) ||
+// !isset($_COOKIE['folks_login_user'])) {
+// return;
+// }
+//
+// $user = Auth::getAuth();
+// if ($user) {
+// return;
+// }
+//
+// $conn = mysql_connect($GLOBALS['conf']['sql']['hostspec'],
+// $GLOBALS['conf']['sql']['username'],
+// $GLOBALS['conf']['sql']['password']);
+//
+// $query = 'SELECT user_password FROM '
+// . $GLOBALS['conf']['sql']['database']
+// . '.folks_users WHERE user_uid = "'
+// . $_COOKIE['folks_login_user'] . '"';
+//
+// $result = mysql_query($query);
+// $r = mysql_fetch_assoc($result);
+//
+// if (mysql_num_rows($result) == 0) {
+// return;
+// }
+//
+// $key = date('m') . $r['user_password'];
+// require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/Folks.php';
+// if ($_COOKIE['folks_login_code'] != Folks::encodeString($_COOKIE['folks_login_user'], $key)) {
+// return;
+// }
+//
+// $auth = &Auth::singleton('folks');
+// return $auth->setAuth($_COOKIE['folks_login_user'], array('transparent' => 1, 'password' => null));
+// }
+// }
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: prefs.php 233 2008-01-14 15:34:50Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+$prefGroups['Preview'] = array(
+ 'column' => _("Preview"),
+ 'label' => _("How to preview users"),
+ 'desc' => _("Set users preview paramaters"),
+ 'members' => array('sort_by', 'sort_dir', 'per_page')
+);
+
+$prefGroups['Settings'] = array(
+ 'column' => _("Settings"),
+ 'label' => _("Modify account preferences"),
+ 'desc' => _("Set account action details"),
+ 'members' => array('login_notify', 'friends_approval')
+);
+
+$prefGroups['Activities'] = array(
+ 'column' => _("Settings"),
+ 'label' => _("Activity log"),
+ 'desc' => _("Set activity prefetences"),
+ 'members' => array('log_user_comments', 'log_account_changes', 'log_scopes', 'log_scope_comments')
+);
+
+$_prefs['sort_by'] = array(
+ 'value' => 'user_uid',
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'enum',
+ 'enum' => array('user_uid' => _("Username")),
+ 'desc' => _("Sort by")
+);
+
+$_prefs['sort_dir'] = array(
+ 'value' => 1,
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'enum',
+ 'enum' => array(0 => _("Descesending"),
+ 1 => _("Ascesending")),
+ 'desc' => _("Sort by")
+);
+
+$_prefs['per_page'] = array(
+ 'value' => 20,
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'number',
+ 'desc' => _("Number of users perpage")
+);
+
+$_prefs['login_notify'] = array(
+ 'value' => 1,
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'enum',
+ 'enum' => array(0 => _("No"),
+ 1 => _("Yes")),
+ 'desc' => _("Notify friends that I loged in")
+);
+
+$_prefs['friends_approval'] = array(
+ 'value' => 1,
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'enum',
+ 'enum' => array(0 => _("No"),
+ 1 => _("Yes")),
+ 'desc' => _("Require my confirmation if someone would like to add me to his freidn list.")
+);
+
+$_prefs['log_user_comments'] = array(
+ 'value' => 1,
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'enum',
+ 'enum' => array(0 => _("No"),
+ 1 => _("Yes")),
+ 'desc' => _("Log when we comment a user?")
+);
+
+$_prefs['log_account_changes'] = array(
+ 'value' => 1,
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'enum',
+ 'enum' => array(0 => _("No"),
+ 1 => _("Yes")),
+ 'desc' => _("Log account changes?")
+);
+
+$apps = array();
+foreach ($GLOBALS['registry']->listApps() as $app) {
+ $apps[$app] = $GLOBALS['registry']->get('name', $app);
+}
+asort($apps);
+
+$_prefs['log_scopes'] = array(
+ 'value' => 'a:0:{}',
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'multienum',
+ 'enum' => $apps,
+ 'desc' => _("Application you would like NOT to log your activitiy when you post a new PUBLIC CONTENT.")
+);
+
+foreach ($apps as $app) {
+ if (!$GLOBALS['registry']->hasMethod('commentCallback', $app)) {
+ unset($apps[$app]);
+ }
+}
+
+$_prefs['log_scope_comments'] = array(
+ 'value' => 'a:0:{}',
+ 'locked' => false,
+ 'shared' => true,
+ 'type' => 'multienum',
+ 'enum' => $apps,
+ 'desc' => _("Application you would like NOT to log activitiy when you post a new PUBLIC COMMENT")
+);
--- /dev/null
+---
+0.1
+---
+
+[xyz] Initial Release
--- /dev/null
+===========================
+ Folks Development Team
+===========================
+
+
+Core Developers
+===============
+Duck <duck@obala.net>
+Jan Zagar <jan.zagar@siol.net>
+
+
+Drivers
+=======
+Duck <duck@obala.net>
+
+
+Localization
+============
+
+===================== ======================================================
+===================== ======================================================
+Slovenian Duck <duck@obala.net>
+
+Contributions
+=============
+
--- /dev/null
+=========================
+ Installing Folks 1.0
+=========================
+
+:Last update: $Date: 2007-12-14 17:44:26 $
+:Revision: $Revision: 1.16 $
+
+.. contents:: Contents
+.. section-numbering::
+
+This document contains instructions for installing the Folks ...
+
+For information on the capabilities and features of Folks, see the file
+README_ in the top-level directory of the Folks distribution.
+
+
+Obtaining Folks
+==================
+
+Folks can be obtained from the Horde website and FTP server, at
+
+ http://www.horde.org/folks/
+
+ ftp://ftp.horde.org/pub/folks/
+
+Or use the mirror closest to you:
+
+ http://www.horde.org/mirrors.php
+
+Bleeding-edge development versions of Folks are available via CVS; see the
+file `horde/docs/HACKING`_ in the Horde distribution, or the website
+http://www.horde.org/source/, for information on accessing the Horde CVS
+repository.
+
+
+Prerequisites
+=============
+
+To function properly, Folks **requires** the following:
+
+1. A working Horde installation.
+
+ Folks runs within the `Horde Application Framework`_, a set of common
+ tools for Web applications written in PHP. You must install Horde before
+ installing Folks.
+
+ .. Important:: Folks 1.0 requires version 3.0+ of the Horde Framework -
+ earlier versions of Horde will **not** work.
+
+ .. _`Horde Application Framework`: http://www.horde.org/horde/
+
+ The Horde Framework can be obtained from the Horde website and FTP server,
+ at
+
+ http://www.horde.org/horde/
+
+ ftp://ftp.horde.org/pub/horde/
+
+ Many of Folks's prerequisites are also Horde prerequisites.
+
+ .. Important:: Be sure to have completed all of the steps in the
+ `horde/docs/INSTALL`_ file for the Horde Framework before
+ installing Folks.
+
+2. The following PHP capabilities:
+
+ a. FOO support ``--with-foo`` [OPTIONAL]
+
+ Description of Foo and what it is used for.
+
+3. The following PEAR packages:
+ (See `horde/docs/INSTALL`_ for instructions on installing PEAR packages)
+
+ a. PEAR_Package x.x.x [OPTIONAL]
+
+ Folks uses the Foo_Bar class for...
+
+4. The following PECL modules:
+ (See `horde/docs/INSTALL`_ for instructions on installing PECL modules)
+
+ a. pecl_package x.x.x [OPTIONAL]
+
+ pecl_package is required to...
+
+5. Something else.
+
+The following items are not required, but are strongly **recommended**:
+
+1. Yet something else.
+
+
+Installing Folks
+===================
+
+Folks is written in PHP, and must be installed in a web-accessible
+directory. The precise location of this directory will differ from system to
+system. Conventionally, Folks is installed directly underneath Horde in the
+web server's document tree.
+
+Since Folks is written in PHP, there is no compilation necessary; simply
+expand the distribution where you want it to reside and rename the root
+directory of the distribution to whatever you wish to appear in the URL. For
+example, with the Apache web server's default document root of
+``/usr/local/apache/htdocs``, you would type::
+
+ cd /usr/local/apache/htdocs/horde
+ tar zxvf /path/to/folks-h3-x.y.z.tar.gz
+ mv folks-h3-x.y.z folks
+
+and would then find Folks at the URL::
+
+ http://your-server/horde/folks/
+
+
+Configuring Folks
+====================
+
+1. Configuring Horde for Folks
+
+ a. Register the application
+
+ In ``horde/config/registry.php``, find the ``applications['folks']``
+ stanza. The default settings here should be okay, but you can change
+ them if desired. If you have changed the location of Folks relative
+ to Horde, either in the URL, in the filesystem or both, you must update
+ the ``fileroot`` and ``webroot`` settings to their correct values.
+
+2. Creating the database tables
+
+ The specific steps to create Folks's database tables depend on which
+ database you've chosen to use.
+
+ First, look in ``scripts/sql/`` to see if a script already exists for your
+ database type. If so, you should be able to simply execute that script as
+ superuser in your database. (Note that executing the script as the "horde"
+ user will probably fail when granting privileges.)
+
+ If such a script does not exist, you'll need to build your own, using the
+ file ``folks.sql`` as a starting point. If you need assistance in
+ creating database tables, you may wish to let us know on the Folks
+ mailing list.
+
+ You will also need to make sure that the "horde" user in your database has
+ table-creation privileges, so that the tables that `PEAR DB`_ uses to
+ provide portable sequences can be created.
+
+ .. _`PEAR DB`: http://pear.php.net/DB
+
+3. Configuring Folks
+
+ To configure Folks, change to the ``config/`` directory of the installed
+ distribution, and make copies of all of the configuration ``dist`` files
+ without the ``dist`` suffix::
+
+ cd config/
+ for foo in *.dist; do cp $foo `basename $foo .dist`; done
+
+ Or on Windows::
+
+ copy *.dist *.
+
+ Documentation on the format and purpose of those files can be found in each
+ file. You may edit these files if you wish to customize Folks's
+ appearance and behavior. With one exception (``foo.php``) the defaults will
+ be correct for most sites.
+
+ You must login to Horde as a Horde Administrator to finish the
+ configuration of Folks. Use the Horde ``Administration`` menu item to
+ get to the administration page, and then click on the ``Configuration``
+ icon to get the configuration page. Select ``Folks Name`` from the
+ selection list of applications. Fill in or change any configuration values
+ as needed. When done click on ``Generate Folks Name Configuration`` to
+ generate the ``conf.php`` file. If your web server doesn't have write
+ permissions to the Folks configuration directory or file, it will not be
+ able to write the file. In this case, go back to ``Configuration`` and
+ choose one of the other methods to create the configuration file
+ ``folks/config/conf.php``.
+
+ Note for international users: Folks uses GNU gettext to provide local
+ translations of text displayed by applications; the translations are found
+ in the ``po/`` directory. If a translation is not yet available for your
+ locale (and you wish to create one), see the ``horde/po/README`` file, or
+ if you're having trouble using a provided translation, please see the
+ `horde/docs/TRANSLATIONS`_ file for instructions.
+
+4. More instructions, upgrading, securing, etc.
+
+5. Testing Folks
+
+ Once you have configured Folks, bring up the included test page in your
+ Web browser to ensure that all necessary prerequisites have been met. See
+ the `horde/docs/INSTALL`_ document for further details on Horde test
+ scripts. If you installed Folks as described above, the URL to the test
+ page would be::
+
+ http://your-server/horde/folks/test.php
+
+ The test script will also allow you to test...
+
+ Next, use Folks to.... Test at least the following:
+
+ - Foo
+ - Bar
+
+
+Known Problems
+==============
+
+...
+
+
+Obtaining Support
+=================
+
+If you encounter problems with Folks, help is available!
+
+The Horde Frequently Asked Questions List (FAQ), available on the Web at
+
+ http://www.horde.org/faq/
+
+The Horde Project runs a number of mailing lists, for individual applications
+and for issues relating to the project as a whole. Information, archives, and
+subscription information can be found at
+
+ http://www.horde.org/mail/
+
+Lastly, Horde developers, contributors and users may also be found on IRC,
+on the channel #horde on the Freenode Network (irc.freenode.net).
+
+Please keep in mind that Folks is free software written by volunteers.
+For information on reasonable support expectations, please read
+
+ http://www.horde.org/support.php
+
+Thanks for using Folks!
+
+The Folks team
+
+
+.. _README: ?f=README.html
+.. _`horde/docs/HACKING`: ../../horde/docs/?f=HACKING.html
+.. _`horde/docs/INSTALL`: ../../horde/docs/?f=INSTALL.html
+.. _`horde/docs/TRANSLATIONS`: ../../horde/docs/?f=TRANSLATIONS.html
--- /dev/null
+<?php
+/**
+ * Release focus. Possible values:
+ * 0 - N/A
+ * 1 - Initial freshmeat announcement
+ * 2 - Documentation
+ * 3 - Code cleanup
+ * 4 - Minor feature enhancements
+ * 5 - Major feature enhancements
+ * 6 - Minor bugfixes
+ * 7 - Major bugfixes
+ * 8 - Minor security fixes
+ * 9 - Major security fixes
+ */
+$this->notes['fm']['focus'] = 4;
+
+/* Mailing list release notes. */
+$this->notes['ml']['changes'] = <<<ML
+The Horde Team is pleased to announce the [first release candidate|final
+release] of the Folks Foo Bar Application version H3 (x.x).
+
+The Folks Foo Bar Application is a...
+
+[For alpha/beta releases:
+This is a preview version that should not be used on production systems. This
+version is considered feature complete but there might still be a few bugs.
+You should not use this preview version over existing production data.
+
+We encourage widespread testing and feedback via the mailing lists or our bug
+tracking system. Updated translations are very welcome, though some strings
+might still change before the final release.]
+
+[For release candidates:
+Barring any problems, this code will be released as Folks H3 (x.x).
+Testing is requested and comments are encouraged.
+Updated translations would also be great.]
+
+The major changes compared to the Folks version H3 (x.x) are:
+[or: Changes in this release:]
+ * ...
+ML;
+
+/* Freshmeat release notes, not more than 600 characters. */
+$this->notes['fm']['changes'] = <<<FM
+FM;
+
+$this->notes['name'] = 'Folks';
+$this->notes['fm']['project'] = 'folks';
+$this->notes['fm']['branch'] = 'Default';
--- /dev/null
+================================
+ Folks Development TODO List
+================================
+
+:Last update: $Date: 2007-04-22 04:51:54 $
+:Revision: $Revision: 1.2 $
--- /dev/null
+## This file should be reviewed prior to inclusion in your lighttpd
+## configuration. Specifically, if you have folks somewhere other than
+## /horde/folks you will need to edit the following rules to match your server
+## configuration.
+
+## This file should be included in your lighttpd.conf file with the "include"
+## directive. Example:
+## include "path/to/lighttpd-folks.conf"
+## The exact path you use will of course depend on your specific configuration.
+
+url.rewrite-once += (
+ "^/horde/folks/user/(.*)" => "/horde/folksi/user.php?user=$1",
+ "^/horde/folks/list/([a-z]+)" => "/horde/folksi/$1.php"
+)
--- /dev/null
+[Dolphin]
+Timestamp=2008,9,24,10,34,2
+ViewMode=1
--- /dev/null
+<?php
+/**
+ * $Id: activity.php 975 2008-10-07 20:33:50Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/Forms/Activity.php';
+require_once 'tabs.php';
+
+$title = _("Activity");
+
+$activity_scope = Util::getGet('activity_scope');
+$activity_date = Util::getGet('activity_date');
+if ($activity_scope && $activity_date) {
+ $result = $folks_driver->deleteActivity($activity_scope, $activity_date);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Activity successfully deleted"), 'horde.success');
+ header('Location: ' . Horde::applicationUrl('edit/activity.php'));
+ exit;
+ }
+}
+
+$form = new Folks_Activity_Form($vars, _("What are you doing right now?"), 'long');
+if ($form->validate()) {
+ $result = $form->execute();
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Activity successfully posted"), 'horde.success');
+ header('Location: ' . Horde::applicationUrl('edit/activity.php'));
+ exit;
+ }
+}
+
+$activities = $folks_driver->getActivity(Auth::getAuth());
+if ($activities instanceof PEAR_Error) {
+ $notification->push($activities);
+ header('Location: ' . Folks::getUrlFor('list', 'list'));
+ exit;
+}
+
+$delete_url = Horde::applicationUrl('edit/activity.php');
+$delete_img = Horde::img('delete.png', '', '', $registry->getImageDir('horde'));
+
+Horde::addScriptFile('tables.js', 'horde', true);
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('activity');
+require FOLKS_TEMPLATES . '/edit/activity.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: approve.php 974 2008-10-07 19:46:00Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/Friends.php';
+
+if (!Auth::isAuthenticated()) {
+ Horde::authenticationFailureRedirect();
+}
+
+$user = Util::getGet('user');
+if (empty($user)) {
+ $notification->push(_("You must supply a username."));
+ header('Location: ' . Horde::applicationUrl('edit/friends.php'));
+ exit;
+}
+
+$friends = Folks_Friends::singleton();
+$result = $friends->approveFriend($user);
+if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ $notification->push($result->getDebugInfo());
+ header('Location: ' . Horde::applicationUrl('edit/friends.php'));
+ exit;
+}
+
+$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(),
+ $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(),
+ $registry->get('name', 'horde'),
+ Folks::getUrlFor('user', Auth::getAuth(), true, -1));
+
+$friends->sendNotification($user, $title, $body);
+
+$link = '<a href="' . Folks::getUrlFor('user', $user) . '">' . $user . '</a>';
+$folks_driver->logActivity(sprintf(_("Added user %s as a friend."), $link));
+
+header('Location: ' . Horde::applicationUrl('edit/friends.php'));
+exit;
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: blacklist.php 974 2008-10-07 19:46:00Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/Forms/AddFriend.php';
+require_once 'tabs.php';
+
+$title = _("Blacklist");
+$remove_url = Util::addParameter(Horde::applicationUrl('edit/blacklist.php'), 'user', null);
+
+// Load driver
+require_once FOLKS_BASE . '/lib/Friends.php';
+$friends = Folks_Friends::singleton();
+
+// Perform action
+$user = Util::getGet('user');
+if ($user) {
+ if ($friends->isBlacklisted($user)) {
+ $result = $friends->removeBlacklisted($user);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(sprintf(_("User \"%s\" was removed from your blacklist."), $user), 'horde.success');
+ }
+ } else {
+ $result = $friends->addBlacklisted($user);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(sprintf(_("User \"%s\" was added to your blacklist."), $user), 'horde.success');
+ }
+ }
+}
+
+// Get blacklist
+$blacklist = $friends->getBlacklist();
+if ($blacklist instanceof PEAR_Error) {
+ $notification->push($blacklist);
+ $blacklist = array();
+}
+
+$form = new Folks_AddFriend_Form($vars, _("Add or remove user"), 'blacklist');
+
+Horde::addScriptFile('tables.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('blacklist');
+require FOLKS_TEMPLATES . '/edit/blacklist.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: comments.php 974 2008-10-07 19:46:00Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once 'tabs.php';
+
+$title = _("Comments");
+$profile = $folks_driver->getProfile();
+if ($profile instanceof PEAR_Error) {
+ $notification->push($profile);
+ header('Location: ' . Folks::getUrlFor('list', 'list'));
+ exit;
+}
+
+$comments = array(
+ 'never' => _("No one"),
+ 'all' => _("Any one"),
+ 'authenticated' => _("Authenticated users"),
+ 'moderate' => _("Moderate comments - I will approve every single comment")
+);
+
+if ($conf['comments']['allow'] == 'authenticated') {
+ unset($comments['all']);
+}
+
+$form = new Horde_Form($vars, $title, 'comments');
+$v = $form->addVariable(_("Who can post comments to your profile"), 'user_comments', 'radio', false, false, null, array($comments));
+$v->setDefault('authenticated');
+$form->setButtons(array(_("Save"), _("Delete all current comments")));
+
+if (!$form->isSubmitted()) {
+ $vars->set('user_comments', $profile['user_comments']);
+
+} elseif ($form->validate()) {
+
+ if (Util::getFormData('submitbutton') == _("Delete all current comments")) {
+
+ $result = $registry->call('forums/deleteForum', array('folks', Auth::getAuth()));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $result = $folks_driver->updateComments(Auth::getAuth(), true);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Comments deleted successfuly"), 'horde.success');
+ }
+ }
+
+ } else {
+
+ // Update forum status
+ 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(),
+ 'forum_moderated' => ($profile['user_comments'] == 'moderate'));
+ $result = $registry->call('forums/saveFrom', array('folks', '', $info));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ }
+ }
+
+ // Update profile
+ $result = $folks_driver->saveProfile(array('user_comments' => $vars->get('user_comments')));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Your comments preference was sucessfuly saved."), 'horde.success');
+ }
+ }
+}
+
+Horde::addScriptFile('tables.js', 'horde', true);
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('comments');
+$form->renderActive(null, null, null, 'post');
+
+if ($profile['user_comments'] == 'moderate') {
+ echo '<br />';
+ $result = $registry->call('forums/moderateForm', array('folks'));
+ if ($result instanceof PEAR_Error) {
+ echo $result->getMessage();
+ } else {
+ echo $result;
+ }
+}
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: edit.php 974 2008-10-07 19:46:00Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once 'tabs.php';
+
+$title = _("Edit my profile");
+
+$profile = $folks_driver->getRawProfile(Auth::getAuth());
+if ($profile instanceof PEAR_Error) {
+ $notification->push($profile);
+ header('Location: ' . Folks::getUrlFor('list', 'list'));
+ exit;
+}
+
+$form = new Horde_Form($vars, $title, 'editprofile');
+$form->addVariable(_("Email"), 'user_email', 'email', true);
+$form->addVariable(_("Birthday"), 'user_birthday', 'monthdayyear', false, false, null, array(date('Y')-90, date('Y')-10, '%Y%m%d', '%Y%m%d'));
+$form->addVariable(_("Gender"), 'user_gender', 'enum', false, false, null, array(array(1 => _("Male"), 2 => _("Female")), _("--- Select ---")));
+$form->addVariable(_("City"), 'user_city', 'text', false);
+$v = &$form->addVariable(_("Country"), 'user_country', 'enum', false, false, null, array(Folks::getCountries()));
+$v->setDefault('SI');
+$form->addVariable(_("Homepage"), 'user_url', 'text', false);
+
+if ($registry->hasMethod('video/listVideos')) {
+ $result = $registry->call('video/listVideos', array(array('author' => Auth::getAuth()), 0, 100));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $videos = array();
+ foreach ($result as $video_id => $video) {
+ $videos[$video_id] = $video['video_title'] . ' - ' . Folks::format_date($video['video_created']);
+ }
+ $video_link = '<a href="' . $registry->get('webroot', 'oscar') . '//videos/edit.php">' . _("Upload a new video") . '</a>';
+ $form->addVariable(_("Video"), 'user_video', 'enum', false, false, $video_link, array($videos, _("--- Select ---")));
+ }
+}
+
+$form->addVariable(_("Description"), 'user_description', 'longtext', false, false, false);
+$form->addVariable(_("Picture"), 'user_picture', 'image', false);
+$form->setButtons(array(_("Save"), _("Delete picture")));
+
+if ($form->validate()) {
+ switch (Util::getFormData('submitbutton')) {
+
+ case _("Save"):
+ $form->getInfo(null, $info);
+ $info['user_description'] = strip_tags($info['user_description']);
+ $info['user_city'] = strip_tags($info['user_city']);
+ $info['user_url'] = strip_tags($info['user_url']);
+ $result = $folks_driver->saveProfile($info);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Your data were successfully updated."), 'horde.success');
+ if (empty($data['user_picture'])) {
+ $folks_driver->logActivity(_("Updated his/her profile details."));
+ } else {
+ $folks_driver->logActivity(_("Updated his/her profile picture."));
+ }
+ header('Location: ' . Horde::applicationUrl('edit/edit.php'));
+ exit;
+ }
+ break;
+
+ case _("Delete picture"):
+ $result = $folks_driver->deleteImage(Auth::getAuth());;
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Your image was deleted successfully."), 'horde.success');
+ }
+
+ break;
+
+ }
+} elseif (!$form->isSubmitted()) {
+
+ foreach ($profile as $key => $value) {
+ if ($key != 'user_picture' && !empty($value)) {
+ $vars->set($key, $value);
+ }
+ }
+
+}
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('edit');
+$form->renderActive(null, null, null, 'post');
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: friends.php 976 2008-10-07 21:24:47Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/Forms/AddFriend.php';
+require_once 'tabs.php';
+
+$title = _("Friends");
+$remove_url = Horde::applicationUrl('edit/friends.php');
+$remove_img = Horde::img('delete.png', '', '', $registry->getImageDir('horde'));
+$profile_img = Horde::img('user.png', '', '', $registry->getImageDir('horde'));
+$letter_url = '';
+if ($registry->hasInterface('letter')) {
+ $letter_url = $registry->get('webroot', 'letter') . '/compose.php';
+ $letter_img = Horde::img('letter.png', '', '', $registry->getImageDir('letter'));
+}
+
+// Load driver
+require_once FOLKS_BASE . '/lib/Friends.php';
+$friends = Folks_Friends::singleton();
+
+// Perform action
+$user = Util::getGet('user');
+if ($user) {
+ if ($friends->isFriend($user)) {
+ $result = $friends->removeFriend($user);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(sprintf(_("User \"%s\" was removed from your friend list."), $user), 'horde.success');
+ }
+ } else {
+ $result = $friends->addFriend($user);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } elseif ($friends->needsApproval($user)) {
+ $notification->push(sprintf(_("A confirmation was send to \"%s\"."), $user), 'horde.warning');
+ $title = sprintf(_("%s added you as a friend on %s"),
+ 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(),
+ $registry->get('name', 'horde'),
+ Util::addParameter(Horde::applicationUrl('edit/approve.php', true, -1), 'user', Auth::getAuth()),
+ Util::addParameter(Horde::applicationUrl('edit/reject.php', true, -1), 'user', Auth::getAuth()),
+ Folks::getUrlFor('user', Auth::getAuth(), true, -1));
+ $friends->sendNotification($user, $title, $body);
+ } else {
+ $notification->push(sprintf(_("User \"%s\" was added as your friend."), $user), 'horde.success');
+ }
+ }
+
+ header('Location: ' . Horde::applicationUrl('edit/friends.php'));
+ exit;
+}
+
+// Get friends
+$friend_list = $friends->getFriends();
+if ($friend_list instanceof PEAR_Error) {
+ $notification->push($friend_list);
+ $friend_list = array();
+}
+
+// Get friends we are waiting approval from
+$waitingFrom = $friends->waitingApprovalFrom();
+if ($waitingFrom instanceof PEAR_Error) {
+ $notification->push($waitingFrom);
+ $waitingFrom = array();
+}
+
+// Get friends we are waiting approval from
+$waitingFor = $friends->waitingApprovalFor();
+if ($waitingFor instanceof PEAR_Error) {
+ $notification->push($waitingFor);
+ $waitingFor = array();
+}
+
+// Get users who have you on friendlist
+$possibilities = $friends->getPossibleFriends();
+if ($possibilities instanceof PEAR_Error) {
+ $notification->push($waiting);
+ $possibilities = array();
+}
+
+$form = new Folks_AddFriend_Form($vars, _("Add or remove user"), 'blacklist');
+
+Horde::addScriptFile('tables.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('friends');
+require FOLKS_TEMPLATES . '/edit/friends.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: password.php 880 2008-09-22 12:33:57Z duck $
+ *
+ * Copyright 2007 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once 'tabs.php';
+
+// Make sure auth backend allows passwords to be updated.
+$auth = Auth::singleton($conf['auth']['driver']);
+if (!$auth->hasCapability('resetpassword')) {
+ $notification->push(_("Cannot update password, contact your administrator."), 'horde.error');
+ header('Location: ' . Auth::getLoginScreen('', Util::getFormData('url')));
+ exit;
+}
+
+$title = _("Change Your Password");
+$vars = Variables::getDefaultVariables();
+$form = new Horde_Form($vars, $title, 'password');
+$form->setButtons(_("Continue"));
+$form->addVariable(_("Current password"), 'old', 'password', true);
+$form->addVariable(_("Choose a password"), 'new', 'passwordconfirm', true, false, _("type the password twice to confirm"));
+
+// Use a do-while to allow easy breaking if an error is found.
+do {
+
+ // Validate the form
+ if (!$form->validate()) {
+ break;
+ }
+
+ $form->getInfo(null, $info);
+
+ // Check old and new passwords
+ if ($info['old'] == $info['new']) {
+ $notification->push(_("Your new password must be different from your current password"), 'horde.warning');
+ break;
+ }
+
+ // Check old password
+ if ($info['old'] == $info['new']) {
+ $notification->push(_("Your old password didn't match"), 'horde.warning');
+ break;
+ }
+
+ // Check some password policy
+ $password_policy = Horde::loadConfiguration('password_policy.php', 'password_policy', 'folks');
+ if (is_array($password_policy)) {
+
+ // Check max/min lengths if specified in the backend config.
+ if (isset($password_policy['minLength']) &&
+ strlen($info['new']) < $password_policy['minLength']) {
+ $notification->push(sprintf(_("Your new password must be at least %d characters long!"), $password_policy['minLength']), 'horde.warning');
+ break;
+ }
+ if (isset($password_policy['maxLength']) &&
+ strlen($info['new']) > $password_policy['maxLength']) {
+ $notification->push(sprintf(_("Your new password is too long; passwords may not be more than %d characters long!"), $password_policy['maxLength']), 'horde.warning');
+ break;
+ }
+
+ // Disect the password in a localised way.
+ $classes = array();
+ $alpha = $alnum = $num = $upper = $lower = $space = $symbol = 0;
+ for ($i = 0; $i < strlen($info['new']); $i++) {
+ $char = substr($info['new'], $i, 1);
+ if (ctype_lower($char)) {
+ $lower++; $alpha++; $alnum++; $classes['lower'] = 1;
+ } elseif (ctype_upper($char)) {
+ $upper++; $alpha++; $alnum++; $classes['upper'] = 1;
+ } elseif (ctype_digit($char)) {
+ $num++; $alnum++; $classes['number'] = 1;
+ } elseif (ctype_punct($char)) {
+ $symbol++; $classes['symbol'] = 1;
+ } elseif (ctype_space($char)) {
+ $space++; $classes['symbol'] = 1;
+ }
+ }
+
+ // Check reamaining password policy options.
+ if (isset($password_policy['minUpper']) &&
+ $password_policy['minUpper'] > $upper) {
+ $notification->push(sprintf(_("Your new password must contain at least %d uppercase characters."), $password_policy['minUpper']), 'horde.warning');
+ break;
+ }
+ if (isset($password_policy['minLower']) &&
+ $password_policy['minLower'] > $lower) {
+ $notification->push(sprintf(_("Your new password must contain at least %d lowercase characters."), $password_policy['minLower']), 'horde.warning');
+ break;
+ }
+ if (isset($password_policy['minNumeric']) &&
+ $password_policy['minNumeric'] > $num) {
+ $notification->push(sprintf(_("Your new password must contain at least %d numeric characters."), $password_policy['minNumeric']), 'horde.warning');
+ break;
+ }
+ if (isset($password_policy['minAlpha']) &&
+ $password_policy['minAlpha'] > $alpha) {
+ $notification->push(sprintf(_("Your new password must contain at least %d alphabetic characters."), $password_policy['minAlpha']), 'horde.warning');
+ break;
+ }
+ if (isset($password_policy['minAlphaNum']) &&
+ $password_policy['minAlphaNum'] > $alnum) {
+ $notification->push(sprintf(_("Your new password must contain at least %d alphanumeric characters."), $password_policy['minAlphaNum']), 'horde.warning');
+ break;
+ }
+ if (isset($password_policy['minClasses']) &&
+ $password_policy['minClasses'] > array_sum($classes)) {
+ $notification->push(sprintf(_("Your new password must contain at least %d different types of characters. The types are: lower, upper, numeric, and symbols."), $password_policy['minClasses']), 'horde.warning');
+ break;
+ }
+ if (isset($password_policy['maxSpace']) &&
+ $password_policy['maxSpace'] < $space) {
+ if ($password_policy['maxSpace'] > 0) {
+ $notification->push(sprintf(_("Your new password must contain less than %d whitespace characters."), $password_policy['maxSpace']), 'horde.warning');
+ } else {
+ $notification->push(_("Your new password must not contain whitespace characters."), 'horde.warning');
+ }
+ break;
+ }
+
+ // Do some simple strength tests, if enabled in the config file.
+ if ($conf['password']['strengthtests']) {
+ // Check for new==old, pass==user, simple reverse strings, etc.
+ if ((strcasecmp($info['new'], $userid) == 0) ||
+ (strcasecmp($info['new'], strrev($userid)) == 0) ||
+ (strcasecmp($info['new'], $old_password) == 0) ||
+ (strcasecmp($info['new'], strrev($old_password)) == 0) ) {
+ $notification->push(_("Your new password is too simple to guess. Not changed!"),
+ 'horde.warning');
+ break;
+ }
+ // Check for percentages similarity also. This will catch very simple
+ // Things like "password" -> "password2" or "xpasssword"...
+ @similar_text($info['new'], $old_password, $percent1);
+ @similar_text($info['new'], $userid, $percent2);
+ if (($percent1 > 80) || ($percent2 > 80)) {
+ $notification->push(_("Your new password is too simple to guess! Not changed!"),
+ 'horde.warning');
+ break;
+ }
+ }
+ }
+
+ // try to chage it
+ $result = $folks_driver->changePassword($info['new'], 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'])) {
+ $_SESSION['imp']['pass'] = Secret::write(Secret::getKey('imp'),
+ $info['new']);
+ } elseif (Auth::getProvider() == 'mimp' || !empty($_SESSION['mimp']['pass'])) {
+ $_SESSION['mimp']['pass'] = Secret::write(Secret::getKey('mimp'),
+ $info['new']);
+ }
+ }
+
+} while (false);
+
+// update password reminder prefs
+if (Util::getPost('formname') == 'security') {
+ if ($prefs->getValue('security_question') != Util::getPost('security_question')) {
+ $prefs->setValue('security_question', Util::getPost('security_question'));
+ }
+
+ if ($prefs->getValue('security_answer') != Util::getPost('security_answer')) {
+ $prefs->setValue('security_answer', Util::getPost('security_answer'));
+ }
+
+ $notification->push(_("Your securiy questions was updated."), 'horde.success');
+}
+
+
+$form_security = new Horde_Form($vars, _("Security question used when reseting password"), 'security');
+$form_security->setButtons(_("Continue"), _("Reset"));
+if (!$prefs->isLocked('security_question')) {
+ $v = &$form_security->addVariable(_("Security question"), 'security_question', 'text', true);
+ $v->setDefault($prefs->getValue('security_question'));
+}
+$v = &$form_security->addVariable(_("Security answer"), 'security_answer', 'text', true);
+$v->setDefault($prefs->getValue('security_answer'));
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('password');
+$form->renderActive(null, null, null, 'post');
+echo '<br />';
+$form_security->renderActive(null, null, null, 'post');
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: privacy.php 984 2008-10-09 09:38:16Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once 'tabs.php';
+
+$title = _("Privacy");
+
+$profile = $folks_driver->getRawProfile(Auth::getAuth());
+if ($profile instanceof PEAR_Error) {
+ $notification->push($profile);
+ header('Location: ' . Folks::getUrlFor('list', 'list'));
+ exit;
+}
+
+$statuses = array('public' => _("Public"),
+ 'public_authenticated' => _("Public - only authenticated users can see my personal data"),
+ // 'public_private' => _("Public - others can see only ma basic data"),
+ 'public_friends' => _("Public - only my friends can see my presonal data"),
+ 'private' => _("Private"));
+
+$types = array('all' => _("All visitors"),
+ 'authenticated' => _("Only authenticated users"),
+ 'friends' => _("Only my friedns"),
+ 'noone' => _("No one"));
+
+$form = new Horde_Form($vars, $title, 'privacy');
+
+$v = &$form->addVariable(_("Status"), 'user_status', 'radio', true, false, null, array($statuses));
+$v->setDefault($profile['user_status']);
+
+$v = &$form->addVariable(_("Who can see when I was last time online"), 'last_online', 'radio', false, false, null, array($types));
+$v->setDefault($profile['last_online']);
+
+$v = &$form->addVariable(_("Who can see my acticity log on my profile"), 'activity_log', 'radio', false, false, null, array($types));
+$v->setDefault($profile['activity_log']);
+
+$v = &$form->addVariable(_("Notify online friends that I logged in"), 'login_notify', 'radio', false, false, null, array(array(_("No"), _("Yes"))));
+$v->setDefault($prefs->getValue('login_notify'));
+
+if ($form->validate()) {
+
+ $form->getInfo(null, $info);
+
+ // Save pref
+ $prefs->setValue('login_notify', $info['login_notify']);
+
+ // Save profile
+ unset($info['login_notify']);
+ $result = $folks_driver->saveProfile($info);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Your data were successfully updated."), 'horde.success');
+ header('Location: ' . Horde::applicationUrl('edit/privacy.php'));
+ exit;
+ }
+
+}
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('privacy');
+$form->renderActive(null, null, null, 'post');
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: reject.php 974 2008-10-07 19:46:00Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/Friends.php';
+
+if (!Auth::isAuthenticated()) {
+ Horde::authenticationFailureRedirect();
+}
+
+$user = Util::getGet('user');
+if (empty($user)) {
+ $notification->push(_("You must supply a username."));
+ header('Location: ' . Horde::applicationUrl('edit/friends.php'));
+ exit;
+}
+
+$friends = Folks_Friends::singleton($conf['friends'], array('user' => $user));
+$result = $friends->removeFriend(Auth::getAuth());
+if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ header('Location: ' . Horde::applicationUrl('edit/friends.php'));
+ exit;
+}
+
+$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(),
+ $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(),
+ $registry->get('name', 'horde'),
+ Folks::getUrlFor('user', Auth::getAuth(), true, -1));
+
+$friends->sendNotification($user, $title, $body);
+
+header('Location: ' . Horde::applicationUrl('edit/friends.php'));
+exit;
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: tabs.php 974 2008-10-07 19:46:00Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+if (!Auth::isAuthenticated()) {
+ Horde::authenticationFailureRedirect();
+}
+
+require_once 'Horde/Variables.php';
+
+$vars = Variables::getDefaultVariables();
+$tabs = new Horde_UI_Tabs('what', $vars);
+$tabs->addTab(_("Edit my profile"), 'edit.php', 'edit');
+$tabs->addTab(_("Privacy"), 'privacy.php', 'privacy');
+$tabs->addTab(_("Blacklist"), 'blacklist.php', 'blacklist');
+$tabs->addTab(_("Friends"), 'friends.php', 'friends');
+$tabs->addTab(_("Activity"), 'activity.php', 'activity');
+$tabs->addTab(_("Password"), 'password.php', 'password');
+
+if ($conf['comments']['allow'] != 'never'
+ && $registry->hasMethod('forums/doComments')) {
+ $tabs->addTab(_("Comments"), 'comments.php', 'comments');
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: friends.php 983 2008-10-09 09:06:53Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/Forms/Activity.php';
+
+if (!Auth::isAuthenticated()) {
+ Horde::authenticationFailureRedirect();
+}
+
+$title = _("Friends");
+
+require_once 'Horde/Variables.php';
+$vars = Variables::getDefaultVariables();
+$form = new Folks_Activity_Form($vars, _("What are you doing right now?"), 'short');
+if ($form->validate()) {
+ $result = $form->execute();
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Activity successfully posted"), 'horde.success');
+ header('Location: ' . Horde::applicationUrl('friends.php'));
+ exit;
+ }
+}
+
+// Load driver
+require_once FOLKS_BASE . '/lib/Friends.php';
+$friends = Folks_Friends::singleton();
+
+// Get friends
+$friend_list = $friends->getFriends();
+if ($friend_list instanceof PEAR_Error) {
+ $notification->push($friend_list);
+ $friend_list = array();
+}
+
+// Get friends activities
+$firendActivities = array();
+foreach ($friend_list as $user) {
+ $activities = $folks_driver->getActivity($user);
+ if ($activities instanceof PEAR_Error) {
+ continue;
+ }
+ foreach ($activities as $activity) {
+ $firendActivities[$activity['activity_date']] = array('message' => $activity['activity_message'],
+ 'scope' => $activity['activity_scope'],
+ 'user' => $user);
+ }
+}
+krsort($firendActivities);
+
+// Own activities
+$activities = $folks_driver->getActivity(Auth::getAuth());
+if ($activities instanceof PEAR_Error) {
+ $notification->push($activities);
+ header('Location: ' . Folks::getUrlFor('list', 'list'));
+ exit;
+}
+
+// Users online
+$online = $folks_driver->getOnlineUsers();
+if ($online instanceof PEAR_Error) {
+ return $online;
+}
+
+Horde::addScriptFile('tables.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+require FOLKS_TEMPLATES . '/friends/friends.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Horde: folks/index.php,v 1.12 2008-01-02 11:14:00 jan Exp $
+ *
+ * Copyright 2007-2008 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.
+ *
+ * @author Your Name <you@example.com>
+ */
+
+define('FOLKS_BASE', dirname(__FILE__));
+$folks_configured = (is_readable(FOLKS_BASE . '/config/conf.php') &&
+ is_readable(FOLKS_BASE . '/config/prefs.php'));
+
+if (!$folks_configured) {
+ require FOLKS_BASE . '/../lib/Test.php';
+ Horde_Test::configFilesMissing('Folks', FOLKS_BASE,
+ array('conf.php', 'prefs.php'));
+}
+
+require FOLKS_BASE . '/list.php';
\ No newline at end of file
--- /dev/null
+
+function saveSearch(url){RedBox.loading();new Ajax.Request(url,{parameters:{ajax:1},method:'get',onSuccess:function(transport){RedBox.showHtml('<div id="RB_info">'+transport.responseText+'</div>');},onFailure:function(transport){RedBox.close();}});}
\ No newline at end of file
--- /dev/null
+function saveSearch(url) {\r
+ RedBox.loading();\r
+ new Ajax.Request(url, {\r
+ parameters: {\r
+ ajax: 1\r
+ },\r
+ method: 'get',\r
+ onSuccess: function(transport) {\r
+ RedBox.showHtml('<div id="RB_info">' + transport.responseText + '</div>');\r
+ },\r
+ onFailure: function(transport) {\r
+ RedBox.close();\r
+ }\r
+ });\r
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+require_once dirname(__FILE__) . '/application.php';
+
+/**
+ * The 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 $
+ *
+ * Copyright 2008 Obala d.o.o. (http://www.obala.si/)
+ *
+ * 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 Duck <duck@obala.net>
+ */
+class Auth_folks extends 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);
+
+ /**
+ * Constructs a new Application authentication object.
+ *
+ * @param array $params A hash containing connection parameters.
+ */
+ function Auth_folks($params = array())
+ {
+ $this->_params = array('app' => 'folks');
+ }
+
+ /**
+ * 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 = '')
+ {
+ $login = Horde::url($GLOBALS['registry']->get('webroot', 'folks') . '/login.php', true);
+ if (!empty($url)) {
+ $login = Util::addParameter($login, 'url', $url);
+ }
+ return $login;
+ }
+
+ /**
+ * 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)
+ {
+ return $GLOBALS['registry']->callByPackage('folks',
+ 'userExists',
+ array('userId' => $userId));
+ }
+
+ /**
+ * Resets a user's password. Used for example when the user does not
+ * remember the existing password.
+ *
+ * @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.
+ */
+ function resetPassword($userId)
+ {
+ /* Get a new random password. */
+ $password = Auth::genRandomPassword();
+
+ /* Process. */
+ require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/base.php';
+ $result = $GLOBALS['folks_driver']->changePassword($password, $userId);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ return $password;
+ }
+
+ /**
+ * Automatic authentication: Finds out if the client matches an allowed IP
+ * block.
+ *
+ * @return boolean Whether or not the client is allowed.
+ */
+ function transparent()
+ {
+ if (!isset($_COOKIE['folks_login_code']) ||
+ !isset($_COOKIE['folks_login_user'])) {
+ return false;
+ }
+
+ require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/base.php';
+ if ($_COOKIE['folks_login_code'] != $GLOBALS['folks_driver']->getCookie($_COOKIE['folks_login_user'])) {
+ return false;
+ }
+
+ if ($this->setAuth($_COOKIE['folks_login_user'], array('transparent' => 1, 'password' => null))) {
+ $GLOBALS['folks_driver']->resetOnlineUsers();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ function transparent()
+ {
+ if (!isset($_COOKIE['folks_login_code']) ||
+ !isset($_COOKIE['folks_login_user'])) {
+ return false;
+ }
+
+ $conn = mysql_connect($GLOBALS['conf']['sql']['hostspec'],
+ $GLOBALS['conf']['sql']['username'],
+ $GLOBALS['conf']['sql']['password']);
+
+ $query = 'SELECT user_password FROM '
+ . $GLOBALS['conf']['sql']['database']
+ . '.folks_users WHERE user_uid = "'
+ . $_COOKIE['folks_login_user'] . '"';
+
+ $result = mysql_query($query);
+ $r = mysql_fetch_assoc($result);
+
+ if (mysql_num_rows($result) == 0) {
+ return false;
+ }
+
+ require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/Folks.php';
+ $key = date('m') . $r['user_password'];
+
+ if ($_COOKIE['folks_login_code'] != Folks::encodeString($_COOKIE['folks_login_user'], $key)) {
+ return false;
+ }
+
+ if ($this->setAuth($_COOKIE['folks_login_user'], array('transparent' => 1, 'password' => null))) {
+
+ $sql = 'REPLACE INTO ' . $GLOBALS['conf']['sql']['database']
+ . '.folks_online SET user_uid="'
+ . $_COOKIE['folks_login_user']
+ . '", ip_address="' . $_SERVER["REMOTE_ADDR"]
+ . '", time_last_click="' . $_SERVER['REQUEST_TIME'] . '"';
+ mysql_unbuffered_query($sql, $conn);
+
+ return true;
+
+ } else {
+ return false;
+ }
+ }
+ */
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+$block_name = _("Friends");
+
+/**
+ * $Id: friends.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * @package Folks
+ * @author Duck <duck@obala.net>
+ */
+class Horde_Block_Folks_friends extends Horde_Block {
+
+ var $_app = 'folks';
+
+ /**
+ * The title to go in this block.
+ *
+ * @return string The title text.
+ */
+ function _title()
+ {
+ return _("Friends");
+ }
+
+ /**
+ * The parameters of block
+ *
+ * @return array The parameters
+ */
+ function _params()
+ {
+ $params = array('display' => array('name' => _("Show friends that are"),
+ 'type' => 'enum',
+ 'default' => 'online',
+ 'values' => array('all' => _("All"),
+ 'online' => _("Online"),
+ 'offline' => _("Offline"))));
+ }
+
+ /**
+ * The content to go in this block.
+ *
+ * @return string The content
+ */
+ function _content()
+ {
+ require_once dirname(__FILE__) . '/../base.php';
+
+ $friends = $GLOBALS['folks_driver']->getFriends(Auth::getAuth());
+ if ($friends instanceof PEAR_Error) {
+ return $friends;
+ }
+
+ $users = $GLOBALS['folks_driver']->getOnlineUsers();
+ if ($users instanceof PEAR_Error) {
+ return $users;
+ }
+
+ $online = '';
+ $offline = '';
+
+ foreach ($friends as $friend) {
+ if (array_key_exists($friend, $users)) {
+ $online .= '<a href="' . Folks::getUrlFor('user', $friend) . '">' . $friend . '</a> ';
+ } else {
+ $offline .= '<a href="' . Folks::getUrlFor('user', $friend) . '">' . $friend . '</a> ';
+ }
+ }
+
+ switch ($this->_params['display']) {
+
+ case 'online':
+ return $online;
+ break;
+
+ case 'offline':
+ return $offline;
+ break;
+
+ default:
+ return $online . $offline;
+ break;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+$block_name = _("Last comments on my profile");
+
+/**
+ * Horde_Block_folks_my_comments:: Implementation of the Horde_Block API to
+ * display last comments on users videos.
+ *
+ * $Horde: incubator/folks/lib/Block/my_comments.php,v 1.1 2008/03/27 11:02:57 duck Exp $
+ *
+ * @package Horde_Block
+ */
+class Horde_Block_folks_my_comments extends Horde_Block {
+
+ var $_app = 'folks';
+
+ function _params()
+ {
+ return array('limit' => array('name' => _("Number of comments to display"),
+ 'type' => 'int',
+ 'default' => 10));
+ }
+
+ /**
+ * The title to go in this block.
+ *
+ * @return string The title text.
+ */
+ function _title()
+ {
+ return _("Last comments on my profile");
+ }
+
+ /**
+ * The content to go in this block.
+ *
+ * @return string The content
+ */
+ function _content()
+ {
+ if (!Auth::isAuthenticated()) {
+ return '';
+ }
+
+ $GLOBALS['cache'] = Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
+ Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
+
+ $cache_key = 'folks_myscommetns_' . $this->_params['limit'];
+ $threads = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($threads) {
+ return $threads;
+ }
+
+ Horde::addScriptFile('tables.js', 'horde', true);
+ $html = '<table class="sortable striped" id="my_comment_list" style="width: 100%">'
+ . '<thead><tr><th>' . _("Title") . '</th>'
+ . '<th>' . _("User") . '</th></tr></thead>';
+
+ $threads = $GLOBALS['registry']->call('forums/getThreadsByForumOwner',
+ array(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());
+ foreach ($threads as $message) {
+ $html .= '<tr><td>'
+ . '<a href="' . $url . '" title="' . $message['message_date']. '">'
+ . $message['message_subject'] . '</a> '
+ . '</td><td>'
+ . $message['message_author'] . '</td></tr>';
+ }
+ $html .= '</table>';
+
+ $GLOBALS['cache']->set($cache_key, $html);
+ return $html;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+$block_name = _("New users");
+
+/**
+ * $Id: new.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * @package Folks
+ * @author Duck <duck@obala.net>
+ */
+class Horde_Block_Folks_new extends Horde_Block {
+
+ var $_app = 'folks';
+
+ /**
+ * The title to go in this block.
+ *
+ * @return string The title text.
+ */
+ function _title()
+ {
+ return _("New users");
+ }
+
+ /**
+ * The parameters of block
+ *
+ * @return array The parameters
+ */
+ function _params()
+ {
+ return array('limit' => array('name' => _("Limit"),
+ 'type' => 'int',
+ 'default' => 10));
+ }
+
+ /**
+ * The content to go in this block.
+ *
+ * @return string The content
+ */
+ function _content()
+ {
+ require_once dirname(__FILE__) . '/../base.php';
+
+ $new = $GLOBALS['folks_driver']->getNewUsers($this->_params['limit']);
+ if ($new instanceof PEAR_Error) {
+ return $new;
+ }
+
+ $html = '';
+
+ foreach ($new as $user) {
+ $html .= '<a href="' . Folks::getUrlFor('user', $user['user_uid']) . '">' . $user['user_uid'] . '</a> ';
+ }
+
+ return $html;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+$block_name = _("Random users");
+
+/**
+ * $Id: random.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * @package Folks
+ * @author Duck <duck@obala.net>
+ */
+class Horde_Block_Folks_random extends Horde_Block {
+
+ var $_app = 'folks';
+
+ /**
+ * The title to go in this block.
+ *
+ * @return string The title text.
+ */
+ function _title()
+ {
+ return _("Random users");
+ }
+
+ /**
+ * The parameters of block
+ *
+ * @return array The parameters
+ */
+ function _params()
+ {
+ return array('limit' => array('name' => _("Limit"),
+ 'type' => 'int',
+ 'default' => 10),
+ 'online' => array('name' => _("User is currently online?"),
+ 'type' => 'enum',
+ 'default' => 'online',
+ 'values' => array('online' => _("Online"),
+ 'all' => _("Does not metter"))));
+ }
+
+ /**
+ * The content to go in this block.
+ *
+ * @return string The content
+ */
+ function _content()
+ {
+ require_once dirname(__FILE__) . '/../base.php';
+
+ $recent = $GLOBALS['folks_driver']->getRandomUsers($this->_params['limit'], $this->_params['online'] == 'online');
+ if ($recent instanceof PEAR_Error) {
+ return $recent;
+ }
+
+ $html = '';
+
+ foreach ($recent as $user) {
+ $html .= '<a href="' . Folks::getUrlFor('user', $user) . '">' . $user . '</a> ';
+ }
+
+ return '';
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+$block_name = _("Recent visitors");
+
+/**
+ * $Id: recent.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * @package Folks
+ * @author Duck <duck@obala.net>
+ */
+class Horde_Block_Folks_recent extends Horde_Block {
+
+ var $_app = 'folks';
+
+ /**
+ * The title to go in this block.
+ *
+ * @return string The title text.
+ */
+ function _title()
+ {
+ return _("Recent visitors");
+ }
+
+ /**
+ * The parameters of block
+ *
+ * @return array The parameters
+ */
+ function _params()
+ {
+ return array('limit' => array('name' => _("Limit"),
+ 'type' => 'int',
+ 'default' => 10));
+ }
+
+ /**
+ * The content to go in this block.
+ *
+ * @return string The content
+ */
+ function _content()
+ {
+ require_once dirname(__FILE__) . '/../base.php';
+
+ $recent = $GLOBALS['folks_driver']->getRecentVisitors($this->_params['limit']);
+ if ($recent instanceof PEAR_Error) {
+ return $recent;
+ }
+
+ $html = '';
+
+ foreach ($recent as $user) {
+ $html .= '<a href="' . Folks::getUrlFor('user', $user) . '">' . $user . '</a>';
+ }
+
+ return $html;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Folks_Driver:: defines an API for implementing storage backends for
+ * Folks.
+ *
+ * $Id: Driver.php 991 2008-10-10 10:27:58Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+class Folks_Driver {
+
+ /**
+ * Hash containing connection parameters.
+ *
+ * @var array
+ */
+ protected $_params = array();
+
+ /**
+ * Attempts to return a concrete Folks_Driver instance based on $driver.
+ *
+ * @param string $driver The type of the concrete Folks_Driver subclas
+ * to return. The clas name is based on the
+ * storage driver ($driver). The code is
+ * dynamically included.
+ *
+ * @param array $params A hash containing any additional configuration
+ * or connection parameters a subclas might need.
+ *
+ * @return Folks_Driver The newly created concrete Folks_Driver
+ * instance, or false on an error.
+ */
+ public function factory($driver = null, $params = null)
+ {
+ if ($driver === null) {
+ $driver = $GLOBALS['conf']['storage']['driver'];
+ }
+
+ $driver = basename($driver);
+
+ if ($params === null) {
+ $params = Horde::getDriverConfig('storage', $driver);
+ }
+
+ $clas = 'Folks_Driver_' . $driver;
+ if (!class_exists($clas)) {
+ include dirname(__FILE__) . '/Driver/' . $driver . '.php';
+ }
+ if (class_exists($clas)) {
+ return new $clas($params);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Load VFS Backend
+ */
+ protected function _loadVFS()
+ {
+ $v_params = Horde::getVFSConfig('images');
+ if ($v_params instanceof PEAR_Error) {
+ return $v_params;
+ }
+
+ return VFS::singleton($v_params['type'], $v_params['params']);
+ }
+
+ /**
+ * Store image
+ *
+ * @param string $file Image file
+ * @param string $user User pricture belongs to
+ */
+ protected function _saveImage($file, $user)
+ {
+ global $conf;
+
+ $vfs = $this->_loadVFS();
+ if ($vfs instanceof PEAR_Error) {
+ return $vfs;
+ }
+
+ $p = md5($user);
+ $vfspath = Folks::VFS_PATH . '/' . substr(str_pad($p, 2, 0, STR_PAD_LEFT), -2) . '/';
+ $vfs_name = $p . '.' . $conf['images']['image_type'];
+
+ $img = Horde_Image::factory('gd', array('type' => $conf['images']['image_type'],
+ 'temp' => Horde::getTempDir()));
+
+ $result = $img->loadFile($file);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ $dimensions = $img->getDimensions();
+ if ($dimensions instanceof PEAR_Error) {
+ return $dimensions;
+ }
+ $img->resize(min($conf['images']['screen_width'], $dimensions['width']),
+ min($conf['images']['screen_height'], $dimensions['height']));
+
+ // Store big image
+ $result = $vfs->writeData($vfspath . '/big/', $vfs_name, $img->raw(), true);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ // Resize thumbnail
+ $dimensions = $img->getDimensions();
+ $img->resize(min($conf['images']['thumbnail_width'], $dimensions['width']),
+ min($conf['images']['thumbnail_height'], $dimensions['height']));
+
+ // Store thumbnail
+ return $vfs->writeData($vfspath . '/small/', $vfs_name, $img->raw(), true);
+ }
+
+ /**
+ * Delete user image
+ *
+ * @param string $user User pricture belongs to
+ */
+ public function deleteImage($user)
+ {
+ $vfs = $this->_loadVFS();
+ if ($vfs instanceof PEAR_Error) {
+ return $vfs;
+ }
+
+ $p = md5($user);
+ $vfspath = Folks::VFS_PATH . '/' . substr(str_pad($p, 2, 0, STR_PAD_LEFT), -2) . '/';
+ $vfs_name = $p . '.' . $GLOBALS['conf']['images']['image_type'];
+
+ $result = $vfs->deleteFile($vfspath . '/big/', $vfs_name);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ $result = $vfs->deleteFile($vfspath . '/small/', $vfs_name);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ // Delete cache
+ $GLOBALS['cache']->expire('folksProfile' . $user);
+
+ return $this->_deleteImage($user);
+ }
+
+ /**
+ * Check if user is on blacklist
+ *
+ * @param string $user User owner
+ * @param string $chcek User to check
+ *
+ * @return boolean
+ */
+ public function isBlacklisted($user, $check)
+ {
+ require_once FOLKS_BASE . '/lib/Friends.php';
+ $friends = Folks_Friends::singleton($GLOBALS['conf']['friends'], array('user' => $user));
+ return $friends->isBlacklisted($check);
+ }
+
+ /**
+ * Check if user is on blacklist
+ *
+ * @param string $user User owner
+ * @param string $chcek User to check
+ *
+ * @return boolean
+ */
+ public function isFriend($user, $check)
+ {
+ if ($user == $check) {
+ return true;
+ }
+
+ require_once FOLKS_BASE . '/lib/Friends.php';
+ $friends = Folks_Friends::singleton($GLOBALS['conf']['friends'], array('user' => $user));
+ return $friends->isFriend($check);
+ }
+
+ /**
+ * Check if user is on blacklist
+ *
+ * @param string $user User owner
+ *
+ * @return array firends usernames
+ */
+ public function getFriends($user)
+ {
+ require_once FOLKS_BASE . '/lib/Friends.php';
+ $friends = Folks_Friends::singleton($GLOBALS['conf']['friends'], array('user' => $user));
+
+ return $friends->getFriends();
+ }
+
+ /**
+ * Get usersnames online
+ *
+ * @return array users online
+ */
+ public function getOnlineUsers()
+ {
+ static $online;
+
+ if ($online !== null) {
+ return $online;
+ }
+
+ $online = $GLOBALS['cache']->get('folksOnlineUsers', $GLOBALS['conf']['online']['ttl']);
+ if ($online) {
+ $online = unserialize($online);
+ } else {
+ $online = $this->_getOnlineUsers();
+ if ($online instanceof PEAR_Error) {
+ return $online;
+ }
+ $online = array_flip($online);
+ $GLOBALS['cache']->set('folksOnlineUsers', serialize($online));
+ }
+
+ return $online;
+ }
+
+ /**
+ * Reset online users cache
+ *
+ * @return boolean
+ */
+ public function resetOnlineUsers()
+ {
+ $this->_updateOnlineStatus();
+ return $GLOBALS['cache']->expire('folksOnlineUsers');
+ }
+
+ /**
+ * Get usersnames online
+ *
+ * @return array users online
+ */
+ public function getRecentVisitors($limit = 10)
+ {
+ $recent = $GLOBALS['cache']->get('folksRecentVisitors', $GLOBALS['conf']['online']['ttl']);
+ if ($recent) {
+ $recent = unserialize($recent);
+ } else {
+ $recent = $this->_getRecentVisitors($limit);
+ if ($recent instanceof PEAR_Error) {
+ return $recent;
+ }
+ $GLOBALS['cache']->set('folksRecentVisitors', serialize($recent));
+ }
+
+ return $recent;
+ }
+
+ /**
+ * Get last signed up users
+ *
+ * @return array users online
+ */
+ public function getNewUsers($limit = 10)
+ {
+ $new = $GLOBALS['cache']->get('folksNewUsers', $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($new) {
+ $new = unserialize($new);
+ } else {
+ $new = $this->getUsers(array('sort_by' => 'signup_at',
+ 'sort_dir' => 1), 0, $limit);
+ if ($new instanceof PEAR_Error) {
+ return $new;
+ }
+ $GLOBALS['cache']->set('folksNewUsers', serialize($new));
+ }
+
+ return $new;
+ }
+
+ /**
+ * Get random users
+ *
+ * @param integer $limit Username to check
+ * @param boolean $online User is online?
+ *
+ * @return array users
+ */
+ public function getRandomUsers($limit = 10, $online = true)
+ {
+ $random = $GLOBALS['cache']->get('folksRandomUsers' . $limit . '-' . $online, $GLOBALS['conf']['online']['ttl']);
+ if ($random) {
+ $random = unserialize($random);
+ } else {
+ $random = $this->_getRandomUsers($limit, $online);
+ if ($random instanceof PEAR_Error) {
+ return $random;
+ }
+ $GLOBALS['cache']->set('folksRandomUsers' . $limit . '-' . $online, serialize($random));
+ }
+
+ return $random;
+ }
+
+ /**
+ * Check if a user is online
+ *
+ * @param string $user Username to check
+ *
+ * @return boolean
+ */
+ public function isOnline($user)
+ {
+ $online = $this->getOnlineUsers();
+
+ return array_key_exists($user, $online);
+ }
+
+ /**
+ * Update user online status
+ */
+ public function updateOnlineStatus()
+ {
+ // Update user online status only if needed
+ // is not added site wide to a general template file
+ // scripts/online.sql
+ if ($GLOBALS['conf']['online']['autoupdate'] &&
+ (!isset($_SESSION['folks']['last_update']) ||
+ $_SESSION['folks']['last_update'] + $GLOBALS['conf']['online']['ttl'] < $_SERVER['REQUEST_TIME'])) {
+
+ // Update online status
+ $this->_updateOnlineStatus();
+
+ // Update profile
+ if (Auth::isAuthenticated()) {
+ $this->_saveProfile(array('last_online_on' => $_SERVER['REQUEST_TIME']), Auth::getAuth());
+ }
+ }
+
+ // Delete aways users of needed - if not done by cron job as recomended.
+ if ($GLOBALS['conf']['online']['autodelete']) {
+ $to = $_SERVER['REQUEST_TIME'] - $GLOBALS['conf']['online']['ttl'];
+ $this->_deleteOnlineStatus($to);
+ }
+ }
+
+ /**
+ * Get raw profile of current user
+ */
+ public function getRawProfile($user)
+ {
+ return $this->_getProfile($user);
+ }
+
+ /**
+ * Get user profile
+ *
+ * @param string $user Username
+ */
+ public function getProfile($user = null)
+ {
+ static $profiles;
+
+ if ($user == null) {
+ $user = Auth::getAuth();
+ }
+
+ if (empty($user)) {
+ return PEAR::raiseError(sprintf(_("User \"%s\" does not exists."), $user));
+ }
+
+ if (isset($profiles[$user])) {
+ return $profiles[$user];
+ }
+
+ $profile = $GLOBALS['cache']->get('folksProfile' . $user, $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($profile || (Auth::isAdmin() && Util::getGet('debug'))) {
+
+ $profile = unserialize($profile);
+
+ } else {
+
+ // Load profile
+ $profile = $this->_getProfile($user);
+ if ($profile instanceof PEAR_Error) {
+ return $profile;
+ }
+
+ // Filter description
+ require_once 'Horde/Text/Filter.php';
+ $filters = array('text2html', 'bbcode', 'highlightquotes', 'emoticons');
+ $filters_params = array(array('parselevel' => TEXT_HTML_MICRO),
+ array(),
+ array(),
+ array());
+
+ if (($hasBBcode = strpos($profile['user_description'], '[')) !== false &&
+ strpos($profile['user_description'], '[/', $hasBBcode) !== false) {
+ $filters_params[0]['parselevel'] = TEXT_HTML_NOHTML;
+ }
+
+ $profile['user_description'] = Text_Filter::filter(trim($profile['user_description']), $filters, $filters_params);
+
+ // Get user last external data
+ foreach ($profile as $key => $value) {
+ if (substr($key, 0, 6) != 'count_') {
+ continue;
+ }
+ $service = substr($key, 6);
+ if ($GLOBALS['conf']['services']['countcron']) {
+ if (empty($value)) {
+ continue;
+ }
+ } else {
+ $profile['count_' . $service] = Horde::callHook('_folks_hook_countService', array($service, $user), 'folks');
+ if ($profile['count_' . $service] instanceof PEAR_Error) {
+ return $profile['count_' . $service];
+ } elseif (empty($profile['count_' . $service])) {
+ continue;
+ }
+ }
+ $profile['count_' . $service . '_list'] = Horde::callHook('_folks_hook_getService', array($service, $user), 'folks');
+ if ($profile['count_' . $service . '_list'] instanceof PEAR_Error) {
+ return PEAR::raiseError($profile['count_' . $service . '_list']);
+ } elseif (empty($profile['count_' . $service . '_list'])) {
+ $profile['count_' . $service] = 0;
+ }
+ }
+
+ // Cache profile
+
+ // cache profile
+ $GLOBALS['cache']->set('folksProfile' . $user, serialize($profile));
+ }
+
+ $profiles[$user] = $profile;
+
+ return $profile;
+ }
+
+ /**
+ * Change user password
+ *
+ * @param string $password Plain password
+ * @param string $user Username
+ */
+ public function changePassword($password, $user = null)
+ {
+ if ($user == null) {
+ $user = Auth::getAuth();
+ }
+
+ $password = md5($password);
+
+ return $this->_saveProfile(array('user_password' => $password), $user);
+ }
+
+ /**
+ * Save user profile
+ *
+ * @param array $data Profile data
+ * @param string $user Username
+ */
+ public function saveProfile($data, $user = null)
+ {
+ if ($user == null) {
+ $user = Auth::getAuth();
+ }
+
+ $GLOBALS['cache']->expire('folksProfile' . $user);
+
+ return $this->_saveProfile($data, $user);
+ }
+
+ /**
+ * Logs a user view.
+ *
+ * @param string $id Username
+ *
+ * @return boolean True, if the view was logged, false if the mesage was aleredy seen
+ */
+ function logView($id)
+ {
+ if (!Auth::isAuthenticated() || Auth::getAUth() == $id) {
+ return false;
+ }
+
+ /* We already read this user? */
+ if (isset($_COOKIE['folks_viewed_user']) &&
+ strpos($_COOKIE['folks_viewed_user'], $id . ':') !== false) {
+ return false;
+ }
+
+ /* Remember when we see a user */
+ if (!isset($_COOKIE['folks_viewed_user'])) {
+ $_COOKIE['folks_viewed_user'] = $id . ':';
+ } else {
+ $_COOKIE['folks_viewed_user'] .= $id . ':';
+ }
+
+ setcookie('folks_viewed_user', $_COOKIE['folks_viewed_user'], $_SERVER['REQUEST_TIME'] + 22896000, $GLOBALS['conf']['cookie']['path'],
+ $GLOBALS['conf']['cookie']['domain'], $GLOBALS['conf']['use_ssl'] == 1 ? 1 : 0);
+
+ return $this->_logView($id);
+ }
+
+ /**
+ * Delete user
+ *
+ * @param string $user Username
+ *
+ * @return boolean
+ */
+ public function deleteUser($user)
+ {
+ if (!Auth::isAdmin()) {
+ return false;
+ }
+
+ // Delete image
+ $result = $this->deleteImage($user);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ // Delete groups
+ if ($GLOBALS['conf']['friends']) {
+ $shares = Horde_Share::singleton('folks');
+ $groups = $shares->listShares(Auth::getAuth(), PERMS_SHOW, true);
+ foreach ($groups as $share) {
+ $result = $shares->removeShare($share);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+ }
+ }
+
+ // Delete comments
+ if ($registry->hasMethod('forums/deleteForum')) {
+ $comments = $registry->call('forums/deleteForum', array('folks', $user));
+ if ($comments instanceof PEAR_Error) {
+ return $comments;
+ }
+ }
+
+ // Delete user
+ $result = $this->_deleteUser($user);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ // Delete cache
+ $GLOBALS['cache']->expire('folksProfile' . $user);
+
+ return true;
+ }
+
+ /**
+ * Get user attributes
+ *
+ * @param string $user Username
+ * @param string $group Only a specific group
+ */
+ public function getAttributes($user = null, $group = null)
+ {
+ if ($user == null) {
+ $user = Auth::getAuth();
+ }
+
+ $attributes = $GLOBALS['cache']->get('folksUserAttributes' . $user, $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($attributes) {
+ $attributes = unserialize($attributes);
+ } else {
+ $attributes = $this->_getAttributes($user);
+ if ($attributes instanceof PEAR_Error) {
+ return $attributes;
+ }
+ $GLOBALS['cache']->set('folksUserAttributes' . $user, serialize($attributes));
+ }
+
+ return $group ? (isset($attributes[$group]) ? $attributes[$group] : array()) : $attributes;
+ }
+
+ /**
+ * Save user attributes
+ *
+ * @param array $data Attributes data
+ * @param string $user Username
+ * @param string $group Only a specific group
+ */
+ public function saveAttributes($data, $group, $user = null)
+ {
+ if ($user == null) {
+ $user = Auth::getAuth();
+ }
+
+ $GLOBALS['cache']->expire('folksAttributes' . $user);
+
+ return $this->_saveAttributes($data, $group, $user);
+ }
+
+ /**
+ * Compare an encrypted pasword to a plaintext string to see if
+ * they match.
+ *
+ * @param string $user Username
+ * @param string $plaintext The plaintext pasword to verify.
+ *
+ * @return boolean True if matched, false otherwise.
+ */
+ public function comparePassword($user, $plaintext)
+ {
+ $encrypted = $this->_getCryptedPassword($user);
+ if ($encrypted instanceof PEAR_Error) {
+ return $encrypted;
+ } elseif (empty($encrypted)) {
+ return false;
+ }
+
+ return $encrypted == md5($plaintext);
+ }
+
+ /**
+ * Get encripted cookie login string
+ *
+ * @param string $user Username to get cookie for
+ *
+ * @return string Encripted
+ */
+ public function getCookie($user)
+ {
+ $encrypted = $this->_getCryptedPassword($user);
+ if ($encrypted instanceof PEAR_Error) {
+ return $encrypted;
+ }
+
+ // force relogin once a mount and user pass to encript cookie
+ $key = date('m') . $encrypted;
+
+ return Folks::encodeString($user, $key);
+ }
+
+ /**
+ * Get confirmation code
+ *
+ * @param string $user Username to get code for
+ * @param string $type Code type
+ *
+ * @return string Confirmation code
+ */
+ public function getConfirmationCode($user, $type = 'activate')
+ {
+ $encrypted = $this->_getCryptedPassword($user);
+ if ($encrypted instanceof PEAR_Error) {
+ return $encrypted;
+ }
+
+ return Folks::encodeString($user, $type . $encrypted);
+ }
+
+ /**
+ * Save search criteria
+ *
+ * @param string $criteria Search criteria
+ * @param string $name Search name
+ */
+ public function saveSearch($criteria, $name)
+ {
+ $GLOBALS['cache']->expire('folksearch' . Auth::getAuth());
+
+ return $this->_saveSearch($criteria, $name);
+ }
+
+ /**
+ * Get saved search
+ *
+ * @return array saved searches
+ */
+ public function getSavedSearch()
+ {
+ $search = $GLOBALS['cache']->get('folksearch' . Auth::getAuth(), $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($search) {
+ return unserialize($search);
+ }
+
+ $search = $this->_getSavedSearch();
+ if ($search instanceof PEAR_Error) {
+ return $search;
+ }
+
+ $GLOBALS['cache']->set('folksearch' . Auth::getAuth(), serialize($search));
+
+ return $search;
+ }
+
+ /**
+ * Get saved search criteria
+ *
+ * @param string $name Username
+ *
+ * @return array search criteria
+ */
+ public function getSearchCriteria($name)
+ {
+ $criteria = $this->_getSearchCriteria($name);
+ if ($criteria instanceof PEAR_Error) {
+ return $criteria;
+ }
+
+ return unserialize($criteria);
+ }
+
+ /**
+ * Delete saved search
+ *
+ * @param string $name Username
+ */
+ public function deleteSavedSearch($name)
+ {
+ $GLOBALS['cache']->expire('folksearch' . Auth::getAuth());
+
+ return $this->_deleteSavedSearch($name);
+ }
+
+ /**
+ * Log users activity
+ *
+ * @param string $message Activity message
+ * @param string $scope Scope
+ * @param string $user $user
+ *
+ * @return true on success
+ */
+ public function logActivity($message, $scope = 'folks', $user = null)
+ {
+ if ($user == null) {
+ $user = Auth::getAuth();
+ }
+
+ if (empty($message)) {
+ return PEAR::raiseError(_("You cannot post an empty activity message."));
+ }
+
+ // Don't log user comments
+ if ($scope == 'folks:comments' && !$GLOBALS['prefs']->getValue('log_user_comments')) {
+ return true;
+
+ // Don't log account changes
+ } elseif ($scope == 'folks' && !$GLOBALS['prefs']->getValue('log_account_changes')) {
+ return true;
+ }
+
+ // Don't log conetnt posting
+ $scopes = unserialize($GLOBALS['prefs']->getValue('log_scopes'));
+ if (!empty($scopes) && in_array($scopes, $scope)) {
+ return true;
+ }
+
+ // Don't log comments
+ $scope_app = explode(':', $scope);
+ $scopes = unserialize($GLOBALS['prefs']->getValue('log_scope_comments'));
+ if (!empty($scopes) && in_array($scopes, $scope_app[0])) {
+ return true;
+ }
+
+ $GLOBALS['cache']->expire($user . '_activity');
+ return $this->_logActivity($message, $scope, $user);
+ }
+
+ /**
+ * Get user's activity
+ *
+ * @param string $user Username
+ * @param int $limit Number of actions to return
+ *
+ * @return array Activity log
+ */
+ public function getActivity($user, $limit = 10)
+ {
+ $activity = $GLOBALS['cache']->get($user . '_activity', $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($activity) {
+ return unserialize($activity);
+ } else {
+ $activity = $this->_getActivity($user, $limit);
+ if ($activity instanceof PEAR_Error) {
+ return $activity;
+ }
+
+ $GLOBALS['cache']->set($user . '_activity', serialize($activity));
+ }
+
+ return $activity;
+ }
+
+ /**
+ * Delete users activity
+ *
+ * @param string $scope Scope
+ * @param integer $date Date
+ *
+ * @return true on success
+ */
+ public function deleteActivity($scope, $date)
+ {
+ $user = Auth::getAuth();
+ $GLOBALS['cache']->expire($user . '_activity');
+ return $this->_deleteActivity($scope, $date, $user);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Folks storage implementation for PHP's PEAR database abstraction layer.
+ *
+ * Required values for $params:<pre>
+ * 'phptype' The database type (e.g. 'pgsql', 'mysql', etc.).
+ * 'table' The name of the foo table in 'database'.
+ * 'charset' The database's internal charset.</pre>
+ *
+ * Required by some database implementations:<pre>
+ * 'database' The name of the database.
+ * 'hostspec' The hostname of the database server.
+ * 'protocol' The communication protocol ('tcp', 'unix', etc.).
+ * 'username' The username with which to connect to the database.
+ * 'password' The password associated with 'username'.
+ * 'options' Additional options to pass to the database.
+ * 'tty' The TTY on which to connect to the database.
+ * 'port' The port on which to connect to the database.</pre>
+ *
+ * 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 $
+ *
+ * Copyright 2007 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.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Driver_sql extends Folks_Driver {
+
+ /**
+ * Handle for the current database connection.
+ *
+ * @var DB
+ */
+ private $_db;
+
+ /**
+ * Handle for the current database connection, used for writing. Defaults
+ * to the same handle as $_db if a separate write database is not required.
+ *
+ * @var DB
+ */
+ private $_write_db;
+
+ /**
+ * Constructs a new SQL storage object.
+ *
+ * @param array $params A hash containing connection parameters.
+ */
+ public function __construct($params = array())
+ {
+ $this->_params = $params;
+ $this->_connect();
+ }
+
+ /**
+ * Get usersnames online
+ */
+ protected function _getOnlineUsers()
+ {
+ return $this->_db->getCol('SELECT user_uid FROM ' . $this->_params['online'] . ' WHERE user_uid <> ""');
+ }
+
+ /**
+ * Get last visitors
+ */
+ 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;
+
+ return $this->_db->getCol($sql);
+ }
+
+ /**
+ * Get random users
+ *
+ * @param integer $limit Username to check
+ * @param boolean $online User is online?
+ *
+ * @return array users
+ */
+ protected function _getRandomUsers($limit = 10, $online = false)
+ {
+ if ($online) {
+ $sql = 'SELECT u.user_uid FROM ' . $this->_params['table'] . ' u, .' . $this->_params['online'] . ' o '
+ . ' WHERE u.user_picture = 1 AND o.user_uid = u.user_uid ORDER BY RAND() LIMIT 0, ' . (int)$limit;
+ } else {
+ $sql = 'SELECT user_uid FROM ' . $this->_params['table']
+ . ' WHERE user_picture = 1 ORDER BY RAND() LIMIT 0, ' . (int)$limit;
+ }
+
+ return $this->_db->getCol($sql);
+ }
+
+ /**
+ * Get usersnames online
+ */
+ 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']));
+ }
+
+ /**
+ * Delete users online
+ */
+ protected function _deleteOnlineStatus($to)
+ {
+ $query = 'DELETE FROM ' . $this->_params['online'] . ' WHERE time_last_click < ?';
+ return $this->_write_db->query($query, array($to));
+ }
+
+ /**
+ * Remove user if is online
+ */
+ public function deleteOnlineUser($user)
+ {
+ $query = 'DELETE FROM ' . $this->_params['online'] . ' WHERE user_uid = ?';
+ return $this->_write_db->query($query, array($user));
+ }
+
+ /**
+ * Get users by attributes
+ */
+ public function getUsers($criteria = array(), $from = 0, $count = 0)
+ {
+ $binds = $this->_buildWhere($criteria, false);
+
+ if (!isset($criteria['sort_by'])) {
+ $criteria['sort_by'] = $GLOBALS['prefs']->getValue('sort_by');
+ }
+ if (isset($criteria['sort_dir'])) {
+ $criteria['sort_dir'] = $criteria['sort_dir'] ? 'ASC' : 'DESC';
+ } else {
+ $criteria['sort_dir'] = $GLOBALS['prefs']->getValue('sort_dir') ? 'ASC' : 'DESC';
+ }
+
+ $binds[0] = 'SELECT u.* ' . $binds[0]
+ . ' ORDER BY u.' . $criteria['sort_by']
+ . ' ' . $criteria['sort_dir'];
+
+ if ($count) {
+ $binds[0] = $this->_db->modifyLimitQuery($binds[0], $from, $count);
+ }
+
+ return $this->_db->getAssoc($binds[0], false, $binds[1], DB_FETCHMODE_ASSOC);
+ }
+
+ /**
+ * Count users by attributes
+ */
+ public function countUsers($criteria = array())
+ {
+ $binds = $this->_buildWhere($criteria, true);
+ $binds[0] = 'SELECT COUNT(*) ' . $binds[0];
+
+ return $this->_db->getOne($binds[0], $binds[1]);
+ }
+
+ /**
+ * Build attributes query
+ *
+ * @return array An array containing sql statement and parameters
+ */
+ private function _buildWhere($criteria = array())
+ {
+ static $parts;
+
+ $id = serialize($criteria);
+ if (isset($parts[$id])) {
+ return $parts[$id];
+ }
+
+ if (empty($criteria)) {
+ $parts[$id] = array(' FROM ' . $this->_params['table'] . ' u', array());
+ return $parts[$id];
+ }
+
+ $tables = $this->_params['table'] . ' u ';
+ $params = array();
+ $where = '';
+
+ // WORD
+ if (!empty($criteria['word']) && !empty($criteria['by'])) {
+ foreach ($criteria['by'] as $key) {
+ $where .= ' AND u.user_' . $key . ' LIKE ?';
+ $params[] = '%' . $criteria['word'] . '%';
+ }
+ }
+
+ // EMAIL
+ if (!empty($criteria['email'])) {
+ $where .= ' AND u.user_email = ?';
+ $params[] = $criteria['email'];
+ }
+
+ // AGES
+ if (isset($criteria['birthday'])) {
+ if (is_array($criteria['birthday'])) {
+ $where .= ' AND DAYOFYEAR(u.user_birthday) >= ? AND DAYOFYEAR(u.user_birthday) <= ?';
+ $params[] = date('z', $criteria['birthday']['from']) + 1;
+ $params[] = date('z', $criteria['birthday']['to']) + 1;
+ } else {
+ $where .= ' AND u.user_birthday LIKE ?';
+ $params[] = '%' . $criteria['birthday'];
+ }
+ }
+
+ if (isset($criteria['age_from'])) {
+ $where .= ' AND u.user_birthday <= ?';
+ $params[] = (date('Y') - $criteria['age_from']) . '-' . date('m-d');
+ }
+
+ if (isset($criteria['age_to'])) {
+ $where .= ' AND u.user_birthday >= ?';
+ $params[] = (date('Y') - $criteria['age_to']) . '-' . date('m-d');
+ }
+
+ // GOES OUT
+ if (isset($criteria['out'])) {
+ $tables .= ', ' . $this->_params['out'] . ' g ';
+ $where .= ' AND u.user_uid = g.user_uid AND g.out_from >= ? AND g.out_to <= ? ';
+ $params[] = $criteria['out']['from'];
+ $params[] = $criteria['out']['to'];
+ }
+
+ // COUNTERS
+ if (isset($criteria['has'])) {
+ foreach ($criteria['has'] as $key) {
+ if ($key == 'picture') {
+ $where .= ' AND u.user_picture > 0';
+ } else {
+ $where .= ' AND u.count_' . $key . ' > 0';
+ }
+ }
+ }
+
+ // ONLINE
+ if (isset($criteria['online'])) {
+ $tables .= ', ' . $this->_params['online'] . ' o ';
+ $where .= ' AND o.user_uid <> "" AND o.user_uid = u.user_uid';
+ }
+
+ // Gander
+ if (isset($criteria['user_gender'])) {
+ $where .= ' AND user_gender = ? ';
+ $params[] = (int)$criteria['user_gender'];
+ }
+
+ // City
+ if (isset($criteria['user_city'])) {
+ $where .= ' AND user_city LIKE ? ';
+ $params[] = '%' . $criteria['user_city'] . '%';
+ }
+
+ $sql = ' FROM ' . $tables;
+ if (!empty($where)) {
+ $sql .= ' WHERE ' . substr($where, 4);
+ }
+
+ $parts[$id] = array($sql, $params);
+
+ return $parts[$id];
+ }
+
+ /**
+ * Formats a password using the current encryption.
+ *
+ * @param string $user User we are getting password for
+ *
+ * @return string The encrypted password.
+ */
+ protected function _getCryptedPassword($user)
+ {
+ $query = 'SELECT user_password FROM ' . $this->_params['table'] . ' WHERE user_uid = ?';
+ return $this->_db->getOne($query, array($user));
+ }
+
+ /**
+ * Get user profile
+ *
+ * @param string $user Username
+ */
+ protected function _getProfile($user)
+ {
+ $query = 'SELECT user_email, user_status, user_url, user_description, user_comments, '
+ . ' user_city, user_country, user_gender, user_birthday, user_video, '
+ . ' last_online, last_online_on, activity_log, user_vacation, activity, popularity, '
+ . ' user_picture, count_classifieds, count_news, count_videos, '
+ . ' count_attendances, count_wishes, count_galleries, count_blogs '
+ . ' FROM ' . $this->_params['table'] . ' WHERE user_uid = ?';
+
+ $result = $this->_db->getRow($query, array(strval($user)), DB_FETCHMODE_ASSOC);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ } elseif (empty($result)) {
+ return PEAR::raiseError(sprintf(_("User \"%s\" does not exists."), $user));
+ }
+
+ return $result;
+ }
+
+ /**
+ * Save basic user profile
+ *
+ * @param array $data A hash containing profile data
+ * @param string $user Username
+ */
+ protected function _saveProfile($data, $user)
+ {
+ if (empty($data['user_picture'])) {
+ unset($data['user_picture']);
+ } else {
+ $image = $this->_saveImage($data['user_picture']['file'], $user);
+ if ($image instanceof PEAR_Error) {
+ return $image;
+ }
+ $data['user_picture'] = 1;
+ }
+
+ $query = 'UPDATE ' . $this->_params['table'] . ' SET '
+ . implode(' = ?, ', array_keys($data))
+ . ' = ? WHERE user_uid = ?';
+
+ $data[0] = $user;
+
+ return $this->_write_db->query($query, $data);
+ }
+
+ /**
+ * Update user comments count
+ *
+ * @param string $user Username
+ */
+ public function updateComments($user, $reset = false)
+ {
+ $query = 'UPDATE ' . $this->_params['table'] . ' SET count_comments = ';
+ if ($reset) {
+ $query .= '0';
+ } else {
+ $query .= 'count_comments + 1';
+ }
+ $query .= ' WHERE user_uid = ?';
+
+ return $this->_write_db->query($query, array($user));
+ }
+
+ /**
+ * Delete user image
+ *
+ * @param string $user Username
+ */
+ protected function _deleteImage($user)
+ {
+ $query = 'UPDATE ' . $this->_params['table'] . ' SET user_picture = 0 WHERE user_uid = ?';
+ return $this->_write_db->query($query, array($user));
+ }
+
+ /**
+ * Log user view
+ *
+ * @param string $user Username
+ */
+ 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']));
+ }
+
+ /**
+ * Get user groups
+ *
+ * @param string $user Username
+ */
+ public function getViews()
+ {
+ $query = 'SELECT user_uid FROM ' . $this->_params['views'] . ' WHERE view_uid = ?';
+ return $this->_db->getCol($query, 0, array(Auth::getAuth()));
+ }
+
+ /**
+ * Check if user exist
+ *
+ * @param string $user Username
+ *
+ * @return boolean
+ */
+ public function userExists($user)
+ {
+ $query = 'SELECT 1 FROM ' . $this->_params['table'] . ' WHERE user_uid = ?';
+ $result = $this->_db->getOne($query, array($user));
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ return (boolean)$result;
+ }
+
+ /**
+ * Add dummy user data
+ */
+ public function addUser($user)
+ {
+ // password and mail will be added later with the addextra hook
+ $query = 'INSERT INTO ' . $this->_params['table']
+ . ' (user_uid, user_status, user_password, user_email, signup_at, signup_by) '
+ . ' VALUES (?, ?, ?, ?, NOW(), ?)';
+ $params = array($user, 'inactive', rand(),
+ rand() . '@' . $_SERVER['REMOTE_ADDR'],
+ $_SERVER['REMOTE_ADDR']);
+
+ return $this->_write_db->query($query, $params);
+ }
+
+ /**
+ * Delete user
+ *
+ * @param string $user Username
+ *
+ * @return boolean
+ */
+ protected function _deleteUser($user)
+ {
+ $tables = array($this->_params['table'],
+ $this->_params['attributes'],
+ $this->_params['friends'],
+ $this->_params['testimonials'],
+ $this->_params['online'],
+ $this->_params['views'],
+ $this->_params['out']);
+
+ foreach ($tables as $table) {
+ $query = 'DELETE FROM ' . $table . ' WHERE user_uid = ?';
+ $result = $this->_write_db->query($query, array($user));
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Save search criteria
+ *
+ * @param string $criteria Search criteria
+ * @param string $name Search name
+ */
+ protected function _saveSearch($criteria, $name)
+ {
+ $query = 'INSERT INTO ' . $this->_params['search'] . ' (user_uid, search_name, search_criteria) VALUES (?, ?, ?)';
+
+ return $this->_write_db->query($query, array(Auth::getAuth(), $name, $criteria));
+ }
+
+ /**
+ * Get saved search
+ *
+ * @return array saved searches
+ */
+ protected function _getSavedSearch()
+ {
+ $query = 'SELECT search_name FROM ' . $this->_params['search'] . ' WHERE user_uid = ?';
+
+ return $this->_db->getCol($query, 'search_name', Auth::getAuth());
+ }
+
+ /**
+ * Get saved search criteria
+ *
+ * @param string $name Username
+ *
+ * @return array search criteria
+ */
+ protected function _getSearchCriteria($name)
+ {
+ $query = 'SELECT search_criteria FROM ' . $this->_params['search'] . ' WHERE user_uid = ? AND search_name = ?';
+
+ return $this->_db->getOne($query, array(Auth::getAuth(), $name));
+ }
+
+ /**
+ * Delete saved search
+ *
+ * @param string $name Username
+ */
+ protected function _deleteSavedSearch($name)
+ {
+ $query = 'DELETE FROM ' . $this->_params['search'] . ' WHERE user_uid = ? AND search_name = ?';
+
+ return $this->_write_db->query($query, array(Auth::getAuth(), $name));
+ }
+
+ /**
+ * Log users actions
+ *
+ * @param string $message Log message
+ * @param string $scope Scope
+ * @param string $user Username
+ *
+ * @return true on success
+ */
+ protected function _logActivity($message, $scope, $user)
+ {
+ $query = 'INSERT INTO ' . $this->_params['activity']
+ . ' (user_uid, activity_message, activity_scope, activity_date) VALUES (?, ?, ?, ?)';
+
+ return $this->_write_db->query($query, array($user, $message, $scope, $_SERVER['REQUEST_TIME']));
+ }
+
+ /**
+ * Get user's activity
+ *
+ * @param string $user Username
+ * @param string $activity Number of actions to return
+ *
+ * @return array Activity log
+ */
+ protected function _getActivity($user, $limit)
+ {
+ $query = 'SELECT activity_message, activity_scope, activity_date FROM '
+ . $this->_params['activity'] . ' WHERE user_uid = ? '
+ . 'ORDER BY activity_date DESC';
+ $query = $this->_db->modifyLimitQuery($query, 0, $limit);
+
+ return $this->_db->getAll($query, array($user), DB_FETCHMODE_ASSOC);
+ }
+
+ /**
+ * Delete users activity
+ *
+ * @param string $scope Scope
+ * @param integer $date Date
+ * @param string $user Username
+ *
+ * @return true on success
+ */
+ protected function _deleteActivity($scope, $date, $user)
+ {
+ $query = 'DELETE FROM ' . $this->_params['activity']
+ . ' WHERE user_uid = ? AND activity_scope = ? AND activity_date = ?';
+
+ return $this->_write_db->query($query, array($user, $scope, $date));
+ }
+
+ /**
+ * Attempts to open a persistent connection to the SQL server.
+ *
+ * @return boolean True on success; exits (Horde::fatal()) on error.
+ */
+ private function _connect()
+ {
+ Horde::assertDriverConfig($this->_params, 'storage',
+ array('phptype', 'charset', 'table'));
+
+ if (!isset($this->_params['database'])) {
+ $this->_params['database'] = '';
+ }
+ if (!isset($this->_params['username'])) {
+ $this->_params['username'] = '';
+ }
+ if (!isset($this->_params['hostspec'])) {
+ $this->_params['hostspec'] = '';
+ }
+
+ /* Connect to the SQL server using the supplied parameters. */
+ $this->_write_db = DB::connect($this->_params,
+ array('persistent' => !empty($this->_params['persistent'])));
+ if ($this->_write_db instanceof PEAR_Error) {
+ Horde::fatal($this->_write_db, __FILE__, __LINE__);
+ }
+
+ // Set DB portability options.
+ switch ($this->_write_db->phptype) {
+ case 'mssql':
+ $this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
+ break;
+ default:
+ $this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
+ }
+
+ /* Check if we need to set up the read DB connection seperately. */
+ if (!empty($this->_params['splitread'])) {
+ $params = array_merge($this->_params, $this->_params['read']);
+ $this->_db = DB::connect($params,
+ array('persistent' => !empty($params['persistent'])));
+ if ($this->_db instanceof PEAR_Error) {
+ Horde::fatal($this->_db, __FILE__, __LINE__);
+ }
+
+ // Set DB portability options.
+ switch ($this->_db->phptype) {
+ case 'mssql':
+ $this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
+ break;
+ default:
+ $this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
+ }
+
+ } else {
+ /* Default to the same DB handle for the writer too. */
+ $this->_db =& $this->_write_db;
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Folks Base Class.
+ *
+ * $Id: Folks.php 976 2008-10-07 21:24:47Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+class Folks {
+
+ const VFS_PATH = '.horde/folks';
+
+ /**
+ * Returns published videos from user
+ *
+ * @param string $user User to check
+ */
+ static function format_date($time)
+ {
+ return strftime($GLOBALS['prefs']->getValue('date_format'), $time);
+ }
+
+ /**
+ * Returns published videos from user
+ *
+ * @param string $user User to check
+ */
+ static function format_datetime($time)
+ {
+ return strftime($GLOBALS['prefs']->getValue('date_format'), $time)
+ . ' '
+ . (date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:ia', $time));
+ }
+
+ /**
+ * Returns avaiable countries
+ */
+ static function getCountries()
+ {
+ if (file_exists(FOLKS_BASE . '/config/countries.php')) {
+ $countries = Horde::loadConfiguration('countries.php', 'countries', 'folks');
+ } else {
+ $countries = NLS::getCountryISO();
+ }
+
+ return $countries;
+ }
+
+ /**
+ * Get Image path
+ */
+ static public function getImageUrl($user, $view = 'small')
+ {
+ if (empty($GLOBALS['conf']['images']['direct'])) {
+ return Util::addParameter(Horde::applicationUrl('view.php'),
+ array('view' => $view,
+ 'id' => $user),
+ null, false);
+ } else {
+ $p = md5($user);
+ return $GLOBALS['conf']['images']['direct'] .
+ '/' . substr(str_pad($p, 2, 0, STR_PAD_LEFT), -2) . '/' . $view . '/' .
+ $p . '.' . $GLOBALS['conf']['images']['image_type'];
+ }
+ }
+
+ /**
+ * Return a properly formatted link depending on the global pretty url
+ * configuration
+ *
+ * @param string $controller The controller to generate a URL for.
+ * @param array $data The data needed to generate the URL.
+ * @param boolean $full Generate a full URL.
+ * @param integer $append_session 0 = only if needed, 1 = always,
+ * -1 = never.
+ *
+ * @param string The generated URL
+ */
+ function getUrlFor($controller, $data, $full = false, $append_session = 0)
+ {
+
+ switch ($controller) {
+
+ case 'list':
+ if (empty($GLOBALS['conf']['urls']['pretty'])) {
+ return Horde::applicationUrl($data . '.php', $full, $append_session);
+ } else {
+ return Horde::applicationUrl('list/' . $data, $full, $append_session);
+ }
+
+ case 'user':
+ if (empty($GLOBALS['conf']['urls']['pretty'])) {
+ return Util::addParameter(Horde::applicationUrl('user.php', $full, $append_session), 'user', $data);
+ } else {
+ return Horde::applicationUrl('user/' . $data, $full, $append_session);
+ }
+ }
+ }
+
+ /**
+ * Calculate user age
+ */
+ static public function calcAge($birthday)
+ {
+ list($year, $month, $day) = explode('-', $birthday);
+ $year_diff = date('Y') - $year;
+ $month_diff = date('m') - $month;
+ $day_diff = date('d') - $day;
+
+ if ($month_diff < 0) {
+ $year_diff--;
+ } elseif (($month_diff == 0) && ($day_diff < 0)) {
+ $year_diff--;
+ }
+
+ if ($year_diff < 1 || $year == '0000') {
+ return array('age' => '', 'sign' => '');
+ }
+
+ $sign = '';
+ switch ($month) {
+
+ case 1:
+ $sign = ($day<21) ? _("Capricorn") : _("Aquarius");
+ break;
+
+ case 2:
+ $sign = ($day<20) ? _("Aquarius") : _("Pisces");
+ break;
+
+ case 3:
+ $sign = ($day<21) ? _("Pisces") : _("Aries");
+ break;
+
+ case 4:
+ $sign = ($day<21) ? _("Aries") : _("Taurus");
+ break;
+
+ case 5:
+ $sign = ($day<22) ? _("Taurus") : _("Gemini");
+ break;
+
+ case 6:
+ $sign = ($day<22) ? _("Gemini") : _("Cancer");
+ break;
+
+ case 7:
+ $sign = ($day<23) ? _("Cancer") : _("Leo");
+ break;
+
+ case 8:
+ $sign = ($day<24) ? _("Leo") : _("Virgo");
+ break;
+
+ case 9:
+ $sign = ($day<24) ? _("Virgo") : _("Libra");
+ break;
+
+ case 10:
+ $sign = ($day<24) ? _("Libra") : _("Scorpio");
+ break;
+
+ case 11:
+ $sign = ($day<23) ? _("Scorpio") : _("Sagittarius");
+ break;
+
+ case 12:
+ $sign = ($day<21) ? _("Sagittarius") : _("Capricorn");
+ break;
+
+ }
+
+ return array('age' => $year_diff, 'sign' => $sign);
+ }
+
+ /**
+ * Returns a new or the current CAPTCHA string.
+ */
+ static public function getCAPTCHA($new = false)
+ {
+ if ($new || empty($_SESSION['folks']['CAPTCHA'])) {
+ $_SESSION['folks']['CAPTCHA'] = '';
+ for ($i = 0; $i < 5; $i++) {
+ $_SESSION['folks']['CAPTCHA'] .= chr(rand(65, 90));
+ }
+ }
+
+ return $_SESSION['folks']['CAPTCHA'];
+ }
+
+ /**
+ * Get encripted cookie login string
+ *
+ * @param string $string String to encode
+ * @param string $key Key to encode with
+ *
+ * @return string Encripted
+ */
+ static function encodeString($string, $key)
+ {
+ $key = substr(md5($key), 0, 24);
+ $iv_size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ECB);
+ $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+ $string = mcrypt_ecb(MCRYPT_3DES, $key, $string, MCRYPT_ENCRYPT, $iv);
+ return base64_encode($string);
+ }
+
+ /**
+ * Send email with attachments
+ *
+ * @param string $from From address
+ * @param string $subject Subject of message
+ * @param string $body Body of message
+ * @param array $attaches Path of file to attach
+ *
+ * @return true on succes, PEAR_Error on failure
+ */
+ static public function sendMail($to, $subject, $body, $attaches = array())
+ {
+ global $conf;
+
+ require_once FOLKS_BASE . '/lib/version.php';
+ require_once 'Horde/MIME/Mail.php';
+
+ $mail = new MIME_Mail($subject, $body, $to, $conf['support'], NLS::getCharset());
+ $mail->addHeader('User-Agent', 'Folks ' . FOLKS_VERSION);
+ foreach ($attaches as $file) {
+ if (file_exists($file)) {
+ $mail->addAttachment($file, null, null, NLS::getCharset());
+ }
+ }
+
+ return $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
+ }
+
+ /**
+ * Fetch user email
+ *
+ * @param string $user Username
+ *
+ * @return email on succes, PEAR_Error on failure
+ */
+ 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->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()) {
+ $profile = $GLOBALS['folks_driver']->getProfile($user);
+ } else {
+ $profile = $GLOBALS['folks_driver']->getRawProfile($user);
+ }
+ if ($profile instanceof PEAR_Error) {
+ return $profile;
+ }
+
+ $email = $profile['user_email'];
+ }
+
+ if (empty($email)) {
+ return PEAR::raiseError(_("Cannot retrieve user email."));
+ } else {
+ return $email;
+ }
+ }
+
+ /**
+ * Build Folks's list of menu items.
+ */
+ static function getMenu($returnType = 'object')
+ {
+ require_once 'Horde/Menu.php';
+
+ $img = $GLOBALS['registry']->getImageDir('horde');
+ $menu = new Menu(HORDE_MENU_MASK_ALL);
+ $menu->add(self::getUrlFor('user', Auth::getAuth()), _("My profile"), 'myaccount.png', $img);
+ $menu->add(Horde::applicationUrl('friends.php'), _("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);
+ $menu->add(Horde::applicationUrl('search.php'), _("Search"), 'search.png', $img);
+ $menu->add(self::getUrlFor('list', 'online'), _("List"), 'group.png', $img);
+ // $menu->add(self::getUrlFor('list', 'list'), _("List"), 'group.png', $img);
+ // $menu->add(self::getUrlFor('list', 'online'), _("Online"), 'group.png', $img);
+ // $menu->add(self::getUrlFor('list', 'popularity'), _("Popularity"), 'group.png', $img);
+ // $menu->add(self::getUrlFor('list', 'activity'), _("Activity"), 'group.png', $img);
+ // $menu->add(self::getUrlFor('list', 'birthday'), _("Birthday"), 'guest.png', $img);
+
+ if ($returnType == 'object') {
+ return $menu;
+ } else {
+ return $menu->render();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: Activity.php 979 2008-10-08 08:31:13Z duck $
+ *
+ * Copyright 2008 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.
+ *
+ * @author Duck <duck@obala.net>
+ */
+class Folks_Activity_Form extends Horde_Form {
+
+ function __construct($vars, $title, $name)
+ {
+ parent::__construct($vars, $title, $name);
+
+ if ($name == 'long') {
+ $this->addVariable(_("Activity"), 'activity', 'longText', true, false, null, array(4));
+ } else {
+ $this->addVariable(_("Activity"), 'activity', 'text', true, false, null, array('', 80));
+ }
+
+ $this->setButtons(_("Post"));
+ }
+
+ function execute()
+ {
+ $message = trim(strip_tags($this->_vars->get('activity')));
+
+ if (empty($message)) {
+ return PEAR::raiseError(_("You cannot post an empty activity message."));
+ }
+
+ require_once 'Horde/Text/Filter.php';
+ $filters = array('text2html', 'bbcode', 'highlightquotes', 'emoticons');
+ $filters_params = array(array('parselevel' => TEXT_HTML_MICRO),
+ array(),
+ array(),
+ array());
+
+ if (($hasBBcode = strpos($message, '[')) !== false &&
+ strpos($message, '[/', $hasBBcode) !== false) {
+ $filters_params[0]['parselevel'] = TEXT_HTML_NOHTML;
+ }
+
+ $message = Text_Filter::filter(trim($message), $filters, $filters_params);
+
+ return $GLOBALS['folks_driver']->logActivity($message, 'folks:custom');
+ }
+}
--- /dev/null
+<?php
+/**
+ * $Id: AddFriend.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright 2007 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.
+ *
+ * @author Duck <duck@obala.net>
+ */
+class Folks_AddFriend_Form extends Horde_Form {
+
+ function __construct($vars, $title, $name)
+ {
+ parent::__construct($vars, $title, $name);
+
+ $this->addVariable(_("Username"), 'user', 'text', true, false, null, array('', 20, 32));
+ $this->setButtons(_("Add / Remove"));
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: Login.php 931 2008-09-26 12:20:19Z duck $
+ *
+ * Copyright 2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license inthisation (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ */
+class Folks_Login_Form extends Horde_Form {
+
+ function __construct($vars, $title = '', $name = null)
+ {
+ parent::__construct($vars, $title, $name);
+
+ $this->addHidden('', 'url', 'text', Util::getFormData('url', '/'));
+ $this->setButtons(_("Login"));
+
+ $this->addVariable(_("Username"), 'username', 'text', true, false,
+ sprintf(_("Enter the username you registered to %s"),
+ $GLOBALS['registry']->get('name', 'horde')), array('', 30, 26));
+
+ $this->addVariable(_("Password"), 'password', 'password', true, false, _("Enter your password. Please be aware that password is case sensitive."));
+
+ $v = &$this->addVariable(_("Remember login?"), 'loginfor', 'radio', true, false, null,
+ array(array('0' => _("No, only for this view"),
+ '1' => _("Yes, remember me so the next time I don't neet to login"))));
+ $v->setDefault('0');
+
+ $username = $vars->get('username');
+ if ($GLOBALS['conf']['login']['tries']
+ && !empty($username)) {
+ $tries = (int)$GLOBALS['cache']->get('login_tries_' . $username, 0);
+ $GLOBALS['cache']->set('login_tries_' . $username, $tries + 1);
+ if ($tries >= $GLOBALS['conf']['login']['tries']) {
+ $desc = _("Please enter the text above");
+ $this->addVariable('Preverjanje:', 'captcha', 'captcha', true, false, $desc,
+ array($this->_getCAPTCHA(!$this->isSubmitted()), HORDE_BASE . '/config/couri.ttf'));
+ }
+ }
+ }
+
+ /**
+ * Returns a new or the current CAPTCHA string.
+ */
+ private function _getCAPTCHA($new = false)
+ {
+ if ($new || empty($_SESSION['folks']['login_CAPTCHA'])) {
+ $_SESSION['folks']['login_CAPTCHA'] = '';
+ for ($i = 0; $i < 5; $i++) {
+ $_SESSION['folks']['login_CAPTCHA'] .= chr(rand(65, 90));
+ }
+ }
+ return $_SESSION['folks']['login_CAPTCHA'];
+ }
+}
--- /dev/null
+<?php
+/**
+ * $Id: Search.php 920 2008-09-25 08:16:34Z duck $
+ *
+ * Copyright 2007 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.
+ *
+ * @author Duck <duck@obala.net>
+ */
+class Folks_Search_Form extends Horde_Form {
+
+ function __construct($vars, $title = '', $name = null)
+ {
+ parent::__construct($vars, $title, $name);
+
+ $this->addVariable(_("Word"), 'word', 'text', false);
+ $this->addVariable(_("Search by"), 'by', 'set', false, false, null, array(array('uid' => _("Name"), 'city' => _("City"), 'description' => _("Description")), true));
+ $this->addVariable(_("Gender"), 'user_gender', 'radio', false, false, null, array(array(1 => _("Male"), 2 => _("Female")), true));
+ $this->addVariable(_("City"), 'user_city', 'text', false);
+ $this->addVariable(_("Age from"), 'age_from', 'number', false);
+ $this->addVariable(_("Age to"), 'age_to', 'number', false);
+ $this->addVariable(_("Mast have"), 'has', 'set', false , false, null, array(array('picture' => _("Picture"), 'videos' => _("Video"))));
+ $this->addVariable(_("Is online"), 'online', 'boolean', false);
+ $this->setButtons(array(_("Search")));
+ }
+
+ /**
+ * Fetch the field values of the submitted form.
+ *
+ * @param Variables $vars A Variables instance, optional since Horde 3.2.
+ * @param array $info Array to be filled with the submitted field
+ * values.
+ */
+ function getInfo($vars, &$info)
+ {
+ $this->_getInfoFromVariables($this->getVariables(), $this->_vars, $info);
+ }
+
+ /**
+ * Fetch the field values from a given array of variables.
+ *
+ * @access private
+ *
+ * @param array $variables An array of Horde_Form_Variable objects to
+ * fetch from.
+ * @param object $vars The Variables object.
+ * @param array $info The array to be filled with the submitted
+ * field values.
+ */
+ function _getInfoFromVariables($variables, &$vars, &$info)
+ {
+ foreach ($variables as $var) {
+ $value = $var->getValue($vars);
+ if (empty($value)) {
+ continue;
+ }
+
+ require_once 'Horde/Array.php';
+ if (Horde_Array::getArrayParts($var->getVarName(), $base, $keys)) {
+ if (!isset($info[$base])) {
+ $info[$base] = array();
+ }
+ $pointer = &$info[$base];
+ while (count($keys)) {
+ $key = array_shift($keys);
+ if (!isset($pointer[$key])) {
+ $pointer[$key] = array();
+ }
+ $pointer = &$pointer[$key];
+ }
+ $var->getInfo($vars, $pointer);
+ } else {
+ $var->getInfo($vars, $info[$var->getVarName()]);
+ }
+
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Folks_Friends:: defines an API for implementing storage backends for
+ * Friends.
+ *
+ * $Id: Friends.php 910 2008-09-24 19:02:50Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+class Folks_Friends {
+
+ /**
+ */
+ static private $instance;
+
+ /**
+ * Hash containing connection parameters.
+ *
+ * @var array
+ */
+ protected $_params = array();
+
+ /**
+ * String containing user
+ *
+ * @var string
+ */
+ protected $_user;
+
+ /**
+ * Attempts to return a concrete Folks_Friends instance based on $friends.
+ *
+ * @param string $friends The type of the concrete Folks_Friends subclass
+ * to return. The class name is based on the
+ * storage Friends ($friends). The code is
+ * dynamically included.
+ *
+ * @param array $params A hash containing any additional configuration
+ * or connection parameters a subclass might need.
+ *
+ * @return Folks_Friends The newly created concrete Folks_Friends
+ * instance, or false on an error.
+ */
+ public function factory($driver = null, $params = null)
+ {
+ if ($driver === null) {
+ $driver = $GLOBALS['conf']['friends'];
+ }
+
+ $driver = basename($driver);
+
+ $class = 'Folks_Friends_' . $driver;
+ if (!class_exists($class)) {
+ include dirname(__FILE__) . '/Friends/' . $driver . '.php';
+ }
+ if (class_exists($class)) {
+ return new $class($params);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Singleton for driver object
+ *
+ * @param string $friends The type of the concrete Folks_Friends subclass
+ * to return. The class name is based on the
+ * storage Friends ($friends). The code is
+ * dynamically included.
+ *
+ * @param array $params A hash containing any additional configuration
+ * or connection parameters a subclass might need.
+ */
+ static function singleton($driver = null, $params = null)
+ {
+ if (!self::$instance) {
+ self::$instance = Folks_Friends::factory($driver, $params);
+ }
+
+ return self::$instance;
+ }
+
+ /**
+ * Construct object
+ *
+ * @param array $params A hash containing any additional configuration
+ * or connection parameters a subclass might need.
+ */
+ public function __construct($params)
+ {
+ $this->_user = empty($params['user']) ? Auth::getAuth() : $params['user'];
+ }
+
+ /**
+ * Check if a users requies his approval to be added as a friend
+ *
+ * @param string $user Usersame
+ *
+ * @return boolean
+ */
+ public function needsApproval($user)
+ {
+ if ($GLOBALS['prefs']->isLocked('friends_approval')) {
+ return (boolean)$GLOBALS['prefs']->getValue('friends_approval');
+ }
+
+ $prefs = Prefs::singleton($GLOBALS['conf']['prefs']['driver'], 'folks', Auth::addHook($user), '', null, false);
+ $prefs->retrieve();
+
+ return (boolean)$prefs->getValue('friends_approval');
+ }
+
+ /**
+ * Send user a nofication or approve request
+ *
+ * @param string $user Usersame
+ * @param string $title Title of notification
+ * @param string $body Content of notification
+ *
+ * @return boolean
+ */
+ public function sendNotification($user, $title, $body)
+ {
+ $to = Folks::getUserEmail($user);
+ if ($to instanceof PEAR_Error) {
+ return $to;
+ }
+
+ $result = Folks::sendMail($to, $title, $body);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ if (!$GLOBALS['registry']->hasInterface('letter')) {
+ return true;
+ }
+
+ return $GLOBALS['registry']->callByPackage(
+ 'letter', 'sendMessage', array($user,
+ array('title' => $title,
+ 'content' => $body)));
+ }
+
+ /**
+ * Get user blacklist
+ *
+ * @return array of users blacklist
+ */
+ public function getBlacklist()
+ {
+ $blacklist = $GLOBALS['cache']->get('folksBlacklist' . $this->_user, $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($blacklist) {
+ return unserialize($blacklist);
+ } else {
+ $blacklist = $this->_getBlacklist();
+ if ($blacklist instanceof PEAR_Error) {
+ return $blacklist;
+ }
+ $GLOBALS['cache']->set('folksBlacklist' . $this->_user, serialize($blacklist));
+ return $blacklist;
+ }
+ }
+
+ /**
+ * Add user to a blacklist list
+ *
+ * @param string $user Usersame
+ */
+ public function addBlacklisted($user)
+ {
+ if ($this->_user == $user) {
+ return PEAR::raiseError(_("You cannot add yourself to your blacklist."));
+ }
+
+ // Check if users exits
+ $auth = Auth::singleton($GLOBALS['conf']['auth']['driver']);
+ if (!$auth->exists($user)) {
+ return PEAR::raiseError(sprintf(_("User \"%s\" does not exits"), $user));
+ }
+
+ // Do not allow to blacklist adminstrators
+ if (in_array($user, $this->_getAdmins())) {
+ return PEAR::raiseError(sprintf(_("You cannot add \"%s\" to your blacklist."), $user));
+ }
+
+ $result = $this->_addBlacklisted($user);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ $GLOBALS['cache']->expire('folksBlacklist' . $this->_user);
+
+ return true;
+ }
+
+ /**
+ * Remove user from blacklist list
+ *
+ * @param string $user Usersame
+ */
+ public function removeBlacklisted($user)
+ {
+ $result = $this->_removeBlacklisted($user);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ $GLOBALS['cache']->expire('folksBlacklist' . $this->_user);
+
+ return true;
+ }
+
+ /**
+ * Check if user is on blacklist
+ *
+ * @param string $user User to check
+ *
+ * @return boolean
+ */
+ public function isBlacklisted($user)
+ {
+ $blacklist = $this->getBlacklist();
+ if ($blacklist instanceof PEAR_Error) {
+ return $blacklist;
+ }
+
+ return in_array($user, $blacklist);
+ }
+
+ /**
+ * Add user to a friend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to add friend to
+ */
+ public function addFriend($friend, $group = null)
+ {
+ $friend = strtolower($friend);
+
+ if ($this->_user == $friend) {
+ return PEAR::raiseError(_("You cannot add yourself as your own friend."));
+ }
+
+ // Check if users exits
+ $auth = Auth::singleton($GLOBALS['conf']['auth']['driver']);
+ if (!$auth->exists($friend)) {
+ return PEAR::raiseError(sprintf(_("User \"%s\" does not exits"), $friend));
+ }
+
+ // Check if user exists in group
+ $friends = $this->getFriends();
+ if ($friends instanceof PEAR_Error) {
+ return $friends;
+ } elseif (in_array($friend, $friends)) {
+ return PEAR::raiseError(sprintf(_("User \"%s\" is already in fiend list"), $friend));
+ }
+
+ // Check if user is frend but has not confmed us yet
+ $friends = $this->waitingApprovalFrom();
+ if ($friends instanceof PEAR_Error) {
+ return $friends;
+ } elseif (in_array($friend, $friends)) {
+ return PEAR::raiseError(sprintf(_("User \"%s\" is already in fiend list, but we are waiting his/her approval."), $friend));
+ }
+
+ // Add friend to backend
+ $result = $this->_addFriend($friend, $group);
+ if ($friends instanceof PEAR_Error) {
+ return $friends;
+ }
+
+ // If we do not need an approval just expire cache
+ if (!$this->needsApproval($friend)) {
+ $GLOBALS['cache']->expire('folksFriends' . $this->_user . $group);
+ }
+
+ return true;
+ }
+
+ /**
+ * Remove user from a fiend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to remove friend from
+ */
+ public function removeFriend($friend, $group = null)
+ {
+ $GLOBALS['cache']->expire('folksFriends' . $this->_user . $group);
+
+ return $this->_removeFriend($friend, $group);
+ }
+
+ /**
+ * Get user friends
+ *
+ * @param string $user Username
+ * @param string $group Get friens only from this group
+ *
+ * @return array of users (in group)
+ */
+ public function getFriends($group = null)
+ {
+ $friends = $GLOBALS['cache']->get('folksFriends' . $this->_user . $group, $GLOBALS['conf']['cache']['default_lifetime']);
+ if ($friends) {
+ return unserialize($friends);
+ } else {
+ $friends = $this->_getFriends($group);
+ if ($friends instanceof PEAR_Error) {
+ return $friends;
+ }
+ $GLOBALS['cache']->set('folksFriends' . $this->_user . $group, serialize($friends));
+ return $friends;
+ }
+ }
+
+ /**
+ * Get friends that does not confirm the current user yet
+ */
+ public function waitingApprovalFrom()
+ {
+ return array();
+ }
+
+ /**
+ * User that we do not confirm them user yet
+ */
+ public function waitingApprovalFor()
+ {
+ return array();
+ }
+
+ /**
+ * Approve our friend to add us to his userlist
+ *
+ * @param string $friend Friend username
+ */
+ public function approveFriend($friend)
+ {
+ $result = $this->_approveFriend($friend);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ $GLOBALS['cache']->expire('folksFriends' . $friend);
+ $GLOBALS['cache']->expire('folksFriends' . $this->_user);
+
+ return true;
+ }
+
+ /**
+ * Approve our friend to add us to his userlist
+ *
+ * @param string $friend Friedn username
+ */
+ protected function _approveFriend($friend)
+ {
+ return true;
+ }
+
+ /**
+ * Check if user is on blacklist
+ *
+ * @param string $user User to check
+ *
+ * @return boolean
+ */
+ public function isFriend($user)
+ {
+ $friends = $this->getFriends();
+ if ($friends instanceof PEAR_Error) {
+ return $friends;
+ }
+
+ return in_array($user, $friends);
+ }
+
+ /**
+ * Get users who have you on friendlist
+ *
+ * @return array users
+ */
+ public function getPossibleFriends()
+ {
+ return false;
+ }
+
+ /**
+ * Get user groups
+ */
+ public function getGroups()
+ {
+ return array();
+ }
+
+ /**
+ * Delete user friend group
+ *
+ * @param string $group Group to delete
+ */
+ public function removeGroup($group)
+ {
+ return false;
+ }
+
+ /**
+ * Add group
+ *
+ * @param string $group Group name
+ */
+ public function addGroup($name)
+ {
+ return false;
+ }
+
+ /**
+ * Get administartor usernames
+ */
+ private function _getAdmins()
+ {
+ if (!$GLOBALS['perms']->exists('folks:admin')) {
+ return array();
+ }
+
+ $permission = $GLOBALS['perms']->getPermission('folks:admin');
+
+ return array_merge($permission->getUserPermissions(PERM_DELETE),
+ $GLOBALS['conf']['auth']['admins']);
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Folks_Friends:: defines an API for implementing storage backends for
+ * Folks.
+ *
+ * $Id: letter.php 777 2008-08-21 09:23:07Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Friends_letter extends Folks_Friends {
+
+ /**
+ * Get user blacklist
+ *
+ * @return array of users blacklist
+ */
+ protected function _getBlacklist()
+ {
+ return $GLOBALS['registry']->callByPackage('letter', 'getBlacklist', array($this->_user));
+ }
+
+ /**
+ * Add user to a blacklist list
+ *
+ * @param string $user Usersame
+ */
+ protected function _addBlacklisted($user)
+ {
+ return $GLOBALS['registry']->callByPackage('letter', 'addFriend', array($user, 'blacklist', $this->_user));
+ }
+
+ /**
+ * Remove user from a fiend list
+ *
+ * @param string $user Usersame
+ */
+ protected function _removeBlacklisted($user)
+ {
+ return $GLOBALS['registry']->callByPackage('letter', 'addFriend', array($user, 'blacklist', $this->_user));
+ }
+
+ /**
+ * Add user to a friend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to add friend to
+ */
+ protected function _addFriend($friend, $group = null)
+ {
+ return $GLOBALS['registry']->callByPackage('letter', 'addFriend', array($friend, 'whitelist', $this->_user));
+ }
+
+ /**
+ * Remove user from a fiend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to remove friend from
+ */
+ protected function _removeFriend($friend, $group = null)
+ {
+ return $GLOBALS['registry']->callByPackage('letter', 'addFriend', array($friend, 'whitelist', $this->_user));
+ }
+
+ /**
+ * Get user friends
+ *
+ * @param string $group Get friens only from this group
+ *
+ * @return array of users (in group)
+ */
+ protected function _getFriends($group = null)
+ {
+ return $GLOBALS['registry']->callByPackage('letter', 'getFriends', array($this->_user, 'whitelist'));
+ }
+
+ /**
+ * Get user groups
+ */
+ public function getGroups()
+ {
+ return array('whitelist' => _("Whitelist"),
+ 'blacklist' => _("Blacklist"));
+ }
+}
+
--- /dev/null
+<?php
+
+require_once dirname(__FILE__) . '/sql.php';
+
+/**
+ * Folks_Friends:: defines an API for implementing storage backends for
+ * Folks.
+ *
+ * $Id: shared.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Friends_shared extends Folks_Friends_sql {
+
+ /**
+ * friends list ID
+ *
+ * @var int
+ */
+ private $_friends;
+
+ /**
+ * Black list ID
+ *
+ * @var int
+ */
+ private $_blacklist;
+
+ /**
+ * Get user friends and blacklist group id
+ */
+ private function _getIds()
+ {
+ if ($this->_friends && $this->_blacklist) {
+ return;
+ }
+
+ $GLOBALS['folks_shares'] = Horde_Share::singleton('folks');
+ $groups = $GLOBALS['folks_shares']->listShares($this->_user, PERMS_READ);
+ if ($groups instanceof PEAR_Error) {
+ return $groups;
+ }
+
+ foreach ($groups as $id => $group) {
+ if ($group->get('type') == self::BLACKLIST) {
+ $this->_blacklist = $group->getId();
+ } elseif ($group->get('type') == self::WHITELIST) {
+ $this->_friends = $group->getId();
+ }
+ }
+ }
+
+ /**
+ * Get user blacklist
+ *
+ * @return array of users blacklist
+ */
+ protected function _getBlacklist()
+ {
+ $this->_getIds();
+
+ if (empty($this->_blacklist)) {
+ return array();
+ }
+
+ parent::_getBlacklist();
+ }
+
+ /**
+ * Add user to a blacklist list
+ *
+ * @param string $user Usersame
+ */
+ protected function _addBlacklisted($user)
+ {
+ $this->_getIds();
+
+ if (empty($this->_blacklist)) {
+ $result = $this->addGroup('_BLACKLIST_', self::BLACKLIST);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+ }
+
+ parent::_addBlacklisted($user);
+ }
+
+ /**
+ * Remove user from blacklist list
+ *
+ * @param string $user Usersame
+ */
+ protected function _removeBlacklisted($user)
+ {
+ $this->_getIds();
+
+ if (empty($this->_blacklist)) {
+ return false;
+ }
+
+ parent::_removeBlacklisted($user);
+ }
+
+ /**
+ * Add user to a friend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to add friend to
+ */
+ protected function _addFriend($friend, $group = null)
+ {
+ $this->_getIds();
+
+ if (empty($this->_friends)) {
+ $result = $this->addGroup('_FRIENDS_', self::WHITELIST);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+ }
+
+ parent::_addFriend($friend, $group);
+ }
+
+ /**
+ * Remove user from a fiend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to remove friend from
+ */
+ protected function _removeFriend($friend, $group = null)
+ {
+ $this->_getIds();
+
+ if (empty($this->_friends)) {
+ return true;
+ }
+
+ parent::_removeFriend($friend, $group);
+ }
+
+ /**
+ * Get user friends
+ *
+ * @param string $group Get friens only from this group
+ * @param boolean $ask Show all users or only them who approved us
+ *
+ * @return array of users (in group)
+ */
+ protected function _getFriends($group = null, $ask = false)
+ {
+ $this->_getIds();
+
+ if (empty($this->_friends)) {
+ return array();
+ }
+
+ parent::_getFriends($group, $ask);
+ }
+
+ /**
+ * Get user groups
+ */
+ public function getGroups()
+ {
+ $GLOBALS['folks_shares'] = Horde_Share::singleton('folks');
+ $groups = $GLOBALS['folks_shares']->listShares($this->_user, PERMS_READ);
+ if ($groups instanceof PEAR_Error) {
+ return $groups;
+ }
+
+ $list = array();
+ foreach ($groups as $id => $group) {
+ $list[$id] = $group->get('name');
+
+ // set friends ids
+ if ($group->get('type') == self::BLACKLIST) {
+ $this->_blacklist = $id;
+ } elseif ($group->get('type') == self::WHITELIST) {
+ $this->_friends = $id;
+ }
+ }
+
+ return $list;
+ }
+
+ /**
+ * Delete user group
+ *
+ * @param string $group Group to delete
+ */
+ public function removeGroup($group)
+ {
+ $GLOBALS['folks_shares'] = Horde_Share::singleton('folks');
+
+ $share = $GLOBALS['folks_shares']->getShareById($group);
+ if ($share instanceof PEAR_Error) {
+ return $share;
+ }
+
+ $query = 'DELETE FROM ' . $this->_params['friends'] . ' WHERE user_uid = ? AND group_id = ?';
+ $result = $this->_write_db->query($query, array($this->_user, $share->getId()));
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ return $GLOBALS['folks_shares']->_removeShare($share);
+ }
+
+ /**
+ * Delete user group
+ *
+ * @param string $group Group to delete
+ */
+ public function addGroup($group, $type = null)
+ {
+ $GLOBALS['folks_shares'] = Horde_Share::singleton('folks');
+
+ $share = $GLOBALS['folks_shares']->newShare(md5(microtime()));
+ if ($share instanceof PEAR_Error) {
+ return $share;
+ }
+
+ $share->set('name', $group);
+
+ if ($type !== null) {
+ $share->set('type', $type);
+ }
+
+ return $GLOBALS['folks_shares']->addShare($share);
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Folks_Friends:: defines an API for implementing storage backends for
+ * Folks.
+ *
+ * $Id: sql.php 1008 2008-10-24 09:07:35Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Friends_sql extends Folks_Friends {
+
+ const WHITELIST = 0;
+ const BLACKLIST = 1;
+
+ /**
+ * Handle for the current database connection.
+ *
+ * @var DB
+ */
+ private $_db;
+
+ /**
+ * Handle for the current database connection, used for writing. Defaults
+ * to the same handle as $_db if a separate write database is not required.
+ *
+ * @var DB
+ */
+ private $_write_db;
+
+ /**
+ * friends list ID
+ *
+ * @var int
+ */
+ private $_friends = 0;
+
+ /**
+ * Black list ID
+ *
+ * @var int
+ */
+ private $_blacklist = 1;
+
+ /**
+ * Constructs a new SQL storage object.
+ *
+ * @param array $params A hash containing connection parameters.
+ */
+ public function __construct($params = array())
+ {
+ parent::__construct($params);
+ $this->_params = $params;
+ $this->_connect();
+ }
+
+ /**
+ * Get user blacklist
+ *
+ * @return array of users blacklist
+ */
+ protected function _getBlacklist()
+ {
+ $query = 'SELECT friend_uid FROM ' . $this->_params['friends']
+ . ' WHERE user_uid = ? AND group_id = ? '
+ . ' ORDER BY friend_uid ASC';
+
+ return $this->_db->getCol($query, 0, array($this->_user, self::BLACKLIST));
+ }
+
+ /**
+ * Add user to a blacklist list
+ *
+ * @param string $user Usersame
+ */
+ protected function _addBlacklisted($user)
+ {
+ $query = 'INSERT INTO ' . $this->_params['friends']
+ . ' (user_uid, group_id, friend_uid, friend_ask) VALUES (?, ?, ?, ?)';
+ return $this->_write_db->query($query, array($this->_user, self::BLACKLIST, $user, 0));
+ }
+
+ /**
+ * Remove user from blacklist list
+ *
+ * @param string $user Usersame
+ */
+ protected function _removeBlacklisted($user)
+ {
+ $query = 'DELETE FROM ' . $this->_params['friends'] . ' WHERE user_uid = ? AND group_id = ? AND friend_uid = ?';
+ return $this->_write_db->query($query, array($this->_user, self::BLACKLIST, $user));
+ }
+
+ /**
+ * Add user to a friend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to add friend to
+ */
+ protected function _addFriend($friend, $group = null)
+ {
+ $approve = $this->needsApproval($friend) ? 1 : 0;
+ $query = 'INSERT INTO ' . $this->_params['friends']
+ . ' (user_uid, group_id, friend_uid, friend_ask) VALUES (?, ?, ?, ?)';
+ return $this->_write_db->query($query, array($this->_user, self::WHITELIST, $friend, $approve));
+ }
+
+ /**
+ * Approve our friend to add us to his userlist
+ *
+ * @param string $friend Friedn username
+ */
+ protected function _approveFriend($friend)
+ {
+ $query = 'UPDATE ' . $this->_params['friends']
+ . ' SET friend_ask = ? WHERE user_uid = ? AND friend_uid = ?';
+ $result = $this->_write_db->query($query, array(0, $friend, $this->_user));
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ // Add user even to firend's friend list
+ $query = 'REPLACE INTO ' . $this->_params['friends']
+ . ' (user_uid, group_id, friend_uid, friend_ask) VALUES (?, ?, ?, ?)';
+ return $this->_write_db->query($query, array($this->_user, self::WHITELIST, $friend, 0));
+ }
+
+ /**
+ * Remove user from a fiend list
+ *
+ * @param string $friend Friend's usersame
+ * @param string $group Group to remove friend from
+ */
+ protected function _removeFriend($friend, $group = null)
+ {
+ $query = 'DELETE FROM ' . $this->_params['friends'] . ' WHERE user_uid = ? AND group_id = ? AND friend_uid = ?';
+ return $this->_write_db->query($query, array($this->_user, self::WHITELIST, $friend));
+ }
+
+ /**
+ * Get user friends
+ *
+ * @param string $group Get friens only from this group
+ *
+ * @return array of users (in group)
+ */
+ protected function _getFriends($group = null)
+ {
+ $query = 'SELECT friend_uid FROM ' . $this->_params['friends']
+ . ' WHERE user_uid = ? AND group_id = ?'
+ . ' ORDER BY friend_uid ASC';
+
+ return $this->_db->getCol($query, 0, array($this->_user, self::WHITELIST));
+ }
+
+ /**
+ * Get friends that does not confirm the current user yet
+ */
+ public function waitingApprovalFrom()
+ {
+ $query = 'SELECT friend_uid FROM ' . $this->_params['friends']
+ . ' WHERE user_uid = ? AND friend_ask = ?'
+ . ' ORDER BY friend_uid ASC';
+
+ return $this->_db->getCol($query, 0, array($this->_user, 1));
+ }
+
+ /**
+ * Get friends that does not confirm the current user yet
+ */
+ public function waitingApprovalFor()
+ {
+ $query = 'SELECT user_uid FROM ' . $this->_params['friends']
+ . ' WHERE friend_uid = ? AND friend_ask = ?'
+ . ' ORDER BY user_uid ASC';
+
+ return $this->_db->getCol($query, 0, array($this->_user, 1));
+ }
+
+ /**
+ * Get users who have you on friendlist
+ *
+ * @return array users
+ */
+ public function getPossibleFriends()
+ {
+ $query = 'SELECT user_uid FROM ' . $this->_params['friends']
+ . ' WHERE friend_uid = ? AND group_id = ? AND friend_ask = ?'
+ . ' ORDER BY friend_uid ASC';
+
+ return $this->_db->getCol($query, 0, array($this->_user, self::WHITELIST, 0));
+ }
+
+ /**
+ * Get users friends birthdays
+ *
+ * @return array users
+ */
+ public function getBirthdays()
+ {
+ return false;
+ }
+
+ /**
+ * Get user groups
+ */
+ public function getGroups()
+ {
+ return array(self::WHITELIST => _("Whitelist"),
+ self::BLACKLIST => _("Blacklist"));
+ }
+
+ /**
+ * Attempts to open a persistent connection to the SQL server.
+ *
+ * @return boolean True on success; exits (Horde::fatal()) on error.
+ */
+ protected function _connect()
+ {
+ $this->_params = Horde::getDriverConfig('storage', 'sql');
+
+ if (!isset($this->_params['database'])) {
+ $this->_params['database'] = '';
+ }
+ if (!isset($this->_params['username'])) {
+ $this->_params['username'] = '';
+ }
+ if (!isset($this->_params['hostspec'])) {
+ $this->_params['hostspec'] = '';
+ }
+
+ /* Connect to the SQL server using the supplied parameters. */
+ $this->_write_db = DB::connect($this->_params,
+ array('persistent' => !empty($this->_params['persistent'])));
+ if ($this->_write_db instanceof PEAR_Error) {
+ Horde::fatal($this->_write_db, __FILE__, __LINE__);
+ }
+
+ // Set DB portability options.
+ switch ($this->_write_db->phptype) {
+ case 'mssql':
+ $this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
+ break;
+ default:
+ $this->_write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
+ }
+
+ /* Check if we need to set up the read DB connection seperately. */
+ if (!empty($this->_params['splitread'])) {
+ $params = array_merge($this->_params, $this->_params['read']);
+ $this->_db = DB::connect($params,
+ array('persistent' => !empty($params['persistent'])));
+ if ($this->_db instanceof PEAR_Error) {
+ Horde::fatal($this->_db, __FILE__, __LINE__);
+ }
+
+ // Set DB portability options.
+ switch ($this->_db->phptype) {
+ case 'mssql':
+ $this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);
+ break;
+ default:
+ $this->_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);
+ }
+
+ } else {
+ /* Default to the same DB handle for the writer too. */
+ $this->_db =& $this->_write_db;
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Reporting abstraction class
+ *
+ * $Horde: ansel/lib/Report.php,v 1.9 2008-07-03 04:16:00 mrubinsk Exp $
+ *
+ * Copyright 2008 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.
+ *
+ * Copyright 2008 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.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Report {
+
+ var $_title = '';
+
+ /**
+ * Create instance
+ */
+ function factory($driver = null, $params = array())
+ {
+ if ($driver === null) {
+ $driver = $GLOBALS['conf']['report_content']['driver'];
+ }
+
+ if (empty($params)) {
+ $params = $GLOBALS['conf']['report_content'];
+ }
+
+ require_once ANSEL_BASE . '/lib/Report/' . $driver . '.php';
+ $class_name = 'Folks_Report_' . $driver;
+ if (!class_exists($class_name)) {
+ return PEAR::RaiseError(_("Report driver does not exist."));
+ }
+
+ $report = &new $class_name($params);
+
+ return $report;
+ }
+
+ /**
+ * Get reporting user email
+ */
+ function getUserEmail()
+ {
+ return $this->_getUserEmail();
+ }
+
+ /**
+ * Get user email
+ */
+ function _getUserEmail($user = null)
+ {
+ require_once 'Horde/Identity.php';
+
+ // Get user email
+ $identity = &Identity::singleton('none', $user);
+ return $identity->getValue('from_addr');
+ }
+
+ /**
+ * Get scope admins
+ */
+ function getAdmins()
+ {
+ $name = $GLOBALS['registry']->getApp() . ':admin';
+
+ if ($GLOBALS['perms']->exists($name)) {
+ return array();
+ }
+
+ $permission = $GLOBALS['perms']->getPermission($name);
+
+ return $permission->getUserPermissions(PERM_DELETE);
+ }
+
+ /**
+ * Set title
+ */
+ function setTitle($title)
+ {
+ $this->_title = $title;
+ }
+
+ /**
+ * Get report message title
+ */
+ function getTitle()
+ {
+ if (empty($this->_title)) {
+ return sprintf(_("Content abuse report in %s"), $GLOBALS['registry']->get('name'));
+ } else {
+ return $this->_title;
+ }
+ }
+
+ /**
+ * Get report message content
+ */
+ function getMessage($message)
+ {
+ $message .= "\n\n" . _("Report by user") . ': ' . Auth::getAuth()
+ . ' (' . $_SERVER['REMOTE_ADDR'] . ')';
+
+ return $message;
+ }
+
+ /**
+ * Report
+ *
+ * @param string $message to pass
+ */
+ function report($message, $users = array())
+ {
+ return PEAR::raiseError(_("Unsupported"));
+ }
+}
--- /dev/null
+<?php
+/**
+ * Report by letter api class
+ *
+ * $Horde: Folks/lib/Report/letter.php,v 1.5 2008/07/03 04:13:35 mrubinsk Exp $
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Report_letter extends Folks_Report {
+
+ /**
+ * Report
+ */
+ function report($message, $users = array())
+ {
+ if (!empty($users)) {
+ // We are sending a report to to the gallery owner
+ $admins = array($users);
+ } elseif (empty($GLOBALS['conf']['report_content']['users'])) {
+ $admins = $this->getAdmins();
+ if (empty($admins)) {
+ return true;
+ }
+ } else {
+ $admins = $GLOBALS['conf']['report_content']['users'];
+ }
+
+ $title = $this->getTitle();
+ $message = $this->getMessage($message);
+
+ return $GLOBALS['registry']->callByPackage(
+ 'letter', 'sendMessage', array($admins,
+ array('title' => $title,
+ 'content' => $message)));
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Report by email class
+ *
+ * $Horde: Folks/lib/Report/mail.php,v 1.7 2008/07/03 04:17:52 mrubinsk Exp $
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Report_mail extends Folks_Report {
+
+ /**
+ * Report
+ */
+ function report($message, $users = array())
+ {
+ global $conf;
+
+ if (empty($users)) {
+ $to = $conf['report_content']['email'];
+ } else {
+ // we are sending a report to to the gallery owner, but fall back
+ // to the admin in case the user has no email.
+ $to = $this->_getUserEmail($users);
+ if (empty($to)) {
+ $to = $conf['report_content']['email'];
+ }
+ }
+
+ require_once 'Horde/MIME.php';
+ require_once 'Horde/MIME/Headers.php';
+ require_once 'Horde/MIME/Message.php';
+
+ $email = $this->getUserEmail();
+
+ $msg_headers = new MIME_Headers();
+ $msg_headers->addReceivedHeader();
+ $msg_headers->addMessageIdHeader();
+ $msg_headers->addAgentHeader();
+ $msg_headers->addHeader('Date', date('r'));
+ $msg_headers->addHeader('To', $to);
+ $msg_headers->addHeader('Subject', $this->getTitle());
+ $msg_headers->addHeader('From', $email);
+
+ //FIXME: This address should be configurable
+ $msg_headers->addHeader('Sender', 'horde-problem@' . $conf['report_content']['maildomain']);
+
+ $mime = new MIME_Message();
+ $mime->addPart(
+ new MIME_Part('text/plain',
+ String::wrap($this->getMessage($message), 80, "\n"),
+ NLS::getCharset()));
+ $msg_headers->addMIMEHeaders($mime);
+
+ $mail_driver = $conf['mailer']['type'];
+ $mail_params = $conf['mailer']['params'];
+ if ($mail_driver == 'smtp' && $mail_params['auth'] &&
+ empty($mail_params['username'])) {
+ if (Auth::getAuth()) {
+ $mail_params['username'] = Auth::getAuth();
+ $mail_params['password'] = Auth::getCredential('password');
+ } elseif (!empty($conf['report_content']['username']) &&
+ !empty($conf['report_content']['password'])) {
+ $mail_params['username'] = $conf['report_content']['username'];
+ $mail_params['password'] = $conf['report_content']['password'];
+ }
+ }
+
+ return $mime->send($conf['report_content']['email'],
+ $msg_headers, $mail_driver, $mail_params);
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Report using tickets
+ *
+ * $Horde: Folks/lib/Report/tickets.php,v 1.3 2008/05/07 01:45:56 chuck Exp $
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+class Folks_Report_tickets extends Folks_Report {
+
+ /**
+ * Report
+ */
+ function report($message)
+ {
+ $info = array_merge($GLOBALS['conf']['report_content']['ticket_params'],
+ array('summary' => $this->getTitle(),
+ 'comment' => $message,
+ 'user_email' => $this->getUserEmail()));
+
+ return $registry->call('tickets/addTicket', array($info));
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Folks api
+ *
+ * Copyright 2008 Obala d.o.o (www.obala.si)
+ *
+ * See the enclosed file LICENSE for license information (BSD). If you
+ * did not receive this file, see http://cvs.horde.org/co.php/folks/LICENSE.
+ *
+ * $Id: api.php 979 2008-10-08 08:31:13Z duck $
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+$_services['commentCallback'] = array(
+ 'args' => array('id' => 'string'),
+ 'type' => 'string'
+);
+
+$_services['removeUserData'] = array(
+ 'args' => array('user' => 'string'),
+ 'type' => 'boolean'
+);
+
+$_services['hasComments'] = array(
+ 'args' => array(),
+ 'type' => 'boolean'
+);
+
+$_services['getOnlineUsers'] = array(
+ 'args' => array(),
+ 'type' => 'array'
+);
+
+$_services['getProfile'] = array(
+ 'args' => array(),
+ 'type' => 'array'
+);
+
+$_services['getFriends'] = array(
+ 'args' => array('user' => 'string'),
+ 'type' => 'array'
+);
+
+$_services['addFriend'] = array(
+ 'args' => array('friend' => 'string'),
+ 'type' => 'boolean'
+);
+
+$_services['getBlacklist'] = array(
+ 'args' => array('user' => 'string'),
+ 'type' => 'array'
+);
+
+$_services['addBlacklisted'] = array(
+ 'args' => array('user' => 'string'),
+ 'type' => 'boolean'
+);
+
+$_services['removeBlacklisted'] = array(
+ 'args' => array('user' => 'string'),
+ 'type' => 'boolean'
+);
+
+$_services['isBlacklisted'] = array(
+ 'args' => array('user' => 'string'),
+ 'type' => 'boolean'
+);
+
+$_services['show'] = array(
+ 'link' => '%application%/user.php?user=|user|'
+);
+
+$_services['listTimeObjectCategories'] = array(
+ 'type' => '{urn:horde}stringArray'
+);
+
+$_services['listTimeObjects'] = array(
+ 'args' => array('start' => 'int', 'end' => 'int'),
+ 'type' => '{urn:horde}hashHash'
+);
+
+$_services['logActivity'] = array(
+ 'args' => array('activity_message' => 'string', 'scope' => 'string', 'user' => 'string'),
+ 'type' => 'boolean'
+);
+
+$_services['getActivity'] = array(
+ 'args' => array('user' => 'user_name'),
+ 'type' => 'boolean'
+);
+
+$_services['authenticate'] = array(
+ 'args' => array('userID' => 'string', 'credentials' => '{urn:horde}hash', 'params' => '{urn:horde}hash'),
+ 'checkperms' => false,
+ 'type' => 'boolean'
+);
+
+$_services['userExists'] = array(
+ 'args' => array('userId' => 'string'),
+ 'type' => 'boolean'
+);
+
+$_services['addUser'] = array(
+ 'args' => array('userId' => 'string')
+);
+
+if (Auth::isAdmin()) {
+ $_services['userList'] = array(
+ 'type' => '{urn:horde}stringArray'
+ );
+
+ $_services['removeUser'] = array(
+ 'args' => array('userId' => 'string')
+ );
+}
+
+/**
+ * Callback for comment API.
+ *
+ * @param int $id Internal data identifier.
+ * @param string $type Type of data to retreive (title, owner...).
+ * @param array $params Parameter to be passed to callback function
+ */
+function _folks_commentCallback($id, $type = 'title', $params = null)
+{
+ static $info;
+
+ if (!empty($info[$id][$type])) {
+ return $info[$id][$type];
+ }
+
+ require_once dirname(__FILE__) . '/base.php';
+
+ switch ($type) {
+
+ case 'owner':
+ return $id;
+
+ case 'link':
+ return Folks::getUrlFor('user', $id);
+
+ case 'messages':
+
+ // Update comments count
+ $result = $GLOBALS['folks_driver']->updateComments($id);
+ if ($result instanceof PEAR_Error) {
+ return $result;
+ }
+
+ // Update activity log
+ $link = '<a href="' . Folks::getUrlFor('user', $id) . '">' . $id . '</a>';
+ return $GLOBALS['folks_driver']->logActivity(sprintf(_("Commented user %s."), $link), 'folks:comments');
+
+ return true;
+
+ default:
+ return $id;
+ }
+}
+
+/**
+ * Comments are enebled
+ */
+function _folks_hasComments()
+{
+ return $GLOBALS['conf']['comments']['allow'];
+}
+
+/**
+ * Get online users
+ */
+function _folks_getOnlineUsers()
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ return $GLOBALS['folks_driver']->getOnlineUsers();
+}
+
+/**
+ * Get user profile
+ *
+ * @param string $user User to get profile for
+ */
+function _folks_getProfile($user = null)
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ return $GLOBALS['folks_driver']->getProfile($user);
+}
+
+
+/**
+ * Get user friends
+ *
+ * @param string $user Username to get friends for
+ *
+ * @return array of users
+ */
+function _folks_getFriends($user = null)
+{
+ require_once dirname(__FILE__) . '/Friends.php';
+
+ $friends = Folks_Friends::singleton(null, null, $user);
+
+ return $friends->getFriends();
+}
+
+/**
+ * Add user to our friend list
+ *
+ * @param string $friend Friend's usersame
+ *
+ * @return true or PEAR_Error
+ */
+function _folks_addFriend($user)
+{
+ require_once dirname(__FILE__) . '/Friends.php';
+
+ $friends = Folks_Friends::singleton(null);
+
+ return $friends->addFriend($user);
+}
+
+/**
+ * Remove user from a fiend list
+ *
+ * @param string $friend Friend's usersame
+ *
+ * @return true or PEAR_Error
+ */
+function _folks_removeFriend($user)
+{
+ require_once dirname(__FILE__) . '/Friends.php';
+
+ $friends = Folks_Friends::singleton(null);
+
+ return $friends->removeFriend($user);
+}
+
+/**
+ * Get user blacklist
+ *
+ * @param string $user Username to get blacklist for
+ *
+ * @return array of users
+ */
+function _folks_getBlacklist()
+{
+ require_once dirname(__FILE__) . '/Friends.php';
+
+ $friends = Folks_Friends::singleton(null);
+
+ return $friends->getBlacklist();
+}
+
+/**
+ * Add user to a blacklist list
+ *
+ * @param string $user Usersame
+ */
+function _folks_addBlacklisted($user)
+{
+ require_once dirname(__FILE__) . '/Friends.php';
+
+ $friends = Folks_Friends::singleton(null);
+
+ return $friends->addBlacklisted($user);
+}
+
+/**
+ * Remove user from a blacklist list
+ *
+ * @param string $user Usersame
+ */
+function _folks_removeBlacklisted($user)
+{
+ require_once dirname(__FILE__) . '/Friends.php';
+
+ $friends = Folks_Friends::singleton(null);
+
+ return $friends->removeBlacklisted($user);
+}
+
+/**
+ * Are we blackisted by user this user?
+ *
+ * @param string $user Username to get blacklist for
+ *
+ * @return array of users
+ */
+function _folks_isBlacklisted($user = null)
+{
+ if (empty($user)) {
+ $user = Auth::getAuth();
+ }
+
+ require_once dirname(__FILE__) . '/Friends.php';
+
+ $friends = Folks_Friends::singleton(null, null, $user);
+
+ return $friends->isBlacklisted(Auth::getAuth());
+}
+
+/**
+ * Users categories
+ */
+function _folks_listTimeObjectCategories()
+{
+ return array('birthday_friends' => _("Friends Birthdays"),
+ 'birthday_all' => _("Users Birthdays"));
+}
+
+/**
+ * Lists users with birthdays/goout dates as time objects.
+ *
+ * @param array $categories The time categories (from listTimeObjectCategories) to list.
+ * @param Horde_Date $start The start date of the period.
+ * @param Horde_Date $end The end date of the period.
+ */
+function _folks_listTimeObjects($categories, $start, $end)
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ $friends = array();
+ $objects = array();
+
+ foreach ($categories as $category) {
+ $what = substr($category, 0, strpos($category, '_', 2));
+ $criteria = array($what => array('from' => $start->timestamp(),
+ 'to' => $end->timestamp()));
+
+ $users = $GLOBALS['folks_driver']->getUsers($criteria, 0, 500);
+ if ($users instanceof PEAR_Error) {
+ return array();
+ }
+
+ if (empty($friends)
+ && ($category == 'birthday_friends')) {
+ $friends = $GLOBALS['folks_driver']->getFriends(Auth::getAuth());
+ }
+
+ foreach ($users as $user) {
+
+ if ($category == 'birthday_friends' &&
+ !array_key_exists($user['user_uid'], $friends)) {
+ continue; // skip non friends
+ }
+
+ $age = Folks::calcAge($user['user_birthday']);
+ $desc = $age['age'] . ' (' . $age['sign'] . ')';
+ $user['user_birthday'] = date('Y') . substr($user['user_birthday'], 4);
+ $from = strtotime($user['user_birthday']);
+ $to = strtotime($user['user_birthday']) + 1;
+
+ $objects[$user['user_uid']] = array(
+ 'title' => $user['user_uid'],
+ 'description' => $desc,
+ 'id' => $user['user_uid'],
+ 'start' => date('Y-m-d\TH:i:s', $from),
+ 'end' => date('Y-m-d\TH:i:s', $to),
+ 'params' => array('user' => $user['user_uid']));
+ }
+ }
+
+ return $objects;
+}
+
+/**
+ * Log user's activity
+ *
+ *
+ * @param string $message Activity message
+ * @param string $scope Scope
+ * @param string $user $user
+ *
+ * @return boolean True on success or a PEAR_Error object on failure.
+ */
+function _folks_logActivity($message, $scope, $user = null)
+{
+ if (empty($user)) {
+ $user = Auth::getAuth();
+ } elseif ($user !== Auth::getAuth() && !Auth::isAdmin('admin:' . $scope)) {
+ return PEAR::raiseError(_("You cannot log activities for other users."));
+ }
+
+ // Do not load the whole applcation
+ // require_once dirname(__FILE__) . '/base.php';
+ // return $GLOBALS['folks_driver']->logActivity($message, $scope, $user)
+
+ $_db = DB::connect($GLOBALS['conf']['sql']);
+ $query = 'INSERT INTO folks_activity'
+ . ' (user_uid, activity_message, activity_scope, activity_date) '
+ . ' VALUES (?, ?, ?, ?)';
+ return $_db->query($query, array($user, $message, $scope, $_SERVER['REQUEST_TIME']));
+}
+
+/**
+ * Get user's activity
+ *
+ * @param string $user Username
+ * @param int $limit Number of actions to return
+ *
+ * @return array Activity log
+ */
+function _folks_getActivity($user, $limit = 10)
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ return $GLOBALS['folks_driver']->getActivity($user, $limit);
+}
+
+/**
+ * Authenticate a givern user
+ *
+ * @param string $userID Username
+ * @param array $credentials Array of criedentials (password requied)
+ * @param array $params Additional params
+ *
+ * @return boolean Whether IMP authentication was successful.
+ */
+function _folks_authenticate($userID, $credentials, $params)
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ return $GLOBALS['folks_driver']->comparePassword($userID, $credentials['password']);
+}
+
+/**
+ * Check if a user exists
+ *
+ * @param string $userID Username
+ *
+ * @return boolean True if user exists
+ */
+function _folks_userExists($userId)
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ return $GLOBALS['folks_driver']->userExists($userId);
+}
+
+/**
+ * Lists all users in the system.
+ *
+ * @return array The array of userIds, or a PEAR_Error object on failure.
+ */
+function _folks_userList()
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ $users = array();
+ foreach ($GLOBALS['folks_driver']->getUsers() as $user) {
+ $users[] = $user['user_uid'];
+ }
+
+ return $users;
+}
+
+/**
+ * Adds a set of authentication credentials.
+ *
+ * @param string $userId The userId to add.
+ *
+ * @return boolean True on success or a PEAR_Error object on failure.
+ */
+function _folks_addUser($userId)
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ return $GLOBALS['folks_driver']->addUser($userId);
+}
+
+/**
+ * Deletes a set of authentication credentials.
+ *
+ * @param string $userId The userId to delete.
+ *
+ * @return boolean True on success or a PEAR_Error object on failure.
+ */
+function _folks_removeUser($userId)
+{
+ require_once dirname(__FILE__) . '/base.php';
+
+ return $GLOBALS['folks_driver']->deleteUser($userId);
+}
+
+/**
+ * Deletes a user and its data
+ *
+ * @param string $userId The userId to delete.
+ *
+ * @return boolean True on success or a PEAR_Error object on failure.
+ */
+function _folks_removeUserData($user)
+{
+ return _folks_removeUser($user);
+}
--- /dev/null
+<?php
+/**
+ * Folks base application file.
+ *
+ * $Horde: folks/lib/base.php,v 1.16 2007-02-21 10:25:28 jan Exp $
+ *
+ * This file brings in all of the dependencies that every Folks script will
+ * need, and sets up objects that all scripts use.
+ */
+
+// Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file
+// definition for site customization).
+if (!defined('HORDE_BASE')) {
+ define('HORDE_BASE', dirname(__FILE__) . '/../..');
+}
+
+// Load the Horde Framework core, and set up inclusion paths and autoloading.
+require_once HORDE_BASE . '/lib/core.php';
+require_once 'Horde/Loader.php';
+
+// Registry.
+$registry = &Registry::singleton();
+if (($pushed = $registry->pushApp('folks', !defined('AUTH_HANDLER'))) instanceof PEAR_Error) {
+ if ($pushed->getCode() == 'permission_denied') {
+ Horde::authenticationFailureRedirect();
+ }
+ Horde::fatal($pushed, __FILE__, __LINE__, false);
+}
+$conf = &$GLOBALS['conf'];
+define('FOLKS_TEMPLATES', $registry->get('templates'));
+
+// Notification system.
+$notification = &Notification::singleton();
+$notification->attach('status');
+
+// Define the base file path of Folks.
+if (!defined('FOLKS_BASE')) {
+ define('FOLKS_BASE', dirname(__FILE__) . '/..');
+}
+
+// Folks base library
+require_once FOLKS_BASE . '/lib/Folks.php';
+require_once FOLKS_BASE . '/lib/Driver.php';
+$GLOBALS['folks_driver'] = Folks_Driver::factory();
+
+// Cache
+$GLOBALS['cache'] = &Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
+ Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
+
+// Update user online status
+$GLOBALS['folks_driver']->updateOnlineStatus();
+
+// Start output compression.
+if (!Util::nonInputVar('no_compress')) {
+ Horde::compressOutput();
+}
\ No newline at end of file
--- /dev/null
+<?php define('FOLKS_VERSION', '0.1-cvs') ?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: list.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+$title = _("List");
+
+$count = $folks_driver->countUsers();
+if ($count instanceof PEAR_Error) {
+ $notification->push($count);
+ $count = 0;
+}
+
+if (($sort_by = Util::getFormData('sort_by')) !== null) {
+ $prefs->setValue('sort_by', $sort_by);
+} else {
+ $sort_by = $prefs->getValue('sort_by');
+}
+
+if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+ $prefs->setValue('sort_dir', $sort_dir);
+} else {
+ $sort_dir = $prefs->getValue('sort_dir');
+}
+
+$page = Util::getGet('page', 0);
+$perpage = $prefs->getValue('per_page');
+$criteria = array('sort_by' => $sort_by, 'sort_dir' => $sort_dir);
+$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
+if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ $users = array();
+}
+
+$vars = Variables::getDefaultVariables();
+$pager = new Horde_UI_Pager('page',
+ $vars, array('num' => $count,
+ 'url' => 'list.php',
+ 'perpage' => $perpage));
+
+$pager->preserve($criteria);
+$list_url = Folks::getUrlFor('list', 'list');
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+require FOLKS_TEMPLATES . '/list/list.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+[Dolphin]
+Timestamp=2008,10,7,18,48,56
+ViewMode=1
--- /dev/null
+<?php
+/**
+ * $Id: login.php 954 2008-09-30 19:09:25Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/account/tabs.php';
+require_once FOLKS_BASE . '/lib/Forms/Login.php';
+
+/*
+ * Send notification message to friends online
+ */
+function _loginNotice($user)
+{
+ if ($GLOBALS['prefs']->getValue('login_notify') != 1 ||
+ !$GLOBALS['registry']->hasInterface('letter')) {
+ return;
+ }
+
+ $friends = $GLOBALS['folks_driver']->getFriends(Auth::getAuth());
+ if ($friends instanceof PEAR_Error) {
+ return $friends;
+ } elseif (empty($friends)) {
+ return true;
+ }
+
+ $users = $GLOBALS['folks_driver']->getOnlineUsers();
+ if ($users instanceof PEAR_Error) {
+ return $users;
+ } elseif (empty($users)) {
+ return true;
+ }
+
+ $notify = array();
+ foreach ($friends as $friend) {
+ if (array_key_exists($friend, $users)) {
+ $notify[] = $friend;
+ }
+ }
+
+ if (empty($notify)) {
+ return true;
+ }
+
+ $body = _("User %s just logged in.\n%s");
+ $params = array($notify,
+ array('title' => _("Login remainder"),
+ 'content' => sprintf($body, $user, Folks::getUrlFor('user', $user, true))));
+ $GLOBALS['registry']->callByPackage('letter', 'sendMessage', $params);
+}
+
+/*
+ * Logout?
+ */
+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());
+
+ @session_destroy();
+ if (!empty($_GET['redirect'])) {
+ header('Location: ' . $_GET['redirect']);
+ } else {
+ $page = $registry->getInitialPage('folks');
+ header('Location: ' . (empty($page) ? '/' : $page));
+ }
+ exit;
+}
+
+/*
+ * Special login for apps (gollem, imp)?
+ */
+if ($conf['login']['prelogin'] &&
+ Auth::getAuth() &&
+ ($app = Util::getGet('app'))) {
+ Horde::callHook('_folks_hook_prelogin', array($app), 'folks');
+}
+
+/*
+ * Login parameters
+ */
+$url_param = Util::getFormData('url');
+$login_url = Auth::getLoginScreen('folks', $url_param);
+
+/*
+ * We are already logged in?
+ */
+if (Auth::isAuthenticated()) {
+ if (empty($url_param)) {
+ $url_param = Folks::getUrlFor('user', Auth::getAuth());
+ }
+ header('Location: ' . $url_param);
+ exit;
+}
+
+/*
+ * We have a login cookie?
+ */
+if (isset($_COOKIE['folks_login_code']) &&
+ isset($_COOKIE['folks_login_user']) &&
+ $_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));
+
+ if (empty($url_param)) {
+ $url_param = Folks::getUrlFor('user', $_COOKIE['folks_login_user']);
+ }
+ header('Location: ' . $url_param);
+ exit;
+}
+
+/*
+ * Form
+ */
+$title = sprintf(_("Login to %s"), $registry->get('name', 'horde'));
+$vars = Variables::getDefaultVariables();
+$form = new Folks_Login_Form($vars, $title, 'folks_login');
+
+/*
+ * Check time between one login and anther
+ */
+$username = strtolower(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']) {
+ $notification->push(_("You are entering your data too fast!"));
+ header('Location: ' . $login_url);
+ exit;
+ } else {
+ $cache->set('login_last_try_' . $username, $_SERVER['REQUEST_TIME']);
+ }
+}
+
+/*
+ * Process form
+ */
+if ($form->isSubmitted()) {
+
+ // check password
+ $form->getInfo(null, $info);
+
+ $result = $folks_driver->comparePassword($username, $info['password']);
+ if ($result !== true) {
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Your username or password is incorrect."));
+ }
+ header('Location: ' . $login_url);
+ exit;
+ }
+
+ // Check user profile status
+ $profile = $folks_driver->getRawProfile($username);
+ if ($profile instanceof PEAR_Error) {
+ $notification->push($profile);
+ header('Location: ' . $login_url);
+ exit;
+ }
+ switch ($profile['user_status']) {
+
+ case 'deactivated':
+ $notification->push(sprintf(_("Your username was temporary deacirvated. For any additional information please write to %s, and don't forgot to incluide your username."), $conf['folks']['support']), 'horde.warning');
+ header('Location: ' . Horde::selfUrl(true));
+ exit;
+ break;
+
+ case 'unconfirmed':
+ $notification->push(_("This account was still not activated. Check your inbox, we sendy you the activation code there."), 'horde.warning');
+ header('Location: ' . Horde::selfUrl(true));
+ exit;
+ break;
+
+ case 'deleted':
+ $notification->push(_("This account was deleted or is expired."), 'horde.warning');
+ header('Location: ' . Horde::selfUrl(true));
+ exit;
+ break;
+ }
+
+ // Horde Auto login
+ $auth = &Auth::singleton('auto', array('username' => $username));
+ $auth->setAuth($username, array('transparent' => 1, 'password' => $info['password']));
+
+ // Save user last login info, we don't use last_login prefs as it can be turned off by user
+ $params = array('last_login_on' => date('Y-m-d H:i:s'),
+ 'last_login_by' => $_SERVER['REMOTE_ADDR']);
+ if ($profile['user_status'] == 'deleted') {
+ $params['user_status'] = 'active';
+ }
+ $result = $folks_driver->saveProfile($params, $username);
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ }
+
+ // set cookie
+ $cookie = $folks_driver->getCookie($username);
+ if ($info['loginfor']) {
+ $info['loginfor'] = $_SERVER['REQUEST_TIME'] + 2592000;
+ } else {
+ $info['loginfor'] = 0;
+ }
+ setcookie('folks_login_user', $username, $info['loginfor'], $conf['cookie']['path'], $conf['cookie']['domain']);
+ setcookie('folks_login_code', $cookie, $info['loginfor'], $conf['cookie']['path'], $conf['cookie']['domain']);
+
+ // Notify user's freinds that user come online
+ _loginNotice($username);
+
+ // Reset online users
+ $folks_driver->resetOnlineUsers();
+
+ if (empty($url_param)) {
+ $url_param = Folks::getUrlFor('user', $username);
+ }
+ header('Location: ' . $url_param);
+ exit;
+}
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+require FOLKS_TEMPLATES . '/login/login.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: new.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+$title = _("New");
+
+$count = $folks_driver->countUsers();
+if ($count instanceof PEAR_Error) {
+ $notification->push($count);
+ $count = 0;
+}
+
+$page = Util::getGet('page', 0);
+$perpage = $prefs->getValue('per_page');
+$criteria = array('sort_by' => 'signup_at', 'sort_dir' => 0);
+$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
+if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ $users = array();
+}
+
+$vars = Variables::getDefaultVariables();
+$pager = new Horde_UI_Pager('page',
+ $vars, array('num' => $count,
+ 'url' => 'new.php',
+ 'perpage' => $perpage));
+
+$pager->preserve($criteria);
+$list_url = Folks::getUrlFor('list', 'new');
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+require FOLKS_TEMPLATES . '/list/list.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: online.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+$title = _("Online");
+
+$count = $folks_driver->countUsers(array('online' => true));
+if ($count instanceof PEAR_Error) {
+ $notification->push($count);
+ $count = 0;
+}
+
+if (($sort_by = Util::getFormData('sort_by')) !== null) {
+ $prefs->setValue('sort_by', $sort_by);
+} else {
+ $sort_by = $prefs->getValue('sort_by');
+}
+
+if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+ $prefs->setValue('sort_dir', $sort_dir);
+} else {
+ $sort_dir = $prefs->getValue('sort_dir');
+}
+
+$page = Util::getGet('page', 0);
+$perpage = $prefs->getValue('per_page');
+$criteria = array('online' => true, 'sort_by' => $sort_by, 'sort_dir' => $sort_dir);
+$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
+if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ $users = array();
+}
+
+$vars = Variables::getDefaultVariables();
+$pager = new Horde_UI_Pager('page',
+ $vars, array('num' => $count,
+ 'url' => 'online.php',
+ 'perpage' => $perpage));
+
+$pager->preserve($criteria);
+$list_url = Folks::getUrlFor('list', 'online');
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+require FOLKS_TEMPLATES . '/list/list.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+# translation of folks_sl_SI.po to Slovene
+# FIRST AUTHOR <duck@obala.net>, 2007.
+# Marko Milost <marko.milost@obala.si>, 2008.
+# Usms translation.
+# Copyright (C) 2007 Horde Project
+# This file is distributed under the same license as the FOlks package.
+msgid ""
+msgstr ""
+"Project-Id-Version: folks_sl_SI\n"
+"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
+"POT-Creation-Date: 2008-09-27 19:37+0200\n"
+"PO-Revision-Date: 2008-02-05 13:07+0100\n"
+"Last-Translator: Marko Milost <marko.milost@obala.si>\n"
+"Language-Team: Slovene <sl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=3\n"
+
+#: edit/friends.php:49
+#, php-format
+msgid "%s added you as a friend on %s"
+msgstr "%s vas je dodal kot prijetelja na %s"
+
+#: edit/approve.php:40
+#, php-format
+msgid "%s approved you as a friend on %s"
+msgstr "%s vas je potrdil kot prijetelja na %s"
+
+#: edit/reject.php:39
+#, php-format
+msgid "%s rejected you as a friend on %s"
+msgstr "%s vas je zavrnil kot prijetelja na %s"
+
+#: user.php:29
+#, php-format
+msgid "%s's profile"
+msgstr "%s se predstavlja"
+
+#: edit/edit.php:43 edit/edit.php:59
+msgid "--- Select ---"
+msgstr "--- Izeberi ---"
+
+#: edit/friends.php:48
+#, php-format
+msgid "A confirmation was send to \"%s\"."
+msgstr "Potrditev je bila poslana na \"%s\"."
+
+#: templates/edit/blacklist.php:13 templates/edit/friends.php:13
+msgid "Action"
+msgstr "Ukaz"
+
+#: activity.php:17 templates/user/user.php:95 templates/list/list.php:6
+msgid "Activity"
+msgstr "Aktivnost"
+
+#: templates/user/actions.php:17 templates/user/user.php:116
+#, php-format
+msgid "Add %s as a friend?"
+msgstr "Dodamo %s kot prijatelja?"
+
+#: templates/user/actions.php:20
+#, php-format
+msgid "Add %s to you blacklist?"
+msgstr "Dodamo %s na črno listo?"
+
+#: lib/Forms/AddFriend.php:19
+msgid "Add / Remove"
+msgstr "Dodaj / Odstrani"
+
+#: templates/user/actions.php:14 templates/user/actions.php:15
+msgid "Add a comment"
+msgstr "Dodaj komentar"
+
+#: edit/blacklist.php:53 edit/friends.php:96
+msgid "Add or remove user"
+msgstr "Dodaj ali odstrani u porabnika"
+
+#: templates/user/user.php:141 templates/user/user.php:166
+#: templates/user/user.php:191 templates/user/user.php:218
+#: templates/user/user.php:244 templates/user/user.php:272
+#: templates/user/user.php:298
+msgid "Add your content"
+msgstr "Dodaj svojo vsebino"
+
+#: account/signup.php:38
+#, php-format
+msgid "Added \"%s\" to the system. You can log in now."
+msgstr "Uporabnik \"%s\" je bil oddan v sistem. Lahko se prijavite."
+
+#: report.php:36
+msgid "Advertisement content"
+msgstr "Reklama vsebina"
+
+#: templates/user/user.php:82 templates/list/list.php:27
+msgid "Age"
+msgstr "Starost"
+
+#: lib/Forms/Search.php:22
+msgid "Age from"
+msgstr "Starost od"
+
+#: lib/Forms/Search.php:23
+msgid "Age to"
+msgstr "Starost do"
+
+#: templates/list/list.php:37
+msgid "Albums"
+msgstr "Albumi"
+
+#: lib/Block/friends.php:36
+msgid "All"
+msgstr "Vsi"
+
+#: templates/list/list.php:9
+msgid "All users"
+msgstr "Vsi uporabniki"
+
+#: edit/edit.php:33
+msgid "All visitors can see when I was last time online"
+msgstr "Vsi lahko vidijo, kdaj sem bil nazadnje online"
+
+#: edit/comments.php:28
+msgid "Any one"
+msgstr "Vsi"
+
+#: templates/edit/friends.php:53
+msgid "Approve"
+msgstr "Potrdi"
+
+#: lib/Folks.php:131 lib/Folks.php:135
+msgid "Aquarius"
+msgstr "Vodnar"
+
+#: lib/Folks.php:139 lib/Folks.php:143
+msgid "Aries"
+msgstr "Oven"
+
+#: config/prefs.php.dist:43
+msgid "Ascesending"
+msgstr "Naraščajoče"
+
+#: edit/comments.php:29
+msgid "Authenticated users"
+msgstr "Prijavljeni uporabniki"
+
+#: services.php:16
+msgid "Available services"
+msgstr "Dostopne storitve"
+
+#: birthday.php:17 templates/list/list.php:8 edit/edit.php:42
+msgid "Birthday"
+msgstr "Rojstni dan"
+
+#: templates/user/actions.php:21 edit/tabs.php:23 edit/blacklist.php:19
+#: lib/Friends/sql.php:205 lib/Friends/letter.php:88
+msgid "Blacklist"
+msgstr "Črna lista"
+
+#: report.php:34
+msgid "Cancel"
+msgstr "Prekliči"
+
+#: lib/Folks.php:151 lib/Folks.php:155
+msgid "Cancer"
+msgstr "Rak"
+
+#: account/resetpassword.php:19
+msgid "Cannot reset password automatically, contact your administrator."
+msgstr "Ne moremo resetirati gesla, kontaktirajte podporo uporabnikom."
+
+#: lib/Folks.php:272
+msgid "Cannot retrieve user email."
+msgstr "Ne morem prebrati email uporabnika"
+
+#: edit/password.php:20
+msgid "Cannot update password, contact your administrator."
+msgstr "Ne moremo nastaviti geslo, obrnite se na podporo."
+
+#: lib/Folks.php:131 lib/Folks.php:175
+msgid "Capricorn"
+msgstr "Kozorog"
+
+#: edit/password.php:25
+msgid "Change Your Password"
+msgstr "Spremeni geslo"
+
+#: edit/password.php:30 config/hooks.php.dist:240
+msgid "Choose a password"
+msgstr "Izberite geslo"
+
+#: config/hooks.php.dist:233
+msgid "Choose a username"
+msgstr "Izberite uporabniško ime"
+
+#: config/hooks.php.dist:236
+#, php-format
+msgid ""
+"Choose a username to be used as your nickname on %s. It can be up to %d long."
+msgstr "Izberite uporabniško ime za %s. Dolgo je lahko največ %d znakov."
+
+#: templates/user/user.php:90 templates/list/list.php:29 edit/edit.php:44
+#: lib/Forms/Search.php:19 lib/Forms/Search.php:21
+msgid "City"
+msgstr "Mesto"
+
+#: templates/user/private.php:9 templates/user/friends.php:9
+msgid "Click here"
+msgstr "Klikni tukaj"
+
+#: templates/user/authenticated.php:7 templates/user/authenticated.php:8
+msgid "Click here to login."
+msgstr "Klikni tukaj za prijavo"
+
+#: save_search.php:18 save_search.php:51
+msgid "Close"
+msgstr "Zapri"
+
+#: edit/tabs.php:29 edit/comments.php:18
+msgid "Comments"
+msgstr "Komentarji"
+
+#: edit/comments.php:53
+msgid "Comments deleted successfuly"
+msgstr "Komentarji so bili uspešno izbrisani"
+
+#: account/approve.php:15
+msgid "Confirm email"
+msgstr "Potridtev poštnega predela"
+
+#: config/hooks.php.dist:224
+msgid "Confirmation code"
+msgstr "Potrditvena koda"
+
+#: lib/Report.php:98
+#, php-format
+msgid "Content abuse report in %s"
+msgstr "Prijava zlorabe vsebina v %s"
+
+#: account/resetpassword.php:28 edit/password.php:28 edit/password.php:190
+msgid "Continue"
+msgstr "Nadaljuj"
+
+#: report.php:39
+msgid "Copyright infringement"
+msgstr "Kršitev avtorskih pravic"
+
+#: account/username.php:30
+msgid "Could not find any username with this email."
+msgstr "Ne najdem uporabniškega imena s tem emailom."
+
+#: account/resetpassword.php:90
+msgid ""
+"Could not reset the password for the requested user. Some or all of the "
+"details are not correct. Try again or contact your administrator if you need "
+"further help."
+msgstr ""
+"Ne morem resetirati gesla za tega uporabnika. Nekateri ali vsi podatki niso "
+"pravilni. Poskusite ponovno ali kontaktirajte podporo uporabnikom za dodatno "
+"pomoč."
+
+#: edit/edit.php:45
+msgid "Country"
+msgstr "Država"
+
+#: edit/password.php:29
+msgid "Current password"
+msgstr "Trenutno geslo"
+
+#: templates/list/search.php:14
+msgid "Delete"
+msgstr "Izbriši"
+
+#: edit/comments.php:40 edit/comments.php:47
+msgid "Delete all current comments"
+msgstr "Izbriši vse trenutne komentarje"
+
+#: edit/edit.php:65 edit/edit.php:85
+msgid "Delete picture"
+msgstr "Izbriši sliko"
+
+#: config/prefs.php.dist:42
+msgid "Descesending"
+msgstr "Padajoče"
+
+#: templates/user/user.php:318 templates/list/list.php:33 edit/edit.php:63
+#: lib/Forms/Search.php:19
+msgid "Description"
+msgstr "Opis"
+
+#: report.php:30
+msgid "Do you really want to report this user?"
+msgstr "Res želite prijavit tega uporabnika?"
+
+#: lib/Block/random.php:40
+msgid "Does not metter"
+msgstr "Ni pomembno"
+
+#: account/tabs.php:25
+msgid "Don't have an account? Sign up."
+msgstr "Niste še prijavljeni?"
+
+#: templates/user/user.php:115
+msgid "Edit my firends"
+msgstr "Uredi prijatelje"
+
+#: edit/edit.php:18 edit/tabs.php:22
+msgid "Edit my profile"
+msgstr "Uredi moj profil"
+
+#: lib/Folks.php:288
+msgid "Edit profile"
+msgstr "Uredi profil"
+
+#: edit/edit.php:39 config/hooks.php.dist:246
+msgid "Email"
+msgstr "Email"
+
+#: config/hooks.php.dist:250
+msgid ""
+"Email will be used only for admistration reasons and it won't be published "
+"or passed to third parties."
+msgstr ""
+"Vnesite naslov vaše elektronske pošte. Naslov ne bo nikoli posredovan "
+"tretjim osebam."
+
+#: lib/Forms/Login.php:22
+#, php-format
+msgid "Enter the username you registered to %s"
+msgstr "Unesite uporabnško ime s katerega se se prijavili na %s"
+
+#: lib/Forms/Login.php:25
+msgid "Enter your password. Please be aware that password is case sensitive."
+msgstr "Vnesite vaše geslo. Gelo loči med velikimi in malimi črkami."
+
+#: templates/user/user.php:248
+msgid "Faces"
+msgstr "Obrazi"
+
+#: templates/user/user.php:248
+msgid "Faces in user galleries"
+msgstr "Orazi v galerijah uporabnika"
+
+#: templates/user/user.php:87 templates/list/list.php:66 edit/edit.php:43
+#: lib/Forms/Search.php:20
+msgid "Female"
+msgstr "Ženski"
+
+#: account/tabs.php:29
+msgid "Forgot your password?"
+msgstr "Ste pozabili geslo?"
+
+#: account/username.php:17 account/tabs.php:32
+msgid "Forgot your username?"
+msgstr "Ste pozabili uporabniško ime?"
+
+#: templates/user/actions.php:10
+msgid "Forward"
+msgstr "Posreduj"
+
+#: templates/user/actions.php:18
+msgid "Friend"
+msgstr "Prijatelj"
+
+#: templates/user/user.php:118 edit/tabs.php:24 edit/friends.php:19
+#: lib/Block/friends.php:3 lib/Block/friends.php:23
+msgid "Friends"
+msgstr "Prijatelji"
+
+#: lib/api.php:275
+msgid "Friends Birthdays"
+msgstr "Rojstni dnevi prijateljev"
+
+#: lib/Folks.php:147 lib/Folks.php:151
+msgid "Gemini"
+msgstr "Dvojčka"
+
+#: templates/user/user.php:86 templates/list/list.php:25 edit/edit.php:43
+#: lib/Forms/Search.php:20
+msgid "Gender"
+msgstr "Spol"
+
+#: templates/user/user.php:50
+msgid "Has no picture"
+msgstr "Ima sliko"
+
+#: templates/user/user.php:104 templates/list/list.php:31 edit/edit.php:47
+msgid "Homepage"
+msgstr "Domača stran"
+
+#: config/prefs.php.dist:16
+msgid "How to preview users"
+msgstr "Kako naj pregledujem uporabnike"
+
+#: templates/user/user.php:105
+msgid "I don't have it"
+msgstr "Je nimam"
+
+#: lib/Forms/Search.php:25
+msgid "Is online"
+msgstr "Je online"
+
+#: lib/Block/my_comments.php:3 lib/Block/my_comments.php:32
+msgid "Last comments on my profile"
+msgstr "Zadnji komentarji na moj profil"
+
+#: templates/user/user.php:75 edit/edit.php:41
+msgid "Last time online"
+msgstr "Zadnjič online"
+
+#: lib/Folks.php:155 lib/Folks.php:159
+msgid "Leo"
+msgstr "lev"
+
+#: lib/Folks.php:163 lib/Folks.php:167
+msgid "Libra"
+msgstr "Tehtnica"
+
+#: lib/Block/random.php:33 lib/Block/new.php:33 lib/Block/recent.php:33
+msgid "Limit"
+msgstr "Omeji"
+
+#: list.php:17 templates/list/list.php:9 lib/Folks.php:291
+msgid "List"
+msgstr "Spisek"
+
+#: account/tabs.php:22 lib/Forms/Login.php:19
+msgid "Login"
+msgstr "Prijava"
+
+#: login.php:54
+msgid "Login remainder"
+msgstr "Opozorilo o prijavi prijatela"
+
+#: login.php:124
+#, php-format
+msgid "Login to %s"
+msgstr "Prijava v %s"
+
+#: templates/user/actions.php:9
+msgid "Look at this profile"
+msgstr "Poglej ta profil"
+
+#: templates/user/user.php:87 templates/list/list.php:66 edit/edit.php:43
+#: lib/Forms/Search.php:20
+msgid "Male"
+msgstr "Moški"
+
+#: lib/Forms/Search.php:24
+msgid "Mast have"
+msgstr "Mora imeti"
+
+#: edit/comments.php:30
+msgid "Moderate comments - I will approve every single comment"
+msgstr "Moderiranje komentarjev - potrdil bom vsak kometar"
+
+#: config/prefs.php.dist:23
+msgid "Modify account preferences"
+msgstr "Popravi nastavitve"
+
+#: templates/list/list.php:6
+msgid "Most active users"
+msgstr "Najbolj aktvni uporabniki"
+
+#: templates/list/list.php:5
+msgid "Most popular users"
+msgstr "Najbolj priljubljeni uporabniki"
+
+#: lib/Folks.php:287
+msgid "My profile"
+msgstr "Moj profil"
+
+#: templates/list/search.php:11
+msgid "My queries"
+msgstr "Moja iskanja"
+
+#: save_search.php:49 lib/Forms/Search.php:19
+msgid "Name"
+msgstr "Ime"
+
+#: lib/Block/new.php:3 lib/Block/new.php:23
+msgid "New users"
+msgstr "Novi uporabniki"
+
+#: templates/list/list.php:74 templates/list/list.php:75
+#: templates/list/list.php:76 templates/list/list.php:77
+#: templates/list/list.php:78 config/prefs.php.dist:60
+#: config/prefs.php.dist:70
+msgid "No"
+msgstr "Ne"
+
+#: edit/comments.php:27
+msgid "No one"
+msgstr "Nihče"
+
+#: edit/edit.php:36
+msgid "No one can see when I was last time online"
+msgstr "Nihče ne sme videti kdaj sem bil zadnjič online"
+
+#: templates/list/list.php:15
+msgid "No users found under selected criteria"
+msgstr "Ni uporabnikov pod izbranimi kriteriji"
+
+#: lib/Forms/Login.php:28
+msgid "No, only for this view"
+msgstr "Samo za to prijavo."
+
+#: config/prefs.php.dist:62
+msgid "Notify friends that I loged in"
+msgstr "Javi prijateljem, da sem se prijavil"
+
+#: lib/Block/my_comments.php:20
+msgid "Number of comments to display"
+msgstr "Število komentarjev za prikaz"
+
+#: config/prefs.php.dist:52
+msgid "Number of users perpage"
+msgstr "Število uporabnikov na stran"
+
+#: report.php:38
+msgid "Offensive content"
+msgstr "Neprimerna ali žaljiva vsebina"
+
+#: templates/user/user.php:71 lib/Block/friends.php:38
+msgid "Offline"
+msgstr "Offline"
+
+#: online.php:17 templates/user/user.php:69 templates/list/list.php:3
+#: lib/Block/random.php:39 lib/Block/friends.php:37
+msgid "Online"
+msgstr "Online"
+
+#: templates/user/user.php:359 templates/user/user.php:368
+msgid "Only authenticated users can post comments."
+msgstr "Samo prijavljeni uporabniki lahko vpisujejo komentarje."
+
+#: edit/edit.php:34
+msgid "Only authenticated users can see when I as last time online"
+msgstr "Samo prijavljeni uporabniki lahko vidiijo kdaj sem bil zanjič online"
+
+#: edit/edit.php:35
+msgid "Only my friedns can see when I as last time online"
+msgstr "Samo prijatelji lahko vidijo kdaj sem bil zadnjič online"
+
+#: templates/user/user.php:144 templates/user/user.php:169
+#: templates/user/user.php:194 templates/user/user.php:221
+#: templates/user/user.php:247 templates/user/user.php:275
+#: templates/user/user.php:301
+msgid "Others user content"
+msgstr "Ostala uporabniška vsebina"
+
+#: edit/tabs.php:25 lib/Forms/Login.php:25
+msgid "Password"
+msgstr "Geslo"
+
+#: edit/password.php:159
+msgid "Password changed."
+msgstr "Geslo je bilo spremenjeno."
+
+#: templates/list/list.php:35 edit/edit.php:64 lib/Forms/Search.php:24
+msgid "Picture"
+msgstr "Slika"
+
+#: lib/Folks.php:135 lib/Folks.php:139
+msgid "Pisces"
+msgstr "Riba"
+
+#: lib/Forms/Login.php:38
+msgid "Please enter the text above"
+msgstr "Prosimo vnesite zgodnji tekst."
+
+#: account/resetpassword.php:47
+msgid "Please respond to your security question: "
+msgstr "Prosimo odgovorite na varnostno vprašanje: "
+
+#: popularity.php:17 templates/user/user.php:99 templates/list/list.php:5
+msgid "Popularity"
+msgstr "Priljubljenost"
+
+#: templates/user/user.php:142 templates/user/user.php:167
+#: templates/user/user.php:192 templates/user/user.php:219
+#: templates/user/user.php:245 templates/user/user.php:273
+#: templates/user/user.php:299 config/prefs.php.dist:15
+msgid "Preview"
+msgstr "Pregled"
+
+#: edit/edit.php:31
+msgid "Private"
+msgstr "Osebno"
+
+#: edit/edit.php:27
+msgid "Public"
+msgstr "Javno"
+
+#: edit/edit.php:28
+msgid "Public - only authenticated users can see my personal data"
+msgstr "javno - samo registrirani uporabniki lahko vidijo moje osebne podatke"
+
+#: edit/edit.php:30
+msgid "Public - only my friends can see my presonal data"
+msgstr "javno - samo moji prijatelji lahko vidijo moje osebne podatke"
+
+#: lib/Block/random.php:3 lib/Block/random.php:23
+msgid "Random users"
+msgstr "Nakjučni uporabniki"
+
+#: lib/Block/recent.php:3 lib/Block/recent.php:23
+msgid "Recent visitors"
+msgstr "Zadnji obiskovalci"
+
+#: lib/Forms/Login.php:27
+msgid "Remember login?"
+msgstr "Si zapomnim prijavo?"
+
+#: templates/edit/blacklist.php:20 templates/edit/friends.php:21
+msgid "Remove"
+msgstr "Odstrani"
+
+#: account/renew.php:15
+msgid "Renew account"
+msgstr "Obnovi uporabniški račun."
+
+#: report.php:34 report.php:51 templates/user/actions.php:25
+msgid "Report"
+msgstr "Prijavi"
+
+#: lib/Report.php:109
+msgid "Report by user"
+msgstr "Prjava s strani uporabnika"
+
+#: lib/Report.php:40
+msgid "Report driver does not exist."
+msgstr "Gonilnike za prijavo ne bostaja."
+
+#: report.php:46 report.php:57
+msgid "Report reason"
+msgstr "Razlog prijave"
+
+#: report.php:45 report.php:56
+msgid "Report type"
+msgstr "Tip prijave"
+
+#: templates/user/actions.php:24
+msgid "Report user"
+msgstr "Prijavi uporabnika"
+
+#: config/prefs.php.dist:72
+msgid ""
+"Require my confirmation if someone would like to add me to his freidn list."
+msgstr "Zahtevja mojo potrditev če me želi kdo dodati kot prijatelja."
+
+#: edit/password.php:190
+msgid "Reset"
+msgstr "Ponastavi"
+
+#: account/resetpassword.php:26
+msgid "Reset Your Password"
+msgstr "Ponastavi svoje geslo"
+
+#: lib/Folks.php:171 lib/Folks.php:175
+msgid "Sagittarius"
+msgstr "Strelec"
+
+#: save_search.php:51 edit/edit.php:65 edit/edit.php:70 edit/comments.php:40
+msgid "Save"
+msgstr "Shrani"
+
+#: templates/list/search.php:3
+msgid "Save search criteria"
+msgstr "Shrani rezultate iskanja"
+
+#: lib/Folks.php:167 lib/Folks.php:171
+msgid "Scorpio"
+msgstr "Škorpijon"
+
+#: search.php:18 lib/Folks.php:290 lib/Forms/Search.php:26
+msgid "Search"
+msgstr "Najdi"
+
+#: lib/Forms/Search.php:19
+msgid "Search by"
+msgstr "Išči po"
+
+#: save_search.php:39
+msgid "Search criteria deleted."
+msgstr "Stranjeno iskanje je bilo zbrisano"
+
+#: save_search.php:28
+msgid "Search criteria saved successfuly"
+msgstr "Stranjeno iskanje je bilo uspešno shranjeno"
+
+#: account/resetpassword.php:49 edit/password.php:195
+msgid "Security answer"
+msgstr "Varnostni odgovor"
+
+#: edit/password.php:192
+msgid "Security question"
+msgstr "Varnostno vprašanje"
+
+#: edit/password.php:189
+msgid "Security question used when reseting password"
+msgstr "Varnostno vprašanje, ki ga bomo uporabili pri resetiranju gesla"
+
+#: account/username.php:19
+msgid "Send me my username"
+msgstr "Pošlji mi uporabniško ime"
+
+#: templates/user/actions.php:7 templates/edit/friends.php:24
+msgid "Send message"
+msgstr "Pošlji sporočilo"
+
+#: templates/user/actions.php:6
+msgid "Send private message"
+msgstr "Pošlji osebno sporočilo"
+
+#: templates/user/actions.php:9
+msgid "Send this profile to a friend"
+msgstr "Povej prijatelju za ta profil"
+
+#: lib/Folks.php:289
+msgid "Services"
+msgstr "Servisi"
+
+#: config/prefs.php.dist:24
+msgid "Set account action details"
+msgstr "Nastavite ukazne parametre"
+
+#: config/prefs.php.dist:17
+msgid "Set users preview paramaters"
+msgstr "Nastavitev pregledovanja uporabnikov"
+
+#: config/prefs.php.dist:22
+msgid "Settings"
+msgstr "Nastavitve"
+
+#: lib/Block/friends.php:33
+msgid "Show friends that are"
+msgstr "Prikaži prijatelje, ki so"
+
+#: account/signup.php:61
+msgid "Sign up"
+msgstr "Prijava novega uporabnika"
+
+#: templates/list/list.php:19 templates/list/list.php:42
+msgid "Sort Direction"
+msgstr "Smer razvrščanja"
+
+#: config/prefs.php.dist:34 config/prefs.php.dist:44
+msgid "Sort by"
+msgstr "Razvrsti po"
+
+#: templates/list/list.php:26
+msgid "Sort by Age"
+msgstr "Razvrsti po starost"
+
+#: templates/list/list.php:36
+msgid "Sort by Albums"
+msgstr "Razvrsti po šptevilu albumov"
+
+#: templates/list/list.php:28
+msgid "Sort by City"
+msgstr "Razvrsti po mestu"
+
+#: templates/list/list.php:32
+msgid "Sort by Description"
+msgstr "Razvrsti po opisu"
+
+#: templates/list/list.php:24
+msgid "Sort by Gender"
+msgstr "Razvrsti po spolu"
+
+#: templates/list/list.php:30
+msgid "Sort by Homepage"
+msgstr "Razvrsti po domačio strani"
+
+#: templates/list/list.php:34
+msgid "Sort by Picture"
+msgstr "Razvrsti po sliki"
+
+#: templates/list/list.php:22
+msgid "Sort by Username"
+msgstr "Ste po uporabniškem imenu"
+
+#: templates/list/list.php:38
+msgid "Sort by Video"
+msgstr "Razvrsti po posnetkih"
+
+#: templates/user/user.php:65 edit/edit.php:40
+msgid "Status"
+msgstr "Status"
+
+#: account/signup.php:44
+#, php-format
+msgid ""
+"Submitted request to add \"%s\" to the system. You cannot log in until your "
+"request has been approved."
+msgstr ""
+"Poslana je bila zahteva za prijavo \"%s\" v sistem. Ne morete se prijaviti, "
+"dokler vaša zahteva ne bo potrjena."
+
+#: lib/Folks.php:143 lib/Folks.php:147
+msgid "Taurus"
+msgstr "Bik"
+
+#: report.php:37
+msgid "Terms and conditions infringement"
+msgstr "Kršenje pravil obnašanja"
+
+#: account/approve.php:65 account/renew.php:65
+msgid ""
+"The code is not right. If you copy and paste the link from your email, "
+"please check if you copied the whole string."
+msgstr ""
+"Koda ni pravilna. Morda ste jo narobe prenesli s vašega poštnega predala."
+
+#: templates/edit/blacklist.php:4
+msgid "There are no users in your blacklist."
+msgstr "V vaši črni listi ni nikogar."
+
+#: templates/edit/friends.php:4
+msgid "There are no users listed as your friend."
+msgstr "Nimate nobenega uporabnika označenega kot prijatelja."
+
+#: config/hooks.php.dist:176
+msgid "There is already an user registered with this email"
+msgstr "Elektronska pošta je že v uporabi."
+
+#: config/hooks.php.dist:174
+msgid "There is already an user registered with this username"
+msgstr "Uporabniško ime je že zasedno."
+
+#: account/signup.php:50 account/signup.php:52
+#, php-format
+msgid "There was a problem adding \"%s\" to the system: %s"
+msgstr "Prišlo je do napake pri dodaju uporabnika \"%s\": %s"
+
+#: config/hooks.php.dist:138
+msgid "There was an error login into your mail account."
+msgstr "Prišlo je do napake pri praijavi v vaš poštni predal."
+
+#: login.php:184
+msgid "This account was deleted or is expired."
+msgstr "Vaše uporabnško ime je preteklo ali je v postopku izbrisa."
+
+#: login.php:178
+msgid ""
+"This account was still not activated. Check your inbox, we sendy you the "
+"activation code there."
+msgstr ""
+"Vaše uporabniško ime ni še aktivno. Preglejte vašo elektronsko pošto. Nanjo "
+"smo poslali aktivacijsko kodo."
+
+#: lib/Block/my_comments.php:57
+msgid "Title"
+msgstr "Naslov"
+
+#: lib/Report.php:122
+msgid "Unsupported"
+msgstr "Nepodprto."
+
+#: edit/edit.php:58
+msgid "Upload a new video"
+msgstr "Naloži nov posnetek"
+
+#: report.php:55 lib/Block/my_comments.php:58
+msgid "User"
+msgstr "Uporabnik"
+
+#: lib/Driver.php:372 lib/Driver/sql.php:303
+#, php-format
+msgid "User \"%s\" does not exists."
+msgstr "Uporabnik \"%s\" ne obstaja."
+
+#: lib/Friends.php:185 lib/Friends.php:254
+#, php-format
+msgid "User \"%s\" does not exits"
+msgstr "Uporabnik \"%s\" ne obstaja."
+
+#: lib/Friends.php:262
+#, php-format
+msgid "User \"%s\" is already in fiend list"
+msgstr "Uporabnik \"%s\" je že med bašimi prijatelji."
+
+#: lib/Friends.php:270
+#, php-format
+msgid ""
+"User \"%s\" is already in fiend list, but we are waiting his/her approval."
+msgstr ""
+"Uporabnik \"%s\" je že na spisku vaših prijateljev vendar čakamo da vas "
+"potrdi."
+
+#: account/renew.php:43
+#, php-format
+msgid "User \"%s\" is not market to be in the removal process."
+msgstr "Uporabnik \"%s\" ni v postopku izbisa."
+
+#: edit/friends.php:60
+#, php-format
+msgid "User \"%s\" was added as your friend."
+msgstr "Uporabnik \"%s\" je bil dodan kot vaš prijatelj."
+
+#: edit/blacklist.php:41
+#, php-format
+msgid "User \"%s\" was added to your blacklist."
+msgstr "Uporabnik \"%s\" je bil dodan v vašo črno listo."
+
+#: account/approve.php:43
+#, php-format
+msgid "User \"%s\" was already activated."
+msgstr "Uporabnik \"%s\" je že potrjen."
+
+#: edit/approve.php:38
+#, php-format
+msgid "User \"%s\" was confirmed as a friend."
+msgstr "Uporabnik \"%s\" je bil potrjen kot vaš prijatelj."
+
+#: edit/reject.php:37
+#, php-format
+msgid "User \"%s\" was rejected as a friend."
+msgstr "Uporabnik \"%s\" je bil zavrnjen kot vaš prijatelj."
+
+#: edit/blacklist.php:34
+#, php-format
+msgid "User \"%s\" was removed from your blacklist."
+msgstr "Uporabnik \"%s\" je bil odstranjen z vaše črne liste."
+
+#: edit/friends.php:41
+#, php-format
+msgid "User \"%s\" was removed from your friend list."
+msgstr "Uporabnik \"%s\" je bil odstranjen z vaše liste uporabnikov."
+
+#: edit/friends.php:52
+#, php-format
+msgid ""
+"User %s added you to his firends list on %s. \n"
+"To approve, go to: %s \n"
+"To reject, go to: %s \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+"Uporabnik %s vas je izbral za prijatelja na %s. \n"
+"Za potditev: %s \n"
+"Za zavrnitev: %s \n"
+"Njegov profil: %s \n"
+
+#: edit/approve.php:44
+#, php-format
+msgid ""
+"User %s confirmed you as a friend on %s.. \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+"Uporabnik %s vas je potrdil za prijatelja na %s. \n"
+"Njegov profil: %s \n"
+
+#: templates/user/user.php:348
+#, php-format
+msgid "User %s does not wish to be commented."
+msgstr "Uporabnik %s ne želi biti kometiran."
+
+#: templates/user/deleted.php:4
+#, php-format
+msgid "User %s has been disabled."
+msgstr "Uporabnik %s je bil izklopljen."
+
+#: templates/user/inactive.php:4
+#, php-format
+msgid "User %s is inactive."
+msgstr "Uporabnik %s ni aktiven."
+
+#: login.php:52
+#, php-format
+msgid ""
+"User %s just logged in.\n"
+"%s"
+msgstr ""
+"Uporabnik %s se je pravkar prijavil.\n"
+"%s"
+
+#: edit/reject.php:43
+#, php-format
+msgid ""
+"User %s rejected you as a friend on %s.. \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+"Uporabnik %s vas je zavrnil kot prijatelja na %s. \n"
+"Njegov profil: %s \n"
+
+#: templates/user/authenticated.php:4
+#, php-format
+msgid ""
+"User %s would like to his profile remains visible only to authenticated "
+"users."
+msgstr ""
+"Uporabnik %s želi da njegov profil ogledujejo le prijavljeni uporabniki."
+
+#: templates/user/friends.php:4
+#, php-format
+msgid "User %s would like to his profile remains visible only to his friends."
+msgstr "Uporabnik %s želi da njegov profil ogledujejo le njegovi prijatelji."
+
+#: templates/user/private.php:4
+#, php-format
+msgid "User %s would like to remain private."
+msgstr "Uporabnik %s želi ostati anonimen"
+
+#: account/signup.php:21
+msgid "User Registration has been disabled for this site."
+msgstr "Registracija novih uporabnikv je začasno izklopljena."
+
+#: lib/Block/random.php:36
+msgid "User is currently online?"
+msgstr "Je uporabnik trenutno online?."
+
+#: report.php:25
+msgid "User is not selected"
+msgstr "Uporabnik ni izbran"
+
+#: templates/user/actions.php:28
+msgid "User list"
+msgstr "Spiske uporabnikov"
+
+#: report.php:62 report.php:68
+msgid "User was not reported."
+msgstr "Uporabnik ni bil prijavljen."
+
+#: report.php:65
+msgid "User was reported."
+msgstr "Uporabnik ni bil prijavljen."
+
+#: templates/list/list.php:23 templates/edit/blacklist.php:12
+#: templates/edit/friends.php:12 account/resetpassword.php:43
+#: lib/Forms/AddFriend.php:18 lib/Forms/Login.php:21 config/prefs.php.dist:33
+msgid "Username"
+msgstr "Uporabniško ime"
+
+#: templates/user/actions.php:29
+msgid "Users"
+msgstr "Uporabniki"
+
+#: lib/api.php:276
+msgid "Users Birthdays"
+msgstr "Rojstni dnevi uporabnikov"
+
+#: templates/list/list.php:8
+msgid "Users celebrating birthday today"
+msgstr "Uporabniki, ki danes praznujejo rojstni dan"
+
+#: templates/list/list.php:3
+msgid "Users currently online"
+msgstr "Uporabniki trenutno na strani."
+
+#: templates/edit/friends.php:59
+msgid "Users that has you listed as a friend"
+msgstr "Uporabniki, ki nas imajo mene za prijatelje."
+
+#: templates/edit/friends.php:48
+msgid "Users winting us to approve their friendship"
+msgstr "Uporabnki ki čakajo na našo potditev."
+
+#: templates/list/list.php:39 edit/edit.php:59 lib/Forms/Search.php:24
+msgid "Video"
+msgstr "Video"
+
+#: templates/edit/friends.php:22
+msgid "View profile"
+msgstr "Preglej profil"
+
+#: lib/Folks.php:159 lib/Folks.php:163
+msgid "Virgo"
+msgstr "Devica"
+
+#: templates/user/user.php:105
+msgid "Visit my homepage"
+msgstr "Obišči mojo domačo stran"
+
+#: templates/edit/friends.php:39
+msgid "We are waiting this users to approve our friendship"
+msgstr "Uporabnke na katere čakamo da nas potrdijo kot uporabniki."
+
+#: lib/Friends/sql.php:204 lib/Friends/letter.php:87
+msgid "Whitelist"
+msgstr "Želje"
+
+#: edit/comments.php:38
+msgid "Who can post comments to your profile"
+msgstr "Kdo lahko kometira vaš profil"
+
+#: lib/Forms/Search.php:18
+msgid "Word"
+msgstr "Beseda"
+
+#: templates/list/list.php:74 templates/list/list.php:75
+#: templates/list/list.php:76 templates/list/list.php:77
+#: templates/list/list.php:78 config/prefs.php.dist:61
+#: config/prefs.php.dist:71
+msgid "Yes"
+msgstr "Da"
+
+#: lib/Forms/Login.php:29
+msgid "Yes, remember me so the next time I don't neet to login"
+msgstr "Da, želim da si zapomnim prijavo za naslednji obisk."
+
+#: account/approve.php:62 account/renew.php:62
+msgid "You account is activated, you can login now."
+msgstr "Vaše uporabniško ime je bilo potrjeno. Sedaj se lahko prijavite."
+
+#: login.php:135
+msgid "You are entering your data too fast!"
+msgstr "Podatke vnašate prehitro."
+
+#: templates/user/user.php:356 templates/user/user.php:376
+#, php-format
+msgid "You are on %s blacklist."
+msgstr "Ste na črni listi uporabnika %s."
+
+#: templates/user/private.php:8 templates/user/friends.php:8
+#, php-format
+msgid "You can still send a private message to user %s."
+msgstr "Še vedno mu lahko pošljete osebno sporočilo %s."
+
+#: lib/Friends.php:190
+#, php-format
+msgid "You cannot add \"%s\" to your blacklist."
+msgstr "Ne morete dodati \"%s\" na črno listo."
+
+#: lib/Friends.php:248
+msgid "You cannot add yourself as your own friend."
+msgstr "Sami sebe ne morete dati kot prijatelja"
+
+#: lib/Friends.php:179
+msgid "You cannot add yourself to your blacklist."
+msgstr "Ne morete dodati samega sebe na črno listo."
+
+#: account/approve.php:20 account/renew.php:20
+msgid "You must supply a confirmation code."
+msgstr "Podati morate kodo za potrditev računa."
+
+#: account/approve.php:28 account/renew.php:28 edit/approve.php:24
+#: edit/reject.php:24
+msgid "You must supply a username."
+msgstr "Podati morate uporabiško ime"
+
+#: edit/comments.php:76
+msgid "Your comments preference was sucessfuly saved."
+msgstr "Vaše nastaviteve komentarjev so bile uspešno shranjene."
+
+#: edit/edit.php:79
+msgid "Your data were successfully updated."
+msgstr "Vaši podatki so bili uspešno ažurirani."
+
+#: account/username.php:20
+msgid "Your email"
+msgstr "Vaš email"
+
+#: edit/edit.php:90
+msgid "Your image was deleted successfully."
+msgstr "Vaša slika je bila uspešno izbrisana."
+
+#: account/resetpassword.php:76
+#, php-format
+msgid ""
+"Your new password for %s is: %s. \n"
+"\n"
+" It was requested by %s on %s"
+msgstr ""
+"Vaše novo geslo za %s je %s. \n"
+"\n"
+"Zahtevano je bilo s strani %s ob %s"
+
+#: edit/password.php:66
+#, php-format
+msgid ""
+"Your new password is too long; passwords may not be more than %d characters "
+"long!"
+msgstr "Vaše geslo je predlogo. Gesla ne morejo biti daljša od %d znakov!"
+
+#: edit/password.php:145
+msgid "Your new password is too simple to guess! Not changed!"
+msgstr "Geslo je preveč preposto. Ni bilo spremenjeno!"
+
+#: edit/password.php:136
+msgid "Your new password is too simple to guess. Not changed!"
+msgstr "Geslo je preveč preposto. Ni spremenjeno!"
+
+#: edit/password.php:61
+#, php-format
+msgid "Your new password must be at least %d characters long!"
+msgstr "Geslo mora biti vsaj %d znakov dolgo!"
+
+#: edit/password.php:44
+msgid "Your new password must be different from your current password"
+msgstr "Novo geslo mora biti drugaćno od starega"
+
+#: edit/password.php:106
+#, php-format
+msgid "Your new password must contain at least %d alphabetic characters."
+msgstr "Geslo mora vsebovati vsaj %d črk."
+
+#: edit/password.php:111
+#, php-format
+msgid "Your new password must contain at least %d alphanumeric characters."
+msgstr "Geslo mora vsebovati vsaj %d števil."
+
+#: edit/password.php:116
+#, php-format
+msgid ""
+"Your new password must contain at least %d different types of characters. "
+"The types are: lower, upper, numeric, and symbols."
+msgstr ""
+"Gelo mora vsebovati vsaj %d različnih tipov znakov. Tipi znakov: majhne "
+"črke, velike črke, številke in simboli."
+
+#: edit/password.php:96
+#, php-format
+msgid "Your new password must contain at least %d lowercase characters."
+msgstr "Geslo mora vsebovati vsaj %d majhnih črk."
+
+#: edit/password.php:101
+#, php-format
+msgid "Your new password must contain at least %d numeric characters."
+msgstr "Geslo mora vsebovati vsaj %d številk."
+
+#: edit/password.php:91
+#, php-format
+msgid "Your new password must contain at least %d uppercase characters."
+msgstr "Geslo mora vsebovati vsaj %d velikih črk."
+
+#: edit/password.php:122
+#, php-format
+msgid "Your new password must contain less than %d whitespace characters."
+msgstr "Geslo mora vsebovati manj kot %d presledkov."
+
+#: edit/password.php:124
+msgid "Your new password must not contain whitespace characters."
+msgstr "Geslo ne sme vsebovati presledkov."
+
+#: edit/password.php:50
+msgid "Your old password didn't match"
+msgstr "Vaše staro gelso se ne ujema"
+
+#: account/resetpassword.php:82
+msgid "Your password has been reset"
+msgstr "Vaše geslo je bilo resetirano"
+
+#: account/resetpassword.php:84
+#, php-format
+msgid ""
+"Your password has been reset, check your email (%s) and log in with your new "
+"password."
+msgstr ""
+"Vaše geslo je bilo resetirano, novo geslo smo poslali na vaš email (%s)."
+
+#: edit/password.php:185
+msgid "Your securiy questions was updated."
+msgstr "Vaše varnostno vprašanje je bilo ažurirano."
+
+#: account/username.php:34
+#, php-format
+msgid ""
+"Your username on %s %s is: %s. \n"
+"\n"
+" It was requested by %s on %s"
+msgstr ""
+"Vaše uporabniško ime na %s %s je: %s. \n"
+"\n"
+" Zahteval ga je %s ob %s"
+
+#: config/hooks.php.dist:218
+#, php-format
+msgid ""
+"Your username on %s %s is: %s. \n"
+"\n"
+" Please confirm the registration by going to this link \n"
+" %s"
+msgstr ""
+"Vaše uporabniško ime na %s %s je: %s. \n"
+"\n"
+" Prosimo potrdite prijevo na spodnji povezavu\n"
+" %s"
+
+#: login.php:156
+msgid "Your username or password is incorrect."
+msgstr "Vaše uporabniško ime ali geslo je napačno."
+
+#: account/username.php:41
+msgid "Your username was requested"
+msgstr "Zahtevano je bilo vaše uporabniško ime"
+
+#: account/username.php:43
+#, php-format
+msgid "Your username was sent, check your email (%s)."
+msgstr "Vaše uporabniško ime je bilo poslano na vaš emali (%s)."
+
+#: login.php:172
+#, php-format
+msgid ""
+"Your username was temporary deacirvated. For any additional information "
+"please write to %s, and don't forgot to incluide your username."
+msgstr ""
+"Vaše uporabniško ime je bilo začasno deaktivirano. Za dodatne informacije se "
+"obrnite na %s. Ne pozabite navesti vašega uporabniškega imena."
+
+#: edit/password.php:30 config/hooks.php.dist:243
+msgid "type the password twice to confirm"
+msgstr "Prosim, vnesite geslo dvakrat za potrditev"
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Horde Project
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
+"POT-Creation-Date: 2008-10-29 15:01+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: edit/friends.php:49
+#, php-format
+msgid "%s added you as a friend on %s"
+msgstr ""
+
+#: edit/approve.php:40
+#, php-format
+msgid "%s approved you as a friend on %s"
+msgstr ""
+
+#: edit/reject.php:39
+#, php-format
+msgid "%s rejected you as a friend on %s"
+msgstr ""
+
+#: user.php:63
+#, php-format
+msgid "%s's profile"
+msgstr ""
+
+#: edit/edit.php:30 edit/edit.php:46
+msgid "--- Select ---"
+msgstr ""
+
+#: scripts/mail.php:157
+msgid "-c, --count Limit count"
+msgstr ""
+
+#: scripts/mail.php:158
+msgid "-f, --from Limit offset"
+msgstr ""
+
+#: scripts/mail.php:156
+msgid "-h, --help Show this help"
+msgstr ""
+
+#: scripts/mail.php:160
+msgid "-p, --password[=password] Horde login password"
+msgstr ""
+
+#: scripts/mail.php:159
+msgid "-u, --username[=username] Horde login username"
+msgstr ""
+
+#: edit/friends.php:48
+#, php-format
+msgid "A confirmation was send to \"%s\"."
+msgstr ""
+
+#: templates/edit/activity.php:19 templates/edit/blacklist.php:13
+#: templates/edit/friends.php:13
+msgid "Action"
+msgstr ""
+
+#: activity.php:17 templates/friends/friends.php:18
+#: templates/friends/friends.php:45 templates/user/user.php:121
+#: templates/user/user.php:360 templates/list/list.php:7
+#: templates/edit/activity.php:18 edit/tabs.php:26 edit/activity.php:19
+#: lib/Forms/Activity.php:19 lib/Forms/Activity.php:21
+msgid "Activity"
+msgstr ""
+
+#: config/prefs.php.dist:30
+msgid "Activity log"
+msgstr ""
+
+#: edit/activity.php:28
+msgid "Activity successfully deleted"
+msgstr ""
+
+#: user.php:54 friends.php:31 edit/activity.php:40
+msgid "Activity successfully posted"
+msgstr ""
+
+#: templates/user/actions.php:17 templates/user/user.php:142
+#, php-format
+msgid "Add %s as a friend?"
+msgstr ""
+
+#: templates/user/actions.php:20
+#, php-format
+msgid "Add %s to you blacklist?"
+msgstr ""
+
+#: lib/Forms/AddFriend.php:19
+msgid "Add / Remove"
+msgstr ""
+
+#: templates/user/actions.php:14 templates/user/actions.php:15
+msgid "Add a comment"
+msgstr ""
+
+#: edit/blacklist.php:53 edit/friends.php:96
+msgid "Add or remove user"
+msgstr ""
+
+#: templates/user/user.php:167 templates/user/user.php:192
+#: templates/user/user.php:217 templates/user/user.php:244
+#: templates/user/user.php:270 templates/user/user.php:298
+#: templates/user/user.php:324 templates/user/user.php:357
+msgid "Add your content"
+msgstr ""
+
+#: account/signup.php:38
+#, php-format
+msgid "Added \"%s\" to the system. You can log in now."
+msgstr ""
+
+#: edit/approve.php:52
+#, php-format
+msgid "Added user %s as a friend."
+msgstr ""
+
+#: report.php:36
+msgid "Advertisement content"
+msgstr ""
+
+#: templates/user/user.php:108 templates/list/list.php:28
+msgid "Age"
+msgstr ""
+
+#: lib/Forms/Search.php:22
+msgid "Age from"
+msgstr ""
+
+#: lib/Forms/Search.php:23
+msgid "Age to"
+msgstr ""
+
+#: templates/list/list.php:38
+msgid "Albums"
+msgstr ""
+
+#: lib/Block/friends.php:36
+msgid "All"
+msgstr ""
+
+#: templates/list/list.php:10
+msgid "All users"
+msgstr ""
+
+#: edit/privacy.php:33
+msgid "All visitors"
+msgstr ""
+
+#: edit/comments.php:28
+msgid "Any one"
+msgstr ""
+
+#: templates/friends/friends.php:43 templates/edit/activity.php:16
+msgid "Application"
+msgstr ""
+
+#: config/prefs.php.dist:129
+msgid ""
+"Application you would like NOT to log activitiy when you post a new PUBLIC "
+"COMMENT"
+msgstr ""
+
+#: config/prefs.php.dist:114
+msgid ""
+"Application you would like NOT to log your activitiy when you post a new "
+"PUBLIC CONTENT."
+msgstr ""
+
+#: templates/edit/friends.php:53
+msgid "Approve"
+msgstr ""
+
+#: lib/Folks.php:131 lib/Folks.php:135
+msgid "Aquarius"
+msgstr ""
+
+#: lib/Folks.php:139 lib/Folks.php:143
+msgid "Aries"
+msgstr ""
+
+#: config/prefs.php.dist:50
+msgid "Ascesending"
+msgstr ""
+
+#: edit/comments.php:29
+msgid "Authenticated users"
+msgstr ""
+
+#: services.php:16
+msgid "Available services"
+msgstr ""
+
+#: birthday.php:17 templates/list/list.php:9 edit/edit.php:29
+msgid "Birthday"
+msgstr ""
+
+#: templates/user/actions.php:21 edit/tabs.php:24 edit/blacklist.php:19
+#: lib/Friends/sql.php:215 lib/Friends/letter.php:88
+msgid "Blacklist"
+msgstr ""
+
+#: report.php:34
+msgid "Cancel"
+msgstr ""
+
+#: lib/Folks.php:151 lib/Folks.php:155
+msgid "Cancer"
+msgstr ""
+
+#: scripts/mail-filter.php:120
+msgid "Cannot authenticate at mail server:"
+msgstr ""
+
+#: account/resetpassword.php:19
+msgid "Cannot reset password automatically, contact your administrator."
+msgstr ""
+
+#: lib/Folks.php:272
+msgid "Cannot retrieve user email."
+msgstr ""
+
+#: edit/password.php:20
+msgid "Cannot update password, contact your administrator."
+msgstr ""
+
+#: lib/Folks.php:131 lib/Folks.php:175
+msgid "Capricorn"
+msgstr ""
+
+#: edit/password.php:25
+msgid "Change Your Password"
+msgstr ""
+
+#: edit/password.php:30
+msgid "Choose a password"
+msgstr ""
+
+#: templates/user/user.php:116 templates/list/list.php:30 edit/edit.php:31
+#: lib/Forms/Search.php:19 lib/Forms/Search.php:21
+msgid "City"
+msgstr ""
+
+#: templates/user/private.php:9 templates/user/friends.php:9
+msgid "Click here"
+msgstr ""
+
+#: templates/user/authenticated.php:7 templates/user/authenticated.php:8
+msgid "Click here to login."
+msgstr ""
+
+#: save_search.php:18 save_search.php:51
+msgid "Close"
+msgstr ""
+
+#: lib/api.php:154
+#, php-format
+msgid "Commented user %s."
+msgstr ""
+
+#: edit/tabs.php:31 edit/comments.php:18
+msgid "Comments"
+msgstr ""
+
+#: edit/comments.php:57
+msgid "Comments deleted successfuly"
+msgstr ""
+
+#: account/approve.php:15
+msgid "Confirm email"
+msgstr ""
+
+#: config/hooks.php.dist:237
+msgid "Confirmation code"
+msgstr ""
+
+#: lib/Report.php:98
+#, php-format
+msgid "Content abuse report in %s"
+msgstr ""
+
+#: account/resetpassword.php:28 edit/password.php:28 edit/password.php:190
+msgid "Continue"
+msgstr ""
+
+#: report.php:39
+msgid "Copyright infringement"
+msgstr ""
+
+#: account/username.php:30
+msgid "Could not find any username with this email."
+msgstr ""
+
+#: account/resetpassword.php:90
+msgid ""
+"Could not reset the password for the requested user. Some or all of the "
+"details are not correct. Try again or contact your administrator if you need "
+"further help."
+msgstr ""
+
+#: scripts/mail.php:43
+msgid "Couldn't read command-line options."
+msgstr ""
+
+#: edit/edit.php:32
+msgid "Country"
+msgstr ""
+
+#: edit/password.php:29
+msgid "Current password"
+msgstr ""
+
+#: templates/friends/friends.php:17 templates/friends/friends.php:44
+#: templates/edit/activity.php:17
+msgid "Date"
+msgstr ""
+
+#: scripts/mail-filter.php:133
+#, php-format
+msgid ""
+"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."
+msgstr ""
+
+#: templates/list/search.php:14 templates/edit/activity.php:31
+msgid "Delete"
+msgstr ""
+
+#: edit/comments.php:40 edit/comments.php:47
+msgid "Delete all current comments"
+msgstr ""
+
+#: edit/edit.php:52 edit/edit.php:77
+msgid "Delete picture"
+msgstr ""
+
+#: config/prefs.php.dist:49
+msgid "Descesending"
+msgstr ""
+
+#: templates/user/user.php:344 templates/list/list.php:34 edit/edit.php:50
+#: lib/Forms/Search.php:19
+msgid "Description"
+msgstr ""
+
+#: report.php:30
+msgid "Do you really want to report this user?"
+msgstr ""
+
+#: lib/Block/random.php:40
+msgid "Does not metter"
+msgstr ""
+
+#: account/tabs.php:25
+msgid "Don't have an account? Sign up."
+msgstr ""
+
+#: templates/friends/friends.php:37
+msgid "Edit activities"
+msgstr ""
+
+#: templates/friends/friends.php:11
+msgid "Edit friends"
+msgstr ""
+
+#: templates/user/user.php:141
+msgid "Edit my firends"
+msgstr ""
+
+#: edit/edit.php:18 edit/tabs.php:22
+msgid "Edit my profile"
+msgstr ""
+
+#: lib/Folks.php:289
+msgid "Edit profile"
+msgstr ""
+
+#: edit/edit.php:28
+msgid "Email"
+msgstr ""
+
+#: scripts/mail-filter.php:132
+msgid "Email problem"
+msgstr ""
+
+#: lib/Forms/Login.php:22
+#, php-format
+msgid "Enter the username you registered to %s"
+msgstr ""
+
+#: lib/Forms/Login.php:25
+msgid "Enter your password. Please be aware that password is case sensitive."
+msgstr ""
+
+#: templates/user/user.php:274
+msgid "Faces"
+msgstr ""
+
+#: templates/user/user.php:274
+msgid "Faces in user galleries"
+msgstr ""
+
+#: templates/user/user.php:113 templates/list/list.php:67 edit/edit.php:30
+#: lib/Forms/Search.php:20
+msgid "Female"
+msgstr ""
+
+#: account/tabs.php:29
+msgid "Forgot your password?"
+msgstr ""
+
+#: account/username.php:17 account/tabs.php:32
+msgid "Forgot your username?"
+msgstr ""
+
+#: templates/user/actions.php:10
+msgid "Forward"
+msgstr ""
+
+#: templates/user/actions.php:18
+msgid "Friend"
+msgstr ""
+
+#: friends.php:21 templates/user/user.php:144 edit/tabs.php:25
+#: edit/friends.php:19 lib/Folks.php:288 lib/Block/friends.php:3
+#: lib/Block/friends.php:23
+msgid "Friends"
+msgstr ""
+
+#: lib/api.php:311
+msgid "Friends Birthdays"
+msgstr ""
+
+#: templates/friends/friends.php:12
+msgid "Friends activities"
+msgstr ""
+
+#: lib/Folks.php:147 lib/Folks.php:151
+msgid "Gemini"
+msgstr ""
+
+#: templates/user/user.php:112 templates/list/list.php:26 edit/edit.php:30
+#: lib/Forms/Search.php:20
+msgid "Gender"
+msgstr ""
+
+#: templates/user/user.php:56
+msgid "Has no picture"
+msgstr ""
+
+#: templates/user/user.php:130 templates/list/list.php:32 edit/edit.php:34
+msgid "Homepage"
+msgstr ""
+
+#: config/prefs.php.dist:16
+msgid "How to preview users"
+msgstr ""
+
+#: templates/user/user.php:131
+msgid "I don't have it"
+msgstr ""
+
+#: lib/Forms/Search.php:25
+msgid "Is online"
+msgstr ""
+
+#: templates/user/user.php:102
+msgid "Last activity"
+msgstr ""
+
+#: lib/Block/my_comments.php:3 lib/Block/my_comments.php:32
+msgid "Last comments on my profile"
+msgstr ""
+
+#: templates/user/user.php:84
+msgid "Last time online"
+msgstr ""
+
+#: lib/Folks.php:155 lib/Folks.php:159
+msgid "Leo"
+msgstr ""
+
+#: lib/Folks.php:163 lib/Folks.php:167
+msgid "Libra"
+msgstr ""
+
+#: lib/Block/random.php:33 lib/Block/new.php:33 lib/Block/recent.php:33
+msgid "Limit"
+msgstr ""
+
+#: list.php:17 templates/list/list.php:10 lib/Folks.php:292
+msgid "List"
+msgstr ""
+
+#: config/prefs.php.dist:99
+msgid "Log account changes?"
+msgstr ""
+
+#: config/prefs.php.dist:89
+msgid "Log when we comment a user?"
+msgstr ""
+
+#: scripts/mail.php:92
+#, php-format
+msgid "Logged in successfully as \"%s\"."
+msgstr ""
+
+#: account/tabs.php:22 lib/Forms/Login.php:19
+msgid "Login"
+msgstr ""
+
+#: scripts/mail.php:88
+msgid "Login is incorrect."
+msgstr ""
+
+#: login.php:54
+msgid "Login remainder"
+msgstr ""
+
+#: login.php:124
+#, php-format
+msgid "Login to %s"
+msgstr ""
+
+#: templates/user/actions.php:9
+msgid "Look at this profile"
+msgstr ""
+
+#: templates/user/user.php:113 templates/list/list.php:67 edit/edit.php:30
+#: lib/Forms/Search.php:20
+msgid "Male"
+msgstr ""
+
+#: scripts/mail.php:154
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too."
+msgstr ""
+
+#: lib/Forms/Search.php:24
+msgid "Mast have"
+msgstr ""
+
+#: edit/comments.php:30
+msgid "Moderate comments - I will approve every single comment"
+msgstr ""
+
+#: config/prefs.php.dist:23
+msgid "Modify account preferences"
+msgstr ""
+
+#: templates/list/list.php:7
+msgid "Most active users"
+msgstr ""
+
+#: templates/list/list.php:6
+msgid "Most popular users"
+msgstr ""
+
+#: lib/Folks.php:287
+msgid "My profile"
+msgstr ""
+
+#: templates/list/search.php:11
+msgid "My queries"
+msgstr ""
+
+#: save_search.php:49 lib/Forms/Search.php:19
+msgid "Name"
+msgstr ""
+
+#: new.php:17 templates/list/list.php:4
+msgid "New"
+msgstr ""
+
+#: templates/list/list.php:4
+msgid "New registered user"
+msgstr ""
+
+#: lib/Block/new.php:3 lib/Block/new.php:23
+msgid "New users"
+msgstr ""
+
+#: templates/list/list.php:75 templates/list/list.php:76
+#: templates/list/list.php:77 templates/list/list.php:78
+#: templates/list/list.php:79 edit/privacy.php:49 config/prefs.php.dist:67
+#: config/prefs.php.dist:77 config/prefs.php.dist:87 config/prefs.php.dist:97
+msgid "No"
+msgstr ""
+
+#: scripts/mail-filter.php:157
+msgid "No mail found"
+msgstr ""
+
+#: edit/privacy.php:36 edit/comments.php:27
+msgid "No one"
+msgstr ""
+
+#: templates/list/list.php:16
+msgid "No users found under selected criteria"
+msgstr ""
+
+#: lib/Forms/Login.php:28
+msgid "No, only for this view"
+msgstr ""
+
+#: config/prefs.php.dist:69
+msgid "Notify friends that I loged in"
+msgstr ""
+
+#: edit/privacy.php:49
+msgid "Notify online friends that I logged in"
+msgstr ""
+
+#: lib/Block/my_comments.php:20
+msgid "Number of comments to display"
+msgstr ""
+
+#: config/prefs.php.dist:59
+msgid "Number of users perpage"
+msgstr ""
+
+#: report.php:38
+msgid "Offensive content"
+msgstr ""
+
+#: templates/user/user.php:77 lib/Block/friends.php:38
+msgid "Offline"
+msgstr ""
+
+#: online.php:17 templates/user/user.php:75 templates/list/list.php:3
+#: lib/Block/random.php:39 lib/Block/friends.php:37
+msgid "Online"
+msgstr ""
+
+#: templates/friends/friends.php:68
+msgid "Online friends"
+msgstr ""
+
+#: edit/privacy.php:34
+msgid "Only authenticated users"
+msgstr ""
+
+#: templates/user/user.php:402 templates/user/user.php:411
+msgid "Only authenticated users can post comments."
+msgstr ""
+
+#: edit/privacy.php:35
+msgid "Only my friedns"
+msgstr ""
+
+#: templates/user/user.php:170 templates/user/user.php:195
+#: templates/user/user.php:220 templates/user/user.php:247
+#: templates/user/user.php:273 templates/user/user.php:301
+#: templates/user/user.php:327
+msgid "Others user content"
+msgstr ""
+
+#: edit/tabs.php:27 lib/Forms/Login.php:25
+msgid "Password"
+msgstr ""
+
+#: edit/password.php:159
+msgid "Password changed."
+msgstr ""
+
+#: templates/list/list.php:36 edit/edit.php:51 lib/Forms/Search.php:24
+msgid "Picture"
+msgstr ""
+
+#: lib/Folks.php:135 lib/Folks.php:139
+msgid "Pisces"
+msgstr ""
+
+#: lib/Forms/Login.php:38
+msgid "Please enter the text above"
+msgstr ""
+
+#: account/resetpassword.php:47
+msgid "Please respond to your security question: "
+msgstr ""
+
+#: popularity.php:17 templates/user/user.php:125 templates/list/list.php:6
+msgid "Popularity"
+msgstr ""
+
+#: lib/Forms/Activity.php:24
+msgid "Post"
+msgstr ""
+
+#: templates/user/user.php:168 templates/user/user.php:193
+#: templates/user/user.php:218 templates/user/user.php:245
+#: templates/user/user.php:271 templates/user/user.php:299
+#: templates/user/user.php:325 templates/user/user.php:358
+#: config/prefs.php.dist:15
+msgid "Preview"
+msgstr ""
+
+#: edit/privacy.php:18 edit/tabs.php:23
+msgid "Privacy"
+msgstr ""
+
+#: edit/privacy.php:31
+msgid "Private"
+msgstr ""
+
+#: edit/privacy.php:27
+msgid "Public"
+msgstr ""
+
+#: edit/privacy.php:28
+msgid "Public - only authenticated users can see my personal data"
+msgstr ""
+
+#: edit/privacy.php:30
+msgid "Public - only my friends can see my presonal data"
+msgstr ""
+
+#: lib/Block/random.php:3 lib/Block/random.php:23
+msgid "Random users"
+msgstr ""
+
+#: lib/Block/recent.php:3 lib/Block/recent.php:23
+msgid "Recent visitors"
+msgstr ""
+
+#: templates/edit/friends.php:55
+msgid "Reject"
+msgstr ""
+
+#: lib/Forms/Login.php:27
+msgid "Remember login?"
+msgstr ""
+
+#: templates/edit/blacklist.php:20 templates/edit/friends.php:21
+msgid "Remove"
+msgstr ""
+
+#: account/renew.php:15
+msgid "Renew account"
+msgstr ""
+
+#: report.php:34 report.php:51 templates/user/actions.php:25
+msgid "Report"
+msgstr ""
+
+#: lib/Report.php:109
+msgid "Report by user"
+msgstr ""
+
+#: lib/Report.php:40
+msgid "Report driver does not exist."
+msgstr ""
+
+#: report.php:46 report.php:57
+msgid "Report reason"
+msgstr ""
+
+#: report.php:45 report.php:56
+msgid "Report type"
+msgstr ""
+
+#: templates/user/actions.php:24
+msgid "Report user"
+msgstr ""
+
+#: config/prefs.php.dist:79
+msgid ""
+"Require my confirmation if someone would like to add me to his freidn list."
+msgstr ""
+
+#: edit/password.php:190
+msgid "Reset"
+msgstr ""
+
+#: account/resetpassword.php:26
+msgid "Reset Your Password"
+msgstr ""
+
+#: lib/Folks.php:171 lib/Folks.php:175
+msgid "Sagittarius"
+msgstr ""
+
+#: save_search.php:51 edit/edit.php:52 edit/edit.php:57 edit/comments.php:40
+msgid "Save"
+msgstr ""
+
+#: templates/list/search.php:3
+msgid "Save search criteria"
+msgstr ""
+
+#: lib/Folks.php:167 lib/Folks.php:171
+msgid "Scorpio"
+msgstr ""
+
+#: search.php:18 lib/Folks.php:291 lib/Forms/Search.php:26
+msgid "Search"
+msgstr ""
+
+#: lib/Forms/Search.php:19
+msgid "Search by"
+msgstr ""
+
+#: save_search.php:39
+msgid "Search criteria deleted."
+msgstr ""
+
+#: save_search.php:28
+msgid "Search criteria saved successfuly"
+msgstr ""
+
+#: account/resetpassword.php:49 edit/password.php:195
+msgid "Security answer"
+msgstr ""
+
+#: edit/password.php:192
+msgid "Security question"
+msgstr ""
+
+#: edit/password.php:189
+msgid "Security question used when reseting password"
+msgstr ""
+
+#: account/username.php:19
+msgid "Send me my username"
+msgstr ""
+
+#: templates/user/actions.php:7 templates/edit/friends.php:24
+msgid "Send message"
+msgstr ""
+
+#: templates/user/actions.php:6
+msgid "Send private message"
+msgstr ""
+
+#: templates/user/actions.php:9
+msgid "Send this profile to a friend"
+msgstr ""
+
+#: lib/Folks.php:290
+msgid "Services"
+msgstr ""
+
+#: config/prefs.php.dist:24
+msgid "Set account action details"
+msgstr ""
+
+#: config/prefs.php.dist:31
+msgid "Set activity prefetences"
+msgstr ""
+
+#: config/prefs.php.dist:17
+msgid "Set users preview paramaters"
+msgstr ""
+
+#: config/prefs.php.dist:22 config/prefs.php.dist:29
+msgid "Settings"
+msgstr ""
+
+#: lib/Block/friends.php:33
+msgid "Show friends that are"
+msgstr ""
+
+#: account/signup.php:61
+msgid "Sign up"
+msgstr ""
+
+#: templates/list/list.php:20 templates/list/list.php:43
+msgid "Sort Direction"
+msgstr ""
+
+#: config/prefs.php.dist:41 config/prefs.php.dist:51
+msgid "Sort by"
+msgstr ""
+
+#: templates/list/list.php:27
+msgid "Sort by Age"
+msgstr ""
+
+#: templates/list/list.php:37
+msgid "Sort by Albums"
+msgstr ""
+
+#: templates/list/list.php:29
+msgid "Sort by City"
+msgstr ""
+
+#: templates/list/list.php:33
+msgid "Sort by Description"
+msgstr ""
+
+#: templates/list/list.php:25
+msgid "Sort by Gender"
+msgstr ""
+
+#: templates/list/list.php:31
+msgid "Sort by Homepage"
+msgstr ""
+
+#: templates/list/list.php:35
+msgid "Sort by Picture"
+msgstr ""
+
+#: templates/list/list.php:23
+msgid "Sort by Username"
+msgstr ""
+
+#: templates/list/list.php:39
+msgid "Sort by Video"
+msgstr ""
+
+#: templates/user/user.php:71 edit/privacy.php:40
+msgid "Status"
+msgstr ""
+
+#: account/signup.php:44
+#, php-format
+msgid ""
+"Submitted request to add \"%s\" to the system. You cannot log in until your "
+"request has been approved."
+msgstr ""
+
+#: lib/Folks.php:143 lib/Folks.php:147
+msgid "Taurus"
+msgstr ""
+
+#: report.php:37
+msgid "Terms and conditions infringement"
+msgstr ""
+
+#: account/approve.php:65 account/renew.php:65
+msgid ""
+"The code is not right. If you copy and paste the link from your email, "
+"please check if you copied the whole string."
+msgstr ""
+
+#: templates/edit/blacklist.php:4
+msgid "There are no users in your blacklist."
+msgstr ""
+
+#: templates/edit/friends.php:4
+msgid "There are no users listed as your friend."
+msgstr ""
+
+#: config/hooks.php.dist:184
+msgid "There is already an user registered with this email"
+msgstr ""
+
+#: config/hooks.php.dist:182
+msgid "There is already an user registered with this username"
+msgstr ""
+
+#: templates/edit/activity.php:7
+msgid "There is no activity logged for your account."
+msgstr ""
+
+#: account/signup.php:50 account/signup.php:52
+#, php-format
+msgid "There was a problem adding \"%s\" to the system: %s"
+msgstr ""
+
+#: config/hooks.php.dist:138
+msgid "There was an error login into your mail account."
+msgstr ""
+
+#: login.php:184
+msgid "This account was deleted or is expired."
+msgstr ""
+
+#: login.php:178
+msgid ""
+"This account was still not activated. Check your inbox, we sendy you the "
+"activation code there."
+msgstr ""
+
+#: lib/Block/my_comments.php:57
+msgid "Title"
+msgstr ""
+
+#: lib/Report.php:122
+msgid "Unsupported"
+msgstr ""
+
+#: edit/edit.php:68
+msgid "Updated his/her profile details."
+msgstr ""
+
+#: edit/edit.php:70
+msgid "Updated his/her profile picture."
+msgstr ""
+
+#: edit/edit.php:45
+msgid "Upload a new video"
+msgstr ""
+
+#: scripts/mail.php:152
+#, php-format
+msgid "Usage: %s [OPTIONS]..."
+msgstr ""
+
+#: report.php:55 lib/Block/my_comments.php:58
+msgid "User"
+msgstr ""
+
+#: lib/Driver.php:376 lib/Driver/sql.php:303
+#, php-format
+msgid "User \"%s\" does not exists."
+msgstr ""
+
+#: lib/Friends.php:185 lib/Friends.php:254
+#, php-format
+msgid "User \"%s\" does not exits"
+msgstr ""
+
+#: lib/Friends.php:262
+#, php-format
+msgid "User \"%s\" is already in fiend list"
+msgstr ""
+
+#: lib/Friends.php:270
+#, php-format
+msgid ""
+"User \"%s\" is already in fiend list, but we are waiting his/her approval."
+msgstr ""
+
+#: account/renew.php:43
+#, php-format
+msgid "User \"%s\" is not market to be in the removal process."
+msgstr ""
+
+#: edit/friends.php:60
+#, php-format
+msgid "User \"%s\" was added as your friend."
+msgstr ""
+
+#: edit/blacklist.php:41
+#, php-format
+msgid "User \"%s\" was added to your blacklist."
+msgstr ""
+
+#: account/approve.php:43
+#, php-format
+msgid "User \"%s\" was already activated."
+msgstr ""
+
+#: edit/approve.php:38
+#, php-format
+msgid "User \"%s\" was confirmed as a friend."
+msgstr ""
+
+#: edit/reject.php:37
+#, php-format
+msgid "User \"%s\" was rejected as a friend."
+msgstr ""
+
+#: edit/blacklist.php:34
+#, php-format
+msgid "User \"%s\" was removed from your blacklist."
+msgstr ""
+
+#: edit/friends.php:41
+#, php-format
+msgid "User \"%s\" was removed from your friend list."
+msgstr ""
+
+#: edit/friends.php:52
+#, php-format
+msgid ""
+"User %s added you to his firends list on %s. \n"
+"To approve, go to: %s \n"
+"To reject, go to: %s \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+
+#: edit/approve.php:44
+#, php-format
+msgid ""
+"User %s confirmed you as a friend on %s.. \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+
+#: templates/user/user.php:391
+#, php-format
+msgid "User %s does not wish to be commented."
+msgstr ""
+
+#: templates/user/deleted.php:4
+#, php-format
+msgid "User %s has been disabled."
+msgstr ""
+
+#: templates/user/inactive.php:4
+#, php-format
+msgid "User %s is inactive."
+msgstr ""
+
+#: login.php:52
+#, php-format
+msgid ""
+"User %s just logged in.\n"
+"%s"
+msgstr ""
+
+#: edit/reject.php:43
+#, php-format
+msgid ""
+"User %s rejected you as a friend on %s.. \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+
+#: templates/user/authenticated.php:4
+#, php-format
+msgid ""
+"User %s would like to his profile remains visible only to authenticated "
+"users."
+msgstr ""
+
+#: templates/user/friends.php:4
+#, php-format
+msgid "User %s would like to his profile remains visible only to his friends."
+msgstr ""
+
+#: templates/user/private.php:4
+#, php-format
+msgid "User %s would like to remain private."
+msgstr ""
+
+#: account/signup.php:21
+msgid "User Registration has been disabled for this site."
+msgstr ""
+
+#: lib/Block/random.php:36
+msgid "User is currently online?"
+msgstr ""
+
+#: report.php:25
+msgid "User is not selected"
+msgstr ""
+
+#: templates/user/actions.php:28
+msgid "User list"
+msgstr ""
+
+#: report.php:62 report.php:68
+msgid "User was not reported."
+msgstr ""
+
+#: report.php:65
+msgid "User was reported."
+msgstr ""
+
+#: templates/friends/friends.php:16 templates/list/list.php:24
+#: templates/edit/blacklist.php:12 templates/edit/friends.php:12
+#: account/resetpassword.php:43 lib/Forms/AddFriend.php:18
+#: lib/Forms/Login.php:21 config/prefs.php.dist:40
+msgid "Username"
+msgstr ""
+
+#: config/hooks.php.dist:169
+msgid ""
+"Username can contain only alphanumeric characters, underscore and minus."
+msgstr ""
+
+#: templates/user/actions.php:29
+msgid "Users"
+msgstr ""
+
+#: lib/api.php:312
+msgid "Users Birthdays"
+msgstr ""
+
+#: templates/list/list.php:9
+msgid "Users celebrating birthday today"
+msgstr ""
+
+#: templates/list/list.php:3
+msgid "Users currently online"
+msgstr ""
+
+#: templates/edit/friends.php:61
+msgid "Users that has you listed as a friend"
+msgstr ""
+
+#: templates/edit/friends.php:48
+msgid "Users winting us to approve their friendship"
+msgstr ""
+
+#: templates/list/list.php:40 edit/edit.php:46 lib/Forms/Search.php:24
+msgid "Video"
+msgstr ""
+
+#: templates/edit/friends.php:22
+msgid "View profile"
+msgstr ""
+
+#: lib/Folks.php:159 lib/Folks.php:163
+msgid "Virgo"
+msgstr ""
+
+#: templates/user/user.php:131
+msgid "Visit my homepage"
+msgstr ""
+
+#: templates/edit/friends.php:39
+msgid "We are waiting this users to approve our friendship"
+msgstr ""
+
+#: user.php:48 friends.php:25 edit/activity.php:34
+msgid "What are you doing right now?"
+msgstr ""
+
+#: lib/Friends/sql.php:214 lib/Friends/letter.php:87
+msgid "Whitelist"
+msgstr ""
+
+#: edit/comments.php:38
+msgid "Who can post comments to your profile"
+msgstr ""
+
+#: edit/privacy.php:46
+msgid "Who can see my acticity log on my profile"
+msgstr ""
+
+#: edit/privacy.php:43
+msgid "Who can see when I was last time online"
+msgstr ""
+
+#: lib/Forms/Search.php:18
+msgid "Word"
+msgstr ""
+
+#: templates/list/list.php:75 templates/list/list.php:76
+#: templates/list/list.php:77 templates/list/list.php:78
+#: templates/list/list.php:79 edit/privacy.php:49 config/prefs.php.dist:68
+#: config/prefs.php.dist:78 config/prefs.php.dist:88 config/prefs.php.dist:98
+msgid "Yes"
+msgstr ""
+
+#: lib/Forms/Login.php:29
+msgid "Yes, remember me so the next time I don't neet to login"
+msgstr ""
+
+#: account/approve.php:62 account/renew.php:62
+msgid "You account is activated, you can login now."
+msgstr ""
+
+#: login.php:135
+msgid "You are entering your data too fast!"
+msgstr ""
+
+#: templates/user/user.php:399 templates/user/user.php:419
+#, php-format
+msgid "You are on %s blacklist."
+msgstr ""
+
+#: templates/user/private.php:8 templates/user/friends.php:8
+#, php-format
+msgid "You can still send a private message to user %s."
+msgstr ""
+
+#: lib/Friends.php:190
+#, php-format
+msgid "You cannot add \"%s\" to your blacklist."
+msgstr ""
+
+#: lib/Friends.php:248
+msgid "You cannot add yourself as your own friend."
+msgstr ""
+
+#: lib/Friends.php:179
+msgid "You cannot add yourself to your blacklist."
+msgstr ""
+
+#: lib/api.php:385
+msgid "You cannot log activities for other users."
+msgstr ""
+
+#: lib/Driver.php:748 lib/Forms/Activity.php:32
+msgid "You cannot post an empty activity message."
+msgstr ""
+
+#: account/approve.php:20 account/renew.php:20
+msgid "You must supply a confirmation code."
+msgstr ""
+
+#: account/approve.php:28 account/renew.php:28 edit/approve.php:24
+#: edit/reject.php:24
+msgid "You must supply a username."
+msgstr ""
+
+#: templates/friends/friends.php:38
+msgid "Your activities"
+msgstr ""
+
+#: edit/comments.php:81
+msgid "Your comments preference was sucessfuly saved."
+msgstr ""
+
+#: edit/edit.php:66 edit/privacy.php:65
+msgid "Your data were successfully updated."
+msgstr ""
+
+#: account/username.php:20
+msgid "Your email"
+msgstr ""
+
+#: edit/edit.php:82
+msgid "Your image was deleted successfully."
+msgstr ""
+
+#: account/resetpassword.php:76
+#, php-format
+msgid ""
+"Your new password for %s is: %s. \n"
+"\n"
+" It was requested by %s on %s"
+msgstr ""
+
+#: edit/password.php:66
+#, php-format
+msgid ""
+"Your new password is too long; passwords may not be more than %d characters "
+"long!"
+msgstr ""
+
+#: edit/password.php:145
+msgid "Your new password is too simple to guess! Not changed!"
+msgstr ""
+
+#: edit/password.php:136
+msgid "Your new password is too simple to guess. Not changed!"
+msgstr ""
+
+#: edit/password.php:61
+#, php-format
+msgid "Your new password must be at least %d characters long!"
+msgstr ""
+
+#: edit/password.php:44
+msgid "Your new password must be different from your current password"
+msgstr ""
+
+#: edit/password.php:106
+#, php-format
+msgid "Your new password must contain at least %d alphabetic characters."
+msgstr ""
+
+#: edit/password.php:111
+#, php-format
+msgid "Your new password must contain at least %d alphanumeric characters."
+msgstr ""
+
+#: edit/password.php:116
+#, php-format
+msgid ""
+"Your new password must contain at least %d different types of characters. "
+"The types are: lower, upper, numeric, and symbols."
+msgstr ""
+
+#: edit/password.php:96
+#, php-format
+msgid "Your new password must contain at least %d lowercase characters."
+msgstr ""
+
+#: edit/password.php:101
+#, php-format
+msgid "Your new password must contain at least %d numeric characters."
+msgstr ""
+
+#: edit/password.php:91
+#, php-format
+msgid "Your new password must contain at least %d uppercase characters."
+msgstr ""
+
+#: edit/password.php:122
+#, php-format
+msgid "Your new password must contain less than %d whitespace characters."
+msgstr ""
+
+#: edit/password.php:124
+msgid "Your new password must not contain whitespace characters."
+msgstr ""
+
+#: edit/password.php:50
+msgid "Your old password didn't match"
+msgstr ""
+
+#: account/resetpassword.php:82
+msgid "Your password has been reset"
+msgstr ""
+
+#: account/resetpassword.php:84
+#, php-format
+msgid ""
+"Your password has been reset, check your email (%s) and log in with your new "
+"password."
+msgstr ""
+
+#: edit/password.php:185
+msgid "Your securiy questions was updated."
+msgstr ""
+
+#: account/username.php:34
+#, php-format
+msgid ""
+"Your username on %s %s is: %s. \n"
+"\n"
+" It was requested by %s on %s"
+msgstr ""
+
+#: config/hooks.php.dist:231
+#, php-format
+msgid ""
+"Your username on %s %s is: %s. \n"
+"\n"
+" Please confirm the registration by going to this link \n"
+" %s"
+msgstr ""
+
+#: login.php:156
+msgid "Your username or password is incorrect."
+msgstr ""
+
+#: account/username.php:41
+msgid "Your username was requested"
+msgstr ""
+
+#: account/username.php:43
+#, php-format
+msgid "Your username was sent, check your email (%s)."
+msgstr ""
+
+#: login.php:172
+#, php-format
+msgid ""
+"Your username was temporary deacirvated. For any additional information "
+"please write to %s, and don't forgot to incluide your username."
+msgstr ""
+
+#: edit/password.php:30
+msgid "type the password twice to confirm"
+msgstr ""
--- /dev/null
+# translation of sl_SI.po to Slovene
+# Duck <duck@obala.net>, 2007.
+# Marko Milost <marko.milost@obala.si>, 2008.
+# Usms translation.
+# Copyright (C) 2008 Horde Project
+# This file is distributed under the same license as the FOlks package.
+msgid ""
+msgstr ""
+"Project-Id-Version: sl_SI\n"
+"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
+"POT-Creation-Date: 2008-10-29 15:01+0100\n"
+"PO-Revision-Date: 2008-09-30 14:48+0200\n"
+"Last-Translator: Marko Milost <marko.milost@obala.si>\n"
+"Language-Team: Slovene <sl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=3\n"
+
+#: edit/friends.php:49
+#, php-format
+msgid "%s added you as a friend on %s"
+msgstr "%s vas je dodal kot prijatelja na %s"
+
+#: edit/approve.php:40
+#, php-format
+msgid "%s approved you as a friend on %s"
+msgstr "%s vas je potrdil kot prijatelja na %s"
+
+#: edit/reject.php:39
+#, php-format
+msgid "%s rejected you as a friend on %s"
+msgstr "%s je zavrnil vaše prijateljstvo na %s"
+
+#: user.php:63
+#, php-format
+msgid "%s's profile"
+msgstr "%s se predstavlja"
+
+#: edit/edit.php:30 edit/edit.php:46
+msgid "--- Select ---"
+msgstr "--- Izberi ---"
+
+#: scripts/mail.php:157
+msgid "-c, --count Limit count"
+msgstr ""
+
+#: scripts/mail.php:158
+msgid "-f, --from Limit offset"
+msgstr ""
+
+#: scripts/mail.php:156
+msgid "-h, --help Show this help"
+msgstr ""
+
+#: scripts/mail.php:160
+msgid "-p, --password[=password] Horde login password"
+msgstr ""
+
+#: scripts/mail.php:159
+msgid "-u, --username[=username] Horde login username"
+msgstr ""
+
+#: edit/friends.php:48
+#, php-format
+msgid "A confirmation was send to \"%s\"."
+msgstr "Potrditev je bila poslana na \"%s\"."
+
+#: templates/edit/activity.php:19 templates/edit/blacklist.php:13
+#: templates/edit/friends.php:13
+msgid "Action"
+msgstr "Ukaz"
+
+#: activity.php:17 templates/friends/friends.php:18
+#: templates/friends/friends.php:45 templates/user/user.php:121
+#: templates/user/user.php:360 templates/list/list.php:7
+#: templates/edit/activity.php:18 edit/tabs.php:26 edit/activity.php:19
+#: lib/Forms/Activity.php:19 lib/Forms/Activity.php:21
+msgid "Activity"
+msgstr "Aktivnost"
+
+#: config/prefs.php.dist:30
+msgid "Activity log"
+msgstr "Denvnik aktivnosti"
+
+#: edit/activity.php:28
+msgid "Activity successfully deleted"
+msgstr "Aktivnos je bila uspešno izbisana"
+
+#: user.php:54 friends.php:31 edit/activity.php:40
+msgid "Activity successfully posted"
+msgstr "Aktivnos je bila uspešno dodana"
+
+#: templates/user/actions.php:17 templates/user/user.php:142
+#, php-format
+msgid "Add %s as a friend?"
+msgstr "Dodamo %s kot prijatelja?"
+
+#: templates/user/actions.php:20
+#, php-format
+msgid "Add %s to you blacklist?"
+msgstr "Dodamo %s na črno listo?"
+
+#: lib/Forms/AddFriend.php:19
+msgid "Add / Remove"
+msgstr "Dodaj / Odstrani"
+
+#: templates/user/actions.php:14 templates/user/actions.php:15
+msgid "Add a comment"
+msgstr "Dodaj komentar"
+
+#: edit/blacklist.php:53 edit/friends.php:96
+msgid "Add or remove user"
+msgstr "Dodaj ali odstrani uporabnika"
+
+#: templates/user/user.php:167 templates/user/user.php:192
+#: templates/user/user.php:217 templates/user/user.php:244
+#: templates/user/user.php:270 templates/user/user.php:298
+#: templates/user/user.php:324 templates/user/user.php:357
+msgid "Add your content"
+msgstr "Dodaj svojo vsebino"
+
+#: account/signup.php:38
+#, php-format
+msgid "Added \"%s\" to the system. You can log in now."
+msgstr "Dodali smo \"%s\" v sistem. Lahko se prijavite."
+
+#: edit/approve.php:52
+#, php-format
+msgid "Added user %s as a friend."
+msgstr "Dodal %s kot prijatelja."
+
+#: report.php:36
+msgid "Advertisement content"
+msgstr "Oglas"
+
+#: templates/user/user.php:108 templates/list/list.php:28
+msgid "Age"
+msgstr "Starost"
+
+#: lib/Forms/Search.php:22
+msgid "Age from"
+msgstr "Starost od"
+
+#: lib/Forms/Search.php:23
+msgid "Age to"
+msgstr "Starost do"
+
+#: templates/list/list.php:38
+msgid "Albums"
+msgstr "Albumi"
+
+#: lib/Block/friends.php:36
+msgid "All"
+msgstr "Vsi"
+
+#: templates/list/list.php:10
+msgid "All users"
+msgstr "Vsi uporabniki"
+
+#: edit/privacy.php:33
+msgid "All visitors"
+msgstr "Vsi obiskovalci"
+
+#: edit/comments.php:28
+msgid "Any one"
+msgstr "Vsi"
+
+#: templates/friends/friends.php:43 templates/edit/activity.php:16
+msgid "Application"
+msgstr "Aplikacija"
+
+#: config/prefs.php.dist:129
+msgid ""
+"Application you would like NOT to log activitiy when you post a new PUBLIC "
+"COMMENT"
+msgstr "Aplikacije za katere žeite da ne beleži komentiranja"
+
+#: config/prefs.php.dist:114
+msgid ""
+"Application you would like NOT to log your activitiy when you post a new "
+"PUBLIC CONTENT."
+msgstr "Aplikacije za katere žeite da ne beleži dodajanje nove vsebine"
+
+#: templates/edit/friends.php:53
+msgid "Approve"
+msgstr "Potrdi"
+
+#: lib/Folks.php:131 lib/Folks.php:135
+msgid "Aquarius"
+msgstr "Vodnar"
+
+#: lib/Folks.php:139 lib/Folks.php:143
+msgid "Aries"
+msgstr "Oven"
+
+#: config/prefs.php.dist:50
+msgid "Ascesending"
+msgstr "Naraščajoče"
+
+#: edit/comments.php:29
+msgid "Authenticated users"
+msgstr "Prijavljeni uporabniki"
+
+#: services.php:16
+msgid "Available services"
+msgstr "Dostopne storitve"
+
+#: birthday.php:17 templates/list/list.php:9 edit/edit.php:29
+msgid "Birthday"
+msgstr "Rojstni dan"
+
+#: templates/user/actions.php:21 edit/tabs.php:24 edit/blacklist.php:19
+#: lib/Friends/sql.php:215 lib/Friends/letter.php:88
+msgid "Blacklist"
+msgstr "Črna lista"
+
+#: report.php:34
+msgid "Cancel"
+msgstr "Prekliči"
+
+#: lib/Folks.php:151 lib/Folks.php:155
+msgid "Cancer"
+msgstr "Rak"
+
+#: scripts/mail-filter.php:120
+msgid "Cannot authenticate at mail server:"
+msgstr "Ne morem se prijaviti mail server:"
+
+#: account/resetpassword.php:19
+msgid "Cannot reset password automatically, contact your administrator."
+msgstr ""
+"Ne da se avtomatično ponastaviti gesla, kontaktirajte podporo uporabnikom."
+
+#: lib/Folks.php:272
+msgid "Cannot retrieve user email."
+msgstr "Ne morem prebrati email uporabnika."
+
+#: edit/password.php:20
+msgid "Cannot update password, contact your administrator."
+msgstr "Ne morem nastaviti gesla, obrnite se na podporo."
+
+#: lib/Folks.php:131 lib/Folks.php:175
+msgid "Capricorn"
+msgstr "Kozorog"
+
+#: edit/password.php:25
+msgid "Change Your Password"
+msgstr "Spremeni geslo"
+
+#: edit/password.php:30
+msgid "Choose a password"
+msgstr "Izberite geslo"
+
+#: templates/user/user.php:116 templates/list/list.php:30 edit/edit.php:31
+#: lib/Forms/Search.php:19 lib/Forms/Search.php:21
+msgid "City"
+msgstr "Mesto"
+
+#: templates/user/private.php:9 templates/user/friends.php:9
+msgid "Click here"
+msgstr "Klikni tukaj"
+
+#: templates/user/authenticated.php:7 templates/user/authenticated.php:8
+msgid "Click here to login."
+msgstr "Klikni tukaj za prijavo"
+
+#: save_search.php:18 save_search.php:51
+msgid "Close"
+msgstr "Zapri"
+
+#: lib/api.php:154
+#, php-format
+msgid "Commented user %s."
+msgstr "Je komentiral uporabnika %s."
+
+#: edit/tabs.php:31 edit/comments.php:18
+msgid "Comments"
+msgstr "Komentarji"
+
+#: edit/comments.php:57
+msgid "Comments deleted successfuly"
+msgstr "Komentarji so bili izbrisani"
+
+#: account/approve.php:15
+msgid "Confirm email"
+msgstr "Potrditev email naslova"
+
+#: config/hooks.php.dist:237
+msgid "Confirmation code"
+msgstr "Šifra za potrditev uporabnika"
+
+#: lib/Report.php:98
+#, php-format
+msgid "Content abuse report in %s"
+msgstr "Prijava zlorabe v %s"
+
+#: account/resetpassword.php:28 edit/password.php:28 edit/password.php:190
+msgid "Continue"
+msgstr "Nadaljuj"
+
+#: report.php:39
+msgid "Copyright infringement"
+msgstr "Kršitev avtorskih pravic"
+
+#: account/username.php:30
+msgid "Could not find any username with this email."
+msgstr "Ne najdem uporabniškega imena s tem email naslovom."
+
+#: account/resetpassword.php:90
+msgid ""
+"Could not reset the password for the requested user. Some or all of the "
+"details are not correct. Try again or contact your administrator if you need "
+"further help."
+msgstr ""
+"Ne morem ponastaviti gesla za tega uporabnika. Nekateri ali vsi podatki niso "
+"pravilni. Poskusite ponovno ali kontaktirajte podporo uporabnikom za dodatno "
+"pomoč."
+
+#: scripts/mail.php:43
+msgid "Couldn't read command-line options."
+msgstr ""
+
+#: edit/edit.php:32
+msgid "Country"
+msgstr "Država"
+
+#: edit/password.php:29
+msgid "Current password"
+msgstr "Trenutno geslo"
+
+#: templates/friends/friends.php:17 templates/friends/friends.php:44
+#: templates/edit/activity.php:17
+msgid "Date"
+msgstr "Datum"
+
+#: scripts/mail-filter.php:133
+#, php-format
+msgid ""
+"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."
+msgstr ""
+"Pozdravljen %s,\n\n poslali smo vam obvestilo po elektronski pošti, "
+"vendar se nam je vrnilo. Imate morda poln poštni predal? Vaš elektronski "
+"naslov ne deluje več? Če je tako, vas prosimo, da v nastavitvah uporabnika "
+"spremenite email naslov na delujočega: %s."
+
+#: templates/list/search.php:14 templates/edit/activity.php:31
+msgid "Delete"
+msgstr "Izbriši"
+
+#: edit/comments.php:40 edit/comments.php:47
+msgid "Delete all current comments"
+msgstr "Izbriši vse trenutne komentarje"
+
+#: edit/edit.php:52 edit/edit.php:77
+msgid "Delete picture"
+msgstr "Izbriši sliko"
+
+#: config/prefs.php.dist:49
+msgid "Descesending"
+msgstr "Padajoče"
+
+#: templates/user/user.php:344 templates/list/list.php:34 edit/edit.php:50
+#: lib/Forms/Search.php:19
+msgid "Description"
+msgstr "Opis"
+
+#: report.php:30
+msgid "Do you really want to report this user?"
+msgstr "Res želite prijavit tega uporabnika?"
+
+#: lib/Block/random.php:40
+msgid "Does not metter"
+msgstr "Ni pomembno"
+
+#: account/tabs.php:25
+msgid "Don't have an account? Sign up."
+msgstr "Nimate še uporabniškega računa? Prijavite se!"
+
+#: templates/friends/friends.php:37
+msgid "Edit activities"
+msgstr "Uredi aktivnosti"
+
+#: templates/friends/friends.php:11
+msgid "Edit friends"
+msgstr "Uredi prijatelje"
+
+#: templates/user/user.php:141
+msgid "Edit my firends"
+msgstr "Urejanje prijateljev"
+
+#: edit/edit.php:18 edit/tabs.php:22
+msgid "Edit my profile"
+msgstr "Urejanje profila"
+
+#: lib/Folks.php:289
+msgid "Edit profile"
+msgstr "Uredi profil"
+
+#: edit/edit.php:28
+msgid "Email"
+msgstr "Email"
+
+#: scripts/mail-filter.php:132
+msgid "Email problem"
+msgstr "Opozorilo o vašem E-mailu"
+
+#: lib/Forms/Login.php:22
+#, php-format
+msgid "Enter the username you registered to %s"
+msgstr "Vnesite uporabniško ime s katerim ste se prijavili %s"
+
+#: lib/Forms/Login.php:25
+msgid "Enter your password. Please be aware that password is case sensitive."
+msgstr "Vnesite vaše geslo. Pazite, v geslu so velike in male črke POMEMBNE."
+
+#: templates/user/user.php:274
+msgid "Faces"
+msgstr "Obrazi"
+
+#: templates/user/user.php:274
+msgid "Faces in user galleries"
+msgstr "Obrazi v galerijah uporabnika"
+
+#: templates/user/user.php:113 templates/list/list.php:67 edit/edit.php:30
+#: lib/Forms/Search.php:20
+msgid "Female"
+msgstr "Ženski"
+
+#: account/tabs.php:29
+msgid "Forgot your password?"
+msgstr "Ste pozabili geslo?"
+
+#: account/username.php:17 account/tabs.php:32
+msgid "Forgot your username?"
+msgstr "Ste pozabili uporabniško ime?"
+
+#: templates/user/actions.php:10
+msgid "Forward"
+msgstr "Posreduj"
+
+#: templates/user/actions.php:18
+msgid "Friend"
+msgstr "Prijatelj"
+
+#: friends.php:21 templates/user/user.php:144 edit/tabs.php:25
+#: edit/friends.php:19 lib/Folks.php:288 lib/Block/friends.php:3
+#: lib/Block/friends.php:23
+msgid "Friends"
+msgstr "Prijatelji"
+
+#: lib/api.php:311
+msgid "Friends Birthdays"
+msgstr "Rojstni dnevi prijateljev"
+
+#: templates/friends/friends.php:12
+msgid "Friends activities"
+msgstr "Aktivnosti prijateljev"
+
+#: lib/Folks.php:147 lib/Folks.php:151
+msgid "Gemini"
+msgstr "Dvojčka"
+
+#: templates/user/user.php:112 templates/list/list.php:26 edit/edit.php:30
+#: lib/Forms/Search.php:20
+msgid "Gender"
+msgstr "Spol"
+
+#: templates/user/user.php:56
+msgid "Has no picture"
+msgstr "Nima slike"
+
+#: templates/user/user.php:130 templates/list/list.php:32 edit/edit.php:34
+msgid "Homepage"
+msgstr "Domača stran"
+
+#: config/prefs.php.dist:16
+msgid "How to preview users"
+msgstr "Kako naj pregledujem uporabnike"
+
+#: templates/user/user.php:131
+msgid "I don't have it"
+msgstr "Je nimam"
+
+#: lib/Forms/Search.php:25
+msgid "Is online"
+msgstr "Je online"
+
+#: templates/user/user.php:102
+msgid "Last activity"
+msgstr "Zadnja aktivnost"
+
+#: lib/Block/my_comments.php:3 lib/Block/my_comments.php:32
+msgid "Last comments on my profile"
+msgstr "Zadnji komentarji na mojem profilu"
+
+#: templates/user/user.php:84
+msgid "Last time online"
+msgstr "Zadnjič online"
+
+#: lib/Folks.php:155 lib/Folks.php:159
+msgid "Leo"
+msgstr "Lev"
+
+#: lib/Folks.php:163 lib/Folks.php:167
+msgid "Libra"
+msgstr "Tehtnica"
+
+#: lib/Block/random.php:33 lib/Block/new.php:33 lib/Block/recent.php:33
+msgid "Limit"
+msgstr "Omeji"
+
+#: list.php:17 templates/list/list.php:10 lib/Folks.php:292
+msgid "List"
+msgstr "Spisek"
+
+#: config/prefs.php.dist:99
+msgid "Log account changes?"
+msgstr "Zabeležim ko spremenim podatke v mojem profilu?"
+
+#: config/prefs.php.dist:89
+msgid "Log when we comment a user?"
+msgstr "Zabeleži ko komentiramo uporabika?"
+
+#: scripts/mail.php:92
+#, php-format
+msgid "Logged in successfully as \"%s\"."
+msgstr ""
+
+#: account/tabs.php:22 lib/Forms/Login.php:19
+msgid "Login"
+msgstr "Prijava"
+
+#: scripts/mail.php:88
+msgid "Login is incorrect."
+msgstr ""
+
+#: login.php:54
+msgid "Login remainder"
+msgstr "Opozorilo o prijavi prijatelja"
+
+#: login.php:124
+#, php-format
+msgid "Login to %s"
+msgstr "Prijava v %s"
+
+#: templates/user/actions.php:9
+msgid "Look at this profile"
+msgstr "Poglej ta profil"
+
+#: templates/user/user.php:113 templates/list/list.php:67 edit/edit.php:30
+#: lib/Forms/Search.php:20
+msgid "Male"
+msgstr "Moški"
+
+#: scripts/mail.php:154
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too."
+msgstr ""
+
+#: lib/Forms/Search.php:24
+msgid "Mast have"
+msgstr "Mora imeti"
+
+#: edit/comments.php:30
+msgid "Moderate comments - I will approve every single comment"
+msgstr "Moderiranje komentarjev - potrdil bom vsak komentar"
+
+#: config/prefs.php.dist:23
+msgid "Modify account preferences"
+msgstr "Spremeni nastavitve računa"
+
+#: templates/list/list.php:7
+msgid "Most active users"
+msgstr "Najbolj aktvni uporabniki"
+
+#: templates/list/list.php:6
+msgid "Most popular users"
+msgstr "Najbolj priljubljeni uporabniki"
+
+#: lib/Folks.php:287
+msgid "My profile"
+msgstr "Moj profil"
+
+#: templates/list/search.php:11
+msgid "My queries"
+msgstr "Moja iskanja"
+
+#: save_search.php:49 lib/Forms/Search.php:19
+msgid "Name"
+msgstr "Ime"
+
+#: new.php:17 templates/list/list.php:4
+msgid "New"
+msgstr "Novi"
+
+#: templates/list/list.php:4
+msgid "New registered user"
+msgstr "Novo registrirani uporabniki"
+
+#: lib/Block/new.php:3 lib/Block/new.php:23
+msgid "New users"
+msgstr "Novi uporabniki"
+
+#: templates/list/list.php:75 templates/list/list.php:76
+#: templates/list/list.php:77 templates/list/list.php:78
+#: templates/list/list.php:79 edit/privacy.php:49 config/prefs.php.dist:67
+#: config/prefs.php.dist:77 config/prefs.php.dist:87 config/prefs.php.dist:97
+msgid "No"
+msgstr "Ne"
+
+#: edit/privacy.php:36 edit/comments.php:27
+msgid "No one"
+msgstr "Nihče"
+
+#: templates/list/list.php:16
+msgid "No users found under selected criteria"
+msgstr "Ni uporabnikov pod izbranimi kriteriji"
+
+#: lib/Forms/Login.php:28
+msgid "No, only for this view"
+msgstr "Samo za to prijavo"
+
+#: config/prefs.php.dist:69
+msgid "Notify friends that I loged in"
+msgstr "Obvesti prijatelje, da sem se prijavil"
+
+#: edit/privacy.php:49
+msgid "Notify online friends that I logged in"
+msgstr "Obvesti prijavljene prijatelje, da sem se prijavil"
+
+#: lib/Block/my_comments.php:20
+msgid "Number of comments to display"
+msgstr "Število komentarjev na vsaki strani"
+
+#: config/prefs.php.dist:59
+msgid "Number of users perpage"
+msgstr "Število uporabnikov na vsaki strani"
+
+#: report.php:38
+msgid "Offensive content"
+msgstr "Neprimerna ali žaljiva vsebina"
+
+#: templates/user/user.php:77 lib/Block/friends.php:38
+msgid "Offline"
+msgstr "Offline"
+
+#: online.php:17 templates/user/user.php:75 templates/list/list.php:3
+#: lib/Block/random.php:39 lib/Block/friends.php:37
+msgid "Online"
+msgstr "Online"
+
+#: templates/friends/friends.php:68
+msgid "Online friends"
+msgstr "Prijatelji trenutno online"
+
+#: edit/privacy.php:34
+msgid "Only authenticated users"
+msgstr "Samo prijavljeni uporabniki"
+
+#: templates/user/user.php:402 templates/user/user.php:411
+msgid "Only authenticated users can post comments."
+msgstr "Samo prijavljeni uporabniki lahko vpisujejo komentarje."
+
+#: edit/privacy.php:35
+msgid "Only my friedns"
+msgstr "Samo moji prijatelji"
+
+#: templates/user/user.php:170 templates/user/user.php:195
+#: templates/user/user.php:220 templates/user/user.php:247
+#: templates/user/user.php:273 templates/user/user.php:301
+#: templates/user/user.php:327
+msgid "Others user content"
+msgstr "Ostala uporabniška vsebina"
+
+#: edit/tabs.php:27 lib/Forms/Login.php:25
+msgid "Password"
+msgstr "Geslo"
+
+#: edit/password.php:159
+msgid "Password changed."
+msgstr "Geslo je bilo spremenjeno."
+
+#: templates/list/list.php:36 edit/edit.php:51 lib/Forms/Search.php:24
+msgid "Picture"
+msgstr "Slika"
+
+#: lib/Folks.php:135 lib/Folks.php:139
+msgid "Pisces"
+msgstr "Ribi"
+
+#: lib/Forms/Login.php:38
+msgid "Please enter the text above"
+msgstr "Prosimo pretipkajte zgornji tekst."
+
+#: account/resetpassword.php:47
+msgid "Please respond to your security question: "
+msgstr "Prosimo odgovorite na varnostno vprašanje: "
+
+#: popularity.php:17 templates/user/user.php:125 templates/list/list.php:6
+msgid "Popularity"
+msgstr "Priljubljenost"
+
+#: lib/Forms/Activity.php:24
+msgid "Post"
+msgstr "Dodaj"
+
+#: templates/user/user.php:168 templates/user/user.php:193
+#: templates/user/user.php:218 templates/user/user.php:245
+#: templates/user/user.php:271 templates/user/user.php:299
+#: templates/user/user.php:325 templates/user/user.php:358
+#: config/prefs.php.dist:15
+msgid "Preview"
+msgstr "Pregled"
+
+#: edit/privacy.php:18 edit/tabs.php:23
+msgid "Privacy"
+msgstr "Zasebnost"
+
+#: edit/privacy.php:31
+msgid "Private"
+msgstr "Osebno"
+
+#: edit/privacy.php:27
+msgid "Public"
+msgstr "Javno"
+
+#: edit/privacy.php:28
+msgid "Public - only authenticated users can see my personal data"
+msgstr "javno - samo registrirani uporabniki lahko vidijo moje osebne podatke"
+
+#: edit/privacy.php:30
+msgid "Public - only my friends can see my presonal data"
+msgstr "javno - samo moji prijatelji lahko vidijo moje osebne podatke"
+
+#: lib/Block/random.php:3 lib/Block/random.php:23
+msgid "Random users"
+msgstr "Naključni uporabniki"
+
+#: lib/Block/recent.php:3 lib/Block/recent.php:23
+msgid "Recent visitors"
+msgstr "Zadnji obiskovalci"
+
+#: templates/edit/friends.php:55
+msgid "Reject"
+msgstr "Zavrni"
+
+#: lib/Forms/Login.php:27
+msgid "Remember login?"
+msgstr "Si zapomnim prijavo?"
+
+#: templates/edit/blacklist.php:20 templates/edit/friends.php:21
+msgid "Remove"
+msgstr "Odstrani"
+
+#: account/renew.php:15
+msgid "Renew account"
+msgstr "Obnovi uporabniški račun."
+
+#: report.php:34 report.php:51 templates/user/actions.php:25
+msgid "Report"
+msgstr "Prijavi"
+
+#: lib/Report.php:109
+msgid "Report by user"
+msgstr "Prijava s strani uporabnika"
+
+#: lib/Report.php:40
+msgid "Report driver does not exist."
+msgstr "Gonilnik za prijavo ne bostaja."
+
+#: report.php:46 report.php:57
+msgid "Report reason"
+msgstr "Razlog prijave"
+
+#: report.php:45 report.php:56
+msgid "Report type"
+msgstr "Tip prijave"
+
+#: templates/user/actions.php:24
+msgid "Report user"
+msgstr "Prijavi uporabnika"
+
+#: config/prefs.php.dist:79
+msgid ""
+"Require my confirmation if someone would like to add me to his freidn list."
+msgstr "Zahtevaj mojo potrditev, če me kdo želi dodati kot prijatelja."
+
+#: edit/password.php:190
+msgid "Reset"
+msgstr "Ponastavi"
+
+#: account/resetpassword.php:26
+msgid "Reset Your Password"
+msgstr "Ponastavi svoje geslo"
+
+#: lib/Folks.php:171 lib/Folks.php:175
+msgid "Sagittarius"
+msgstr "Strelec"
+
+#: save_search.php:51 edit/edit.php:52 edit/edit.php:57 edit/comments.php:40
+msgid "Save"
+msgstr "Shrani"
+
+#: templates/list/search.php:3
+msgid "Save search criteria"
+msgstr "Shrani rezultate iskanja"
+
+#: lib/Folks.php:167 lib/Folks.php:171
+msgid "Scorpio"
+msgstr "Škorpijon"
+
+#: search.php:18 lib/Folks.php:291 lib/Forms/Search.php:26
+msgid "Search"
+msgstr "Najdi"
+
+#: lib/Forms/Search.php:19
+msgid "Search by"
+msgstr "Iskanje po"
+
+#: save_search.php:39
+msgid "Search criteria deleted."
+msgstr "Shranjeno iskanje bilo izbrisano."
+
+#: save_search.php:28
+msgid "Search criteria saved successfuly"
+msgstr "Iskalni kriteriji so bili uspešno shranjeni."
+
+#: account/resetpassword.php:49 edit/password.php:195
+msgid "Security answer"
+msgstr "Zaščitni odgovor"
+
+#: edit/password.php:192
+msgid "Security question"
+msgstr "Zaščitno vprašanje"
+
+#: edit/password.php:189
+msgid "Security question used when reseting password"
+msgstr "Zaščitno vprašanje, ki ga bomo uporabili pri ponastavljanju gesla"
+
+#: account/username.php:19
+msgid "Send me my username"
+msgstr "Pošlji mi moje uporabniško ime"
+
+#: templates/user/actions.php:7 templates/edit/friends.php:24
+msgid "Send message"
+msgstr "Pošlji sporočilo"
+
+#: templates/user/actions.php:6
+msgid "Send private message"
+msgstr "Pošlji osebno sporočilo"
+
+#: templates/user/actions.php:9
+msgid "Send this profile to a friend"
+msgstr "Obvesti prijatelja za ta profil"
+
+#: lib/Folks.php:290
+msgid "Services"
+msgstr "Servisi"
+
+#: config/prefs.php.dist:24
+msgid "Set account action details"
+msgstr "Uredi uporabniške nastavitve"
+
+#: config/prefs.php.dist:31
+msgid "Set activity prefetences"
+msgstr "Nastavite parametre dnevnika aktivnosti"
+
+#: config/prefs.php.dist:17
+msgid "Set users preview paramaters"
+msgstr "Nastavitev pregledovanja uporabnikov"
+
+#: config/prefs.php.dist:22 config/prefs.php.dist:29
+msgid "Settings"
+msgstr "Nastavitve"
+
+#: lib/Block/friends.php:33
+msgid "Show friends that are"
+msgstr "Prikaži prijatelje, ki so"
+
+#: account/signup.php:61
+msgid "Sign up"
+msgstr "Registracija novega uporabnika"
+
+#: templates/list/list.php:20 templates/list/list.php:43
+msgid "Sort Direction"
+msgstr "Smer sortiranja"
+
+#: config/prefs.php.dist:41 config/prefs.php.dist:51
+msgid "Sort by"
+msgstr "Razvrsti po"
+
+#: templates/list/list.php:27
+msgid "Sort by Age"
+msgstr "Razvrsti po starosti"
+
+#: templates/list/list.php:37
+msgid "Sort by Albums"
+msgstr "Razvrsti po številu albumov"
+
+#: templates/list/list.php:29
+msgid "Sort by City"
+msgstr "Razvrsti po mestu"
+
+#: templates/list/list.php:33
+msgid "Sort by Description"
+msgstr "Razvrsti po opisu"
+
+#: templates/list/list.php:25
+msgid "Sort by Gender"
+msgstr "Razvrsti po spolu"
+
+#: templates/list/list.php:31
+msgid "Sort by Homepage"
+msgstr "Razvrsti po domači strani"
+
+#: templates/list/list.php:35
+msgid "Sort by Picture"
+msgstr "Razvrsti po sliki"
+
+#: templates/list/list.php:23
+msgid "Sort by Username"
+msgstr "Ste po uporabniškem imenu"
+
+#: templates/list/list.php:39
+msgid "Sort by Video"
+msgstr "Razvrsti po posnetkih"
+
+#: templates/user/user.php:71 edit/privacy.php:40
+msgid "Status"
+msgstr "Status"
+
+#: account/signup.php:44
+#, php-format
+msgid ""
+"Submitted request to add \"%s\" to the system. You cannot log in until your "
+"request has been approved."
+msgstr ""
+"Poslana je bila zahteva za registracijo \"%s\" v sistem. Ne morete se "
+"prijaviti, dokler vaša zahteva ne bo potrjena."
+
+#: lib/Folks.php:143 lib/Folks.php:147
+msgid "Taurus"
+msgstr "Bik"
+
+#: report.php:37
+msgid "Terms and conditions infringement"
+msgstr "Kršenje pravil obnašanja"
+
+#: account/approve.php:65 account/renew.php:65
+msgid ""
+"The code is not right. If you copy and paste the link from your email, "
+"please check if you copied the whole string."
+msgstr ""
+"Koda ni pravilna. Morda ste jo narobe prenesli iz elektronskega sporočila, "
+"ki ste ga dobili na vaš email. Preglejte, da ste skopirali kodo v celoti."
+
+#: templates/edit/blacklist.php:4
+msgid "There are no users in your blacklist."
+msgstr "V vaši črni listi ni nikogar."
+
+#: templates/edit/friends.php:4
+msgid "There are no users listed as your friend."
+msgstr "Nimate nobenega uporabnika kot prijatelja."
+
+#: config/hooks.php.dist:184
+msgid "There is already an user registered with this email"
+msgstr "Že obstaja uporabnik, ki koristi ta email naslov"
+
+#: config/hooks.php.dist:182
+msgid "There is already an user registered with this username"
+msgstr "To uporabniško ime je zasedno"
+
+#: templates/edit/activity.php:7
+msgid "There is no activity logged for your account."
+msgstr "Ni zabeleženih aktivnosti za vaše uporabniško ime."
+
+#: account/signup.php:50 account/signup.php:52
+#, php-format
+msgid "There was a problem adding \"%s\" to the system: %s"
+msgstr "Prišlo je do napake pri dodajanju uporabnika \"%s\": %s"
+
+#: config/hooks.php.dist:138
+msgid "There was an error login into your mail account."
+msgstr "Prišlo je do napake pri prijavi v vaš poštni predal."
+
+#: login.php:184
+msgid "This account was deleted or is expired."
+msgstr "Vaše uporabnško ime je preteklo ali pa je v postopku izbrisa."
+
+#: login.php:178
+msgid ""
+"This account was still not activated. Check your inbox, we sendy you the "
+"activation code there."
+msgstr ""
+"Vaše uporabniško ime še ni aktivno. Preglejte vašo elektronsko pošto "
+"(email). Na vaš elektronski naslov smo poslali aktivacijsko kodo."
+
+#: lib/Block/my_comments.php:57
+msgid "Title"
+msgstr "Naslov"
+
+#: lib/Report.php:122
+msgid "Unsupported"
+msgstr "Ni podprto"
+
+#: edit/edit.php:68
+msgid "Updated his/her profile details."
+msgstr "Spremenil podatke svojega profila."
+
+#: edit/edit.php:70
+msgid "Updated his/her profile picture."
+msgstr "Zamenjal sliko v svojem profilu."
+
+#: edit/edit.php:45
+msgid "Upload a new video"
+msgstr "Naloži nov posnetek"
+
+#: scripts/mail.php:152
+#, php-format
+msgid "Usage: %s [OPTIONS]..."
+msgstr ""
+
+#: report.php:55 lib/Block/my_comments.php:58
+msgid "User"
+msgstr "Uporabnik"
+
+#: lib/Driver.php:376 lib/Driver/sql.php:303
+#, php-format
+msgid "User \"%s\" does not exists."
+msgstr "Uporabnik \"%s\" ne obstaja."
+
+#: lib/Friends.php:185 lib/Friends.php:254
+#, php-format
+msgid "User \"%s\" does not exits"
+msgstr "Uporabnik \"%s\" ne obstaja"
+
+#: lib/Friends.php:262
+#, php-format
+msgid "User \"%s\" is already in fiend list"
+msgstr "Uporabnik \"%s\" je že v vašem spisku prijateljev."
+
+#: lib/Friends.php:270
+#, php-format
+msgid ""
+"User \"%s\" is already in fiend list, but we are waiting his/her approval."
+msgstr ""
+"Uporabnik \"%s\" je že v vašem spisku prijateljev, vendar vas še ni potrdil."
+
+#: account/renew.php:43
+#, php-format
+msgid "User \"%s\" is not market to be in the removal process."
+msgstr "Uporabnik \"%s\" ni v postopku izbrisa."
+
+#: edit/friends.php:60
+#, php-format
+msgid "User \"%s\" was added as your friend."
+msgstr "Uporabnik \"%s\" je sedaj vaš prijatelj."
+
+#: edit/blacklist.php:41
+#, php-format
+msgid "User \"%s\" was added to your blacklist."
+msgstr "Uporabnik \"%s\" je sedaj v vaši črni listi."
+
+#: account/approve.php:43
+#, php-format
+msgid "User \"%s\" was already activated."
+msgstr "Uporabnik \"%s\" je že potrjen."
+
+#: edit/approve.php:38
+#, php-format
+msgid "User \"%s\" was confirmed as a friend."
+msgstr "Uporabnik \"%s\" je potrjen kot vaš prijatelj."
+
+#: edit/reject.php:37
+#, php-format
+msgid "User \"%s\" was rejected as a friend."
+msgstr "Uporabnik \"%s\" je zavrnjen kot vaš prijatelj."
+
+#: edit/blacklist.php:34
+#, php-format
+msgid "User \"%s\" was removed from your blacklist."
+msgstr "Uporabnik \"%s\" je odstranjen z vaše črne liste."
+
+#: edit/friends.php:41
+#, php-format
+msgid "User \"%s\" was removed from your friend list."
+msgstr "Uporabnik \"%s\" je odstranjen z vašega spiska prijateljev."
+
+#: edit/friends.php:52
+#, php-format
+msgid ""
+"User %s added you to his firends list on %s. \n"
+"To approve, go to: %s \n"
+"To reject, go to: %s \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+"Uporabnik %s vas je izbral za prijatelja na %s. \n"
+"Klik za potrditev: %s \n"
+"Klik za zavrnitev: %s \n"
+"Prikaz njegovega profila: %s \n"
+
+#: edit/approve.php:44
+#, php-format
+msgid ""
+"User %s confirmed you as a friend on %s.. \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+"Uporabnik %s vas je potrdil kot prijatelja na %s. \n"
+"Njegov profil: %s \n"
+
+#: templates/user/user.php:391
+#, php-format
+msgid "User %s does not wish to be commented."
+msgstr "Uporabnik %s ne želi prejemati komentarjev."
+
+#: templates/user/deleted.php:4
+#, php-format
+msgid "User %s has been disabled."
+msgstr "Uporabnik %s je izklopljen."
+
+#: templates/user/inactive.php:4
+#, php-format
+msgid "User %s is inactive."
+msgstr "Uporabnik %s ni aktiven."
+
+#: login.php:52
+#, php-format
+msgid ""
+"User %s just logged in.\n"
+"%s"
+msgstr ""
+"Uporabnik %s se je pravkar prijavil.\n"
+"%s"
+
+#: edit/reject.php:43
+#, php-format
+msgid ""
+"User %s rejected you as a friend on %s.. \n"
+"To see to his profile, go to: %s \n"
+msgstr ""
+"Uporabnik %s vas je zavrnil kot prijatelja na %s. \n"
+"Njegov profil: %s \n"
+
+#: templates/user/authenticated.php:4
+#, php-format
+msgid ""
+"User %s would like to his profile remains visible only to authenticated "
+"users."
+msgstr ""
+"Uporabnik %s želi, da si njegov profil ogledujejo le prijavljeni uporabniki. "
+"Prijavite se!"
+
+#: templates/user/friends.php:4
+#, php-format
+msgid "User %s would like to his profile remains visible only to his friends."
+msgstr ""
+"Uporabnik %s želi, da si njegov profil ogledujejo le njegovi prijatelji."
+
+#: templates/user/private.php:4
+#, php-format
+msgid "User %s would like to remain private."
+msgstr "Uporabnik %s želi ostati anonimen."
+
+#: account/signup.php:21
+msgid "User Registration has been disabled for this site."
+msgstr "Registracija novih uporabnikv je začasno izklopljena."
+
+#: lib/Block/random.php:36
+msgid "User is currently online?"
+msgstr "Je uporabnik trenutno online?."
+
+#: report.php:25
+msgid "User is not selected"
+msgstr "Uporabnik ni izbran"
+
+#: templates/user/actions.php:28
+msgid "User list"
+msgstr "Spisek uporabnikov"
+
+#: report.php:62 report.php:68
+msgid "User was not reported."
+msgstr "Uporabnik ni bil prijavljen."
+
+#: report.php:65
+msgid "User was reported."
+msgstr "Uporabnik je bil prijavljen."
+
+#: templates/friends/friends.php:16 templates/list/list.php:24
+#: templates/edit/blacklist.php:12 templates/edit/friends.php:12
+#: account/resetpassword.php:43 lib/Forms/AddFriend.php:18
+#: lib/Forms/Login.php:21 config/prefs.php.dist:40
+msgid "Username"
+msgstr "Uporabniško ime"
+
+#: config/hooks.php.dist:169
+msgid ""
+"Username can contain only alphanumeric characters, underscore and minus."
+msgstr ""
+"Uporabniško ime lahko vsebuje le abecedo, ševila, podčrtaj in pomišljaj."
+
+#: templates/user/actions.php:29
+msgid "Users"
+msgstr "Uporabniki"
+
+#: lib/api.php:312
+msgid "Users Birthdays"
+msgstr "Rojstni dnevi uporabnikov"
+
+#: templates/list/list.php:9
+msgid "Users celebrating birthday today"
+msgstr "Uporabniki, ki danes praznujejo rojstni dan"
+
+#: templates/list/list.php:3
+msgid "Users currently online"
+msgstr "Uporabniki trenutno na strani."
+
+#: templates/edit/friends.php:61
+msgid "Users that has you listed as a friend"
+msgstr "Uporabniki, ki me imajo za prijatelja"
+
+#: templates/edit/friends.php:48
+msgid "Users winting us to approve their friendship"
+msgstr "Uporabniki, ki čakajo potrditev."
+
+#: templates/list/list.php:40 edit/edit.php:46 lib/Forms/Search.php:24
+msgid "Video"
+msgstr "Video"
+
+#: templates/edit/friends.php:22
+msgid "View profile"
+msgstr "Preglej profil"
+
+#: lib/Folks.php:159 lib/Folks.php:163
+msgid "Virgo"
+msgstr "Devica"
+
+#: templates/user/user.php:131
+msgid "Visit my homepage"
+msgstr "Obišči mojo domačo stran"
+
+#: templates/edit/friends.php:39
+msgid "We are waiting this users to approve our friendship"
+msgstr "Uporabniki, na katere čakamo, da nas potrdijo kot prijatelja."
+
+#: user.php:48 friends.php:25 edit/activity.php:34
+msgid "What are you doing right now?"
+msgstr "Kaj delate trenutno?"
+
+#: lib/Friends/sql.php:214 lib/Friends/letter.php:87
+msgid "Whitelist"
+msgstr "Želje"
+
+#: edit/comments.php:38
+msgid "Who can post comments to your profile"
+msgstr "Kdo lahko kometira vaš profil"
+
+#: edit/privacy.php:46
+msgid "Who can see my acticity log on my profile"
+msgstr "Kdo lahko v profilu vidi dnevnik mojih aktinovsti"
+
+#: edit/privacy.php:43
+msgid "Who can see when I was last time online"
+msgstr "Kdo lahko vidi kdaj sem bil zadnjič online"
+
+#: lib/Forms/Search.php:18
+msgid "Word"
+msgstr "Beseda"
+
+#: templates/list/list.php:75 templates/list/list.php:76
+#: templates/list/list.php:77 templates/list/list.php:78
+#: templates/list/list.php:79 edit/privacy.php:49 config/prefs.php.dist:68
+#: config/prefs.php.dist:78 config/prefs.php.dist:88 config/prefs.php.dist:98
+msgid "Yes"
+msgstr "Da"
+
+#: lib/Forms/Login.php:29
+msgid "Yes, remember me so the next time I don't neet to login"
+msgstr "Da, želim ostati prijavljen tudi ob naslednjem obisku."
+
+#: account/approve.php:62 account/renew.php:62
+msgid "You account is activated, you can login now."
+msgstr "Vaše uporabniško ime je bilo potrjeno. Sedaj se lahko prijavite."
+
+#: login.php:135
+msgid "You are entering your data too fast!"
+msgstr "Prehitro vnašate podatke!"
+
+#: templates/user/user.php:399 templates/user/user.php:419
+#, php-format
+msgid "You are on %s blacklist."
+msgstr "Ste na črni listi uporabnika %s."
+
+#: templates/user/private.php:8 templates/user/friends.php:8
+#, php-format
+msgid "You can still send a private message to user %s."
+msgstr "Še vedno mu lahko pošljete osebno sporočilo %s."
+
+#: lib/Friends.php:190
+#, php-format
+msgid "You cannot add \"%s\" to your blacklist."
+msgstr "Ne morete dodati \"%s\" na črno listo."
+
+#: lib/Friends.php:248
+msgid "You cannot add yourself as your own friend."
+msgstr "Sami sebe ne morete dodati kot prijatelja."
+
+#: lib/Friends.php:179
+msgid "You cannot add yourself to your blacklist."
+msgstr "Samega sebe ne morete dodati na črno listo."
+
+#: lib/api.php:385
+msgid "You cannot log activities for other users."
+msgstr "Ne morete dodajati aktinosti za druge uporabnike."
+
+#: lib/Driver.php:748 lib/Forms/Activity.php:32
+msgid "You cannot post an empty activity message."
+msgstr "Nimate nobene aktinosti"
+
+#: account/approve.php:20 account/renew.php:20
+msgid "You must supply a confirmation code."
+msgstr "Podati morate kodo za potrditev računa."
+
+#: account/approve.php:28 account/renew.php:28 edit/approve.php:24
+#: edit/reject.php:24
+msgid "You must supply a username."
+msgstr "Podati morate uporabiško ime."
+
+#: templates/friends/friends.php:38
+msgid "Your activities"
+msgstr "Vaše aktinosti"
+
+#: edit/comments.php:81
+msgid "Your comments preference was sucessfuly saved."
+msgstr "Vaše nastaviteve komentarjev so bile uspešno shranjene."
+
+#: edit/edit.php:66 edit/privacy.php:65
+msgid "Your data were successfully updated."
+msgstr "Vaši podatki so bili uspešno ažurirani."
+
+#: account/username.php:20
+msgid "Your email"
+msgstr "Vaš email"
+
+#: edit/edit.php:82
+msgid "Your image was deleted successfully."
+msgstr "Vaša slika je bila uspešno izbrisana."
+
+#: account/resetpassword.php:76
+#, php-format
+msgid ""
+"Your new password for %s is: %s. \n"
+"\n"
+" It was requested by %s on %s"
+msgstr ""
+"Vaše novo geslo za %s je %s. \n"
+"\n"
+"Zahtevano je bilo s strani %s ob %s"
+
+#: edit/password.php:66
+#, php-format
+msgid ""
+"Your new password is too long; passwords may not be more than %d characters "
+"long!"
+msgstr "Vaše novo geslo je predlogo. Gesla ne morejo biti daljša od %d znakov!"
+
+#: edit/password.php:145
+msgid "Your new password is too simple to guess! Not changed!"
+msgstr "Geslo je preveč lahko za ga uganiti. Ni bilo spremenjeno!"
+
+#: edit/password.php:136
+msgid "Your new password is too simple to guess. Not changed!"
+msgstr "Geslo je preveč preveč lahko za uganiti. Ni spremenjeno!"
+
+#: edit/password.php:61
+#, php-format
+msgid "Your new password must be at least %d characters long!"
+msgstr "Geslo mora biti vsaj %d znakov dolgo!"
+
+#: edit/password.php:44
+msgid "Your new password must be different from your current password"
+msgstr "Novo geslo mora biti drugačno od starega"
+
+#: edit/password.php:106
+#, php-format
+msgid "Your new password must contain at least %d alphabetic characters."
+msgstr "Geslo mora vsebovati vsaj %d črk."
+
+#: edit/password.php:111
+#, php-format
+msgid "Your new password must contain at least %d alphanumeric characters."
+msgstr "Geslo mora vsebovati vsaj %d števil."
+
+#: edit/password.php:116
+#, php-format
+msgid ""
+"Your new password must contain at least %d different types of characters. "
+"The types are: lower, upper, numeric, and symbols."
+msgstr ""
+"Gelo mora vsebovati vsaj %d različnih tipov znakov. Tipi znakov: majhne "
+"črke, velike črke, številke in simboli."
+
+#: edit/password.php:96
+#, php-format
+msgid "Your new password must contain at least %d lowercase characters."
+msgstr "Geslo mora vsebovati vsaj %d majhnih črk."
+
+#: edit/password.php:101
+#, php-format
+msgid "Your new password must contain at least %d numeric characters."
+msgstr "Geslo mora vsebovati vsaj %d številk."
+
+#: edit/password.php:91
+#, php-format
+msgid "Your new password must contain at least %d uppercase characters."
+msgstr "Geslo mora vsebovati vsaj %d velikih črk."
+
+#: edit/password.php:122
+#, php-format
+msgid "Your new password must contain less than %d whitespace characters."
+msgstr "Geslo mora vsebovati manj kot %d presledkov."
+
+#: edit/password.php:124
+msgid "Your new password must not contain whitespace characters."
+msgstr "Geslo ne sme vsebovati presledkov."
+
+#: edit/password.php:50
+msgid "Your old password didn't match"
+msgstr "Vaše staro geslo ni pravo"
+
+#: account/resetpassword.php:82
+msgid "Your password has been reset"
+msgstr "Vaše geslo je bilo ponastavljeno"
+
+#: account/resetpassword.php:84
+#, php-format
+msgid ""
+"Your password has been reset, check your email (%s) and log in with your new "
+"password."
+msgstr ""
+"Vaše geslo je bilo ponastavljeno, novo geslo smo poslali na vaš email (%s)."
+
+#: edit/password.php:185
+msgid "Your securiy questions was updated."
+msgstr "Vaše varnostno vprašanje je bilo ažurirano."
+
+#: account/username.php:34
+#, php-format
+msgid ""
+"Your username on %s %s is: %s. \n"
+"\n"
+" It was requested by %s on %s"
+msgstr ""
+"Vaše uporabniško ime na %s %s je: %s. \n"
+"\n"
+" Zahteval ga je %s ob %s"
+
+#: config/hooks.php.dist:231
+#, php-format
+msgid ""
+"Your username on %s %s is: %s. \n"
+"\n"
+" Please confirm the registration by going to this link \n"
+" %s"
+msgstr ""
+"Vaše uporabniško ime na %s %s je: %s. \n"
+"\n"
+" Prosimo potrdite registracijo s klikom na spodnjo povezavo:\n"
+" %s"
+
+#: login.php:156
+msgid "Your username or password is incorrect."
+msgstr "Vaše uporabniško ime ali geslo je napačno."
+
+#: account/username.php:41
+msgid "Your username was requested"
+msgstr "Zahtevano je bilo vaše uporabniško ime"
+
+#: account/username.php:43
+#, php-format
+msgid "Your username was sent, check your email (%s)."
+msgstr "Vaše uporabniško ime je bilo poslano na vaš emali (%s)."
+
+#: login.php:172
+#, php-format
+msgid ""
+"Your username was temporary deacirvated. For any additional information "
+"please write to %s, and don't forgot to incluide your username."
+msgstr ""
+"Vaše uporabniško ime je bilo začasno deaktivirano. Za dodatne informacije se "
+"obrnite na %s. Ne pozabite navesti vašega uporabniškega imena."
+
+#: edit/password.php:30
+msgid "type the password twice to confirm"
+msgstr "Prosim, vnesite dvakrat geslo za potrditev"
--- /dev/null
+<?php
+/**
+ * $Id: popularity.php 891 2008-09-23 18:14:32Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+$title = _("Popularity");
+
+$count = $folks_driver->countUsers();
+if ($count instanceof PEAR_Error) {
+ $notification->push($count);
+ $count = 0;
+}
+
+$page = Util::getGet('page', 0);
+$perpage = $prefs->getValue('per_page');
+$criteria = array('sort_by' => 'popularity', 'sort_dir' => 0);
+$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
+if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ $users = array();
+}
+
+$vars = Variables::getDefaultVariables();
+$pager = new Horde_UI_Pager('page',
+ $vars, array('num' => $count,
+ 'url' => 'popularity.php',
+ 'perpage' => $perpage));
+
+$pager->preserve($criteria);
+$list_url = Folks::getUrlFor('list', 'popularity');
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+require FOLKS_TEMPLATES . '/list/list.php';
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Report offensive content
+ *
+ * $Horde: folks/report.php,v 1.5 2008-08-03 18:32:29 mrubinsk Exp $
+ *
+ * Copyright 2007-2008 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.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+if (!Auth::isAuthenticated()) {
+ Horde::authenticationFailureRedirect();
+}
+
+$user = Util::getFormData('user');
+if (empty($user)) {
+ $notification->push(_("User is not selected"), 'horde.warning');
+ header('Location: ' . Folks::getUrlFor('list', 'list'));
+ exit;
+}
+
+$title = _("Do you really want to report this user?");
+
+$vars = Variables::getDefaultVariables();
+$form = new Horde_Form($vars, $title);
+$form->setButtons(array(_("Report"), _("Cancel")));
+
+$enum = array('advertisement' => _("Advertisement content"),
+ 'terms' => _("Terms and conditions infringement"),
+ 'offensive' => _("Offensive content"),
+ 'copyright' => _("Copyright infringement"));
+
+$form->addVariable($user, 'name', 'description', false);
+
+$form->addHidden('', 'user', 'text', true, true);
+
+$form->addVariable(_("Report type"), 'type', 'radio', true, false, null, array($enum));
+$form->addVariable(_("Report reason"), 'reason', 'longtext', true);
+
+$user_id = Util::getFormData('id');
+
+if ($form->validate()) {
+ if (Util::getFormData('submitbutton') == _("Report")) {
+ require FOLKS_BASE . '/lib/Report.php';
+ $report = Folks_Report::factory();
+
+ $body = _("User") . ': ' . $user . "\n"
+ . _("Report type") . ': ' . $enum[$vars->get('type')] . "\n"
+ . _("Report reason") . ': ' . $vars->get('reason') . "\n"
+ . $return_url;
+
+ $result = $report->report($body);
+ if (is_a($result, 'PEAR_Error')) {
+ $notification->push(_("User was not reported.") . ' ' .
+ $result->getMessage(), 'horde.error');
+ } else {
+ $notification->push(_("User was reported."), 'horde.success');
+ }
+ } else {
+ $notification->push(_("User was not reported."), 'horde.warning');
+ }
+ header('Location: ' . $return_url);
+ exit;
+}
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+$form->renderActive(null, null, null, 'post');
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+ /**
+ * $Id: save_search.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__));
+require_once FOLKS_BASE . '/lib/base.php';
+require_once 'Horde/Variables.php';
+
+if (Util::getFormData('submitbutton') == _("Close")) {
+
+ echo '<script type="text/javascript">RedBox.close();</script>';
+
+} elseif (Util::getFormData('formname') == 'savesearch') {
+
+ $result = $folks_driver->saveSearch(Util::getFormData('search_criteria'), Util::getFormData('search_name'));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Search criteria saved successfuly"), 'horde.success');
+ header('Location: ' . Horde::applicationUrl('search.php'));
+ exit;
+ }
+
+} elseif ((Util::getGet('delete') == 1) && Util::getGet('query')) {
+
+ $result = $folks_driver->deleteSavedSearch(Util::getGet('query'));
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Search criteria deleted."), 'horde.success');
+ header('Location: ' . Horde::applicationUrl('search.php'));
+ exit;
+ }
+}
+
+// Render
+$vars = Variables::getDefaultVariables();
+$vars->set('search_criteria', $_SESSION['folks']['last_search']);
+$form = new Horde_Form($vars, '', 'savesearch');
+$form->addVariable(_("Name"), 'search_name', 'text', true);
+$form->addHidden('', 'search_criteria', 'text', true);
+$form->setButtons(array(_("Save"), _("Close")));
+$notification->notify(array('listeners' => 'status'));
+$form->renderActive(null, null, Horde::selfUrl(), 'post');
\ No newline at end of file
--- /dev/null
+[Dolphin]
+Timestamp=2008,9,23,9,23,16
+ViewMode=1
--- /dev/null
+<?php
+/**
+ * Script calculate user acrivity. Please modify it for your needs.
+ *
+ * $Id: activity.php 1009 2008-10-24 09:30:41Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+exit;
+
+define('AUTH_HANDLER', true);
+require_once dirname(__FILE__) . '/../lib/base.php';
+
+// Do CLI checks and environment setup first.
+require_once 'Horde/CLI.php';
+
+// Make sure no one runs this from the web.
+if (!Horde_CLI::runningFromCLI()) {
+ exit("Must be run from the command line\n");
+}
+
+// Load the CLI environment.
+Horde_CLI::init();
+$cli = &Horde_CLI::singleton();
+
+$db = DB::connect($conf['sql']);
+if ($db instanceof PEAR_Error) {
+ $cli->fatal($db);
+}
+
+$users = array();
+$total = 0; // total points
+$totalnum = 0; // total messages
+
+// Count user activiy in various app
+$apps = array(
+'letter' => array('query' => 'SELECT COUNT(*), user_from FROM letter_inbox WHERE letter_inbox.id >= ' . strtotime('-3 month') * 100000000 . ' GROUP BY letter_inbox.user_from',
+ 'modify' => 0.3),
+'agora' => array('query' => 'SELECT COUNT(*), msg.message_author FROM agora_forums AS idx, agora_messages AS msg WHERE idx.forum_id = msg.forum_id AND msg.message_timestamp >= UNIX_TIMESTAMP(NOW() - INTERVAL 1 MONTH) GROUP BY message_author ORDER BY counter DESC',
+ 'modify' => 2),
+'news' => array('query' => 'SELECT COUNT(*), news.user FROM news WHERE news.publish >= (NOW() - INTERVAL 3 MONTH) AND news.status = 1 GROUP BY news.user',
+ 'modify' => 18),
+'thomas' => array('query' => 'SELECT COUNT(*), thomas_blogs.user_uid FROM thomas_blogs WHERE thomas_blogs.created >= (NOW() - INTERVAL 3 MONTH) AND thomas_blogs.status = 1 GROUP BY thomas_blogs.user_uid',
+ 'modify' => 10),
+'classifieds' => array('query' => 'SELECT COUNT(*), classified_ads.user_uid FROM classified_ads WHERE classified_ads.ad_validto <= UNIX_TIMESTAMP() GROUP BY classified_ads.user_uid',
+ 'modify' => 5),
+'ansel' => array('query' => 'SELECT COUNT(*) AS counter, ansel_shares.share_owner FROM ansel_shares WHERE ansel_shares.attribute_date_created >= UNIX_TIMESTAMP(NOW() - INTERVAL 3 MONTH) GROUP BY ansel_shares.share_owner ORDER BY counter DESC',
+ 'modify' => 5),
+);
+
+// Get application activities
+foreach ($apps as $app) {
+
+ // Try query
+ $result = $db->query($app['query']);
+ if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+ }
+
+ // Add total counts
+ $totalnum += $result->numRows();
+
+ // Process query
+ while ($row = $result->fetchRow()) {
+ $users[$row[1]] = $row[0] * $app['modify'];
+ $total += $row[0] * $app['modify'];
+ }
+}
+
+// Get comments activires
+$comments = array('news' => 5,
+ 'thomas' => 2,
+ 'schedul' => 2,
+ 'oscar' => 1,
+ 'ansel' => 1,
+ 'folks' => 1,
+ 'genie' => 1);
+
+foreach ($comments as $comment_app => $comment_factor) {
+
+ $sql = 'SELECT COUNT(*), msg.message_author '
+ . ' FROM agora_forums_' . $comment_app. ' AS idx, agora_messages_' . $comment_app. ' AS msg '
+ . ' WHERE idx.forum_id = msg.forum_id '
+ . ' AND msg.message_timestamp >= UNIX_TIMESTAMP(NOW() - INTERVAL 1 MONTH) '
+ . ' GROUP BY message_author '
+ . ' ORDER BY counter DESC';
+
+ // Try query
+ $result = $db->query($sql);
+ if ($query instanceof PEAR_Error) {
+ $cli->fatal($query);
+ }
+
+ // Add total counts
+ $totalnum += $result->numRows();
+
+ while ($row = $result->fetchRow()) {
+ $users[$row[1]] = ($row[0] * $comment_factor);
+ $total += ($row[0] * $comment_factor);
+ }
+
+}
+
+// find max user activity
+reset($users);
+$maxp = 0;
+while (list($u,$v) = each($users)) {
+ if (!empty($u) && !empty($v)) {
+ if ($v>$maxp) {
+ $maxp = $v;
+ }
+ }
+}
+
+// update users popularity... 100% = $maxp
+$result = $db->query('UPDATE folks_users SET activity = 0');
+if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+}
+
+reset($users);
+while (list($u,$v) = each($users)) {
+
+ if (empty($u) && empty($v)) {
+ continue;
+ }
+
+ $p = ceil($v / $maxp * 100);
+
+ $result = $db->query('UPDATE folks_users SET activity = ? WHERE user_uid = ?' , array($u, $p));
+ if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+ }
+
+ $cli->message($u . ' ' . $p, 'cli.success');
+}
\ No newline at end of file
--- /dev/null
+
+-- save top
+SET @tc = (SELECT
+ count_news +
+ count_galleries +
+ count_classifieds +
+ count_videos +
+ count_attendances +
+ count_wishes +
+ count_blogs AS count
+FROM
+ folks_users
+ORDER BY
+ count DESC
+LIMIT 1);
+
+-- check
+
+select @tc;
+
+-- update
+
+UPDATE folks_users SET activity = (
+ count_news * 20 +
+ count_galleries * 5 +
+ count_classifieds * 5 +
+ count_videos * 7 +
+ count_attendances * 2 +
+ count_wishes +
+ count_blogs * 15)
+/@tc
\ No newline at end of file
--- /dev/null
+-- cron to update user content counters, update to you needs
+
+-- classified
+UPDATE folks_users SET count_classifieds = 0;
+UPDATE folks_users SET count_classifieds = (
+ SELECT COUNT(*) FROM classified_ads WHERE
+ classified_ads.ad_active = 4 AND
+ classified_ads.ad_validto < UNIX_TIMESTAMP() AND
+ folks_users.user_uid = classified_ads.user_uid
+);
+
+-- news
+UPDATE folks_users SET count_news = 0;
+UPDATE folks_users SET count_news = (
+ SELECT COUNT(*) FROM news WHERE
+ news.status = 1 AND
+ news.publish < NOW() AND
+ folks_users.user_uid = news.user
+);
+
+-- video
+UPDATE folks_users SET count_videos = 0;
+UPDATE folks_users SET count_videos = (
+ SELECT COUNT(*) FROM oscar_videos WHERE
+ oscar_videos.video_status = 6 AND
+ folks_users.user_uid = oscar_videos.video_user
+);
+
+-- attendances
+UPDATE folks_users SET count_attendances = 0;
+UPDATE folks_users SET count_attendances = (
+ SELECT COUNT(*) FROM schedul, schedul_attendance WHERE
+ schedul.ondate >= NOW() AND
+ schedul_attendance.schedul_id = schedul.id AND
+ folks_users.user_uid = schedul_attendance.user_id
+);
+
+-- wishes
+UPDATE folks_users SET count_wishes = 0;
+UPDATE folks_users SET count_wishes = (
+ SELECT COUNT(*) FROM genie_wishes WHERE
+ wish_purchased = 1 AND
+ folks_users.user_uid = genie_wishes.wish_owner
+);
+
+-- galleries
+UPDATE folks_users SET count_galleries = 0;
+UPDATE folks_users SET count_galleries = (
+ SELECT COUNT(*) FROM ansel_shares WHERE
+ ansel_shares.attribute_images > 0 AND
+ folks_users.user_uid = ansel_shares.share_owner
+);
+
+-- blogs
+UPDATE folks_users SET count_blogs = 0;
+UPDATE folks_users SET count_blogs = (
+ SELECT COUNT(*) FROM thomas_blogs WHERE
+ thomas_blogs.status = 1 AND
+ folks_users.user_uid = thomas_blogs.user_uid
+);
--- /dev/null
+<?php
+/**
+ * Script to import Letter friend list
+ *
+ * $Id: import_letter.php 1008 2008-10-24 09:07:35Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+exit;
+
+define('AUTH_HANDLER', true);
+require_once dirname(__FILE__) . '/../lib/base.php';
+
+$db = DB::connect($conf['sql']);
+
+$sql = 'SELECT pref_uid, pref_value, pref_name FROM horde_prefs WHERE '
+ . ' pref_scope = ? AND (pref_name = ? OR pref_name = ?)'
+ . ' AND pref_value <> ? ORDER BY pref_uid';
+
+$result = $db->query($sql, array('letter', 'blacklist', 'whitelist', ''));
+if ($result instanceof PEAR_Error) {
+ die($result);
+}
+
+$sql = 'INSERT INTO folks_friends (user_uid, group_id, friend_uid) VALUES (?, ?, ?)';
+$sth = $db->prepare($sql);
+if ($sth instanceof PEAR_Error) {
+ die($sth);
+}
+
+while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
+
+ $data = array();
+ $list = $row['pref_name'] == 'blacklist' ? 1 : 0;
+
+ $users = preg_split("/[\s,]+/", $row['pref_value'], -1, PREG_SPLIT_NO_EMPTY);
+ array_walk($users, '_array_clean');
+ $users = array_unique($users);
+
+ foreach ($users as $user) {
+ $data[] = array($row['pref_uid'], $list, $user);
+ }
+
+ if (empty($data)) {
+ continue;
+ }
+
+ $insert = $db->executeMultiple($sth, $data);
+ if ($insert instanceof PEAR_Error) {
+ die($insert);
+ }
+}
+
+echo 'done';
+
+/**
+ * Clean usernames from garbage of old prefs letter user data
+ */
+function _array_clean(&$item, $key)
+{
+ $item = strtolower($item);
+ $item = str_replace('"', '', $item);
+ $item = str_replace("'", '', $item);
+}
\ No newline at end of file
--- /dev/null
+#!/usr/bin/php
+<?php
+/**
+ * This script parses MIME messages and deactivates users with returned emails.
+ *
+ * $Id: mail-filter.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright 2008 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.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+function usage()
+{
+ $argv = Console_Getopt::readPHPArgv();
+ $cmd = basename($argv[0]);
+ echo <<<EOU
+Usage: $cmd [options]
+
+This script parses MIME messages and deactivates users with returned emails.
+
+Options:
+ -h, --help Give this help.
+ -u, --username A user to send notificatons with.
+ --mail-host The IMAP/POP3 server to get the messages from.
+ Defaults to "localhost".
+ --mail-user The user name for the mail server.
+ --mail-pass The password for the mail server.
+ --mail-port The mail server port. Defaults to "143".
+ --mail-protocol The mail server protocol. Defaults to "imap/notls".
+ --mail-folder The folder on the mail server. Defaults to "INBOX".
+
+EOU;
+}
+
+define('AUTH_HANDLER', true);
+define('HORDE_BASE', dirname(__FILE__) . '/../..');
+
+// Do CLI checks and environment setup first.
+require_once HORDE_BASE . '/lib/core.php';
+require_once 'Horde/CLI.php';
+
+// Make sure no one runs this from the web.
+if (!Horde_CLI::runningFromCLI()) {
+ exit("Must be run from the command line\n");
+}
+
+// Load the CLI environment - make sure there's no time limit, init some
+// variables, etc.
+Horde_CLI::init();
+$cli = &Horde_CLI::singleton();
+
+require_once dirname(__FILE__) . '/../lib/base.php';
+require_once 'Console/Getopt.php';
+
+// Read command-line parameters.
+$info = array();
+$mail = array('host' => 'localhost',
+ 'pass' => '',
+ 'port' => 143,
+ 'protocol' => 'imap/notls',
+ 'folder' => 'INBOX');
+$from_mail = false;
+$options = Console_Getopt::getopt(Console_Getopt::readPHPArgv(),
+ 'h:u',
+ array('help', 'username=',
+ 'mail-host=', 'mail-user=',
+ 'mail-pass=', 'mail-port=',
+ 'mail-protocol=', 'mail-folder='));
+if ($options instanceof PEAR_Error) {
+ usage();
+ $cli->fatal($options->getMessage());
+}
+
+// Convert options into a hash. This is possible because all options are only
+// allowed once.
+$opts_hash = array();
+list($opts, $args) = $options;
+foreach ($opts as $opt) {
+ list($optName, $optValue) = $opt;
+ switch ($optName) {
+ case 'h': $optName = '--help'; break;
+ case 'u': $optName = '--username'; break;
+ }
+ $opts_hash[$optName] = is_null($optValue) ? true : $optValue;
+}
+
+// Process options in this order because some depend on others.
+if (isset($opts_hash['--help'])) {
+ usage();
+ exit;
+}
+if (!isset($opts_hash['--username'])) {
+ usage();
+ exit;
+}
+foreach (array('host', 'user', 'pass', 'port', 'protocol', 'folder') as $opt) {
+ if (isset($opts_hash['--mail-' . $opt])) {
+ $mail[$opt] = $opts_hash['--mail-' . $opt];
+ }
+}
+
+// Set charset to UTF-8 for most flexible conversion between email charset and
+// backend charset.
+NLS::setCharsetEnvironment('UTF-8');
+
+// Read and parse the message.
+$messages = array();
+$imap = @imap_open(sprintf('{%s:%d/%s}%s',
+ $mail['host'],
+ $mail['port'],
+ $mail['protocol'],
+ $mail['folder']),
+ $mail['user'], $mail['pass']);
+if (!$imap) {
+ $cli->fatal(_("Cannot authenticate at mail server:") . ' ' . implode('; ', imap_errors()));
+}
+
+// Mails from address to check
+$from_str = array('Undelivered Mail', 'MAILER-DAEMON', 'root@' . $conf['server']['name']);
+
+// Connect to db
+$dbconf = Horde::getDriverConfig('storage', 'sql');
+$db = DB::connect($dbconf);
+
+// get mails
+$mails = array();
+foreach ($from_str as $from) {
+ $mailbox = imap_search($imap, 'FROM "' . $from . '"', SE_UID);
+ if ($mailbox) {
+ foreach ($mailbox as $uid) {
+
+ // Get message data
+ $msg_body = imap_body($imap, $uid, FT_UID);
+ $msg_body = explode("\n", $msg_body);
+
+ // Find To: mail
+ foreach ($msg_body as $line) {
+ if (substr($line, 0, 3) == 'To:') {
+ $mails[] = $db->quote(trim(substr($line, 3)));
+ break;
+ }
+ }
+
+ imap_delete($imap, $uid, FT_UID);
+ }
+ }
+ imap_expunge($imap);
+}
+
+imap_close($imap);
+
+// We have anyone to notify?
+if (empty($mails)) {
+ $cli->fatal(_("Have no one to notify"));
+}
+
+// Get usernames
+$query = 'SELECT DISTINCT user_uid FROM folks_users WHERE user_email'
+ . ' IN (' . implode(', ', array_unique($mails)) . ') ';
+$users = $db->getOne($query, $mail);
+if ($user_uid instanceof PEAR_Error) {
+ $cli->fatal($user_uid);
+ continue;
+} elseif (empty($users)) {
+ $cli->fatal(_("Have no one to notify"));
+}
+
+// mail content
+$edit_url = Horde::applicationUrl('edit/edit.php', true);
+$title = _("Email problem");
+$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));
+
+// 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');
+}
+
+exit(0);
--- /dev/null
+<?php
+/**
+ * Send mail to a user that has new messages
+ *
+ * $Horde: incubator/folks/scripts/notify.php,v 1.4 2008/10/07 00:00:05 duck Exp $
+ *
+ * Copyright 2008 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.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+$no_compress = true;
+define('AUTH_HANDLER', true);
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+
+// Do CLI checks and environment setup first.
+require_once 'Horde/CLI.php';
+
+// Make sure no one runs this from the web.
+if (!Horde_CLI::runningFromCLI()) {
+ exit("Must be run from the command line\n");
+}
+
+// Load the CLI environment.
+Horde_CLI::init();
+$cli = &Horde_CLI::singleton();
+
+// Load Folks.
+require_once FOLKS_BASE . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/version.php';
+require_once 'Horde/MIME/Mail.php';
+
+// We accept the user name on the command-line.
+require_once 'Console/Getopt.php';
+$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'h:u:p:dt:f:c:',
+ array('help', 'username=', 'password=', 'time=', 'from=', 'count='));
+
+if ($ret instanceof PEAR_Error) {
+ $error = _("Couldn't read command-line options.");
+ Horde::logMessage($error, __FILE__, __LINE__, PEAR_LOG_DEBUG);
+ $cli->fatal($error);
+}
+
+// Show help and exit if no arguments were set.
+list($opts, $args) = $ret;
+if (!$opts) {
+ showHelp();
+ exit;
+}
+
+foreach ($opts as $opt) {
+ list($optName, $optValue) = $opt;
+ switch ($optName) {
+ case 'u':
+ case '--username':
+ $username = $optValue;
+ break;
+
+ case 'p':
+ case '--password':
+ $password = $optValue;
+ break;
+
+ case 'f':
+ case '--from':
+ $from = (int)$optValue;
+
+ case 'c':
+ case '--count':
+ $count = (int)$optValue;
+ break;
+
+ case 'h':
+ case '--help':
+ showHelp();
+ exit;
+ }
+}
+
+// Login to horde if username & password are set.
+if (!empty($username) && !empty($password)) {
+ $auth = Auth::singleton($conf['auth']['driver']);
+ if (!$auth->authenticate($username, array('password' => $password))) {
+ $error = _("Login is incorrect.");
+ Horde::logMessage($error, __FILE__, __LINE__, PEAR_LOG_ERR);
+ $cli->fatal($error);
+ } else {
+ $msg = sprintf(_("Logged in successfully as \"%s\"."), $username);
+ Horde::logMessage($msg, __FILE__, __LINE__, PEAR_LOG_DEBUG);
+ $cli->message($msg, 'cli.success');
+ }
+}
+
+// Only admins can run this operation
+if (!Auth::isAdmin('folks:admin')) {
+ $cli->fatal('ADMIN ONLY');
+}
+
+// Connect to db
+$dbconf = Horde::getDriverConfig('storage', 'sql');
+$db = DB::connect($dbconf);
+
+// Get new messages older time
+$query = 'SELECT user_uid, user_email FROM folks_users ORDER BY user_uid ASC';
+
+if (isset($count)) {
+ $db->modifyLimitQuery($query, $from, $count);
+}
+
+$res = $db->query($query);
+if ($res instanceof PEAR_Error) {
+ $cli->fatal($res);
+}
+
+$cli->message($res->numRows(), 'cli.success');
+
+$subject = sprintf('News on %s', $registry->get('name', 'horde'));
+$body = "Hello %s,\n\n There is someting new on %s\n\n. Visit us at %s";
+
+// Prepare data for bash process or delete one by one
+$paths = array();
+while ($row =& $res->fetchRow()) {
+
+ $body2 = sprintf($body, $row[0], $registry->get('name', 'horde'), Folks::getUrlFor('user', $row[0], true, -1));
+
+ // Send mail
+ $mail = new MIME_Mail($subject, $body2, $row[1], $conf['support'], NLS::getCharset());
+ $mail->addHeader('User-Agent', 'Folks' . FOLKS_VERSION);
+ $sent = $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
+ if ($sent instanceof PEAR_Error) {
+ $cli->message($sent, 'cli.warning');
+ } else {
+ $cli->message($row[0], 'cli.success');
+ }
+
+ // sleep(1);
+}
+
+$cli->message('done', 'cli.success');
+
+/**
+ * Show the command line arguments that the script accepts.
+ */
+function showHelp()
+{
+ global $cli;
+
+ $cli->writeln(sprintf(_("Usage: %s [OPTIONS]..."), basename(__FILE__)));
+ $cli->writeln();
+ $cli->writeln(_("Mandatory arguments to long options are mandatory for short options too."));
+ $cli->writeln();
+ $cli->writeln(_("-h, --help Show this help"));
+ $cli->writeln(_("-c, --count Limit count"));
+ $cli->writeln(_("-f, --from Limit offset"));
+ $cli->writeln(_("-u, --username[=username] Horde login username"));
+ $cli->writeln(_("-p, --password[=password] Horde login password"));
+ $cli->writeln();
+}
--- /dev/null
+<?php
+/**
+ * Script to update user online status site wide
+ * Using in combination with online.sql is recomended
+ *
+ * Put some ting like this in your cron
+ *
+ * mysql -u USER -h localhost --password=P DB < /pato/to/folks/scripts/online.sql
+ *
+ * $Id: online.php 920 2008-09-25 08:16:34Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+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'] . '"';
+ 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() . '"';
+ // mysql_unbuffered_query($sql)
+
+ // If not using cront with online.sql
+ // $sql = 'DELETE FROM folks_online WHERE time_last_click < UNIX_TIMESTAMP() - 480';
+ // mysql_unbuffered_query($sql)
+
+ if (!headers_sent()) {
+ setcookie('online', 1, $_SERVER['REQUEST_TIME'] + 480, '/');
+ }
+}
\ No newline at end of file
--- /dev/null
+
+CREATE TABLE IF NOT EXISTS folks_online (
+ user_uid varchar(32) NOT NULL default '',
+ ip_address char(16) NOT NULL,
+ time_last_click int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (user_uid,ip_address)
+) TYPE=HEAP;
+
+UPDATE folks_users SET last_online_on = (
+ SELECT time_last_click FROM folks_online WHERE
+ folks_users.user_uid = folks_online.user_uid
+ GROUP BY folks_online.user_uid
+);
+
+DELETE FROM folks_online WHERE time_last_click < UNIX_TIMESTAMP() - 480;
--- /dev/null
+<?php
+/**
+ * Script calculate user popularity. Please modify it for your needs.
+ *
+ * $Id: popularity.php 1009 2008-10-24 09:30:41Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+exit;
+
+define('AUTH_HANDLER', true);
+require_once dirname(__FILE__) . '/../lib/base.php';
+
+// Do CLI checks and environment setup first.
+require_once 'Horde/CLI.php';
+
+// Make sure no one runs this from the web.
+if (!Horde_CLI::runningFromCLI()) {
+ exit("Must be run from the command line\n");
+}
+
+// Load the CLI environment.
+Horde_CLI::init();
+$cli = &Horde_CLI::singleton();
+
+$db = DB::connect($conf['sql']);
+if ($db instanceof PEAR_Error) {
+ $cli->fatal($db);
+}
+
+$users = array();
+$total = 0; // total points
+$totalnum = 0; // total messages
+
+// Count messages recivered
+$sql = 'SELECT COUNT(*), user_to FROM letter_inbox WHERE id >=' . (strtotime('-1 month') * 100000000) . ' GROUP BY user_to';
+$result = $db->query($sql);
+if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+}
+
+while ($row = $result->fetchRow()) {
+ $users[$row[1]] = ($row[0] * 0.5);
+ $total += ($row[0] * 0.5);
+}
+
+// count comments received
+$sql = 'SELECT message_count, forum_name FROM agora_forums_folks WHERE message_count > 0 AND message_count < 1000000';
+$result = $db->query($sql);
+if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+}
+
+while ($row = $result->fetchRow()) {
+ $users[$row[1]] = ($row[0] * 0.5);
+ $total += ($row[0] * 0.5);
+}
+
+// Count user activiy in various app
+$apps = array(
+'news' => array('query' => 'SELECT DISTINCT user, id FROM news WHERE publish >= (NOW() - INTERVAL 3 MONTH) AND status = 1',
+ 'modify' => 2),
+'thomas' => array('query' => 'SELECT DISTINCT user_uid, id FROM thomas_blogs WHERE created >= (NOW() - INTERVAL 3 MONTH)',
+ 'modify' => 3),
+'albums' => array('query' => 'SELECT DISTINCT share_owner, share_id FROM ansel_shares WHERE attribute_date_created >= UNIX_TIMESTAMP(NOW() - INTERVAL 3 MONTH)',
+ 'modify' => 3)
+);
+
+foreach ($apps as $app => $defs) {
+ $result = $db->query($defs['query']);
+ if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+ }
+
+ while ($row = $result->fetchRow()) {
+ $sql = 'SELECT COUNT(*) FROM agora_forums_' . $app . ', agora_messages_' . $app . ' WHERE forum_name = ? AND forum_id = msg.forum_id';
+ $row2 = $db->getRow($sql, array($row[0]));
+ if ($row2 instanceof PEAR_Error) {
+ $cli->fatal($row2);
+ }
+
+ @$users[$row[1] += $row2[0] * $defs['modify'];
+ $total += $row2[0] * $defs['modify'];
+ }
+}
+
+// calclulate users popolarity
+reset($users);
+$maxp = 0;
+while (list($u,$v) = each($users)) {
+ if (!empty($u) && !empty($v)) {
+ continue;
+ }
+ if ($v>$maxp) {
+ $maxp = $v;
+ }
+}
+
+// update users popularity... 100% = $maxp
+$result = $db->query('UPDATE folks_users SET popularity = 0');
+if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+}
+
+reset($users);
+while ( list($u,$v) = each($users) ) {
+ if (!empty($u) && !empty($v)) {
+ continue;
+ }
+
+ $p = ceil($v/$maxp*100);
+
+ $result = $db->query('UPDATE folks_users SET popularity = ? WHERE user_uid = ?' , array($u, $p));
+ if ($result instanceof PEAR_Error) {
+ $cli->fatal($result);
+ }
+
+ $cli->message($u . ' ' . $p, 'cli.success');
+}
\ No newline at end of file
--- /dev/null
+-- $Id$
+
+CREATE TABLE IF NOT EXISTS folks_attributes (
+ user_uid VARCHAR(32) NOT NULL,
+ attributes_group VARCHAR(32) NOT NULL,
+ attributes_key VARCHAR(20) NOT NULL,
+ attributes_value VARCHAR(255) NOT NULL,
+ KEY user_uid (user_uid),
+ KEY attributes_group (attributes_group)
+);
+
+CREATE TABLE IF NOT EXISTS `folks_friends` (
+ `user_uid` VARCHAR(32) NOT NULL,
+ `group_id` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `friend_uid` VARCHAR(32) NOT NULL,
+ `friend_ask` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`user_uid`,`group_id`,`friend_uid`),
+ KEY `user_uid` (`user_uid`),
+ KEY `group_name` (`group_id`),
+ KEY `friend_uid` (`friend_uid`),
+ KEY `friend_ask` (`friend_ask`)
+);
+
+CREATE TABLE IF NOT EXISTS folks_notify_counts (
+ user_uid VARCHAR(32) NOT NULL,
+ count_news SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_galleries SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_classifieds SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_videos SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',
+ count_attendances SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_wishes SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_blog SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_uid),
+ KEY count_news (count_news),
+ KEY count_galleries (count_galleries),
+ KEY count_classifieds (count_classifieds),
+ KEY count_videos (count_videos),
+ KEY count_attendances (count_attendances),
+ KEY count_wishes (count_wishes),
+ KEY count_blog (count_blog)
+);
+
+CREATE TABLE IF NOT EXISTS folks_online (
+ user_uid VARCHAR(32) NOT NULL DEFAULT '',
+ ip_address CHAR(16) NOT NULL,
+ time_last_click INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ KEY user_uid (user_uid),
+ KEY ip_address (ip_address)
+);
+
+ CREATE TABLE folks_out (
+ user_uid VARCHAR(32) NOT NULL ,
+ out_from INT UNSIGNED NOT NULL ,
+ out_to INT UNSIGNED NOT NULL ,
+ out_desc VARCHAR(255) NOT NULL ,
+ INDEX (user_uid , out_from , out_to)
+);
+
+CREATE TABLE folks_shares (
+ share_id INT(10) UNSIGNED NOT NULL,
+ share_name VARCHAR(255) NOT NULL,
+ share_owner VARCHAR(32) NOT NULL,
+ share_flags TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ perm_creator TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
+ perm_DEFAULT TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
+ perm_guest TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
+ attribute_name VARCHAR(255) NOT NULL,
+ attribute_desc VARCHAR(255) NOT NULL,
+ attribute_type TINYINT(1) NOT NULL,
+ PRIMARY KEY (share_id),
+ KEY share_name (share_name),
+ KEY share_owner (share_owner),
+ KEY perm_creator (perm_creator),
+ KEY perm_DEFAULT (perm_DEFAULT),
+ KEY perm_guest (perm_guest),
+ KEY attribute_type (attribute_type)
+);
+
+CREATE TABLE folks_shares_groups (
+ share_id INT(10) UNSIGNED NOT NULL,
+ group_uid INT(10) UNSIGNED NOT NULL,
+ perm TINYINT(3) UNSIGNED NOT NULL,
+ KEY share_id (share_id),
+ KEY group_uid (group_uid),
+ KEY perm (perm)
+);
+
+CREATE TABLE folks_shares_users (
+ share_id INT(10) UNSIGNED NOT NULL,
+ user_uid VARCHAR(32) NOT NULL,
+ perm SMALLINT(5) UNSIGNED NOT NULL,
+ KEY share_id (share_id),
+ KEY user_uid (user_uid),
+ KEY perm (perm)
+);
+
+CREATE TABLE IF NOT EXISTS folks_users (
+ user_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
+ user_uid VARCHAR(32) NOT NULL,
+ user_status VARCHAR(32) NOT NULL,
+ user_comments VARCHAR(32) NOT NULL DEFAULT 'authenticated',
+ user_url VARCHAR(100) NOT NULL,
+ user_description text NOT NULL,
+ user_password CHAR(32) NOT NULL,
+ user_relationship TINYINT(1) NOT NULL DEFAULT '0',
+ user_video SMALLINT(5) UNSIGNED NOT NULL,
+ signup_at DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+ signup_by VARCHAR(19) NOT NULL,
+ user_email VARCHAR(100) NOT NULL,
+ user_city VARCHAR(80) NOT NULL,
+ user_country CHAR(2) NOT NULL,
+ user_gender TINYINT(1) DEFAULT '0',
+ user_birthday DATE NOT NULL DEFAULT '0000-00-00',
+ user_picture TINYINT(1) DEFAULT '0',
+ user_bookmarks SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ user_vacation INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ last_login_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+ last_login_by VARCHAR(19) NOT NULL,
+ last_online VARCHAR(16) NOT NULL DEFAULT 'all',
+ last_online_on INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ popularity TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+ activity TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+ activity_log VARCHAR(32) NOT NULL DEFAULT 'all',
+ count_news SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_galleries SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_classifieds SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_videos SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',
+ count_attendances SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_wishes SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_blogs SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ count_comments SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_id),
+ UNIQUE KEY user_email (user_email),
+ UNIQUE KEY user_uid (user_uid),
+ KEY user_birthday (user_birthday),
+ KEY user_city (user_city),
+ KEY user_gender (user_gender),
+ KEY user_video (user_video)
+);
+
+CREATE TABLE IF NOT EXISTS folks_views (
+ user_uid VARCHAR(32) NOT NULL,
+ view_uid VARCHAR(32) NOT NULL,
+ view_time INT(10) UNSIGNED NOT NULL,
+ PRIMARY KEY (view_uid, user_uid)
+);
+
+CREATE TABLE IF NOT EXISTS folks_testimonials (
+ profile_uid VARCHAR(32) NOT NULL,
+ user_uid VARCHAR(32) NOT NULL,
+ testimonial text NOT NULL,
+ PRIMARY KEY (profile_uid,user_uid)
+);
+
+CREATE TABLE folks_vacation (
+ user_uid VARCHAR(32) NOT NULL ,
+ start INT UNSIGNED NOT NULL ,
+ end INT UNSIGNED NOT NULL ,
+ subject VARCHAR(100) NOT NULL ,
+ reason VARCHAR(255) NOT NULL ,
+ PRIMARY KEY (user_uid)
+);
+
+CREATE TABLE folks_networks (
+ user_uid VARCHAR(32) NOT NULL,
+ network_link_name VARCHAR(255) NOT NULL,
+ network_link VARCHAR(255) NOT NULL,
+ network_name VARCHAR(255) NOT NULL,
+ KEY user_uid (user_uid)
+);
+
+CREATE TABLE folks_search (
+ user_uid VARCHAR(32) NOT NULL,
+ search_name VARCHAR(32) NOT NULL,
+ search_criteria text NOT NULL,
+ KEY user_uid (user_uid)
+);
+
+CREATE TABLE folks_activity (
+ user_uid varchar(32) NOT NULL,
+ activity_message varchar(255) NOT NULL,
+ activity_scope varchar(255) NOT NULL,
+ activity_date int(10) unsigned NOT NULL,
+ KEY user_uid (user_uid),
+ KEY activity_date (activity_date)
+);
--- /dev/null
+<?php
+/**
+ * $Id: search.php 940 2008-09-28 09:11:22Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+require_once FOLKS_BASE . '/lib/Forms/Search.php';
+require_once 'Horde/Variables.php';
+
+$title = _("Search");
+$vars = Variables::getDefaultVariables();
+$form = new Folks_Search_Form($vars, $title, 'search');
+
+if (isset($_SESSION['folks']['last_search']) && !$form->isSubmitted()) {
+ $criteria = unserialize($_SESSION['folks']['last_search']);
+}
+if (Util::getGet('query') && !$form->isSubmitted()) {
+ $criteria = $folks_driver->getSearchCriteria(Util::getGet('query'));
+ if ($criteria instanceof PEAR_Error) {
+ $notification->push($criteria);
+ $criteria = array();
+ }
+} else {
+ $form->getInfo(null, $criteria);
+ $_SESSION['folks']['last_search'] = serialize($criteria);
+}
+
+if (!empty($criteria)) {
+ $count = $folks_driver->countUsers($criteria);
+ if ($count instanceof PEAR_Error) {
+ $notification->push($count);
+ $count = 0;
+ }
+
+ if (($sort_by = Util::getFormData('sort_by')) !== null) {
+ $criteria['sort_by'] = $sort_by;
+ } else {
+ $criteria['sort_by'] = $prefs->getValue('sort_by');
+ }
+
+ if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+ $criteria['sort_dir'] = $sort_dir;
+ } else {
+ $criteria['sort_dir'] = $prefs->getValue('sort_dir');
+ }
+
+ $page = Util::getGet('page', 0);
+ $perpage = $prefs->getValue('per_page');
+ $users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
+ if ($users instanceof PEAR_Error) {
+ $notification->push($users);
+ $users = array();
+ }
+
+ $vars = Variables::getDefaultVariables();
+ $pager = new Horde_UI_Pager('page',
+ $vars, array('num' => $count,
+ 'url' => 'search.php',
+ 'perpage' => $perpage));
+
+ $pager->preserve($criteria);
+ $list_url = Horde::applicationUrl('search.php');
+
+} else {
+ $count = 0;
+ $users = array();
+}
+
+if (Auth::isAuthenticated()) {
+ $queries = $folks_driver->getSavedSearch();
+ if ($queries instanceof PEAR_Error) {
+ $notification->push($queries);
+ $queries = array();
+ }
+}
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+Horde::addScriptFile('prototype.js', 'horde', true);
+Horde::addScriptFile('effects.js', 'horde', true);
+Horde::addScriptFile('redbox.js', 'horde', true);
+Horde::addScriptFile('search.js', 'folks', true);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+require FOLKS_TEMPLATES . '/list/list.php';
+
+echo '<br />';
+$form->renderActive(null, null, null, 'post');
+if (Auth::isAuthenticated()) {
+ require FOLKS_TEMPLATES . '/list/search.php';
+}
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * $Id: services.php 1019 2008-10-31 08:18:10Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+
+$title = _("Available services");
+
+foreach ($registry->listApps() as $app) {
+ if (!in_array($app, $conf['services']['ignore'])) {
+ $apps[$app] = $registry->get('name', $app);
+ }
+}
+asort($apps);
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+require FOLKS_TEMPLATES . '/services/services.php';
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
--- /dev/null
+<?php
+if (isset($language)) {
+ header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Vary: Accept-Language');
+}
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<!-- Folks: Copyright 2008 Obala d.o.o.. www.obala.si -->
+<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
+<head>
+<?php
+
+$page_title = $registry->get('name');
+if (!empty($title)) $page_title .= ' :: ' . $title;
+if (!empty($refresh_time) && ($refresh_time > 0) && !empty($refresh_url)) {
+ echo "<meta http-equiv=\"refresh\" content=\"$refresh_time;url=$refresh_url\">\n";
+}
+
+Horde::includeScriptFiles();
+
+?>
+<title><?php echo htmlspecialchars($page_title) ?></title>
+<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
+<?php echo Horde::stylesheetLink('folks') ?>
+</head>
+
+<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
--- /dev/null
+[Dolphin]
+Timestamp=2008,9,24,10,34,12
+ViewMode=1
--- /dev/null
+<?php
+
+echo $form->renderActive();
+
+if (empty($activities)) {
+ echo '<ul class="notices"><li>';
+ echo _("There is no activity logged for your account.");
+ echo '</li>';
+ return;
+}
+?>
+<h1 class="header"><?php echo $title ?></h1>
+<table id="activities" class="striped sortable" style="width: 100%">
+<thead>
+<tr>
+ <th><?php echo _("Application") ?></th>
+ <th><?php echo _("Date") ?></th>
+ <th><?php echo _("Activity") ?></th>
+ <th><?php echo _("Action") ?></th>
+</tr>
+</thead>
+<tbody>
+<?php foreach ($activities as $activity) { ?>
+<tr>
+ <td><a href="<?php echo $registry->get('webroot', $activity['activity_scope']) ?>" />
+ <img src="<?php echo $registry->getImageDir($activity['activity_scope']) . '/' . $activity['activity_scope'] ?>.png" />
+ <?php echo $registry->get('name', $activity['activity_scope']) ?></a>
+ </td>
+ <td><?php echo Folks::format_datetime($activity['activity_date']) ?></td>
+ <td><?php echo $activity['activity_message']; unset($activity['activity_message']); var_dump($activity['activity_scope']); ?></td>
+ <td><a href="<?php echo Util::addParameter($delete_url, $activity) ?>" title="<?php echo _("Delete") ?>"/><?php echo $delete_img ?></a></td>
+</tr>
+<?php } ?>
+</tbody>
+</table>
--- /dev/null
+<?php
+if (empty($blacklist)) {
+ echo '<ul class="notices"><li>';
+ echo _("There are no users in your blacklist.");
+ echo '</li>';
+} else {
+?>
+<h1 class="header"><?php echo $title ?></h1>
+<table id="blacklist" class="sortable striped">
+<thead>
+<tr>
+ <th><?php echo _("Username") ?></th>
+ <th><?php echo _("Action") ?></th>
+</tr>
+</thead>
+<tbody>
+<?php foreach ($blacklist as $user) { ?>
+<tr>
+ <td><?php echo $user ?></td>
+ <td><a href="<?php $remove_url . $user ?>"><?php echo _("Remove") ?></a></td>
+</tr>
+<?php } ?>
+</tbody>
+</table>
+
+<?php
+}
+echo $form->renderActive();
\ No newline at end of file
--- /dev/null
+<?php
+if (empty($friend_list)) {
+ echo '<ul class="notices"><li>';
+ echo _("There are no users listed as your friend.");
+ echo '</li>';
+} else {
+?>
+<h1 class="header"><?php echo $title ?></h1>
+<table id="friendlist" class="striped sortable">
+<thead>
+<tr>
+ <th><?php echo _("Username") ?></th>
+ <th><?php echo _("Action") ?></th>
+</tr>
+</thead>
+<tbody>
+<?php foreach ($friend_list as $user) { ?>
+<tr>
+ <td><?php echo '<img src="' . Folks::getImageUrl($user) . '" class="userMiniIcon" /> ' . $user ?></td>
+ <td>
+ <a href="<?php echo Util::addParameter($remove_url, 'user', $user) ?>"><?php echo $remove_img . ' ' . _("Remove") ?></a>
+ <a href="<?php echo Folks::getUrlFor('user', $user) ?>"><?php echo $profile_img . ' ' . _("View profile") ?></a>
+ <?php if ($letter_url): ?>
+ <a href="<?php echo Util::addParameter($letter_url, 'user_to', $user) ?>"><?php echo $letter_img . ' ' . _("Send message") ?></a>
+ <?php endif; ?>
+ </td>
+</tr>
+<?php } ?>
+</tbody>
+</table>
+
+<?php
+}
+
+echo '<br />';
+echo $form->renderActive();
+
+if (!empty($waitingFrom)) {
+ echo '<br /><h1 class="header">' . _("We are waiting this users to approve our friendship") .'</h1>';
+ foreach ($waitingFrom as $user) {
+ echo ' <a href="' . Folks::getUrlFor('user', $user) . '">'
+ . '<img src="' . Folks::getImageUrl($user) . '" class="userMiniIcon" />'
+ . ' ' . $user . '</a> ';
+ }
+}
+
+if (!empty($waitingFor)) {
+ echo '<br /><h1 class="header">' . _("Users winting us to approve their friendship") .'</h1>';
+ foreach ($waitingFor as $user) {
+ echo ' <a href="' . Folks::getUrlFor('user', $user) . '">'
+ . '<img src="' . Folks::getImageUrl($user) . '" class="userMiniIcon" />'
+ . ' ' . $user . '</a> '
+ . ' <a href="' . Util::addParameter(Horde::applicationUrl('edit/approve.php'), 'user', $user) . '" title="' . _("Approve") . '">'
+ . '<img src="' . $registry->getImageDir('horde') . '/tick.png" /></a> '
+ . ' <a href="' . Util::addParameter(Horde::applicationUrl('edit/reject.php'), 'user', $user) . '" title="' . _("Reject") . '">'
+ . '<img src="' . $registry->getImageDir('horde') . '/cross.png" /></a>';
+ }
+}
+
+if (!empty($possibilities)) {
+ echo '<br /><h1 class="header">' . _("Users that has you listed as a friend") .'</h1>';
+ foreach ($possibilities as $user) {
+ echo ' <a href="' . Folks::getUrlFor('user', $user) . '">'
+ . '<img src="' . Folks::getImageUrl($user) . '" class="userMiniIcon" />'
+ . ' ' . $user . '</a> ';
+ }
+}
--- /dev/null
+
+<?php echo $form->renderActive(); ?>
+
+<br />
+
+<table style="width: 100%">
+<tr valign="top">
+<td>
+
+<h1 class="header">
+<span style="float: right"><a href="<?php echo Horde::applicationUrl('edit/friends.php') ?>"><?php echo _("Edit friends") ?></a></span>
+<?php echo _("Friends activities") ?></h1>
+<table id="friendactivities" class="striped sortable" style="width: 100%">
+<thead>
+<tr>
+ <th><?php echo _("Username") ?></th>
+ <th><?php echo _("Date") ?></th>
+ <th><?php echo _("Activity") ?></th>
+</tr>
+</thead>
+<tbody>
+<?php
+foreach ($firendActivities as $activity_date => $activity) {
+ echo '<tr><td><a href="' . Folks::getUrlFor('user', $activity['user']) . '">'
+ . '<img src="' . Folks::getImageUrl($activity['user']) . '" class="userMiniIcon" /> '
+ . $activity['user'] . '</a></td>'
+ . ' <td>' . Folks::format_datetime($activity_date) . '</td> '
+ . '<td>' . $activity['message'] . '</td></tr>';
+}
+?>
+
+</table>
+
+<br />
+
+<h1 class="header">
+<span style="float: right"><a href="<?php echo Horde::applicationUrl('edit/activity.php') ?>"><?php echo _("Edit activities") ?></a></span>
+<?php echo _("Your activities") ?>
+</h1>
+<table id="activities" class="striped sortable" style="width: 100%">
+<thead>
+<tr>
+ <th><?php echo _("Application") ?></th>
+ <th><?php echo _("Date") ?></th>
+ <th><?php echo _("Activity") ?></th>
+</tr>
+</thead>
+<tbody>
+<?php
+foreach ($activities as $activity) {
+$scope = explode(':', $activity['activity_scope']);
+?>
+<tr>
+ <td nowrap="nowrap"><a href="<?php echo $registry->get('webroot', $scope[0]) ?>" />
+ <img src="<?php echo $registry->getImageDir($scope[0]) . '/' . $scope[0] ?>.png" />
+ <?php echo $registry->get('name', $scope[0]) ?></a>
+ </td>
+ <td><?php echo Folks::format_datetime($activity['activity_date']) ?></td>
+ <td><?php echo $activity['activity_message']; unset($activity['activity_message']); ?></td>
+</tr>
+<?php } ?>
+</tbody>
+</table>
+
+</td>
+<td>
+
+<h1 class="header" nowrap="nowrap"><?php echo _("Online friends") ?></h1>
+<?php
+foreach ($friend_list as $user) {
+ if (!array_key_exists($user, $online)) {
+ continue;
+ }
+ $img = Folks::getImageUrl($user);
+ echo '<a href="' . Folks::getUrlFor('user', $user) . '" title="' . $user . '">'
+ . '<img src="' . $img . '" class="userMiniIcon" /></a>';
+}
+?>
+
+<br />
+<br />
+
+<h1 class="header"><?php echo $title ?></h1>
+<?php
+foreach ($friend_list as $user) {
+ $img = Folks::getImageUrl($user);
+ echo '<a href="' . Folks::getUrlFor('user', $user) . '" title="' . $user . '">'
+ . '<img src="' . $img . '" class="userMiniIcon" /></a>';
+}
+?>
+
+</td>
+</tr>
+</table>
\ No newline at end of file
--- /dev/null
+<div class="tabset">
+<ul>
+<li <?php if (basename($_SERVER['PHP_SELF']) == 'online.php') echo 'class="activeTab"' ?> title="<?php echo _("Users currently online") ?>"><a href="<?php echo Folks::getUrlFor('list', 'online') ?>"><?php echo _("Online") ?></a></li>
+<li <?php if (basename($_SERVER['PHP_SELF']) == 'new.php') echo 'class="activeTab"' ?> title="<?php echo _("New registered user") ?>"><a href="<?php echo Folks::getUrlFor('list', 'new') ?>"><?php echo _("New") ?></a></li>
+<?php if ($conf['services']['countcron']): ?>
+<li <?php if (basename($_SERVER['PHP_SELF']) == 'popularity.php') echo 'class="activeTab"' ?> title="<?php echo _("Most popular users") ?>"><a href="<?php echo Folks::getUrlFor('list', 'popularity') ?>"><?php echo _("Popularity") ?></a></li>
+<li <?php if (basename($_SERVER['PHP_SELF']) == 'activity.php') echo 'class="activeTab"' ?> title="<?php echo _("Most active users") ?>"><a href="<?php echo Folks::getUrlFor('list', 'activity') ?>"><?php echo _("Activity") ?></a></li>
+<?php endif; ?>
+<li <?php if (basename($_SERVER['PHP_SELF']) == 'birthday.php') echo 'class="activeTab"' ?> title="<?php echo _("Users celebrating birthday today") ?>"><a href="<?php echo Folks::getUrlFor('list', 'birthday') ?>"><?php echo _("Birthday") ?></a></li>
+<li <?php if (basename($_SERVER['PHP_SELF']) == 'list.php') echo 'class="activeTab"' ?> title="<?php echo _("All users") ?>"><a href="<?php echo Folks::getUrlFor('list', 'list') ?>"><?php echo _("List") ?></a></li>
+</ul>
+</div>
+<br class="clear" />
+<h1 class="header"><?php echo $title ?></h1>
+<?php if (empty($users)): ?>
+<?php echo _("No users found under selected criteria"); ?>
+<?php else:
+
+$sortImg = ($criteria['sort_dir'] == 'DESC') ? 'za.png' : 'az.png';
+$sortText = _("Sort Direction");
+
+$headers = array();
+$headers['user_uid'] = array('stext' => _("Sort by Username"),
+ 'text' => _("Username"));
+$headers['user_gender'] = array('stext' => _("Sort by Gender"),
+ 'text' => _("Gender"));
+$headers['user_birthday'] = array('stext' => _("Sort by Age"),
+ 'text' => _("Age"));
+$headers['user_city'] = array('stext' => _("Sort by City"),
+ 'text' => _("City"));
+$headers['user_homepage'] = array('stext' => _("Sort by Homepage"),
+ 'text' => _("Homepage"));
+$headers['user_description'] = array('stext' => _("Sort by Description"),
+ 'text' => _("Description"));
+$headers['user_picture'] = array('stext' => _("Sort by Picture"),
+ 'text' => _("Picture"));
+$headers['count_galleries'] = array('stext' => _("Sort by Albums"),
+ 'text' => _("Albums"));
+$headers['count_video'] = array('stext' => _("Sort by Video"),
+ 'text' => _("Video"));
+
+$sortImg = ($criteria['sort_dir'] == 'DESC') ? 'za.png' : 'az.png';
+$sortText = _("Sort Direction");
+
+?>
+<table class="striped" style="width: 100%">
+<thead>
+<tr>
+<?php
+foreach ($headers as $key => $val) {
+ echo '<th class="widget" align="left" nowrap="nowrap">' . "\n";
+ if ($criteria['sort_by'] == $key) {
+ echo Horde::link(Util::addParameter($list_url, 'sort_dir', ($criteria['sort_dir'] == 'DESC') ? 'ASC' : 'DESC'), $val['text'], null, null, null, $val['text']);
+ echo Horde::img($sortImg, $sortText, null, $registry->getImageDir('horde')) . '</a> ';
+ }
+ echo Horde::widget(Util::addParameter(($criteria['sort_by'] == $key) ? $list_url : $list_url, 'sort_by', $key), $val['text'], 'widget');
+ echo '</th>';
+}
+?>
+</tr>
+</thead>
+<?php
+foreach ($users as $user):
+?>
+<tr>
+ <td><a href="<?php echo Folks::getUrlFor('user', $user['user_uid']) ?>"><?php echo $user['user_uid'] ?></a></td>
+ <td><?php if ($user['user_gender']) { echo $user['user_gender'] == 1 ? _("Male") : _("Female"); } ?></td>
+ <td><?php
+ $age = Folks::calcAge($user['user_birthday']);
+ if (!empty($age['age'])) {
+ echo $age['age'] . ' (' . $age['sign'] . ')' ;
+ }
+ ?></td>
+ <td><?php echo $user['user_city'] ?></td>
+ <td><?php echo $user['user_url'] ? _("Yes") : _("No") ?></td>
+ <td><?php echo $user['user_description'] ? _("Yes") : _("No") ?></td>
+ <td><?php echo $user['user_picture'] || $user['user_video'] ? _("Yes") : _("No") ?></td>
+ <td><?php echo $user['count_galleries'] ? _("Yes") : _("No") ?></td>
+ <td><?php echo $user['count_videos'] ? _("Yes") : _("No") ?></td>
+</td>
+</tr>
+<?php endforeach; ?>
+</table>
+<?php echo $pager->render() ?>
+<?php endif; ?>
\ No newline at end of file
--- /dev/null
+<?php if (!empty($criteria)): ?>
+<br />
+<a href="javascript:void(0)" class="bottom" onclick="saveSearch('<?php echo Horde::applicationUrl('save_search.php') ?>')"><?php echo _("Save search criteria"); ?></a>
+<?php
+endif;
+if (!empty($queries)):
+?>
+<br />
+<br />
+<table class="striped" style="width: 100%">
+<h1 class="header"><?php echo _("My queries") ?></h1>
+<?php
+foreach ($queries as $query) {
+ $delete_img = Horde::img('delete.png', _("Delete"), '', $registry->getImageDir('horde'));
+ echo '<tr><td>' . Horde::link(Util::addParameter(Horde::applicationUrl('search.php'), 'query', $query), '', 'bottom') . $query . '</a></td>';
+ echo '<td>' . Horde::link(Util::addParameter(Horde::applicationUrl('save_search.php'), array('query' => $query, 'delete' => 1))) . $delete_img . '</a></td></tr>';
+}
+?>
+</table>
+<?php endif; ?>
--- /dev/null
+<?php
+
+echo $tabs->render('login');
+$form->renderActive(null, null, null, 'post');
\ No newline at end of file
--- /dev/null
+<?php
+
+echo $tabs->render('signup');
+$form->renderActive(null, null, null, 'post');
--- /dev/null
+<div id="menu">
+ <?php echo Folks::getMenu('string') ?>
+</div>
+<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
--- /dev/null
+<?php
+
+echo '<h1 class="header">' . $title . '</h1>';
+
+foreach ($apps as $app => $name) {
+ $page = $registry->getInitialPage($app);
+ if ($page instanceof PEAR_Error) {
+ continue;
+ }
+ echo '<div class="appService">' .
+ '<a href="' . $page . '">' .
+ '<img src="' . $registry->getImageDir($app) . '/'. $app . '.png" /> ' .
+ $name .
+ '</a></div>';
+}
\ No newline at end of file
--- /dev/null
+[Dolphin]
+Timestamp=2008,9,23,20,32,31
+ViewMode=1
--- /dev/null
+<br />
+
+<div class="control folksActions" style="text-align: center;">
+
+<?php if ($registry->hasInterface('letter')): ?>
+<a href="<?php echo $registry->get('webroot', 'letter') ?>/compose.php?user_to=<?php echo $user ?>" title="<?php echo _("Send private message") ?>">
+<img src="<?php echo $registry->getImageDir('letter') ?>/letter.png"> <?php echo _("Send message") ?></a>
+
+<a href="<?php echo $registry->get('webroot', 'letter') ?>/compose.php?title=<?php echo _("Look at this profile") ?>&content=<?php echo Folks::getUrlFor('user', $user, true, -1) ?>" title="<?php echo _("Send this profile to a friend") ?>">
+<img src="<?php echo $registry->getImageDir('horde') ?>/nav/right.png"> <?php echo _("Forward") ?></a>
+
+<?php endif; ?>
+
+<a href="javascript: document.getElementById('message_body').focus()" title="<?php echo _("Add a comment") ?>">
+<img src="<?php echo $registry->getImageDir('agora') ?>/agora.png"> <?php echo _("Add a comment") ?></a>
+
+<a href="<?php echo Util::addParameter(Horde::applicationUrl('edit/friends.php'), 'user', $user); ?>" title="<?php echo sprintf(_("Add %s as a friend?"), $user) ?>" onclick="return confirm('<?php echo sprintf(_("Add %s as a friend?"), $user) ?>')">
+<img src="<?php echo $registry->getImageDir('horde') ?>/user.png"> <?php echo _("Friend") ?></a>
+
+<a href="<?php echo Util::addParameter(Horde::applicationUrl('edit/blacklist.php'), 'user', $user); ?>" title="<?php echo sprintf(_("Add %s to you blacklist?"), $user) ?>" onclick="return confirm('<?php echo sprintf(_("Add %s to you blacklist?"), $user) ?>')">
+<img src="<?php echo $registry->getImageDir('horde') ?>/locked.png"> <?php echo _("Blacklist") ?></a>
+
+<?php if ($conf['report_content']['driver']): ?>
+<a href="<?php echo Util::addParameter(Horde::applicationUrl('report.php'), 'user', $user); ?>" title="<?php echo _("Report user") ?>">
+<img src="<?php echo $registry->getImageDir('horde') ?>/problem.png"> <?php echo _("Report") ?></a>
+<?php endif; ?>
+
+<a href="<?php echo Folks::getUrlFor('list', 'list') ?>" title="<?php echo _("User list") ?>">
+<img src="<?php echo $registry->getImageDir('horde') ?>/group.png"> <?php echo _("Users") ?></a>
+
+</div>
+
+<br />
\ No newline at end of file
--- /dev/null
+<h1><?php echo $title ?></h1>
+
+<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>';
+}
+?>
+</ul>
--- /dev/null
+<h1><?php echo $title ?></h1>
+
+<ul class="notices">
+<li><img src="<?php echo $registry->getImageDir('horde')?>/alerts/warning.png"><?php echo sprintf(_("User %s has been disabled."), $user) ?></li>
+</ul>
--- /dev/null
+<h1><?php echo $title ?></h1>
+
+<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 his friends."), $user) ?></li>
+<?php
+if ($registry->hasMethod('letter/compose')) {
+ echo '<li><img src="' . $registry->getImageDir('letter') . '/letter.png">'
+ . sprintf(_("You can still send a private message to user %s."), $user)
+ . ' <a href="' . $registry->callByPackage('letter', 'compose', array(array('user_to' => $user))) . '">' . _("Click here") . '</a>'
+ . '</li>';
+}
+?>
+</ul>
--- /dev/null
+<h1><?php echo $title ?></h1>
+
+<ul class="notices">
+<li><img src="<?php echo $registry->getImageDir('horde')?>/alerts/warning.png"><?php echo sprintf(_("User %s is inactive."), $user) ?></li>
+</ul>
--- /dev/null
+<h1><?php echo $title ?></h1>
+
+<ul class="notices">
+<li><img src="<?php echo $registry->getImageDir('horde')?>/alerts/warning.png"><?php echo sprintf(_("User %s would like to remain private."), $user) ?></li>
+<?php
+if ($registry->hasMethod('letter/compose')) {
+ echo '<li><img src="' . $registry->getImageDir('letter') . '/letter.png">'
+ . sprintf(_("You can still send a private message to user %s."), $user)
+ . ' <a href="' . $registry->callByPackage('letter', 'compose', array(array('user_to' => $user))) . '">' . _("Click here") . '</a>'
+ . '</li>';
+}
+?>
+</ul>
--- /dev/null
+
+<h1><?php echo $title ?></h1>
+
+<?php
+if ($user == Auth::getAuth()) {
+ echo $form->renderActive(null, null, '', 'post') . '<br />';
+}
+?>
+
+<table style="width: 100%">
+<tbody>
+<tr valign="top">
+
+<td style="width: 50%; text-align: center">
+
+<?php
+
+if ($profile['user_video']) {
+
+?>
+
+<object type="application/x-shockwave-flash" data="<?php echo $registry->get('webroot', 'oscar') ?>/videos/flow_player.swf" width="400" height="300">
+<param name="allowScriptAccess" value="sameDomain" />
+<param name="movie" value="<?php echo $registry->get('webroot', 'oscar') ?>/videos/flow_player.swf" />
+<param name="quality" value="high" />
+<param name="wmode" value="transparent" />
+<param name="autoPlay" value="true" />
+<param name="autoRewind" value="true" />
+<param name="allowfullscreen" value="true" />
+<param name="useNativeFullScreen" value="true" />
+<param name="loop" value="false" />
+<param name="protected" value="true" />
+<param name="flashvars" value="config={
+ playList: [ {
+ url: '<?php echo $registry->get('webroot', 'horde') ?>/vfs/.horde/oscar/<?php echo substr(str_pad($profile['user_video'], 2, 0, STR_PAD_LEFT), -2) . '/' . $profile['user_video'] . '/' . $profile['user_video'] ?>.flv',
+ } ],
+ streamingServer: 'lighttpd',
+ autoBuffering: true,
+ autoPlay: false,
+ initialScale: 'fit',
+ headersOverVideo: 'locked',
+ headerBarBackgroundColor: -1,
+ headerBarGloss: 'none',
+ menuItems: [ false, false, false, false, false, false ]}" />
+</object>
+
+<?php
+
+} elseif ($profile['user_picture']) {
+
+ echo '<img src="' . Folks::getImageUrl($user, 'big') . '" alt="' . $user . '" />';
+
+} else {
+
+ echo '<img src="' . $registry->getImageDir('horde') . '/guest.png" alt="'
+ . $user . '" title="' . _("Has no picture"). '" style="border: 2px solid #eeeeee; padding: 100px"/>';
+
+}
+
+echo '<br />';
+include FOLKS_TEMPLATES . '/user/actions.php';
+?>
+
+</td>
+
+<td>
+
+<table class="striped" style="width: 100%">
+<tbody>
+<tr valign="top">
+ <td><strong><?php echo _("Status") ?></strong></td>
+ <td>
+ <?php
+ if ($folks_driver->isOnline($user)) {
+ echo '<span class="online">' . _("Online") . '</span>';
+ } else {
+ echo '<span class="offline">' . _("Offline") . '</span>';
+ if ($profile['last_online_on'] &&
+ ($profile['last_online'] == 'all' ||
+ Auth::isAuthenticated() && (
+ $profile['last_online'] == 'authenticated' ||
+ $profile['last_online'] == 'friends' && $folks_driver->isFriend($user, Auth::getAuth())))
+ ) {
+ echo ' ' . _("Last time online") . ': ' . Folks::format_datetime($profile['last_online_on']);
+ }
+ }
+ ?>
+ </td>
+</tr>
+
+<?php
+if (!empty($profile['activity_log'])) {
+$activity = current($profile['activity_log']);
+foreach ($profile['activity_log'] as $item) {
+ if ($item['activity_scope'] == 'folks:custom') {
+ $activity = $item;
+ break;
+ }
+}
+?>
+<tr>
+ <td><strong><?php echo _("Last activity") ?></strong></td>
+ <td><?php echo $activity['activity_message'] ?></td>
+</tr>
+<?php } ?>
+
+<tr>
+ <td><strong><?php echo _("Age") ?></strong></td>
+ <td><?php $age = Folks::calcAge($profile['user_birthday']); echo $age['age'] . ' (' . $age['sign'] . ')'?></td>
+</tr>
+<tr>
+ <td><strong><?php echo _("Gender") ?></strong></td>
+ <td><?php if ($profile['user_gender']) { echo $profile['user_gender'] == 1 ? _("Male") : _("Female"); } ?></td>
+</tr>
+<tr>
+ <td><strong><?php echo _("City") ?></strong></td>
+ <td><?php echo $profile['user_city'] ?></td>
+</tr>
+<?php if ($conf['services']['countcron']): ?>
+<tr>
+ <td><strong><?php echo _("Activity") ?></strong></td>
+ <td><?php echo $profile['activity'] ?>%</td>
+</tr>
+<tr>
+ <td><strong><?php echo _("Popularity") ?></strong></td>
+ <td><?php echo $profile['popularity'] ?>%</td>
+</tr>
+<?php endif; ?>
+<tr>
+ <td><strong><?php echo _("Homepage") ?></strong></td>
+ <td><?php echo $profile['user_url'] ? '<a href="' . $profile['user_url'] . '" target="_blank">' . _("Visit my homepage") . '</a>' : _("I don't have it") ?></td>
+</tr>
+
+<?php
+$friends = $folks_driver->getFriends($user);
+if (!empty($friends)):
+?>
+<tr>
+<td class="header" colspan="2">
+<span style="float: right">
+<a href="<?php echo Horde::applicationUrl('edit/friends.php') ?>" title="<?php echo _("Edit my firends") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/plus.png" /></a>
+<a href="<?php echo Util::addParameter(Horde::applicationUrl('edit/friends.php'), 'user', $user) ?>" title="<?php echo sprintf(_("Add %s as a friend?"), $user) ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/nav/right.png" /></a>
+</span>
+<?php echo _("Friends") ?> (<?php echo count($friends) ?>)
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($friends as $item) {
+ $img = Folks::getImageUrl($item);
+ echo '<a href="' . Folks::getUrlFor('user', $item) . '" title="' . $item . '">'
+ . '<img src="' . $img . '" class="userMiniIcon" /></a>';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ($profile['count_classifieds']):
+$path = $registry->get('webroot', 'classifieds');
+?>
+<tr>
+<td class="header" colspan="2">
+<span style="float: right">
+<a href="<?php echo $path ?>/ads/index.php" 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 ?>/list.php?user_uid=<?php echo $user ?>" title="<?php echo _("Others user content") ?>" ><?php echo $registry->get('name', 'classified') ?> (<?php echo $profile['count_classifieds'] ?>)</a>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($profile['count_classifieds_list'] as $item_id => $item) {
+ echo ' • <a href="' . $path . '/classified/ad.php?ad_id=' . $item_id . '">'
+ . $item['ad_title'] . '</a><br />';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ($profile['count_news']):
+$path = $registry->get('webroot', 'news');
+?>
+<tr>
+<td class="header" colspan="2">
+<span style="float: right">
+<a href="<?php echo $path ?>/add.php" 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 ?>/search.php?user=<?php echo $user ?>" title="<?php echo _("Others user content") ?>" ><?php echo $registry->get('name', 'news') ?> (<?php echo $profile['count_news'] ?>)</a>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($profile['count_news_list'] as $item) {
+ echo ' • <a href="' . $path . '/news.php?id=' . $item['id'] . '" title="'
+ . htmlspecialchars($item['abbreviation']) . '...">' . $item['title'] . '</a><br />';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ($profile['count_videos']):
+$path = $registry->get('webroot', 'oscar');
+?>
+<tr>
+<td class="header" colspan="2">
+<span style="float: right">
+<a href="<?php echo $path ?>/videos/index.php" 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 ?>/search.php?author=<?php echo $user ?>" title="<?php echo _("Others user content") ?>" ><?php echo $registry->get('name', 'oscar') ?> (<?php echo $profile['count_videos'] ?>)</a>
+</a>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($profile['count_videos_list'] as $item_id => $item) {
+ echo '<a href="' . $path . '/video.php?id=' . $item_id . '" title="'
+ . htmlspecialchars($item['video_description']) . '...">'
+ . '<img src="' . $registry->get('webroot', 'horde') . '/vfs/.horde/oscar/' . substr($item_id, -2) . '/' . $item_id . '/00000001.jpg" style="width: 50px; height: 38px" /></a> ';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ($profile['count_wishes']):
+$path = $registry->get('webroot', 'genie');
+?>
+<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 ?>" 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>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($profile['count_wishes_list'] as $item_id => $item) {
+ echo ' • <a href="' . $path . '/view.php?wishlist=' . $user .'&item=' . $item_id . '" title="'
+ . htmlspecialchars($item['desc']) . '...">'
+ . htmlspecialchars($item['name']) . '</a><br />';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ($profile['count_galleries']):
+$path = $registry->get('webroot', 'ansel');
+?>
+<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 ?>" 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> |
+<a href="<?php echo $path ?>/faces/search/owner.php?owner=<?php echo $user ?>" title="<?php echo _("Faces in user galleries") ?>"><?php echo _("Faces") ?></a>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($profile['count_galleries_list'] as $item_id => $item) {
+ echo '<a href="' . $path . '/view.php?gallery=' . $item['share_id'] . '" title="'
+ . htmlspecialchars($item['attribute_name']) . '">'
+ . '<img src="' . $path . '/img/mini.php?style=ansel_default&image='
+ . $item['attribute_default'] . '" /></a> ';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ($profile['count_blogs']):
+$path = $registry->get('webroot', 'thomas');
+?>
+<tr>
+<td class="header" colspan="2">
+<span style="float: right">
+<a href="<?php echo $path ?>/edit.php" 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 ?>/user.php?user=<?php echo $user ?>" title="<?php echo _("Others user content") ?>" ><?php echo $registry->get('name', 'thomas') ?> (<?php echo $profile['count_blogs'] ?>)</a>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($profile['count_blogs_list'] as $item_id => $item) {
+ echo ' • <a href="' . $item['link'] . '" title="'
+ . htmlspecialchars($item['description']) . '">'
+ . $item['title'] . '</a><br />';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<?php
+if ($profile['count_attendances']):
+$path = $registry->get('webroot', 'schedul');
+?>
+<tr>
+<td class="header" colspan="2">
+<span style="float: right">
+<a href="<?php echo $path ?>/add.php" 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 ?>/user.php?user=<?php echo $user ?>" title="<?php echo _("Others user content") ?>" ><?php echo $registry->get('name', 'schedul') ?> (<?php echo $profile['count_attendances'] ?>)</a>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php
+ foreach ($profile['count_attendances_list'] as $item_id => $item) {
+ echo Folks::format_datetime($item['ondate']) . ' ' . $item['city'] . ', ' . $item['place'] . ': <a href="' . $path . '/event.php?id=' . $item['id'] . '">'
+ . ' ' . $item['short'] . '</a><br />';
+ }
+ ?>
+ </td>
+</tr>
+<?php endif; ?>
+
+<tr>
+<td class="header" colspan="2">
+<?php echo _("Description") ?>
+</td>
+</tr>
+<tr>
+ <td colspan="2">
+ <?php echo $profile['user_description'] ?>
+ </td>
+</tr>
+
+<?php if (!empty($profile['activity_log'])): ?>
+<tr>
+<td class="header" colspan="2">
+<span style="float: right">
+<a href="/uporabniki/edit/activity.php" title="<?php echo _("Add your content") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/plus.png" /></a>
+<a href="/uporabniki/friends.php" title="<?php echo _("Preview") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/nav/right.png" /></a>
+</span>
+<?php echo _("Activity") ?>
+</td>
+</tr>
+<?php
+foreach ($profile['activity_log'] as $item_id => $item) {
+ echo '<tr><td colspan="2">' . Folks::format_datetime($item['activity_date']) . ' - ' . $item['activity_message'] . '</td></tr>';
+}
+?>
+<?php endif; ?>
+
+</tbody>
+</table>
+
+</td>
+
+</tr>
+
+</tbody>
+</table>
+
+<?php
+
+include FOLKS_TEMPLATES . '/user/actions.php';
+
+/**
+ * Shoud we allow comments?
+ */
+switch ($profile['user_comments']) {
+
+case 'never':
+ $allow_comments = false;
+ $comments_reason = sprintf(_("User %s does not wish to be commented."), $user);
+ break;
+
+case 'authenticated':
+ $allow_comments = Auth::isAuthenticated();
+ if ($allow_comments) {
+ if ($folks_driver->isBlacklisted($user, Auth::getAuth())) {
+ $allow_comments = false;
+ $comments_reason = sprintf(_("You are on %s blacklist."), $user);
+ }
+ } else {
+ $comments_reason = _("Only authenticated users can post comments.");
+ if ($conf['hooks']['permsdenied']) {
+ $comments_reason = Horde::callHook('_perms_hook_denied', array('folks'), 'horde', $comments_reason);
+ }
+ }
+ break;
+
+case 'friends':
+ $allow_comments = $folks_driver->isFriend($user, Auth::getAuth());
+ $comments_reason = _("Only authenticated users can post comments.");
+ break;
+
+default:
+ $allow_comments = true;
+
+ if (Auth::isAuthenticated() && $folks_driver->isBlacklisted($user, Auth::getAuth())) {
+ $allow_comments = false;
+ $comments_reason = sprintf(_("You are on %s blacklist."), $user);
+ }
+
+ break;
+}
+
+$params = array('folks', $user, 'commentCallback', true, null, null,
+ array('message_subject' => $user), $conf['comments']['comment_template']);
+
+$comments = $GLOBALS['registry']->call('forums/doComments', $params);
+
+if (!empty($comments['threads'])) {
+ echo $comments['threads'];
+}
+
+if ($allow_comments) {
+ if (!empty($comments['comments'])) {
+ echo $comments['comments'];
+ }
+} else {
+ echo $comments_reason;
+}
\ No newline at end of file
--- /dev/null
+/**
+ * $Horde: folks/themes/screen.css,v 1.1 2004/11/25 02: 22: 34 chuck Exp $
+ */
+
+.appService {
+ width: 20%;
+ border: 1px solid #eeeeee;
+ float: left;
+ padding: 5px;
+ margin: 5px;
+}
+
+.appService: hover {
+ background-color: #eeeeee;
+}
+
+.online {
+ color: green;
+ font-weight: bold;
+}
+
+.offline {
+ color: red;
+}
+
+.userMiniIcon {
+ margin: 2px;
+ width: 33px;
+ height: 33px;
+}
+
+/* Actions */
+.folksActions {
+ margin-left: 0;
+ background: #e9e9e9;
+ padding: 4px;
+ border: 1px #cccccc solid;
+}
+
+.folksActions a, .folksActions a:visited, .folksActions label {
+ text-decoration: none;
+ color: #000;
+ font-size: 90%;
+ line-height: 90%;
+ padding: 4px;
+}
+
+.folksActions a img {
+ vertical-align: middle;
+ padding-left: 2px;
+ padding-right: 2px;
+}
+
+.folksActions a:hover {
+ text-decoration: none;
+ border-left: 1px solid #fff;
+ border-top: 1px solid #fff;
+ border-right: 1px solid #000;
+ border-bottom: 1px solid #000;
+ padding: 3px;
+}
--- /dev/null
+<?php
+ /**
+ * $Id: user.php 987 2008-10-09 12:23:30Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+require_once dirname(__FILE__) . '/lib/base.php';
+
+// Load profile
+$user = Util::getFormData('user', Auth::getAuth());
+$profile = $folks_driver->getProfile($user);
+if ($profile instanceof PEAR_Error) {
+ $notification->push($profile);
+ header('Location: ' . Folks::getUrlFor('list', 'list'));
+ exit;
+}
+
+// Log user view
+$folks_driver->logView($user);
+
+// Get user activity
+if ($profile['activity_log'] == 'all' ||
+ Auth::isAuthenticated() && (
+ $profile['activity_log'] == 'authenticated' ||
+ $profile['activity_log'] == 'friends' && $folks_driver->isFriend($user, Auth::getAuth()))
+ ) {
+ $profile['activity_log'] = $folks_driver->getActivity($user);
+ if ($profile['activity_log'] instanceof PEAR_Error) {
+ $notification->push($profile);
+ $profile['activity_log'] = array();
+ }
+} else {
+ $profile['activity_log'] = array();
+}
+
+// Prepare an process activity form
+if ($user == Auth::getAuth()) {
+ require_once FOLKS_BASE . '/lib/Forms/Activity.php';
+ require_once 'Horde/Variables.php';
+ $vars = Variables::getDefaultVariables();
+ $form = new Folks_Activity_Form($vars, _("What are you doing right now?"), 'short');
+ if ($form->validate()) {
+ $result = $form->execute();
+ if ($result instanceof PEAR_Error) {
+ $notification->push($result);
+ } else {
+ $notification->push(_("Activity successfully posted"), 'horde.success');
+ header('Location: ' . Horde::applicationUrl('user.php'));
+ exit;
+ }
+ }
+}
+
+Horde::addScriptFile('stripe.js', 'horde', true);
+
+$title = sprintf(_("%s's profile"), $user);
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+switch ($profile['user_status']) {
+
+case 'inactive':
+ require FOLKS_TEMPLATES . '/user/inactive.php';
+break;
+
+case 'deleted':
+ require FOLKS_TEMPLATES . '/user/deleted.php';
+break;
+
+case 'private':
+ require FOLKS_TEMPLATES . '/user/private.php';
+break;
+
+case 'public_authenticated':
+ if (Auth::isAuthenticated()) {
+ require FOLKS_TEMPLATES . '/user/user.php';
+ } else {
+ require FOLKS_TEMPLATES . '/user/authenticated.php';
+ }
+break;
+
+case 'public_friends':
+ if ($folks_driver->isFriend($user, Auth::getAuth())) {
+ require FOLKS_TEMPLATES . '/user/user.php';
+ } else {
+ require FOLKS_TEMPLATES . '/user/friends.php';
+ }
+break;
+
+default:
+ require FOLKS_TEMPLATES . '/user/user.php';
+break;
+}
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file