isset($_REQUEST['bid']) ? $bid = strip_tags(trim($_REQUEST['bid'])) : ($bid = ""); isset($_REQUEST['cid']) ? $cid = strip_tags(trim($_REQUEST['cid'])) : ($cid = ""); isset($_REQUEST['side']) ? $side = strip_tags(trim($_REQUEST['side'])) : ($side = ""); isset($_REQUEST['race']) ? $race = strip_tags(trim($_REQUEST['race'])) : ($race = ""); isset($_REQUEST['cname']) ? $cname = strip_tags(trim($_REQUEST['cname'])) : ($cname = ""); isset($_REQUEST['curl']) ? $curl = strip_tags(trim($_REQUEST['curl'])) : ($curl = ""); isset($_REQUEST['charid']) ? $charid = strip_tags(trim($_REQUEST['charid'])) : ($charid = ""); isset($_REQUEST['bookid']) ? $bookid = strip_tags(trim($_REQUEST['bookid'])) : ($bookid = ""); if ($s == Null) { $s = 0; } icheck($sid); icheck($bid); icheck($cid); icheck($charid); icheck($bookid); $out = ""; $out = $out . "<html><head</head><body>"; $out = $out . "<div align=center><a href=index.php>Story List|</a>"; $out = $out . "<a href=index.php?s=50>Character List|</a>"; $out = $out . "<a href=index.php?s=4>Add Characters</a></div><hr>"; $out = $out . "<div align=center>"; if (is_numeric($s)) { switch ($s) { case '1': if ($sid == Null) { print "<b> ERROR: </b> Invalid Sysntax."; exit; } $out = $out . "<table><tr><td><b><u>Books</b></u></td></tr></n>"; connect($db);
function QCR_IntegrityCheck($l_RootDir) { global $g_Structure, $g_Counter, $g_Doorway, $g_FoundTotalFiles, $g_FoundTotalDirs, $defaults, $g_SkippedFolders, $g_UrlIgnoreList, $g_DirIgnoreList, $g_UnsafeDirArray, $g_UnsafeFilesFound, $g_SymLinks, $g_HiddenFiles, $g_UnixExec, $g_IgnoredExt, $g_SuspiciousFiles; global $g_IntegrityDB, $g_ICheck; static $l_Buffer = ''; $l_DirCounter = 0; $l_DoorwayFilesCounter = 0; $l_SourceDirIndex = $g_Counter - 1; QCR_Debug('Check ' . $l_RootDir); if ($l_DIRH = @opendir($l_RootDir)) { while (($l_FileName = readdir($l_DIRH)) !== false) { if ($l_FileName == '.' || $l_FileName == '..') { continue; } $l_FileName = $l_RootDir . DIR_SEPARATOR . $l_FileName; $l_Type = filetype($l_FileName); $l_IsDir = $l_Type == "dir"; if ($l_Type == "link") { $g_SymLinks[] = $l_FileName; continue; } else { if ($l_Type != "file" && !$l_IsDir) { $g_UnixExec[] = $l_FileName; continue; } } $l_Ext = substr($l_FileName, strrpos($l_FileName, '.') + 1); $l_NeedToScan = true; $l_Ext2 = substr(strstr(basename($l_FileName), '.'), 1); if (in_array(strtolower($l_Ext2), $g_IgnoredExt)) { $l_NeedToScan = false; } if (getRelativePath($l_FileName) == "./" . INTEGRITY_DB_FILE) { $l_NeedToScan = false; } if ($l_IsDir) { // if folder in ignore list $l_Skip = false; for ($dr = 0; $dr < count($g_DirIgnoreList); $dr++) { if ($g_DirIgnoreList[$dr] != '' && preg_match('#' . $g_DirIgnoreList[$dr] . '#', $l_FileName, $l_Found)) { $l_Skip = true; } } // skip on ignore if ($l_Skip) { $g_SkippedFolders[] = $l_FileName; continue; } $l_BaseName = basename($l_FileName); $l_DirCounter++; $g_Counter++; $g_FoundTotalDirs++; QCR_IntegrityCheck($l_FileName); } else { if ($l_NeedToScan) { $g_FoundTotalFiles++; $g_Counter++; } } if (!$l_NeedToScan) { continue; } if (IMAKE) { write_integrity_db_file($l_FileName); continue; } // ICHECK // skip if known and not modified. if (icheck($l_FileName)) { continue; } $l_Buffer .= getRelativePath($l_FileName); $l_Buffer .= $l_IsDir ? DIR_SEPARATOR . "\n" : "\n"; if (strlen($l_Buffer) > 32000) { file_put_contents(QUEUE_FILENAME, $l_Buffer, FILE_APPEND) or die("Cannot write to file " . QUEUE_FILENAME); $l_Buffer = ''; } } closedir($l_DIRH); } if ($l_RootDir == ROOT_PATH && !empty($l_Buffer)) { file_put_contents(QUEUE_FILENAME, $l_Buffer, FILE_APPEND) or die("Cannot write to file " . QUEUE_FILENAME); $l_Buffer = ''; } if ($l_RootDir == ROOT_PATH) { write_integrity_db_file(); } }