예제 #1
0
function nor_pp_require_row_owner($rowId, $user)
{
    global $authClass, $dbClass;
    if ($authClass->isAdmin()) {
        return;
    }
    $res = $dbClass->query("SELECT Id FROM publications WHERE RowId='" . $rowId . "'");
    $row = $dbClass->next_record($res);
    $account = core_getpw($row["Id"], $dbClass);
    if (!$account or $user != $account["name"]) {
        errorPage("Only the submitting author may edit a preprint", "Access Denied", "Unauthorized access", ".");
    }
}
예제 #2
0
 function addAdmin($id)
 {
     if (!($account = core_getpw($id, $this->db))) {
         return False;
     }
     $this->admins[$account["name"]]++;
     $this->dbg("addAdmin", $account["name"], $account["gecos"]);
     return $account;
 }