Page MenuHomec4science

Is_Original_Submitter.php.wml
No OneTemporary

File Metadata

Created
Tue, Sep 10, 09:22

Is_Original_Submitter.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.
##
## Name: Is_Original_Submitter.php
## Description: function Is_Original_Submitter
## This function compares the email of the current logged
## user with the original submitter of the document, then
## check whether the user has special rights.
## Author: T.Baron
##
## PARAMETERS: -
## OUTPUT: HTML
##
require_once("${HTDOCSDIR}submit/MESS/functions/Retrieve_Data.php");
function Is_Original_Submitter($param_array,$MAINPATH)
{
global $uid_email,$URLPATH,$doctype;
$sysno = $GLOBALS[VARS]->get_sysno();
if (AUTHENTICATION)
{
$email = Get_Field("8560_f","$sysno");
$email = ereg_replace("[\n\r ]+","",$email);
$uid_email = ereg_replace("[\n\r ]+","",$uid_email);
if (!eregi("${uid_email}",$email) &&
!authenticate("$uid_email","submissionuser","$doctype","MBI"))
{
Request_Print("A", "
<SCRIPT>
document.forms[1].action=\"$URLPATH/Main.php\";
document.forms[1].page.value = 1;
document.forms[1].submit();
alert('Only the submitter of this document has the right to do this action. \\nYour login ($uid_email) is different from the one of the submitter ($email).');
</SCRIPT>");
exit;
}
elseif (!eregi("$uid_email",$email) &&
authenticate("$uid_email","submissionuser","$doctype","MBI"))
{
Request_Print("A", "
<SCRIPT>
alert('Only the submitter of this document has the right to do this action. \\nYour login ($uid_email) is different from the one of the submitter ($email).\\n\\nAnyway, as you have a special authorization for this type of documents,\\nyou are allowed to proceed! Watch out your actions!');
</SCRIPT>");
}
}
}
</protect>
?>

Event Timeline