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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user