mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-11-17 13:11:27 +01:00
api functions for ci
This commit is contained in:
1 parent
f6cbcecb78
commit
56b5598c15
3 files changed
+72
-7
No files matched your search
@@ -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