コード例 #1
0
 /**
  * Checks whether the given user email address is assigned to the given
  * issue ID.
  *
  * @access  public
  * @param   resource $rpc_conn The connection resource
  * @param   array $auth Array of authentication information (email, password)
  * @param   integer $issue_id The issue ID
  */
 function checkIssueAssignment(&$rpc_conn, $auth, $issue_id)
 {
     // check if the confirmation message was already displayed
     if (!$GLOBALS['_displayed_confirmation']) {
         // check if the current user is allowed to change the given issue
         $msg = new XML_RPC_Message("mayChangeIssue", array(new XML_RPC_Value($auth[0], 'string'), new XML_RPC_Value($auth[1], 'string'), new XML_RPC_Value($issue_id, 'int')));
         $result = $rpc_conn->send($msg);
         if ($result->faultCode()) {
             Command_Line::quit($result->faultString());
         }
         $may_change_issue = XML_RPC_decode($result->value());
         // if not, show confirmation message
         if ($may_change_issue != 'yes') {
             echo "WARNING: You are not currently assigned to issue #{$issue_id}.\n";
             Command_Line::promptConfirmation($rpc_conn, $auth, $issue_id, false);
         }
     }
 }
コード例 #2
0
ファイル: eventum.php プロジェクト: korusdipl/eventum
if (in_array('--debug', $argv)) {
    $client->setDebug(true);
    $debug = true;
    unset($argv[array_search('--debug', $argv)]);
} else {
    $debug = false;
}
$auth = array($user_email, $user_password);
$issue_id = (int) $argv[1];
try {
    if ($issue_id > 0) {
        if (count($argv) == 2) {
            Command_Line::printIssueDetails($client, $auth, $issue_id);
        } else {
            if ($should_confirm) {
                Command_Line::promptConfirmation($client, $auth, $issue_id, @$argv);
            }
            switch ($argv[2]) {
                case 'assign':
                    if (count($argv) == 3) {
                        Command_Line::quit('Missing parameter for the developer');
                    }
                    Command_Line::assignIssue($client, $auth, $issue_id, $argv[3]);
                    break;
                case 'take':
                    Command_Line::takeIssue($client, $auth, $issue_id);
                    break;
                case 'add-replier':
                case 'ar':
                    // adds a user to the list of authorized repliers
                    if (count($argv) == 3) {