~~ssh~~ https auto update
This commit is contained in:
parent
9217060eb2
commit
e8d454d461
19
api.php
19
api.php
@ -15,7 +15,6 @@ header("X-Accel-Buffering: no");
|
||||
error_reporting(0);
|
||||
//error_reporting(E_ALL);
|
||||
|
||||
|
||||
require_once(__DIR__."/phplib/libutil.php");
|
||||
require_once(__DIR__."/phplib/libcustomerrorgen.php");
|
||||
require_once(__DIR__."/phplib/libteamtokenverifier.php");
|
||||
@ -25,7 +24,6 @@ require_once(__DIR__."/phplib/libchallengelist.php");
|
||||
require_once(__DIR__."/phplib/libattachmentmaker.php");
|
||||
require_once(__DIR__."/phplib/libtemplate_replace_anchor.php");
|
||||
|
||||
|
||||
$query=query2param();
|
||||
|
||||
if($query===false) {
|
||||
@ -74,6 +72,23 @@ if(!verify_team_token($ginfo["gpub"], $team_token)) {
|
||||
$team_id=explode(":", $team_token)[0];
|
||||
$team_id="team_".$team_id;
|
||||
|
||||
|
||||
//change $action[1](cid) based on $alias2cid_l
|
||||
|
||||
if(count($action)>1&&strlen($action[1])>0) {
|
||||
require(__DIR__."/phplib/libvar_alias2cid.php");
|
||||
$alias2cid=[];
|
||||
if(array_key_exists($game, $alias2cid_l)) {
|
||||
$alias2cid=$alias2cid_l[$game];
|
||||
}
|
||||
unset($alias2cid_l);
|
||||
if(array_key_exists($action[1], $alias2cid)) {
|
||||
$action[1]=$alias2cid[$action[1]];
|
||||
}
|
||||
unset($alias2cid);
|
||||
}
|
||||
|
||||
|
||||
//require files depends on the request
|
||||
//$action, $game, $ginfo, $team_id, $team_token is set
|
||||
|
||||
|
20
phplib/libvar_alias2cid.php
Normal file
20
phplib/libvar_alias2cid.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
//this is for giving cid a special alias, makeing it static rather than dynamic.
|
||||
//usually used for external containers that cannot be changed easily
|
||||
|
||||
$alias2cid_l=[
|
||||
|
||||
"test-1"=>[
|
||||
"wp24-mc-1"=>"cid_8",
|
||||
],
|
||||
|
||||
"wood-1"=>[
|
||||
"wp24-mc-1"=>"cid_46",
|
||||
],
|
||||
|
||||
"wood-2"=>[
|
||||
"wp24-mc-1"=>"cid_200",
|
||||
],
|
||||
|
||||
];
|
@ -24,8 +24,8 @@ $cid2tid_l=[
|
||||
],
|
||||
|
||||
"wood-2"=>[
|
||||
"cid_85"=>"tid_1",
|
||||
"cid_86"=>"tid_2",
|
||||
"cid_104"=>"tid_1",
|
||||
"cid_105"=>"tid_2",
|
||||
"cid_89"=>"tid_3",
|
||||
"cid_88"=>"tid_4",
|
||||
"cid_90"=>"tid_5",
|
||||
|
Loading…
x
Reference in New Issue
Block a user