Adds IOdef data from this ticket to the document

@param object $ticket Ticket model
@param string $token ASH token
@param string $ashUrl ASH Url
775509
private function addIodefObject($ticket, $token, $ashUrl)
    {
        // Add report type, origin and date
        $incident = new Iodef\Elements\Incident();
        $incident->setAttributes(
            [
                'purpose' => 'reporting'
            ]
        );

        // Add ASH Link
        $ashlink = new Iodef\Elements\AdditionalData;
        $ashlink->setAttributes(
            [
                'dtype'       => 'string',
                'meaning'     => 'ASH Link',
                'restriction' => 'private',
            ]
        );
        $ashlink->value = $ashUrl . $token;
        $incident->addChild($ashlink);

        // Add ASH Token seperatly
        $ashtoken = new Iodef\Elements\AdditionalData;
        $ashtoken->setAttributes(
            [
                'dtype'       => 'string',
                'meaning'     => 'ASH Token',
                'restriction' => 'private',
            ]
        );
        $ashtoken->value = $token;
        $incident->addChild($ashtoken);

        // Add AbuseDesk Status seperatly
        $ticketStatus = new Iodef\Elements\AdditionalData;
        $ticketStatus->setAttributes(
            [
                'dtype'       => 'string',
                'meaning'     => 'Ticket status',
                'restriction' => 'private',
            ]
        );

        $ticketStatus->value = $ticket->status_id;
        $incident->addChild($ticketStatus);

        // Add Contact Status seperatly
        $contactStatus = new Iodef\Elements\AdditionalData;
        $contactStatus->setAttributes(
            [
                'dtype'       => 'string',
                'meaning'     => 'Contact status',
                'restriction' => 'private',
            ]
        );
        $contactStatus->value = $ticket->contact_status_id;
        $incident->addChild($contactStatus);

        // Add SourceID seperatly
        $sourceID = new Iodef\Elements\AdditionalData;
        $sourceID->setAttributes(
            [
                'dtype'       => 'string',
                'meaning'     => 'SourceID',
                'restriction' => 'private',
            ]
        );
        $sourceID->value = config('app.id');
        $incident->addChild($sourceID);

        // Add Incident data
        $incidentID = new Iodef\Elements\IncidentID();
        $incidentID->setAttributes(
            [
                'name'        => 'https://myhost.isp.local/api/',
                'restriction' => 'need-to-know',
            ]
        );
        $incidentID->value($ticket->id);
        $incident->addChild($incidentID);

        $reportTime = new Iodef\Elements\ReportTime();
        $reportTime->value(date('Y-m-d\TH:i:sP'));
        $incident->addChild($reportTime);

        // Add ticket abuse classification and type
        $assessment = new Iodef\Elements\Assessment();
        $impact = new Iodef\Elements\Impact();
        $severity = [
            'INFO'       => 'low',
            'ABUSE'      => 'medium',
            'ESCALATION' => 'high',
        ];
        echo $ticket->class;
        $impact->setAttributes(
            [
                'type'     => 'ext-value',
                'ext-type' => $ticket->class_id,
                'severity' => $severity[$ticket->type_id],
            ]
        );
        $assessment->addChild($impact);
        $incident->addChild($assessment);

        // Add Origin/Creator contact information for this ticket
        $contact = new Iodef\Elements\Contact();
        $contact->setAttributes(
            [
                'role'        => 'creator',
                'type'        => 'ext-value',
                'ext-type'    => 'Software',
                'restriction' => 'need-to-know',
            ]
        );

        $contactName = new Iodef\Elements\ContactName();
        $contactName->value('AbuseIO downstream provider');
        $contact->addChild($contactName);

        $email = new Iodef\Elements\Email();
        $email->value('notifier@abuse.io');
        $contact->addChild($email);

        $incident->addChild($contact);

        // Add Abusedesk contact information for this ticket
        $contact = new Iodef\Elements\Contact();
        $contact->setAttributes(
            [
                'role'        => 'irt',
                'type'        => 'organization',
                'restriction' => 'need-to-know',
            ]
        );

        $contactName = new Iodef\Elements\ContactName();
        $contactName->value(config('main.notifications.from_name'));
        $contact->addChild($contactName);

        $email = new Iodef\Elements\Email();
        $email->value(config('main.notifications.from_address'));
        $contact->addChild($email);

        $incident->addChild($contact);

        // Add ticket events as records
        if ($ticket->events->count() >= 1) {
            foreach ($ticket->events as $event) {
                $eventData = new Iodef\Elements\EventData();

                // Add the IP and Domain data to each record
                $flow = new Iodef\Elements\Flow;

                $system = new Iodef\Elements\System;
                $system->setAttributes(
                    [
                        'category' => 'source',
                        'spoofed'  => 'no'
                    ]
                );

                $node = new Iodef\Elements\Node;

                if (!empty($ticket->ip)) {
                    $address = new Iodef\Elements\Address;
                    $category = [];
                    if (filter_var($ticket->ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
                        $category['category'] = 'ipv4-addr';
                    } elseif (filter_var($ticket->ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
                        $category['category'] = 'ipv6-addr';
                    } else {
                        $category['category']     = 'ext-value';
                        $category['ext-category'] = 'unknown';

                    }

                    $address->setAttributes($category);
                    $address->value = $ticket->ip;

                    $node->addChild($address);

                }

                if (!empty($ticket->domain)) {
                    $domain = new Iodef\Elements\NodeName;
                    $domain->value = $ticket->domain;

                    $node->addChild($domain);
                }

                $system->addChild($node);
                $flow->addChild($system);
                $eventData->addChild($flow);


                // Now actually add event data
                $record = new Iodef\Elements\Record;
                $record->setAttributes(['restriction' => 'need-to-know']);

                $recordData = new Iodef\Elements\RecordData;

                $recordDateTime = new Iodef\Elements\DateTime;
                $recordDateTime->value = date('Y-m-d\TH:i:sP', $event->timestamp);
                $recordData->addChild($recordDateTime);

                $recordDescription = new Iodef\Elements\Description;
                $recordDescription->value = "Source:{$event->source}";
                $recordData->addChild($recordDescription);

                $recordItem = new Iodef\Elements\RecordItem;
                $recordItem->setAttributes(
                    [
                        'dtype'     => 'ext-value',
                        'ext-dtype' => 'json',
                    ]
                );
                $recordItem->value = $event->information;
                $recordData->addChild($recordItem);

                $record->addChild($recordData);

                $eventData->addChild($record);

                $incident->addChild($eventData);
            }
        }

        // Add ticket notes as history items
        if ($ticket->notes->count() >= 1) {
            $history = new Iodef\Elements\History;

            $elementCounter = 0;
            foreach ($ticket->notes as $note) {
                if ($note->hidden == true) {
                    continue;
                }

                $historyItem = new Iodef\Elements\HistoryItem;
                $historyItem->setAttributes(
                    [
                        'action'      => 'status-new-info',
                        'restriction' => 'need-to-know'
                    ]
                );

                $historyDateTime = new Iodef\Elements\DateTime;
                $historyDateTime->value = date('Y-m-d\TH:i:sP', strtotime($note->created_at));
                $historyItem->addChild($historyDateTime);

                $historySubmitter = new Iodef\Elements\AdditionalData;
                $historySubmitter->setAttributes(
                    [
                        'meaning' => 'submitter',
                    ]
                );
                $historySubmitter->value = "{$note->submitter}";
                $historyItem->addChild($historySubmitter);

                $historyNote = new Iodef\Elements\AdditionalData;
                $historyNote->setAttributes(
                    [
                        'meaning' => 'text',
                    ]
                );

                if(empty(trim($note->text))) {
                    $historyNote->value = false;
                } else {
                    $historyNote->value = "{$note->text}";
                }
                $historyItem->addChild($historyNote);

                $history->addChild($historyItem);
            }

            if($elementCounter >= 1) {
                $incident->addChild($history);
            }
        }

        // Add incident to the document
        $this->iodefDocument->addChild($incident);
    }
738407
public static function get_component_token($component_appid,$component_appsecret,$component_verify_ticket){

        $url= self::COMPONENT_TOKEN_URI;

        $data = [
            'component_appid'    => $component_appid,
            'component_appsecret'=> $component_appsecret,
            'component_verify_ticket' => $component_verify_ticket

        ];
        $json_data = json_encode($data);
        return static::parsePostJson($url, urldecode($json_data));
    }
537666
private function setTicket($request)
	{
		$ticket = array(
				'id' => $request['ticket'],
				'create_at' => $request['create_at'],
				'expire_time' => $request['expire_time'],
				'check_at' => $request['check_at']
			);
		$this->setCookie($ticket);
		$userInfo = $this->chanslate_add_to_empty($request['user']);
		$userInfo = $this->decrypt($userInfo);
		$userInfo = $this->chanslate_json_to_array($userInfo);
		$this->setSession($ticket,$userInfo);
	}
285906
private function ConsumeToken3( $token, $anchor, $length )
	{
		$this->ConsumeToken4( $token, null, $anchor, $length );
	}
1074431
@DeleteOperation
    public void deleteToken(@Selector final String ticketId) {
        val ticket = getToken(ticketId);
        if (ticket != null) {
            ticketRegistry.deleteTicket(ticketId);
        }
    }
211038
public function add($request) {
		$tickets = $this->registration->Event()->getAvailableTickets();
		$form = $this->AttendeeForm();
		// check tickets are actually available
		if (!$tickets->count()) {
			return $this->redirect($this->BackURL);
		}
		$formHasData = $form->hasSessionData();

		$attendee = $this->createAttendee();
		// ticket selection in url
		$ticket = $tickets->byID((int)$request->param('ID'));
		if($ticket && !$ticket->exists()){
			$attendee->TicketID = $ticket->ID;
			$form->setAllowedTickets(
				$this->registration->Event()->getAvailableTickets()
			);
		}
		
		// ticket is always required
		if($ticket) {
			$form->loadDataFrom(array(
				"TicketID" => $ticket->ID
			));
		}else{
			$form->setAllowedTickets(
				$this->registration->Event()->getAvailableTickets()
			);
		}
		if(!$formHasData){
			// load any default data
			$form->loadDataFrom($attendee);
			// automatically populate from previous attendee
			$this->populatePreviousData($form);
		}
		$this->extend("onAdd", $form, $this->registration);
		return array(
			'Title' => $ticket ? $ticket->Title : null,
			'Form' => $form
		);
	}
632467
def acquire_auth_token_ticket(self, headers=None):
        '''
        
        '''
        logging.debug('[CAS] Acquiring Auth token ticket')
        url = self._get_auth_token_tickets_url()
        text = self._perform_post(url, headers=headers)
        auth_token_ticket = json.loads(text)['ticket']
        logging.debug('[CAS] Acquire Auth token ticket: {}'.format(
            auth_token_ticket))
        return auth_token_ticket
916421
def ticket_form_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/ticket_forms.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
163160
protected function addTokenToPage(\Zend_Pdf_Page $page, $tokenId)
    {
        // Set $this->pageFont to false to prevent drawing of tokens on page.
        if ($this->pageFont) {
            $font = \Zend_Pdf_Font::fontWithName($this->pageFont);

            if ($this->pageXfromLeft) {
                $x = $this->pageX;
            } else {
                $x = $page->getWidth() - $this->pageX;
            }
            if ($this->pageYfromTop) {
                $y = $page->getHeight() - $this->pageY;
            } else {
                $y = $this->pageY;
            }

            $page->setFont($font, $this->pageFontSize);
            $page->drawText(strtoupper($tokenId), $x, $y, 'UTF-8');
        }
    }
1258839
public function user(string $ticket, bool $needPoi = false)
    {
        $params = [
            'ticket' => $ticket,
        ];

        if ($needPoi) {
            $params['need_poi'] = 1;
        }

        return $this->httpPostJson('shakearound/user/getshakeinfo', $params);
    }
982309
public static TicketCheckResult ticketCheck(String accessToken, String ticket) {
        HttpUriRequest httpUriRequest = RequestBuilder.post()
                .setHeader(jsonHeader)
                .setUri(BASE_URI + "/scan/scanticket/check")
                .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(accessToken))
                .addParameter("ticket", ticket)
                .build();
        return LocalHttpClient.executeJsonResult(httpUriRequest,
                TicketCheckResult.class);
    }
896150
public static BaseResult clearTicketCheck(String accessToken, TicketCheck ticketCheck) {
        return clearTicketCheck(accessToken, JsonUtil.toJSONString(ticketCheck));
    }
948028
def ticket_field_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/ticket_fields.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
317224
public function showqrcode_url($ticket = '')
    {
        if (!is_string($ticket) || $ticket == '') {
            $this->setError('参数错误');

            return false;
        }

        $url = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . $ticket;

        return $url;
    }
209213
def ticket_field_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/ticket_fields/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
416330
def create_ticket
      post_param = { username: @username, realm: @realm, password: @password }
      @site['access/ticket'].post post_param do |response, _request, _result, &_block|
        if response.code == 200
          extract_ticket response
        else
          @connection_status = 'error'
        end
      end
    end
840677
def ticket_macro_apply(self, ticket_id, id, **kwargs):
        ""
        api_path = "/api/v2/tickets/{ticket_id}/macros/{id}/apply.json"
        api_path = api_path.format(ticket_id=ticket_id, id=id)
        return self.call(api_path, **kwargs)