first commit

This commit is contained in:
Your Name
2021-04-20 11:13:47 +05:30
parent b76859a3f1
commit 0a18b88eba
408 changed files with 47723 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
// +----------------------------------------------------------------------+
// | OpenConf |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on |
// | the OpenConf web site: www.OpenConf.com |
// +----------------------------------------------------------------------+
require_once "../include.php";
beginChairSession();
if (!OCC_ADVANCED_CONFIG) {
$res = array('error' => '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 (ocsql_num_rows($r) == 0) {
$res = array('error' => 'Module has no configuration settings');
} else {
$res = array('error' => '', 'settings' => array());
while ($l = ocsql_fetch_assoc($r)) {
if (preg_match("/^OC_hide/", $l['setting'])) { continue; }
$res['settings'][] = $l['setting'];
}
}
} else {
$res = array('error' => 'DB Error: ' . safeHTMLstr(ocsql_error()));
}
} else {
$res = array('error' => 'Invalid module');
}
echo json_encode($res);
exit;
?>