Gazelle/sections/testing/ajax_run_method.php

19 lines
470 B
PHP
Raw Normal View History

2014-01-24 08:00:47 +00:00
<?
authorize();
if (!check_perms('users_mod')) {
error(404);
}
$Class = $_POST['class'];
$Method = $_POST['method'];
$Params = json_decode($_POST['params'], true);
if (!empty($Class) && !empty($Method) && Testing::has_testable_method($Class, $Method)) {
if (count($Params)) {
$Results = call_user_func_array(array($Class, $Method), array_values($Params));
} else {
$Results = call_user_func(array($Class, $Method));
}
TestingView::render_results($Results);
}