'Advanced configuration disabled'); } elseif (!validToken('chair')) { // Check for valid submission $res = array('error' => 'Invalid Token'); } elseif (isset($_POST['m']) && (($_POST['m'] == 'OC') || in_array($_POST['m'], $OC_activeModulesAR)) && isset($_POST['s']) && array_key_exists($_POST['s'], $OC_configAR)) { $q = "SELECT * FROM `" . OCC_TABLE_CONFIG . "` WHERE `module`='" . safeSQLstr(urldecode($_POST['m'])) . "' AND `setting`='" . safeSQLstr(urldecode($_POST['s'])) . "'"; if ($r = ocsql_query($q)) { if (mysql_num_rows($r) != 1) { $res = array('error' => 'Setting not found'); } else { $res = array( 'error' => '', 'setting' => mysql_fetch_assoc($r) ); } } else { $res = array('error' => 'DB Error: ' . safeHTMLstr(mysql_error())); } } else { $res = array('error' => 'Invalid module or setting'); } echo json_encode($res); exit; ?>