Example #1
0
function show_preprint($rowId, $action, $showcancelButton = True)
{
    global $dbClass;
    $res = $dbClass->query("SELECT * FROM publications WHERE RowId='" . $rowId . "'");
    $row = $dbClass->next_record($res);
    $c = "class='align_right'";
    $t = new table("cellpadding='2'", "<form action='loader.php?rowId=" . $rowId . "&amp;action=" . $action . "' method='POST'>");
    if ($showcancelButton) {
        $missing = x("", "?");
    } else {
        $missing = False;
    }
    $field = nl2html($GLOBALS["NOR_fields"][$row["Field"]]);
    $authors = nl2html($row["Authors"], $missing);
    $title = nl2html($row["Title"], $missing);
    $location = nl2html($row["Location"], $missing);
    $journal = nl2html($row["PublIn"], $missing);
    $t->tro();
    $t->th($c, "Preprint :");
    $t->td("", pp_preprintID($row["Year"], $row["Report"]));
    $t->trc();
    $t->tro();
    $t->th($c, "Field :");
    $t->td("", $field);
    $t->trc();
    $t->tro();
    $t->th($c, "Authors :");
    $t->td("", $authors);
    $t->trc();
    if ($location) {
        $t->tro();
        $t->th($c, "Location :");
        $t->td("", $location);
        $t->trc();
    }
    if ($journal) {
        $t->tro();
        $t->th($c, "Published in :");
        $t->td("", $journal);
        $t->trc();
    }
    $t->tro();
    $t->th($c, "Entered by :");
    $t->td("", uid2gecos($row["Id"]));
    $t->trc();
    $buttons[] = "<input type='submit' value='continue' name='button'>";
    if ($showcancelButton) {
        $buttons[] = "<input type='submit' value='cancel' name='button'>" . "<input type='hidden' name='load' value='show_preprints.php'>";
    } else {
        $buttons[] = "<input type='submit' value='update information for this preprint' name='button'>" . "<input type='hidden' name='load' value='edit_preprints.php'>" . "<input type='hidden' name='nor_pp_mode' value='" . NOR_PP_MODE_EDIT . "'>";
    }
    $t->tro();
    $t->td();
    $t->td("", join("&nbsp;", $buttons));
    $t->trc();
    if (!$showcancelButton) {
        $t->tr("", "colspan='3'", x("i", "<br>When you have published this preprint in a Public Archive<br>" . "(i.e. you know the URL to the abstract)<br>please return and complete the form.<br><br>" . "If you want to publish _only_ at Nordita you can upload your paper now.<br>" . "Note, you can correct eventual typos at any time, and you may also cancel the preprint reservation."));
    }
    $t->close("</form>");
}
Example #2
0
function core_tdbg($name, $key, $value)
{
    global $core_debug, $core_tableDbg, $prevDbg, $nDbg;
    if (!$core_debug) {
        return;
    }
    if (!isset($value)) {
        return;
    }
    $class = "class='core_debug log{$nDbg}'";
    if (!$core_tableDbg) {
        $core_tableDbg = new table('cellpadding=0 cellspacing=0', '<div align=left>');
    }
    $core_tableDbg->tro($class);
    // valign=top");
    $core_tableDbg->td(' width=10', $name == $prevDbg ? '' : $name . '&nbsp;');
    $core_tableDbg->td('', "{$key}&nbsp;");
    if (is_array($value)) {
        foreach ($value as $k => $v) {
            if ($ncount++) {
                $core_tableDbg->trc();
                $core_tableDbg->tro($class);
                $core_tableDbg->td();
                $core_tableDbg->td();
            }
            $core_tableDbg->td(' width=1', $k . "&nbsp;");
            $core_tableDbg->td('', core_formatString($key, $v));
        }
    } else {
        $core_tableDbg->td('' . ' colspan=9', core_formatString($key, $value));
    }
    $core_tableDbg->trc();
    $prevDbg = $name;
}
Example #3
0
        $t->td("", core_getLink("see access log", "listLog.php"));
    }
    if (True) {
        $t->td("", core_getLink(PP_RESERVE, "edit_preprints.php?nor_pp_period=" . $nor_pp_period . "&amp;nor_pp_mode=" . NOR_PP_MODE_RESERVE));
    }
} else {
    $t->td("", "<div class='only_online'>" . pp_getLink("how to submit preprint", "howto.php", $modal = True) . "</div>");
}
$t->trc();
$t->close("</form>");
$t = new table("class='filled' align='center' width='100%'", "<div id='preprints' class='pp_list'>");
$t->tro();
$t->th("width='60'", "<span class='only_online'>Serial</span>");
$t->th("", "Title and author(s)");
$t->th("", "Published in");
$t->trc();
if ($group != "all") {
    $queryG = " AND Field=" . $dbClass->quote($group);
} else {
    $queryG = "";
}
if ($author) {
    $queryA = " AND Authors LIKE '" . $dbClass->quote("%" . $author . "%") . "'";
} else {
    $queryA = "";
}
$dbClass->query("SELECT * FROM publications WHERE " . ($selectPP ? "RowId = '" . $selectPP . "'" : "Status='ok' AND Year>='" . $yFirst . "' AND Year<='" . $yLast . "' " . $queryG . " " . $queryA) . "  ORDER BY Year,Report DESC");
while ($pr = $dbClass->next_record()) {
    prtRow($pr, $t);
}
$t->close("</div>");
Example #4
0
function add_SQLuser()
{
    global $t, $links, $tabs, $dbClass, $authClass;
    if (!$_REQUEST["t"]) {
        $_REQUEST["t"] = "event";
    }
    $accE = $_REQUEST["t"] == "event";
    $error = array();
    if ($_REQUEST["button"]) {
        $users = getSQLusers();
        if ($v = $_REQUEST["full_name"]) {
            foreach ($users as $k => $u) {
                if (strToLower($u["gecos"]) == strToLower($v)) {
                    $error[] = x("li", "'{$v}' is already known as '{$u['email']}'");
                }
            }
            if ($accE && !eregi("20[0-9][0-9]\$", $v)) {
                $error[] = x("li", "'event title' must have the year at the end");
            }
        }
        if ($v = strToLower($_REQUEST["username"])) {
            foreach ($users as $k => $u) {
                if (strToLower($u["email"]) == strToLower($v)) {
                    $error[] = x("li", "'{$v}' is already known as '{$u['gecos']}'");
                }
            }
            if ($accE && !eregi("^[a-z0-9]*\$", $v)) {
                $error[] = x("li", "'{$v}' is not a valid login name");
            }
            if (!$accE && !eregi("@", $v)) {
                $error[] = x("li", "'{$v}' is not a valid e-mail address");
            }
        }
    }
    if ($error || !$_REQUEST["username"] || !$_REQUEST["full_name"]) {
        /*
         * (re)send the form
         */
        $tt = new table("cellpadding='10'", "<center>" . x("h3", "Adding new external user"));
        $tt->tr("", "valign='top' colspan='3'", x("i", "The external user account is associated either with a <ul>" . "<li> a person (identified by his e-mail and password) or</li>" . "<li> a Nordita event (program, conference, etc.)</li></ul>"));
        $tt->tro();
        $tt->td($accE ? "Both the <b>event title</b> and <b>login name</b><br>must end by the 4-digits Year." . "<br><br><b>contact e-mail</b> is a comma-separated list<br>of the organizer e-mails" : "");
        $tt->tdo("valign='top'");
        $t = new table("", "<form action='" . $links[$tabs->active] . "' method='post'>");
        if ($error) {
            str(False, "errors detected:" . x("ul", join("\n", $error)), "colspan='3' class='registered'");
        }
        $r = "input type ='radio' name='t' onchange='submit()'";
        str("account type", "<{$r} value='human' " . ($accE ? "" : "checked") . ">personal account <{$r} value='event' " . ($accE ? "checked" : "") . ">event account");
        str($accE ? "event title" : "full name", "<input type='text' name='full_name' value='{$_REQUEST['full_name']}' size='35'>");
        str($accE ? "login name" : "e-mail", "<input type='text' name='username'  value='{$_REQUEST['username']}'  size='35'>");
        if ($accE) {
            str("proposed password", "<input type='password' name='pwd'  value='{$_REQUEST['pwd']}'  size='35'>");
        }
        if ($accE) {
            str("confirm password", "<input type='password' name='pwd2' value='{$_REQUEST['pwd2']}' size='35'>");
        }
        if ($accE) {
            str("contact e-mail(s)", "<input type='text' name='contact' value='{$_REQUEST['contact']}'  size='35'>");
        }
        str(" ", "<input type='submit' name='button' value='submit'> <input type='submit' name='button' value='cancel'>");
        $t->close("</form>");
        $tt->tdc();
        $tt->trc();
        $tt->close("</center>");
    } else {
        /*
         * the form is ok. Create the account, send info mail
         */
        $users = getSQLusers();
        $uid = -1000;
        while ($users[$uid]) {
            --$uid;
        }
        if (!$_REQUEST["pwd"]) {
            $_REQUEST["pwd"] = $authClass->random_password(8);
        }
        $dbClass->query("INSERT INTO accounts (id,username,password,new_password,full_name,status,superviser) " . "VALUES ('{$uid}','{$_REQUEST['username']}','{$_REQUEST['pwd']}','{$_REQUEST['pwd']}','{$_REQUEST['full_name']}',1,'{$_REQUEST['contact']}')");
        logIt("newuser", $_REQUEST["username"], $_REQUEST["full_name"]);
        print x("h3", "New user for the Preprints Database");
        $t = new table();
        #   $t->tr("","",$uid,"uid:");
        $t->tr("", "", $_REQUEST["full_name"], "name:");
        $t->tr("", "", $_REQUEST["username"], x("b", "login name:"));
        if ($_REQUEST["contact"]) {
            $t->tr("", "", $_REQUEST["contact"], x("b", "contact e-mail:"));
        } else {
            $t->tr("", "colspan='2'", x("i", "The password is sent to " . $_REQUEST["username"]));
        }
        $t->close();
        mail2newUser($_REQUEST["username"]);
    }
}
Example #5
0
 public static function showMailsSent()
 {
     if (!empty(self::$sentMails)) {
         $t = new table("cellpadding='5' cellspacing='0' bgcolor='yellow' " . core_getConfig("errorWidth", "width=70%"));
         $t->tro();
         $t->th("colspan=3", "Important message");
         $t->trc();
         $many = count(self::$sentMails) > 1;
         $t->tr("", "colspan=3", "We have sent the following e-mail" . ($many ? "s" : "") . " (see below) with an important information.<br>" . "Please make sure that " . ($many ? "these e-mails are" : "this e-mail is") . " not considered as spam by the mail filter and that<br>" . ($many ? "they reach" : "it reaches") . " the address you indicated.<br>");
         $t->tro();
         $t->th("", "&nbsp;&nbsp;&nbsp;&nbsp;");
         $t->th("", $t->x("i", "To:"));
         $t->th("", $t->x("i", "Subject:"));
         $t->trc();
         foreach (self::$sentMails as $to => $v) {
             if (!$v || (int) $to) {
                 continue;
             }
             foreach ($v as $k => $subject) {
                 $t->tro();
                 $t->td();
                 $t->td("", $to);
                 $t->td("", $subject);
                 $t->trc();
                 $to = "";
             }
         }
         $t->close();
     }
 }
Example #6
0
 function showMailsSent()
 {
     global $apps_listOfEmails;
     if ($apps_listOfEmails) {
         $t = new table("cellpadding='5' cellspacing='0' bgcolor='yellow' " . core_getConfig('errorWidth', 'width=70%'));
         $t->tro();
         $t->th('colspan=3', 'Important message');
         $t->trc();
         $many = count($apps_listOfEmails) > 1;
         $t->tr('', 'colspan=3', 'We have sent the following e-mail' . ($many ? 's' : '') . ' (see below) with an important information.<br>' . 'Please make sure that ' . ($many ? 'these e-mails are' : 'this e-mail is') . ' not considered as spam by the mail filter and that<br>' . ($many ? 'they reach' : 'it reaches') . ' the address you indicated.<br>');
         $t->tro();
         $t->th('', '&nbsp;&nbsp;&nbsp;&nbsp;');
         $t->th('', $t->x('i', "To:"));
         $t->th('', $t->x('i', "Subject:"));
         $t->trc();
         foreach ($apps_listOfEmails as $to => $v) {
             if (!$v || (int) $to) {
                 continue;
             }
             foreach ($v as $k => $subject) {
                 $t->tro();
                 $t->td();
                 $t->td('', $to);
                 $t->td('', $subject);
                 $t->trc();
                 $to = '';
             }
         }
         $t->close();
     }
 }