$IsCommandlinePlugin = isset($cline['m']) && in_array($cline['m'], $GLOBALS["commandlinePlugins"]); if ($cline['p'] && !$IsCommandlinePlugin) { if (empty($GLOBALS['developer_email']) && isset($cline['p']) && !in_array($cline['p'], $GLOBALS["commandline_pages"])) { clineError($cline['p'] . " does not process commandline"); } elseif (isset($cline['p'])) { $_GET['page'] = $cline['p']; } } elseif ($cline['p'] && $IsCommandlinePlugin) { if (empty($GLOBALS['developer_email']) && isset($cline['p']) && !in_array($cline['p'], $commandlinePluginPages[$cline['m']])) { clineError($cline['p'] . " does not process commandline"); } elseif (isset($cline['p'])) { $_GET['page'] = $cline['p']; $_GET['pi'] = $cline['m']; } } else { clineUsage(" [other parameters]"); exit; } } else { if (CHECK_REFERRER && isset($_SERVER['HTTP_REFERER'])) { ## do a crude check on referrer. Won't solve everything, as it can be faked, but shouldn't hurt $ref = parse_url($_SERVER['HTTP_REFERER']); if ($ref['host'] != $_SERVER['HTTP_HOST'] && !in_array($ref['host'], $allowed_referrers)) { print 'Access denied'; exit; } } } if (!isset($_GET['page'])) { $page = $GLOBALS['homepage']; } else {
if (empty($GLOBALS['developer_email']) && isset($cline['p']) && !in_array($cline['p'], $GLOBALS['commandline_pages'])) { clineError($cline['p'] . ' does not process commandline'); } elseif (isset($cline['p'])) { $_GET['page'] = $cline['p']; } cl_processtitle('core-' . $_GET['page']); } elseif ($cline['p'] && $IsCommandlinePlugin) { if (empty($GLOBALS['developer_email']) && isset($cline['p']) && !in_array($cline['p'], $commandlinePluginPages[$cline['m']])) { clineError($cline['p'] . ' does not process commandline'); } elseif (isset($cline['p'])) { $_GET['page'] = $cline['p']; $_GET['pi'] = $cline['m']; cl_processtitle($_GET['pi'] . '-' . $_GET['page']); } } else { clineUsage(' [other parameters]'); exit; } } else { if (CHECK_REFERRER && isset($_SERVER['HTTP_REFERER'])) { ## do a crude check on referrer. Won't solve everything, as it can be faked, but shouldn't hurt $ref = parse_url($_SERVER['HTTP_REFERER']); $parts = explode(':', $_SERVER['HTTP_HOST']); if ($ref['host'] != $parts[0] && !in_array($ref['host'], $allowed_referrers)) { print 'Access denied'; exit; } } } if (!isset($_GET['page'])) { $page = $GLOBALS['homepage'];
$subselect = ""; $ownership = ''; break; case "none": default: $subselect = " where id = 0"; $ownership = " and id = 0"; break; } $some = 0; # handle commandline if ($GLOBALS["commandline"]) { $cline = parseCline(); reset($cline); if (!$cline || !is_array($cline) || !$cline["s"] || !$cline["l"]) { clineUsage("-s subject -l list [-f from] < message"); exit; } $listnames = explode(" ", $cline["l"]); $listids = array(); foreach ($listnames as $listname) { if (!is_numeric($listname)) { $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where name = "%s"', $tables["list"], $listname)); if ($listid["id"]) { $listids[$listid["id"]] = $listname; } } else { $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables["list"], $listname)); if ($listid["id"]) { $listids[$listid["id"]] = $listid["name"]; }
$subselect = ''; $ownership = ''; break; case 'none': default: $subselect = ' where id = 0'; $ownership = ' and id = 0'; break; } $some = 0; # handle commandline if ($GLOBALS['commandline']) { $cline = parseCline(); reset($cline); if (!$cline || !is_array($cline) || !$cline['s'] || !$cline['l']) { clineUsage('-s subject -l list [-f from] < message'); exit; } $listnames = explode(' ', $cline['l']); $listids = array(); foreach ($listnames as $listname) { if (!is_numeric($listname)) { $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where name = "%s"', $tables['list'], $listname)); if ($listid['id']) { $listids[$listid['id']] = $listname; } } else { $listid = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables['list'], $listname)); if ($listid['id']) { $listids[$listid['id']] = $listid['name']; }