Exemplo n.º 1
0
 function set_siteurl($base)
 {
     $old_siteurl = Navigation::siteurl();
     $base = Navigation::set_siteurl($base);
     if ($this->opt["assetsUrl"] === $old_siteurl) {
         $this->opt["assetsUrl"] = $base;
         Ht::$img_base = $this->opt["assetsUrl"] . "images/";
     }
     if ($this->opt["scriptAssetsUrl"] === $old_siteurl) {
         $this->opt["scriptAssetsUrl"] = $base;
     }
 }
Exemplo n.º 2
0
 function set_siteurl($base)
 {
     global $Opt;
     $old_siteurl = Navigation::siteurl();
     $base = Navigation::set_siteurl($base);
     if ($Opt["assetsUrl"] === $old_siteurl) {
         $Opt["assetsUrl"] = $base;
         Ht::$img_base = $Opt["assetsUrl"] . "images/";
     }
 }
Exemplo n.º 3
0
 private function crosscheck_options()
 {
     global $Opt, $ConfSiteBase;
     // set longName, downloadPrefix, etc.
     $confid = $Opt["confid"];
     if ((!isset($Opt["longName"]) || $Opt["longName"] == "") && (!isset($Opt["shortName"]) || $Opt["shortName"] == "")) {
         $Opt["shortNameDefaulted"] = true;
         $Opt["longName"] = $Opt["shortName"] = $confid;
     } else {
         if (!isset($Opt["longName"]) || $Opt["longName"] == "") {
             $Opt["longName"] = $Opt["shortName"];
         } else {
             if (!isset($Opt["shortName"]) || $Opt["shortName"] == "") {
                 $Opt["shortName"] = $Opt["longName"];
             }
         }
     }
     if (!isset($Opt["downloadPrefix"]) || $Opt["downloadPrefix"] == "") {
         $Opt["downloadPrefix"] = $confid . "-";
     }
     // expand ${confid}, ${confshortname}
     foreach (array("sessionName", "downloadPrefix", "conferenceSite", "paperSite", "defaultPaperSite", "contactName", "contactEmail", "emailFrom", "emailSender", "emailCc", "emailReplyTo") as $k) {
         if (isset($Opt[$k]) && is_string($Opt[$k]) && strpos($Opt[$k], "\$") !== false) {
             $Opt[$k] = preg_replace(',\\$\\{confid\\}|\\$confid\\b,', $confid, $Opt[$k]);
             $Opt[$k] = preg_replace(',\\$\\{confshortname\\}|\\$confshortname\\b,', $Opt["shortName"], $Opt[$k]);
         }
     }
     // remove final slash from $Opt["paperSite"]
     if (!isset($Opt["paperSite"]) || $Opt["paperSite"] == "") {
         $Opt["paperSite"] = Navigation::site_absolute();
     }
     if ($Opt["paperSite"] == "" && isset($Opt["defaultPaperSite"])) {
         $Opt["paperSite"] = $Opt["defaultPaperSite"];
     }
     $Opt["paperSite"] = preg_replace('|/+\\z|', "", $Opt["paperSite"]);
     // set assetsUrl and scriptAssetsUrl
     if (!isset($Opt["scriptAssetsUrl"]) && isset($_SERVER["HTTP_USER_AGENT"]) && strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") !== false) {
         $Opt["scriptAssetsUrl"] = $ConfSiteBase;
     }
     if (!isset($Opt["assetsUrl"])) {
         $Opt["assetsUrl"] = $ConfSiteBase;
     }
     if ($Opt["assetsUrl"] !== "" && !str_ends_with($Opt["assetsUrl"], "/")) {
         $Opt["assetsUrl"] .= "/";
     }
     if (!isset($Opt["scriptAssetsUrl"])) {
         $Opt["scriptAssetsUrl"] = $Opt["assetsUrl"];
     }
     Ht::$img_base = $Opt["assetsUrl"] . "images/";
     // set docstore from filestore
     if (@$Opt["docstore"] === true) {
         $Opt["docstore"] = "docs";
     } else {
         if (!@$Opt["docstore"] && @$Opt["filestore"]) {
             if (($Opt["docstore"] = $Opt["filestore"]) === true) {
                 $Opt["docstore"] = "filestore";
             }
             $Opt["docstoreSubdir"] = @$Opt["filestoreSubdir"];
         }
     }
     // handle timezone
     if (function_exists("date_default_timezone_set")) {
         if (isset($Opt["timezone"])) {
             if (!date_default_timezone_set($Opt["timezone"])) {
                 $this->errorMsg("Timezone option “" . htmlspecialchars($Opt["timezone"]) . "” is invalid; falling back to “America/New_York”.");
                 date_default_timezone_set("America/New_York");
             }
         } else {
             if (!ini_get("date.timezone") && !getenv("TZ")) {
                 date_default_timezone_set("America/New_York");
             }
         }
     }
     // set safePasswords
     if (!@$Opt["safePasswords"] || is_int($Opt["safePasswords"]) && $Opt["safePasswords"] < 1) {
         $Opt["safePasswords"] = 0;
     } else {
         if ($Opt["safePasswords"] === true) {
             $Opt["safePasswords"] = 1;
         }
     }
 }