static function load()
 {
     global $Opt;
     if (!self::$loaded) {
         self::$loaded = true;
         foreach (expand_includes("src/sa/*.php") as $f) {
             include $f;
         }
         if (isset($Opt["searchaction_include"]) && $Opt["searchaction_include"]) {
             read_included_options($Opt["searchaction_include"]);
         }
     }
 }
 static function load_confid($confid)
 {
     global $Opt;
     $save_opt = $Opt;
     $Opt = self::$original_opt;
     self::assign_confid($Opt, $confid);
     if (get($Opt, "include")) {
         read_included_options($Opt["include"]);
     }
     $newconf = get($Opt, "missing") ? null : new Conf($Opt, true);
     $Opt = $save_opt;
     return $newconf;
 }
Exemple #3
0
}
if (!@$Opt["loaded"]) {
    if (defined("HOTCRP_OPTIONS")) {
        if (@(include HOTCRP_OPTIONS) !== false) {
            $Opt["loaded"] = true;
        }
    } else {
        if (@(include "{$ConfSitePATH}/conf/options.php") !== false || @(include "{$ConfSitePATH}/conf/options.inc") !== false || @(include "{$ConfSitePATH}/Code/options.inc") !== false) {
            $Opt["loaded"] = true;
        }
    }
    if (@$Opt["multiconference"]) {
        Multiconference::init();
    }
    if (@$Opt["include"]) {
        read_included_options($ConfSitePATH, $Opt["include"]);
    }
}
if (!@$Opt["loaded"] || @$Opt["missing"]) {
    Multiconference::fail_bad_options();
}
// Allow lots of memory
function set_memory_limit()
{
    global $Opt;
    if (!@$Opt["memoryLimit"]) {
        $suf = array("" => 1, "k" => 1 << 10, "m" => 1 << 20, "g" => 1 << 30);
        if (preg_match(',\\A(\\d+)\\s*([kmg]?)\\z,', strtolower(ini_get("memory_limit")), $m) && $m[1] * $suf[$m[2]] < 128 << 20) {
            $Opt["memoryLimit"] = "128M";
        }
    }
}
if (!get($Opt, "loaded")) {
    if (defined("HOTCRP_OPTIONS")) {
        if (@(include HOTCRP_OPTIONS) !== false) {
            $Opt["loaded"] = true;
        }
    } else {
        if (@(include "{$ConfSitePATH}/conf/options.php") !== false || @(include "{$ConfSitePATH}/conf/options.inc") !== false || @(include "{$ConfSitePATH}/Code/options.inc") !== false) {
            $Opt["loaded"] = true;
        }
    }
    if (get($Opt, "multiconference")) {
        Multiconference::init();
    }
    if (get($Opt, "include")) {
        read_included_options($Opt["include"]);
    }
}
if (!get($Opt, "loaded") || get($Opt, "missing")) {
    Multiconference::fail_bad_options();
}
if (get($Opt, "dbLogQueries")) {
    Dbl::log_queries($Opt["dbLogQueries"]);
}
// Allow lots of memory
function set_memory_limit()
{
    global $Opt;
    if (!get($Opt, "memoryLimit")) {
        $suf = array("" => 1, "k" => 1 << 10, "m" => 1 << 20, "g" => 1 << 30);
        if (preg_match(',\\A(\\d+)\\s*([kmg]?)\\z,', strtolower(ini_get("memory_limit")), $m) && $m[1] * $suf[$m[2]] < 128 << 20) {
Exemple #5
0
        $contact_info_map = $row->replace_contact_info_map(null);
        $contacts = array();
        while ($contact = edb_orow($result)) {
            $row->assign_contact_info($contact, $contact->contactId);
            self::send_to(Contact::make($contact), $template, $row, $rest);
            $contacts[] = Text::user_html($contact);
        }
        $row->replace_contact_info_map($contact_info_map);
        if ($Me->allow_administer($row) && !$row->has_author($Me) && count($contacts)) {
            $endmsg = isset($rest["infoMsg"]) ? ", " . $rest["infoMsg"] : ".";
            $Conf->infoMsg("Sent email to paper #{$row->paperId}’s " . pluralx($contacts, "reviewer") . ", " . commajoin($contacts) . $endmsg);
        }
    }
    static function send_manager($template, $row, $rest = array())
    {
        if ($row && $row->managerContactId && ($c = Contact::find_by_id($row->managerContactId))) {
            self::send_to($c, $template, $row, $rest);
        } else {
            self::send_to(Contact::site_contact(), $template, $row, $rest);
        }
    }
}
// load mail templates, including local ones if any
global $ConfSitePATH, $Opt;
require_once "{$ConfSitePATH}/src/mailtemplate.php";
if (@(include "{$ConfSitePATH}/conf/mailtemplate-local.php") !== false) {
    /* do nothing */
}
if (@$Opt["mailtemplate_include"]) {
    read_included_options($ConfSitePATH, $Opt["mailtemplate_include"]);
}
            if ($p = self::prepare_to($contact, $template, $row, $rest)) {
                $preps[] = $p;
                $contacts[] = Text::user_html($contact);
            }
        }
        self::send_combined_preparations($preps);
        $row->replace_contact_info_map($contact_info_map);
        if ($Me->allow_administer($row) && !$row->has_author($Me) && count($contacts)) {
            $endmsg = isset($rest["infoMsg"]) ? ", " . $rest["infoMsg"] : ".";
            $Conf->infoMsg("Sent email to paper #{$row->paperId}’s " . pluralx($contacts, "reviewer") . ", " . commajoin($contacts) . $endmsg);
        }
    }
    static function send_manager($template, $row, $rest = array())
    {
        $rest["combination_type"] = 2;
        if ($row && $row->managerContactId && ($c = Contact::find_by_id($row->managerContactId))) {
            self::send_to($c, $template, $row, $rest);
        } else {
            self::send_to(Contact::site_contact(), $template, $row, $rest);
        }
    }
}
// load mail templates, including local ones if any
global $ConfSitePATH, $Opt;
require_once "{$ConfSitePATH}/src/mailtemplate.php";
if (@(include "{$ConfSitePATH}/conf/mailtemplate-local.php") !== false || @(include "{$ConfSitePATH}/conf/mailtemplate-local.inc") !== false || @(include "{$ConfSitePATH}/Code/mailtemplate-local.inc") !== false) {
    /* do nothing */
}
if (isset($Opt["mailtemplate_include"]) && $Opt["mailtemplate_include"]) {
    read_included_options($Opt["mailtemplate_include"]);
}