$sv = explode("::", $svar[$i]); $svarmug .= "<h3>{$sp[$i]}</h3>\n"; for ($n = 0; $n < $pro_max_sv; $n++) { if (isset($sv[$n]) and strlen($sv[$n]) > 0) { $j = $i + 1; $k = $n + 1; $svarmug .= "<input type=radio name=\"sp{$j}\" value=\"{$k}\">{$sv[$n]}<BR>\n"; } } } } if (isset($svarmug) and strlen($svarmug) > 0) { $svarmug = "<div class=forside><h2>Hvis du vil svare p flere sprgsml</h2>\n" . $svarmug . "<input type=submit value=\"Svar\"> <input type=reset value=\"Nulstil formular\"></div>\n"; } else { $svarmug = "<div class=forside><h2>Tak!</h2>\nNu er der ikke flere sprgsml at svare p!</div>\n"; } $uaUtils = new UsersAreaUtils($siteContext); //Did something go wrong? if (strlen($problemer) > 0) { $errors = new Errors(); $errors->addError(new Error(2, "<div class=problemer><h1>Der opstod desvrre problemer...</h1>{$problemer}</div>")); $uaUtils->showErrors($errors); exit; } else { if (isset($fsvaret) and strlen($fsvaret) > 0) { $fxsvaret = "<p>Da du fr har svaret p {$fsvaret} er dette/disse svar ikke talt med.</p>"; } $uaUtils->echoSiteHead("Tak fordi du har svaret!", 1); echo "<div class=forside>{$fxsvaret} <form action=\"" . $stier->getOption('cgiURL') . "/pollAnswer.php\" method=POST><input type=hidden name=brugernavn value=\"" . htmlentities($ind['brugernavn']) . "\"><input type=hidden name=svaret value=\"{$svaret}\">\n" . $svarmug . "</form><BR><a href=\"" . $stier->getOption('urlStatsite') . "?brugernavn=" . htmlentities($ind['brugernavn']) . "&show[]=HitsVotes\">Se hvad folk svarede...</A></div>"; $uaUtils->echoSiteEnd(); }
writeImage("stats7.gif", $stier); } elseif ($ind['billed'] == "8") { writeImage("stats8.gif", $stier); } elseif ($ind['billed'] == "trans") { writeImage("stats_trans.gif", $stier); } elseif ($ind['billed'] == "taelsh") { zipcount(0, $stier, $ind, $datafil); } elseif ($ind['billed'] == "taelhs") { zipcount(1, $stier, $ind, $datafil); } else { writeImage("stats1.gif", $stier); } } } else { require_once "lib/UsersArea/Utils.php"; $uaUtils = new UsersAreaUtils($siteContext); $uaUtils->showErrors($errors); exit; } //Ignore this visit on this page? //'taelop' is danish for count up. nej is danish for no. if (!$lib->countVisit(getenv("HTTP_REFERER"), $datafil->getLine(111))) { $ind['taelop'] = "nej"; } //Ignore visits from this IP-address? if (getenv("REMOTE_ADDR") === $datafil->getLine(52) and $datafil->getLine(52) != "") { $ind['taelop'] = "nej"; } //Update the http vars. $lib->setHTTPVars($ind); //Only register visit if the taelop parameter does not forbid it.
<?php require "Html.php"; require "Stier.php"; require "lib/Localizer.php"; require "lib/SiteContext.php"; require "lib/UsersArea/Utils.php"; $stier = new Stier(); $in = Html::setPostOrGetVars($HTTP_POST_VARS, $HTTP_GET_VARS); $dummy_for_lib = NULL; //$lib $siteContext = new SiteContext($dummy_for_lib, $stier, $in, 'da'); $utils = new UsersAreaUtils($siteContext); if (!isset($in['username'])) { $username = ''; } else { $username = $in['username']; } $utils->echoSiteHead('ZIP Stat brugeromrde [' . $username . ']', 1); $utils->echoSiteEnd(0); /* $filename = $stier->getPath("templates")."/HtmlDefault.txt"; $fd = fopen ($filename, "r"); $template = fread ($fd, filesize ($filename)); fclose ($fd); $template = substr($template, 0, strpos($template, '%start_footer%')).substr($template, strpos($template, '%end_footer%')+strlen('%end_footer%')); $keys = array( '%title%', '%css_url%', '%start_menu%', '%end_menu%',
/** * Performs the registration. */ function doRegister() { $errors = new Errors(); $in = $this->siteContext->getHTTP_VARS(); $lib = $this->siteContext->getCodeLib(); //Use the simple user area? if (strpos(strtolower($in['brugerom']), 'simpelt') === 0) { //Set the cookie for users area type $uaUtils = new UsersAreaUtils($this->siteContext); $uaUtils->setUAType(); $simpelt_avan = 1; } else { $simpelt_avan = 0; } $datasource = DataSource::createInstance($in['brugernavn'], $this->siteContext->getOptions()); $datasource->setLine(0, "filen er ok"); $datasource->setLine(1, $in['navn']); $datasource->setLine(2, $in['e-mail']); $datasource->setLine(3, $in['url']); $datasource->setLine(4, $in['titel']); $datasource->setLine(5, $lib->kortdato()); $datasource->setLine(6, $in['pwd1']); $in['kodeord'] = $in['pwd1']; $datasource->setLine(7, "0"); $datasource->setLine(8, $lib->kortdato() . ""); $datasource->setLine(9, "0::0::0::0::0::0::0::0::0::0::0::0"); $datasource->setLine(10, "0"); $datasource->setLine(11, "0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0"); $datasource->setLine(12, "0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0"); $datasource->setLine(13, "0"); $datasource->setLine(14, "0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::0::"); $datasource->setLine(15, "0::0::0::0::0::0::0"); $datasource->setLine(16, "0"); $datasource->setLine(17, $lib->kortdato() . ""); $datasource->setLine(18, "0"); $datasource->setLine(19, $lib->kortdato() . ""); $datasource->setLine(20, ""); $datasource->setLine(21, "::"); $datasource->setLine(22, ""); $datasource->setLine(23, ""); $datasource->setLine(24, ""); $datasource->setLine(25, "::"); $datasource->setLine(26, ""); $datasource->setLine(27, "::"); $datasource->setLine(28, ""); $datasource->setLine(29, ""); $datasource->setLine(30, "::"); $datasource->setLine(31, ""); $datasource->setLine(32, "::"); $datasource->setLine(33, ""); $datasource->setLine(34, "::"); $datasource->setLine(35, ""); $datasource->setLine(36, "::"); $datasource->setLine(37, ""); $datasource->setLine(38, ""); $datasource->setLine(39, ""); $datasource->setLine(40, "::"); $datasource->setLine(41, ""); $datasource->setLine(42, ""); $datasource->setLine(43, ""); $datasource->setLine(44, ""); $datasource->setLine(45, ""); $datasource->setLine(46, ""); $datasource->setLine(47, ""); $datasource->setLine(48, ""); $datasource->setLine(49, ""); $datasource->setLine(50, ""); $datasource->setLine(51, ""); $datasource->setLine(52, ""); $datasource->setLine(53, $in['url']); $datasource->setLine(54, ""); $datasource->setLine(55, ""); $datasource->setLine(56, ""); $datasource->setLine(57, ""); $datasource->setLine(58, ""); $datasource->setLine(59, ""); $datasource->setLine(60, ""); $datasource->setLine(61, ""); $datasource->setLine(62, ""); $datasource->setLine(63, ""); $datasource->setLine(64, ""); $datasource->setLine(65, ""); $datasource->setLine(66, ""); $datasource->setLine(67, ""); $datasource->setLine(68, ""); $datasource->setLine(69, ""); $datasource->setLine(70, ""); $datasource->setLine(71, ""); $datasource->setLine(72, ""); $datasource->setLine(73, "0:0"); $datasource->setLine(74, ""); $datasource->setLine(75, ""); $datasource->setLine(76, "0"); $datasource->setLine(77, "0"); $datasource->setLine(78, $lib->kortdato() . ""); $datasource->setLine(79, "0"); $datasource->setLine(80, "0"); $datasource->setLine(81, $lib->kortdato() . ""); $datasource->setLine(82, "0"); #Registrere om siden er erotisk eller ej if ($in['under18ok'] === "Ja") { $datasource->setLine(83, "erotik"); } else { if ($in['under18ok'] === "Nej") { $datasource->setLine(83, "okunder18"); } else { $datasource->setLine(83, ""); } } $datasource->setLine(84, isset($in['beskrivelse']) ? $in['beskrivelse'] : ''); $datasource->setLine(85, isset($in['sord']) ? $in['sord'] : ''); //The two are not used anymore $datasource->setLine(86, ""); $datasource->setLine(87, ""); $datasource->setLine(88, ""); $datasource->setLine(89, "0"); $datasource->setLine(90, ""); $datasource->setLine(91, ""); $datasource->setLine(92, ""); $datasource->setLine(93, ""); $datasource->setLine(94, ""); $datasource->setLine(95, ""); $datasource->setLine(96, ""); $datasource->setLine(97, ""); $datasource->setLine(98, ""); $datasource->setLine(99, ""); $datasource->setLine(100, ""); $datasource->setLine(101, ""); $datasource->setLine(102, ""); $datasource->setLine(103, ""); $datasource->setLine(104, ""); $datasource->setLine(105, ""); $datasource->setLine(106, "1::1::1"); $datasource->setLine(107, "1::0::0::1::0::0::0"); $datasource->setLine(108, ""); $datasource->setLine(109, ""); $datasource->setLine(110, time()); $shortDate = $lib->kortdato(); $nul[7] = $shortDate; $nul[8] = $shortDate; $nul[9] = $shortDate; $nul[11] = $shortDate; $nul[14] = $shortDate; $nul[15] = $shortDate; $nul[16] = $shortDate; $nul[18] = $shortDate; $nul[20] = $shortDate; $nul[22] = $shortDate; $nul[24] = $shortDate; $nul[26] = $shortDate; $nul[28] = $shortDate; $nul[29] = $shortDate; $nul[31] = $shortDate; $nul[33] = $shortDate; $nul[35] = $shortDate; $nul[37] = $shortDate; $nul[39] = $shortDate; $nul[43] = $shortDate; $nul[44] = $shortDate; $nul[46] = $shortDate; $nul[47] = $shortDate; $nul[49] = $shortDate; $nul[54] = $shortDate; $nul[64] = $shortDate; $nul[69] = $shortDate; $nul[73] = $shortDate; $nul[74] = $shortDate; $nul[77] = $shortDate; $nul[80] = $shortDate; $nul[112] = $shortDate; $nul[114] = $shortDate; $datasource->setLine(51, implode("::", $nul)); if (!$errors->isOccured()) { $datasource->createUser(); $datasource->gemFil(); } else { $this->displayErrors($errors); } if (Html::okmail($in['e-mail'])) { $this->doSendEmail($simpelt_avan); } ?> <div class=forside> <h1><?php echo $this->siteContext->getLocale('regYouAreRegistered'); ?> </h1> <P><?php echo $this->siteContext->getLocale('regCongRegistered'); ?> </p> <h2><?php echo $this->siteContext->getLocale('regNowOnlyMissing'); ?> </h2> <p><?php echo $this->siteContext->getLocale('regGenCode1'); ?> <a href="userarea.php?username=<?php echo htmlentities(urlencode($in['brugernavn'])); ?> &password=<?php echo htmlentities(urlencode($in['kodeord'])); ?> &start=Obligatorisk+kode&start_type=kodegen"> <?php echo $this->siteContext->getLocale('regGenCode2'); ?> </a>. <?php echo $this->siteContext->getLocale('regGenCode3'); ?> </p> <p><?php echo sprintf($this->siteContext->getLocale('regGenCodeAgain'), "<a href=\"" . $this->siteContext->getOption('ZSHomePage') . "\">" . $this->siteContext->getOption('ZSHomePage') . "</a>"); ?> </P> <h2><?php echo $this->siteContext->getLocale('regAboutHelp'); ?> </h2> <p><?php echo sprintf($this->siteContext->getLocale('regAboutHelpText'), "<a href=\"" . $this->siteContext->getLocale('regUrlHelp') . "\">" . $this->siteContext->getLocale('regAboutHelp') . "</a>"); ?> </p></div> <?php }
//Creates error message if it fails. $errMsg = ""; if ($res === -2) { $errMsg .= "Din datafil er desvrre blevet beskadiet, og der kan derfor ikke registreres statistikker. Kontakt " . $stier->getOption('name_of_service') . "'s administrator via e-mail-adressen nederst p siden."; } elseif (!$res or $res === 0) { $errMsg .= "Datafilen kunne hentes. Enten er det et problem p " . $stier->getOption('name_of_service') . " eller ogs har du skrevet det forkerte brugernavn - det kan indeholder tegn der ikke er tilladt - prv at generere den obligatoriske kode igen."; } //.$datafile->getFilnavn("zip");. } //Creates the standard libary. $lib = new Html($in, $datafile); //Instantiates the SiteContext object. $siteContext = new SiteContext($lib, $stier, $in, 'da'); $lib->setSiteContext($siteContext); $lib->setStier($stier); $utils = new UsersAreaUtils($siteContext); //todo: Handle the problems better than this!. if (strlen($errMsg) > 0) { echo $errMsg; exit; } if (!isset($in) or !isset($username)) { $utils->doLoginForm(1, $siteContext->getOption('urlUserAreaMain')); exit; } //Set the latest use with username and password. $datafile->setLine(110, time()); //End bootstrap. //Direct the execution to what to do. if (!isset($in['type'])) { $utils->echoSiteHead("Fejl", 0);
$stier = new Stier(); $datafil = DataSource::createInstance($_SERVER['QUERY_STRING'], $stier); $res = $datafil->hentFil(); $problemer = ''; //No problems so far if ($res === -2) { $problemer .= "Din datafil er desvrre blevet beskadiet, og der kan derfor ikke registreres statistikker. Kontakt " . $stier->getOption('name_of_service') . "'s administrator via e-mail-adressen nederst p siden."; } elseif (!$res) { $problemer .= "Datafilen kunne hentes. Enten er det et problem p " . $stier->getOption('name_of_service') . " eller ogs har du skrevet det forkerte brugernavn - det kan indeholder tegn der ikke er tilladt - prv at generere den obligatoriske kode igen."; } $lib = new Html($ind, $datafil); $lib->setStier($stier); $lib->outputNoCacheHeaders(); if (strlen($problemer) === 0) { $datafil->setLine(52, getenv('REMOTE_ADDR')); $datafil->gemFil(); $url = trim($datafil->getLine(53)); if (strlen($url) > 0) { if (strpos(strtolower($url), 'http://') !== 0) { $url = "http://" . $url; } header('Location: ' . $url); } else { $ind = Html::setPostOrGetVars($HTTP_POST_VARS, $HTTP_GET_VARS); $siteContext = new SiteContext($lib, $stier, $ind, 'da'); $utils = new UsersAreaUtils($siteContext); $utils->echoSiteHead("Ingen adresse angivet", 1); echo "Der var ikke angivet nogen adresse. Dette skal gres under "Rediger Indstillinger" (i kassen "Send-vidre adresse") p brugeromrdet."; $utils->echoSiteEnd(); } }
$uaUtils->showErrors($errors); exit; } } } //If the stat site is password protected if (strlen($datafil->getLine(57)) > 0) { $brugerkodeord = "&brugerkodeord=" . $ind['password'] . "&menu=hide&tableWidth=100%25"; $statside_offentlig = ""; $targetTop = " target=\"main\""; } else { $brugerkodeord = ''; $statside_offentlig = "Statistiksiden er offentlig <a href=\"javascript:alert('Din statistikside er lige nu offentlig for alle.\\nDu kan dog stte kodeord p den,\\ns kun du kan se den.\\nDette gres p siden Indstillinger\\nher p brugeromrdet.');\">Ls mere</a>"; $targetTop = " target=\"_top\""; } $uaUtils = new UsersAreaUtils($siteContext); //Get the users area type if ($uaUtils->getUAType() === $uaUtils->UA_TYPE_SIMPLE) { $simpel = 1; } else { $simpel = 0; } //Set a new type? if (isset($ind['skift'])) { if ($ind['skift'] === 'avanceret') { $uaUtils->setUAType($uaUtils->UA_TYPE_ADVANCED); $simpel = 0; } else { $uaUtils->setUAType($uaUtils->UA_TYPE_SIMPLE); $simpel = 1; }