コード例 #1
0
ファイル: admin.php プロジェクト: negram/flyspray
 /**
  * area_user
  *
  * @access public
  * @return void
  */
 function area_user()
 {
     global $db, $page;
     $id = Flyspray::ValidUserId(Req::val('user_id'));
     $theuser = new User($id);
     if ($theuser->isAnon()) {
         FlysprayDo::error(array(ERROR_INPUT, L('error5')));
     }
     $page->assign('all_groups', Flyspray::listallGroups($theuser->id));
     $page->assign('groups', Flyspray::listGroups());
     $page->assign('theuser', $theuser);
 }
コード例 #2
0
ファイル: class.backend.php プロジェクト: canneverbe/flyspray
 /**
  * Adds a reminder to a task
  * @param integer $task_id
  * @param string $message
  * @param integer $how_often send a reminder every ~ seconds
  * @param integer $start_time time when the reminder starts
  * @param $user_id the user who is reminded. by default (null) all users assigned to the task are reminded.
  * @access public
  * @return bool
  * @version 1.0
  */
 public static function add_reminder($task_id, $message, $how_often, $start_time, $user_id = null)
 {
     global $user, $db;
     $task = Flyspray::GetTaskDetails($task_id);
     if (!$user->perms('manage_project', $task['project_id'])) {
         return false;
     }
     if (is_null($user_id)) {
         // Get all users assigned to a task
         $user_id = Flyspray::GetAssignees($task_id);
     } else {
         $user_id = array(Flyspray::ValidUserId($user_id));
         if (!reset($user_id)) {
             return false;
         }
     }
     foreach ($user_id as $id) {
         $sql = $db->Replace('{reminders}', array('task_id' => $task_id, 'to_user_id' => $id, 'from_user_id' => $user->id, 'start_time' => $start_time, 'how_often' => $how_often, 'reminder_message' => $message), array('task_id', 'to_user_id', 'how_often', 'reminder_message'));
         if (!$sql) {
             // query has failed :(
             return false;
         }
     }
     // 2 = no record has found and was INSERT'ed correclty
     if (isset($sql) && $sql == 2) {
         Flyspray::logEvent($task_id, 17, $task_id);
     }
     return true;
 }
コード例 #3
0
ファイル: class.flyspray.php プロジェクト: heptalium/flyspray
 /**
  * Tries to determine a user ID from a user name. If the
  * user name does not exist, it assumes an user ID as input.     
  * @param mixed $user (string or int)
  * @access public static
  * @return integer 0 if the user does not exist
  * @version 1.0
  */
 function UserNameOrId($user)
 {
     $val = Flyspray::UserNameToId($user);
     return $val ? $val : Flyspray::ValidUserId($user);
 }
コード例 #4
0
ファイル: user.php プロジェクト: canneverbe/flyspray
<?php

/*********************************************************\
  | View a user's profile                                   |
  | ~~~~~~~~~~~~~~~~~~~~                                    |
  \*********************************************************/
if (!defined('IN_FS')) {
    die('Do not access this file directly.');
}
$page->assign('groups', Flyspray::ListGroups());
if ($proj->id) {
    $page->assign('project_groups', Flyspray::ListGroups($proj->id));
}
$id = Flyspray::ValidUserId(Get::val('id', Get::val('uid')));
if (!$id) {
    $id = Flyspray::UserNameToId(Get::val('user_name'));
}
$theuser = new User($id);
if ($theuser->isAnon()) {
    Flyspray::show_error(19);
}
// Some possibly interesting information about the user
$sql = $db->Query('SELECT count(*) FROM {comments} WHERE user_id = ?', array($theuser->id));
$page->assign('comments', $db->fetchOne($sql));
$sql = $db->Query('SELECT count(*) FROM {tasks} WHERE opened_by = ?', array($theuser->id));
$page->assign('tasks', $db->fetchOne($sql));
$sql = $db->Query('SELECT count(*) FROM {assigned} WHERE user_id = ?', array($theuser->id));
$page->assign('assigned', $db->fetchOne($sql));
$page->assign('theuser', $theuser);
$page->setTitle($fs->prefs['page_title'] . L('viewprofile'));
$page->pushTpl('profile.tpl');
コード例 #5
0
ファイル: user.php プロジェクト: negram/flyspray
 function is_accessible()
 {
     $id = Flyspray::ValidUserId(Get::val('id', Get::val('uid')));
     $this->user = new User($id);
     return !$this->user->isAnon();
 }