Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90564595
sub.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 2, 19:44
Size
1 KB
Mime Type
text/x-python
Expires
Mon, Nov 4, 19:44 (2 d)
Engine
blob
Format
Raw Data
Handle
22093730
Attached To
R3600 invenio-infoscience
sub.py
View Options
## $Id$
##
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002, 2003, 2004, 2005, 2006 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.
## import interesting modules:
import
string
import
os
import
sys
import
time
import
types
import
re
from
mod_python
import
apache
from
cdsware.config
import
cdsname
,
cdslang
from
cdsware.access_control_engine
import
acc_authorize_action
from
cdsware.access_control_admin
import
acc_isRole
from
cdsware.websubmit_config
import
*
from
cdsware.webpage
import
page
,
create_error_box
from
cdsware.webuser
import
getUid
,
get_email
,
page_not_authorized
from
cdsware.access_control_config
import
CFG_ACCESS_CONTROL_LEVEL_SITE
def
index
(
req
,
c
=
cdsname
,
ln
=
cdslang
):
uid
=
getUid
(
req
)
if
uid
==
-
1
or
CFG_ACCESS_CONTROL_LEVEL_SITE
>=
1
:
return
page_not_authorized
(
req
,
"../sub.py/index"
)
myQuery
=
req
.
args
if
myQuery
:
if
re
.
search
(
"@"
,
myQuery
):
param
=
re
.
sub
(
"@.*"
,
""
,
myQuery
)
IN
=
re
.
sub
(
".*@"
,
""
,
myQuery
)
else
:
IN
=
myQuery
url
=
"
%s
/direct.py?sub=
%s
&
%s
"
%
(
urlpath
,
IN
,
param
)
req
.
err_headers_out
.
add
(
"Location"
,
url
)
raise
apache
.
SERVER_RETURN
,
apache
.
HTTP_MOVED_PERMANENTLY
return
""
else
:
return
"<html>Illegal page access</html>"
Event Timeline
Log In to Comment