This repository has been archived on 2024-06-20. You can view files and clone it, but cannot push or open issues or pull requests.
peryoudow/apps/input.php
2020-01-06 14:23:12 +01:00

46 lines
No EOL
1.2 KiB
PHP

<?php
if(!empty($_POST['logout'])){
session_unset();
}
if(!empty($_POST['page'])){
$page = filter_input(INPUT_POST, 'page', FILTER_SANITIZE_SPECIAL_CHARS);
}
if(!empty($_GET['page'])){
$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_SPECIAL_CHARS);
}
if(!empty($_POST['createLogin'])){
$createLogin = filter_input(INPUT_POST, 'createLogin', FILTER_SANITIZE_SPECIAL_CHARS);
}
if(!empty($_POST['createPassword'])){
$createPassword = password_hash($_POST['createPassword'], PASSWORD_DEFAULT);
}
if(!empty($_POST['createPath'])){
$createPath = explode(';', $_POST['createPath']);
$createPath = array_filter($createPath);
array_walk($createPath, 'trim_value');
foreach($createPath as $key => &$value){
if(empty($value)){
unset($createPath[$key]);
}
if(substr($value, -1) !== '/'){
$value = $value.'/';
}
}
}
if(isset($_POST['videoUrl'])){
$url = escapeshellcmd($_POST['videoUrl']);
$destination = escapeshellcmd($_POST['destination']);
require 'apps/createTask.php';
//exec('bash script/cronTask.sh.sample', $array);
}
function trim_value(&$value)
{
$value = trim($value);
}