1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 14:33:07 +01:00

api functions for ci

This commit is contained in:
andreas
2023-09-05 19:44:25 +02:00
parent f6cbcecb78
commit 56b5598c15
3 changed files with 72 additions and 7 deletions

View File

@@ -5,16 +5,19 @@ $allowed=array(
);
function fillUserAndRepo($vars=null){
function fillUserAndRepo($vars=null,$source=null){
global $allowed;
if ($vars == null) {
$vars=array();
}
if ($source == null){
$source=$_REQUEST;
}
foreach (array('user','repo') as $n){
if (! isset($_REQUEST[$n])){
if (! isset($source[$n])){
die("missing parameter $n");
}
$v=$_REQUEST[$n];
$v=$source[$n];
$av=$allowed[$n];
if (! in_array($v,$av)){
die("value $v for $n not allowed");