diff --git a/api/api.php b/api/api.php index c5f9b56..839e1f1 100644 --- a/api/api.php +++ b/api/api.php @@ -84,13 +84,13 @@ class api { $commands[count($commands)-1][1] != $item[\SYSTEM\DBD\APITable::FIELD_PARENTVALUE]){ continue;} - //all parameters are required + //all parameters are NOT required - just continue if(!isset($params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]])){ - throw new \SYSTEM\LOG\ERROR('Parameter missing: '.$item[\SYSTEM\DBD\APITable::FIELD_NAME]);} + continue;} //verify parameter - if( !method_exists($verifyclassname, $item[\SYSTEM\DBD\APITable::FIELD_VERIFY]) || - !$verifyclassname->$item[\SYSTEM\DBD\APITable::FIELD_VERIFY]($params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]])){ + if( !method_exists($verifyclassname, $item[\SYSTEM\DBD\APITable::FIELD_VERIFY]) || + !call_user_func(array($verifyclassname,$item[\SYSTEM\DBD\APITable::FIELD_VERIFY]),$params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]])){ throw new \SYSTEM\LOG\ERROR('Parameter type missmacht or Missing Verifier. Param: '.$item[\SYSTEM\DBD\APITable::FIELD_NAME].' Verifier: '.$item[\SYSTEM\DBD\APITable::FIELD_VERIFY]);} $parameters_opt[] = array($item, $params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]]); @@ -99,7 +99,7 @@ class api { //strict check if( $strict && - count($params) != (count($parameters) + count($commands)) ){ + count($params) != (count($parameters) + count($commands) + count($parameters_opt)) ){ throw new \SYSTEM\LOG\ERROR('Unhandled or misshandled parameters - api query is invalid: '.$_SERVER["REQUEST_URI"]);} //Function Name diff --git a/sai/autoload.inc.php b/sai/autoload.inc.php index 3b50c5e..4971b61 100644 --- a/sai/autoload.inc.php +++ b/sai/autoload.inc.php @@ -4,15 +4,5 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__).'/sai','SYSTEM\SAI'); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/page','SYSTEM\SAI'); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/page/default_page','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_sai','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_login','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_log','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_security','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_mod','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_config','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_calls','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_locale','SYSTEM\SAI'); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_cache','SYSTEM\SAI'); - +require_once dirname(__FILE__).'/modules/autoload_modules.php'; require_once dirname(__FILE__).'/modules/register_modules.php'; \ No newline at end of file diff --git a/sai/modules/autoload_modules.php b/sai/modules/autoload_modules.php new file mode 100644 index 0000000..6e52fa7 --- /dev/null +++ b/sai/modules/autoload_modules.php @@ -0,0 +1,13 @@ +Cache';} + public static function html_li_menu(){return '
| '.'time ago in days'.' | '.''.'time'.' | '.''.'reporttype'.' | '.''.'message'.' | '.''.'suggestion'.' | '.''.'additional sources'.' | '.''.'author'.' | '.''.'assigned'.' | '.''.'state of todo(closed/in progress)'.' | '.''.'action'.' | '.'
|---|---|---|---|---|---|---|---|---|---|
| '.'5d'.' | '.''.'5days ago obviously'.' | '.''.'Feature Request'.' | '.''.'Do some new stuff the old stuff sucks.'.' | '.''.'not a valid field for this type of report(ment for error suggestions)'.' | '.''.'http:... here some fancy examples what i want'.' | '.''.'Mr. Pink'.' | '.''.'I_S and many more'.' | '.''.'in progress'.' | '.''.''.''.''.''.' |
| '.'5d'.' | '.''.'5days ago obviously'.' | '.''.'Bugreport'.' | '.''.'Do some new stuff the old stuff sucks.'.' | '.''.'not a valid field for this type of report(ment for error suggestions)'.' | '.''.'http:... here some fancy examples what i want'.' | '.''.'Mr. Pink'.' | '.''.'I_S and many more'.' | '.''.'in progress'.' | '.''.''.''.''.''.' |
| '.'5d'.' | '.''.'5days ago obviously'.' | '.''.'Unasigned Category - what is this?'.' | '.''.'Do some new stuff the old stuff sucks.'.' | '.''.'not a valid field for this type of report(ment for error suggestions)'.' | '.''.'http:... here some fancy examples what i want'.' | '.''.'Mr. Pink'.' | '.''.'I_S and many more'.' | '.''.'in progress'.' | '.''.''.''.''.''.' |
| '.'5d'.' | '.''.'5days ago obviously'.' | '.''.'Closed FR/BR/OT'.' | '.''.'Do some new stuff the old stuff sucks.'.' | '.''.'not a valid field for this type of report(ment for error suggestions)'.' | '.''.'http:... here some fancy examples what i want'.' | '.''.'Mr. Pink'.' | '.''.'I_S and many more'.' | '.''.'in progress'.' | '.''.''.''.''.''.' |
| '.'5d'.' | '.''.'5days ago obviously'.' | '.''.'Note/Reminder'.' | '.''.'Do some new stuff the old stuff sucks.'.' | '.''.'not a valid field for this type of report(ment for error suggestions)'.' | '.''.'http:... here some fancy examples what i want'.' | '.''.'Mr. Pink'.' | '.''.'I_S and many more'.' | '.''.'in progress'.' | '.''.''.''.''.''.' |