'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))) { $q = "SELECT `setting` FROM `" . OCC_TABLE_CONFIG . "` WHERE `module`='" . safeSQLstr(urldecode($_POST['m'])) . "' ORDER BY `setting`"; if ($r = ocsql_query($q)) { if (mysql_num_rows($r) == 0) { $res = array('error' => 'Module has no configuration settings'); } else { $res = array('error' => '', 'settings' => array()); while ($l = mysql_fetch_assoc($r)) { $res['settings'][] = $l['setting']; } } } else { $res = array('error' => 'DB Error: ' . safeHTMLstr(mysql_error())); } } else { $res = array('error' => 'Invalid module'); } echo json_encode($res); exit; ?>