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", "."); } }
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; }