Page MenuHomec4science

Is_Referee.php.wml
No OneTemporary

File Metadata

Created
Tue, Jul 9, 16:06

Is_Referee.php.wml

## $Id$
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002 CERN.
##
## The CDSware is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## The CDSware is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDSware; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
<?
<protect>
## $Id$
## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
function Is_Referee($param_array,$MAINPATH)
{
global $uid_email,$URLPATH,$doctype;
$sysno = $GLOBALS[VARS]->get_sysno();
$repno = $GLOBALS[VARS]->get_report_number();
// Get document category
$res = mysql_query("
SELECT categ
FROM sbmAPPROVAL
WHERE rn='$repno'");
$row = mysql_fetch_row($res);
$categ = $row[0];
// Build referee's email address
$referees = "";
# Try to retrieve the referee's email from the referee's database
$res = mysql_query("
SELECT id_user
FROM user_rule
WHERE id_rule=".getRuleID("referee")." and
param1='$doctype' and
(param2='$categ' or param2='*')");
while ($row = mysql_fetch_row($res))
$referees .= getEmail($row[0]).",";
$referees = ereg_replace(",$","",$referees);
if (AUTHENTICATION)
{
if (!authenticate("$uid_email","referee","$doctype","%"))
{
Request_Print("A", "
<SCRIPT>
document.forms[1].action=\"$URLPATH/Main.php\";
document.forms[1].page.value = 1;
document.forms[1].submit();
alert('Sorry you ($uid_email) have not been recognized as a referee ($referees) for this type of document.\\nIf you think this is an error, please contact ".SUPPORT_EMAIL."');
</SCRIPT>");
exit;
}
}
}
</protect>
?>

Event Timeline