$vbulletin->input->clean_array_gpc('r', array('debug' => TYPE_BOOL)); if ($VB_API_REQUESTS['api_sig'] !== $signtoverify and !($vbulletin->debug and $vbulletin->GPC['debug'])) { //echo ' Should be: ' . $signtoverify . ' md5("' . http_build_query($VB_API_PARAMS_TO_VERIFY, '', '&') . $VB_API_REQUESTS['api_s'] . $client['apiclientid'] . $client['secret'] . '")'; print_apierror('invalid_api_signature', 'Invalid API Signature'); } else { $vbulletin->apiclient = $client; } if ($vbulletin->options['enableapilog']) { $hide = array('vb_login_password', 'vb_login_md5password', 'vb_login_md5password_utf', 'password', 'password_md5', 'passwordconfirm', 'passwordconfirm_md5', 'currentpassword', 'currentpassword_md5', 'newpassword', 'newpasswordconfirm', 'newpassword_md5', 'newpasswordconfirm_md5'); $post_copy = $_POST; foreach ($hide as $param) { if ($post_copy[$param]) { $post_copy[$param] = '*****'; } } $db->query_write("\n\t\t\t\tINSERT INTO " . TABLE_PREFIX . "apilog (apiclientid, method, paramget, parampost, ipaddress, dateline)\n\t\t\t\tVALUES (\n\t\t\t\t\t{$VB_API_REQUESTS['api_c']},\n\t\t\t\t\t'" . $db->escape_string($VB_API_REQUESTS['api_m']) . "',\n\t\t\t\t\t'" . $db->escape_string(serialize($_GET)) . "',\n\t\t\t\t\t'" . ($vbulletin->options['apilogpostparam'] ? $db->escape_string(serialize($post_copy)) : '') . "',\n\t\t\t\t\t'" . $db->escape_string(IPADDRESS) . "',\n\t\t\t\t\t'" . TIMENOW . "'\n\t\t\t\t)\n\t\t\t"); unset($hide, $post_copy); } // TODO: Disable human verification in this release. enabled it when release API to public $vbulletin->options['hvcheck'] = 0; $vbulletin->options['vbforum_url'] = ''; $vbulletin->options['vbcms_url'] = ''; $vbulletin->options['vbblog_url'] = ''; } elseif ($VB_API_REQUESTS['api_m'] != 'api_init' and !($vbulletin->debug and $vbulletin->GPC['debug'])) { print_apierror('missing_api_signature', 'Missing API Signature'); } } // ############################################################################# // Setup session if (!empty($db->explain)) { $db->timer_start('Session Handling');