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
Url
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/2/root/app/RestTrush/Url/Add.php
<?php /** * Copyright (c) Jan Pospisil (http://www.jan-pospisil.cz) */ namespace Rest\Url; use Application\PermissionControl; use Nette\Database\Context; use RestServer\Exceptions\BadRequestException; use RestServer\IPresenter; use RestServer\IParametrs; use RestServer\Response; use RestServer\Exceptions\MissingRequiredParameterException; /** * Add new url * @param ( * name = url, * type = string, * required = 1 * ) * @param ( * name = path, * type = string, * required = 1 * ) * @param ( * requires = 1, * name = api_key, * type = string * ) * @author Jan Pospisil */ 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; } public function run(IParametrs $parameters, Response $response) { //$this->permissionControl->checkAccess('url', 'create'); $url = $parameters->post('url'); $path = $parameters->post('path'); $update = $parameters->post('update'); if(!$url) throw new MissingRequiredParameterException('Parameter url is required.'); if(!$path) throw new MissingRequiredParameterException('Parameter path 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.'); try{ $entry = array( 'path' => $path, 'url' => trim($url, '/'), 'priority' => '0.64', 'change_frequency' => 'weekly' ); if($update){ $row = $this->connection->table('url')->where('path', $path); if($row) $row->update($entry); } $this->connection->table('url')->insert($entry); } catch (\PDOException $e){ if($e->getCode() != 23000) throw $e; } } }
Crotin
Name
Size
Permissions
Modified
User/Group
Add.php
1977
0644
2016-04-16 10:22:15
Unknown/Unknown
Url.php
1194
0644
2016-04-16 10:22:15
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin