Ejemplo n.º 1
0
 function show()
 {
     global $gorumroll, $lll, $gorumuser, $dontRemoveInstallFiles, $CONFIG_FILE_DIR, $noahVersion;
     JavaScript::addCss(CSS_DIR . "/checkconf.css?{$noahVersion}");
     $_GS = new GlobalStat();
     if ($_GS->congrat) {
         View::assign("congrat", $lll["congrat"]);
         $_GS->congrat = FALSE;
         modify($_GS);
     }
     $report = array();
     $st = join("", file($CONFIG_FILE_DIR . "/config.php"));
     $p = "^<\\?";
     $cfe = FALSE;
     if (!ereg($p, $st)) {
         $cfe = TRUE;
         $report[] = array($lll["confpreerr"], 'conferr');
     }
     $p = "\\?>\$";
     $p1 = "\\?>\n\$";
     $p2 = "\\?>\r\n\$";
     if (!ereg($p, $st) && !ereg($p1, $st) && !ereg($p2, $st)) {
         $cfe = TRUE;
         $report[] = array($lll["confposterr"], 'conferr');
     }
     if ($cfe) {
         $report[] = array($lll["conffileok"], 'confok');
     }
     if ($gorumuser->password == getPassword("admin")) {
         $report[] = array($lll["chadmpass"], 'conferr');
     }
     $_S =& new AppSettings();
     if ($_S->adminEmail == "") {
         $report[] = array($lll["chsyspass"], 'conferr');
         $report[] = array($lll["chsyspass_expl"], 'confexpl');
     } else {
         $ctrl = new AppController("checkconf/mailtest");
         $report[] = array($ctrl->generAnchor($lll["triggerMailTest"]), 'confok');
     }
     if (!defined("IMG_GIF") || !function_exists("ImageTypes")) {
         $report[] = array($lll["nogd"], 'conferr');
         $report[] = array($lll["nogd_expl"], 'confexpl');
     }
     if (!is_writeable(ini_get("session.save_path"))) {
         $error_message = "The configured Path for Session files (" . ini_get("session.save_path") . ") is not writeable!";
     }
     $this->checkWritePermission($noPermDirs);
     if (count($noPermDirs)) {
         $report[] = array(sprintf($lll["nopermission"], implode(", ", $noPermDirs)), 'conferr');
         $report[] = array($lll["nopermission_expl"], 'confexpl');
     }
     $this->checkReadPermission($noPermDirs);
     if (count($noPermDirs)) {
         $report[] = array(sprintf($lll["nopermission_read"], implode(", ", $noPermDirs)), 'conferr');
         $report[] = array($lll["nopermission_read_expl"], 'confexpl');
     }
     // Nice URL section:
     View::assign("rewriteOn", $gorumroll->rewriteOn);
     if (!$gorumroll->rewriteOn) {
         if (function_exists("apache_get_modules")) {
             View::assign("rewriteModuleEnabled", in_array("mod_rewrite", apache_get_modules()));
         } else {
             View::assign("rewriteModuleEnabled", "unsure");
         }
     }
     // CAPTCHA test:
     View::assign("captchaLink", Controller::getBaseURL() . "gorum/captcha/captcha.php");
     if ((!empty($dontRemoveInstallFiles) || $this->installFilesRemoved()) && $this->appFilesRemoved() && $this->backupFilesRemoved() && $_GS->defPageConf) {
         $ctrl =& new AppController("checkconf", "remove_first_check");
         View::assign("clickToDisappear", "{$lll['confdisapp']} " . $ctrl->generAnchor($lll["here1"]) . ".<br>{$lll['confclicheck']}");
     }
     View::assign("report", $report);
 }
Ejemplo n.º 2
0
 function showRangeSelector($base)
 {
     global $gorumroll, $lll, $imagesDir;
     global $blockSize, $rangeBlockSize;
     global $yahooStylePagerTool;
     if (function_exists("appShowRangeSelector")) {
         return appShowRangeSelector($base);
     }
     if ($yahooStylePagerTool) {
         return showYahooStyleRangeSelector($base);
     }
     $typ =& $base->getTypeInfo();
     $bs = $blockSize;
     $rbs = $rangeBlockSize;
     $ro = isset($_COOKIE["kuki_rangeoffset_{$gorumroll->list}"]) ? $_COOKIE["kuki_rangeoffset_{$gorumroll->list}"] : (isset($_COOKIE["kuki_rangeoffset"]) ? $_COOKIE["kuki_rangeoffset"] : 0);
     $off = isset($_COOKIE["kuki_offset_{$gorumroll->list}"]) ? $_COOKIE["kuki_offset_{$gorumroll->list}"] : (isset($_COOKIE["kuki_offset"]) ? $_COOKIE["kuki_offset"] : 0);
     $base->getCount($count);
     if ($count <= $bs || $bs == 0 || $rbs == 0) {
         return "";
     }
     $ctrlParams = array();
     $ctrlParams["method"] = "range";
     $s = "";
     $s .= "<div class='pager'>";
     if ($off != 0) {
         $ctrlParams["rangeoffset"] = $ro;
         $ctrlParams["offset"] = 0;
         $s .= "<span>";
         $ctrl = new AppController($ctrlParams);
         $s .= $ctrl->generImageAnchor(IMAGES_DIR . "/first.gif", $lll["first"]);
         $s .= "</span>\n";
         $newOffset = max($off - $bs, 0);
         $ctrl["offset"] = $newOffset;
         $s .= "<span>";
         $ctrl = new AppController($ctrlParams);
         $s .= $ctrl->generImageAnchor(IMAGES_DIR . "/prev.gif", $lll["prev"]);
         $s .= "</span>\n";
     }
     if ($ro != 0) {
         $newOffset = max($ro - $rbs, 0);
         $ctrlParams["rangeoffset"] = $newOffset;
         $ctrlParams["offset"] = $off;
         //*
         $s .= "<span>";
         $ctrl = new AppController($ctrlParams);
         $s .= $ctrl->generAnchor("...");
         $s .= "</span>\n";
     }
     $upperRange = $count;
     for ($i = $ro; $i < $ro + $rbs; $i++) {
         $newOffset = $i * $bs;
         if ($newOffset >= $count) {
             break;
         }
         $ctrlParams["offset"] = $newOffset;
         $ctrlParams["rangeoffset"] = $ro;
         if ($off / $bs == $i) {
             $s .= "<span>";
             $s .= $i + 1;
             $s .= "</span>\n";
         } else {
             $s .= "<span>";
             $ctrl = new AppController($ctrlParams);
             $s .= $ctrl->generAnchor($i + 1);
             $s .= "</span>\n";
         }
         $upperRange = min($newOffset + $bs, $count);
     }
     if ($count > $upperRange) {
         if (($ro + $rbs - 1) * $bs > $count) {
             $newOffset = $count / $bs + 1 - $rbs;
         } else {
             $newOffset = $ro + $rbs;
         }
         $ctrlParams["rangeoffset"] = $newOffset;
         $ctrlParams["offset"] = $off;
         //*
         $s .= "<span>";
         $ctrl = new AppController($ctrlParams);
         $s .= $ctrl->generAnchor("...");
         $s .= "</span>\n";
     }
     if ($off + $bs < $count) {
         $newOffset = $off + $bs;
         $ctrlParams["offset"] = $newOffset;
         $ctrlParams["rangeoffset"] = $ro;
         $s .= "<span>";
         $ctrl = new AppController($ctrlParams);
         $s .= $ctrl->generImageAnchor(IMAGES_DIR . "/next.gif", $lll["next"]);
         $s .= "</span>\n";
         if ($count % $bs) {
             $newOffset = $count - $count % $bs;
         } else {
             $newOffset = $count - $bs;
         }
         $ctrlParams["offset"] = $newOffset;
         $ctrlParams["rangeoffset"] = $ro;
         $s .= "<span>";
         $ctrl = new AppController($ctrlParams);
         $s .= $ctrl->generImageAnchor(IMAGES_DIR . "/last.gif", $lll["last"]);
         $s .= "</span>\n";
     }
     $s .= "</div>\n";
     return $s;
 }