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

46 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2020-01-06 14:14:28 +01:00
<?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);
}