예제 #1
0
 /**
  */
 protected function _content()
 {
     if (!$GLOBALS['registry']->isAuthenticated()) {
         return '';
     }
     $GLOBALS['cache'] = $GLOBALS['injector']->getInstance('Horde_Cache');
     $cache_key = 'folks_myscommetns_' . $this->_params['limit'];
     $threads = $GLOBALS['cache']->get($cache_key, $GLOBALS['conf']['cache']['default_lifetime']);
     if ($threads) {
         return $threads;
     }
     $GLOBALS['page_output']->addScriptFile('tables.js', 'horde');
     $html = '<table class="sortable striped" id="my_comment_list" style="width: 100%">' . '<thead><tr><th>' . _("Title") . '</th>' . '<th>' . _("User") . '</th></tr></thead>';
     try {
         $threads = $GLOBALS['registry']->call('forums/getThreadsByForumOwner', array($GLOBALS['registry']->getAuth(), 'message_timestamp', 1, false, 'folks', 0, $this->_params['limit']));
     } catch (Horde_Exception $e) {
         return $e->getMessage();
     }
     $url = Folks::getUrlFor('user', $GLOBALS['registry']->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;
 }
예제 #2
0
파일: login.php 프로젝트: jubinpatel/horde
function _loginNotice($user)
{
    if ($GLOBALS['prefs']->getValue('login_notify') != 1 || !$GLOBALS['registry']->hasInterface('letter')) {
        return;
    }
    require_once FOLKS_BASE . '/lib/Friends.php';
    $friends_driver = Folks_Friends::singleton();
    $friends = $friends_driver->getFriends();
    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 reminder"), 'content' => sprintf($body, $user, Folks::getUrlFor('user', $user, true))));
    $GLOBALS['registry']->callByPackage('letter', 'sendMessage', $params);
}
예제 #3
0
 /**
  */
 protected function _init()
 {
     $links = array(Folks::getUrlFor('feed', 'online', true, -1) => _("Online users"));
     if ($GLOBALS['registry']->isAuthenticated()) {
         $links[Folks::getUrlFor('feed', 'friends', true, -1)] = _("Online friends");
         $links[Folks::getUrlFor('feed', 'activity', true, -1)] = _("Friends activity");
         $links[Folks::getUrlFor('feed', 'know', true, -1)] = _("People you might know");
     }
     foreach ($links as $url => $label) {
         $GLOBALS['page_output']->addLinkTag(array('href' => $url, 'title' => $label));
     }
 }
예제 #4
0
파일: users.php 프로젝트: jubinpatel/horde
<table class="striped" style="width: 100%">
<?php 
foreach ($list as $user) {
    ?>
<tr valign="top">
<td>
<a href="<?php 
    echo Folks::getUrlFor('user', $user);
    ?>
" alt="<?php 
    echo $user;
    ?>
" title="<?php 
    echo $user;
    ?>
">
<img src="<?php 
    echo Folks::getImageUrl($user);
    ?>
" class="userMiniIcon" style="float: left" />
<strong><?php 
    echo $user;
    ?>
</strong></a><br />
<span class="small">
<?php 
    foreach ($actions as $action) {
        ?>
<a href="<?php 
        echo $action['url']->add($action['id'], $user);
        ?>
예제 #5
0
파일: mail.php 프로젝트: horde/horde
// 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'], 'UTF-8');
    $mail->addHeader('User-Agent', 'Folks' . $registry->getVersion());
    $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.
 */
예제 #6
0
<?php

/**
 * 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.horde.org/licenses/lgpl21.
 *
 * @author Duck <*****@*****.**>
 */
require_once __DIR__ . '/tabs.php';
// We are already logged
if ($registry->isAuthenticated()) {
    Folks::getUrlFor('user', $GLOBALS['registry']->getAuth())->redirect();
}
// Make sure auth backend allows passwords to be reset.
$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create();
if (!$auth->hasCapability('resetpassword')) {
    $notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error');
    throw new Horde_Exception_AuthenticationFailure();
}
$vars = Horde_Variables::getDefaultVariables();
$title = _("Reset Your Password");
$form = new Horde_Form($vars, $title);
$form->setButtons(_("Continue"));
// Get user security pass
$user = Horde_Util::getFormData('username');
if ($user) {
    $u_prefs = $injector->getInstance('Horde_Prefs')->getPrefs('horde', array('cache' => false, 'user' => $registry->convertUsername($user, true)));
    $answer = $u_prefs->getValue('security_answer');
    $question = $u_prefs->getValue('security_question');
예제 #7
0
파일: invite.php 프로젝트: jubinpatel/horde
require_once __DIR__ . '/../../lib/base.php';
require_once FOLKS_BASE . '/lib/base.php';
require_once FOLKS_BASE . '/edit/tabs.php';
$title = _("Invite friend");
// Load driver
require_once FOLKS_BASE . '/lib/Friends.php';
$friends = Folks_Friends::singleton();
// Manage adding groups
$form = new Horde_Form($vars, $title, 'invite');
$form->addVariable(_("Friend's e-mail"), 'email', 'email', true);
$v =& $form->addVariable(_("Subject"), 'subject', 'text', true);
$v->setDefault(sprintf(_("%s Invited to join %s."), ucfirst($GLOBALS['registry']->getAuth()), $registry->get('name', 'horde')));
$v =& $form->addVariable(_("Body"), 'body', 'longtext', true);
try {
    $body = Horde::loadConfiguration('invite.php', 'body', 'folks');
    $body = sprintf($body, $registry->get('name', 'horde'), Folks::getUrlFor('user', $GLOBALS['registry']->getAuth(), true), Horde::url('account/signup.php', true), $GLOBALS['registry']->getAuth());
} catch (Horde_Exception $e) {
    $body = $body->getMessage();
}
$v->setDefault($body);
if ($form->validate()) {
    $form->getInfo(null, $info);
    $result = Folks::sendMail($info['email'], $info['subject'], $info['body']);
    if ($result instanceof PEAR_Error) {
        $notification->push($result);
    } else {
        $notification->push(sprintf(_("Friend \"%s\" was invited to join %s."), $info['email'], $registry->get('name', 'horde')), 'horde.success');
    }
}
$page_output->header(array('title' => $title));
require FOLKS_TEMPLATES . '/menu.inc';
예제 #8
0
파일: list.php 프로젝트: jubinpatel/horde
if ($count instanceof PEAR_Error) {
    $notification->push($count);
    $count = 0;
}
if (($sort_by = Horde_Util::getFormData('sort_by')) !== null) {
    $prefs->setValue('sort_by', $sort_by);
} else {
    $sort_by = $prefs->getValue('sort_by');
}
if (($sort_dir = Horde_Util::getFormData('sort_dir')) !== null) {
    $prefs->setValue('sort_dir', $sort_dir);
} else {
    $sort_dir = $prefs->getValue('sort_dir');
}
$page = Horde_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 = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => $count, 'url' => 'list.php', 'perpage' => $perpage));
$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'list');
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
require FOLKS_TEMPLATES . '/list/list.php';
$page_output->footer();
예제 #9
0
?>
</generator>
<?php 
foreach ($firendActivities as $activity_date => $activity) {
    ?>
   <item>
    <title><?php 
    echo htmlspecialchars($activity['user']);
    ?>
</title>
    <description><?php 
    echo htmlspecialchars(strip_tags($activity['message']));
    ?>
</description>
    <link><?php 
    echo Folks::getUrlFor('user', $activity['user'], true);
    ?>
</link>
    <author><?php 
    echo $activity['user'];
    ?>
</author>
    <pubDate><?php 
    echo htmlspecialchars(date('r'), $activity_date);
    ?>
</pubDate>
  </item>
  <?php 
}
?>
 </channel>
예제 #10
0
echo Horde::url('report.php')->add('user', $user);
?>
" title="<?php 
echo _("Report user");
?>
">
<?php 
echo Horde::img('problem.png');
?>
 <?php 
echo _("Report");
?>
</a>

<a href="<?php 
echo Folks::getUrlFor('list', 'list');
?>
" title="<?php 
echo _("User list");
?>
">
<?php 
echo Horde::img('group.png');
?>
 <?php 
echo _("Users");
?>
</a>

</div>
예제 #11
0
<table id="activities" class="striped"  style="width: 100%">
<tbody>
<?php 
foreach ($list as $activity_date => $activity) {
    echo '<tr>' . '<td><a href="' . Folks::getUrlFor('user', $activity['user_uid']) . '">' . '<img src="' . Folks::getImageUrl($activity['user_uid']) . '" class="userMiniIcon" style="float: left" /> ' . $activity['user_uid'] . '</a> - <span class="small">' . Folks::format_datetime($activity_date) . '</span>' . '<br />' . $activity['activity_message'] . '<br />' . '</td></tr>';
}
?>
</tbody>
</table>
예제 #12
0
파일: online.php 프로젝트: jubinpatel/horde
<?php

/**
 * 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.horde.org/licenses/gpl.
 *
 * @author Duck <*****@*****.**>
 * @package Folks
 */
$folks_authentication = 'none';
require_once __DIR__ . '/../lib/base.php';
$users = $folks_driver->getOnlineUsers();
if ($users instanceof PEAR_Error) {
    $users = array();
} else {
    $users = array_flip($users);
}
$title = _("Online users");
$link = Folks::getUrlFor('list', 'online', true);
$rss_link = Horde::url('rss/online.php', true);
require FOLKS_TEMPLATES . '/feed/feed.php';
예제 #13
0
파일: report.php 프로젝트: horde/horde
}
$title = _("Do you really want to report this user?");
$vars = Horde_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 = Horde_Util::getFormData('id');
if ($form->validate()) {
    if (Horde_Util::getFormData('submitbutton') == _("Report")) {
        $body = _("User") . ': ' . $user . "\n" . _("Report type") . ': ' . $enum[$vars->get('type')] . "\n" . _("Report reason") . ': ' . $vars->get('reason') . "\n" . Folks::getUrlFor('user', $user);
        require FOLKS_BASE . '/lib/Notification.php';
        $rn = new Folks_Notification();
        $result = $rn->notifyAdmins($title, $body);
        if ($result instanceof 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');
    }
    Folks::getUrlFor('user', $user)->redirect();
}
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, null, null, 'post');
$page_output->footer();
예제 #14
0
파일: add.php 프로젝트: jubinpatel/horde
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');
            Horde::url('edit/friends/index.php')->redirect();
        }
    } else {
        $result = $friends->addFriend($user);
        if ($result instanceof PEAR_Error) {
            $notification->push($result);
        } elseif ($friends->needsApproval($user)) {
            $title = sprintf(_("%s added you as a friend on %s"), $GLOBALS['registry']->getAuth(), $GLOBALS['registry']->get('name', 'horde'));
            $body = sprintf(_("User %s added you to his firends list on %s. \nTo approve, go to: %s \nTo reject, go to: %s \nTo see to his profile, go to: %s \n"), $GLOBALS['registry']->getAuth(), $registry->get('name', 'horde'), Horde::url('edit/friends/approve.php', true, -1)->add('user', $GLOBALS['registry']->getAuth()), Horde::url('edit/friends/reject.php', true, -1)->add('user', $GLOBALS['registry']->getAuth()), Folks::getUrlFor('user', $GLOBALS['registry']->getAuth(), true, -1));
            $result = $friends->sendNotification($user, $title, $body);
            if ($result instanceof PEAR_Error) {
                $notification->push($result);
            } else {
                $notification->push(sprintf(_("A confirmation was send to \"%s\"."), $user), 'horde.warning');
            }
            Horde::url('edit/friends/index.php')->redirect();
        } else {
            $notification->push(sprintf(_("User \"%s\" was added as your friend."), $user), 'horde.success');
            Horde::url('edit/friends/index.php')->redirect();
        }
    }
}
$friend_form = new Folks_AddFriend_Form($vars, _("Add or remove user"), 'blacklist');
$page_output->addScriptFile('tables.js', 'horde');
예제 #15
0
파일: feed.php 프로젝트: jubinpatel/horde
?>
</generator>
<?php 
foreach ($users as $user) {
    ?>
   <item>
    <title><?php 
    echo htmlspecialchars($user);
    ?>
</title>
    <description><![CDATA[ <?php 
    echo '<img src="' . Folks::getImageUrl($user, 'small', true) . '" />';
    ?>
 ]]></description>
    <link><?php 
    echo Folks::getUrlFor('user', $user, true);
    ?>
</link>
    <author><?php 
    echo $user;
    ?>
</author>
  </item>
  <?php 
}
?>
 </channel>
</rss>


예제 #16
0
파일: user.php 프로젝트: jubinpatel/horde
</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 
}
?>

<?php 
if ($profile['count_classifieds']) {
    $path = $registry->get('webroot', 'classifieds');
    ?>
<tr>
<td class="header" colspan="2">
<span style="float: right">
예제 #17
0
파일: list.php 프로젝트: jubinpatel/horde
            echo Horde::link($list_url->add('sort_dir', $criteria['sort_dir'] == 'DESC' ? 'ASC' : 'DESC'), $val['text'], null, null, null, $val['text']);
            echo Horde::img($sortImg, $sortText) . '</a>&nbsp;';
        }
        echo Horde::widget(array('url' => $list_url->add('sort_by', $key), 'title' => $val['text']));
        echo '</th>';
    }
    ?>
</tr>
</thead>
<?php 
    foreach ($users as $user) {
        ?>
<tr>
    <td style="text-align: center">
        <a href="<?php 
        echo Folks::getUrlFor('user', $user['user_uid']);
        ?>
">
        <img src="<?php 
        echo Folks::getImageUrl($user['user_uid']);
        ?>
" class="userMiniIcon" />
        <?php 
        echo $user['user_uid'];
        ?>
</a>
    </td>
    <td><?php 
        if ($user['user_gender']) {
            echo $user['user_gender'] == 1 ? _("Male") : _("Female");
        }
예제 #18
0
파일: online.php 프로젝트: jubinpatel/horde
if ($count instanceof PEAR_Error) {
    $notification->push($count);
    $count = 0;
}
if (($sort_by = Horde_Util::getFormData('sort_by')) !== null) {
    $prefs->setValue('sort_by', $sort_by);
} else {
    $sort_by = $prefs->getValue('sort_by');
}
if (($sort_dir = Horde_Util::getFormData('sort_dir')) !== null) {
    $prefs->setValue('sort_dir', $sort_dir);
} else {
    $sort_dir = $prefs->getValue('sort_dir');
}
$page = Horde_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 = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => $count, 'url' => 'online.php', 'perpage' => $perpage));
$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'online');
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
require FOLKS_TEMPLATES . '/list/list.php';
$page_output->footer();
예제 #19
0
$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']] = $activity;
    }
}
krsort($firendActivities);
$firendActivities = array_slice($firendActivities, 0, 30);
// Own activities
$activities = $folks_driver->getActivity($GLOBALS['registry']->getAuth());
if ($activities instanceof PEAR_Error) {
    $notification->push($activities);
    Folks::getUrlFor('list', 'list')->redirect();
}
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
require FOLKS_TEMPLATES . '/friends/friends.php';
$page_output->footer();
예제 #20
0
파일: Api.php 프로젝트: jubinpatel/horde
 /**
  * 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.
  */
 public function listTimeObjects($categories, $start, $end)
 {
     require_once __DIR__ . '/base.php';
     require_once FOLKS_BASE . '/lib/Friends.php';
     $friends_driver = Folks_Friends::singleton('sql');
     $friends = $friends_driver->getFriends();
     if ($friends instanceof PEAR_Error) {
         return array();
     }
     $objects = array();
     foreach ($friends as $friend) {
         $user = $GLOBALS['folks_driver']->getProfile($friend);
         if ($user instanceof PEAR_Error) {
             continue;
         }
         $user['user_birthday'] = date('Y') . substr($user['user_birthday'], 4);
         $born = strtotime($user['user_birthday']);
         if ($born === false || $born < $start->timestamp() || $born > $end->timestamp()) {
             continue;
         }
         $age = Folks::calcAge($user['user_birthday']);
         $desc = $age['age'] . ' (' . $age['sign'] . ')';
         $objects[$friend] = array('title' => $friend, 'description' => $desc, 'id' => $friend, 'start' => date('Y-m-d\\TH:i:s', $born), 'end' => date('Y-m-d\\TH:i:s', $born + 1), 'params' => array('user' => $friend), 'link' => Folks::getUrlFor('user', $friend, true));
     }
     return $objects;
 }
예제 #21
0
if ($count instanceof PEAR_Error) {
    $notification->push($count);
    $count = 0;
}
if (($sort_by = Horde_Util::getFormData('sort_by')) !== null) {
    $prefs->setValue('sort_by', $sort_by);
} else {
    $sort_by = $prefs->getValue('sort_by');
}
if (($sort_dir = Horde_Util::getFormData('sort_dir')) !== null) {
    $prefs->setValue('sort_dir', $sort_dir);
} else {
    $sort_dir = $prefs->getValue('sort_dir');
}
$page = Horde_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 = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => $count, 'url' => 'birthday.php', 'perpage' => $perpage));
$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'birthday');
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
require FOLKS_TEMPLATES . '/list/list.php';
$page_output->footer();
예제 #22
0
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Duck <*****@*****.**>
 * @package Folks
 */
require_once __DIR__ . '/../../lib/base.php';
require_once FOLKS_BASE . '/lib/Friends.php';
if (!$registry->isAuthenticated()) {
    throw new Horde_Exception_AuthenticationFailure();
}
$user = Horde_Util::getGet('user');
if (empty($user)) {
    $notification->push(_("You must supply a username."));
    Horde::url('edit/friends/index.php')->redirect();
}
$friends = Folks_Friends::singleton();
$result = $friends->approveFriend($user);
if ($result instanceof PEAR_Error) {
    $notification->push($result);
    $notification->push($result->getDebugInfo());
    Horde::url('edit/friends/index.php')->redirect();
}
$notification->push(sprintf(_("User \"%s\" was confirmed as a friend."), $user), 'horde.success');
$title = sprintf(_("%s approved you as a friend on %s"), $GLOBALS['registry']->getAuth(), $registry->get('name', 'horde'));
$body = sprintf(_("User %s confirmed you as a friend on %s.. \nTo see to his profile, go to: %s \n"), $GLOBALS['registry']->getAuth(), $registry->get('name', 'horde'), Folks::getUrlFor('user', $GLOBALS['registry']->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));
Horde::url('edit/friends/index.php')->redirect();
예제 #23
0
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Duck <*****@*****.**>
 * @package Folks
 */
require_once __DIR__ . '/lib/base.php';
$title = _("Activity");
$count = $folks_driver->countUsers();
if ($count instanceof PEAR_Error) {
    $notification->push($count);
    $count = 0;
}
$page = Horde_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 = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => $count, 'url' => 'activity.php', 'perpage' => $perpage));
$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'activity');
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
require FOLKS_TEMPLATES . '/list/list.php';
$page_output->footer();
예제 #24
0
파일: header.php 프로젝트: jubinpatel/horde
?>
"><?php 
echo _("Online users");
?>
</a></td></tr>
<tr><td><a href="<?php 
echo Folks::getUrlFor('feed', 'friends');
?>
"><?php 
echo _("Online friends");
?>
</a></td></tr>
<tr><td><a href="<?php 
echo Folks::getUrlFor('feed', 'activity');
?>
"><?php 
echo _("Friends activity");
?>
</a></td></tr>
<tr><td><a href="<?php 
echo Folks::getUrlFor('feed', 'know');
?>
"><?php 
echo _("People you might know");
?>
</a></td></tr>
</table>

</td>
<td>
예제 #25
0
파일: groups.php 프로젝트: jubinpatel/horde
echo _("Group");
?>
</th>
    <th><?php 
echo _("Owner");
?>
</th>
    <th colsan="3"><?php 
echo _("Action");
?>
</th>
</tr>
</thead>
<tbody>
<?php 
foreach ($groups as $group_id => $group_name) {
    echo '<tr><td>' . $group_name . '</td>';
    $owner = $friends->getGroupOwner($group_id);
    echo '<td style="text-align: center"><a href="' . Folks::getUrlFor('user', $owner) . '"><img src="' . Folks::getImageUrl($owner) . '" class="userMiniIcon" /><br />' . $owner . '</a></td>';
    echo '<td><a href="' . $members_url->add('g', $group_id) . '">' . $members_img . ' ' . _("Members") . '</a></td>';
    if ($friends->hasCapability('groups_add')) {
        echo '<td><a href="' . $edit_url->add('g', $group_id) . '">' . $edit_img . ' ' . _("Rename") . '</a></td>';
        echo '<td><a href="#" onclick="if (confirm(\'' . _("Do you really want to delete this group?") . '\')) {window.location=\'' . $remove_url->add('g', $group_id) . '\'}">' . $remove_img . ' ' . _("Delete") . '</a></td>';
        echo '<td><a href="#" onclick="' . Horde::popupJs($perms_url, array('params' => array('cid' => $group_id), 'urlencode' => true)) . '">' . $perms_img . ' ' . _("Permissions") . '</a></td>';
    }
    echo '</tr>';
}
?>
</tbody>
</table>
예제 #26
0
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Duck <*****@*****.**>
 * @package Folks
 */
require_once __DIR__ . '/lib/base.php';
$title = _("Popularity");
$count = $folks_driver->countUsers();
if ($count instanceof PEAR_Error) {
    $notification->push($count);
    $count = 0;
}
$page = Horde_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 = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => $count, 'url' => 'popularity.php', 'perpage' => $perpage));
$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'popularity');
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
$page_output->footer();
$notification->notify(array('listeners' => 'status'));
require FOLKS_TEMPLATES . '/list/list.php';
예제 #27
0
?>
</th>
    <th><?php 
echo _("Action");
?>
</th>
</tr>
</thead>
<tbody>
<?php 
foreach ($list as $user) {
    ?>
<tr>
    <td style="text-align: center">
        <?php 
    echo '<a href="' . Folks::getUrlFor('user', $user) . '">' . '<img src="' . Folks::getImageUrl($user) . '" class="userMiniIcon" /><br />' . $user;
    ?>
</a>
    </td>
    <td>
    <?php 
    if ($folks_driver->isOnline($user)) {
        echo '<span class="online">' . _("Online") . '</span>';
    } else {
        echo '<span class="offline">' . _("Offline") . '</span>';
    }
    ?>
    </td>
    <?php 
    foreach ($actions as $action) {
        echo '<td>';