set_filename . utils . sncode
latest
Set current filename to process.
SET_FILENAME
NAME
set_filename - Set current filename to process.
SYNOPSIS
set_filename (string);
DESCRIPTION
This function is used to set current filename for execution.
This is used in the preload function.
PARAMETERS
- filename
- Specify the filename
EXAMPLES
Note: In the followings examples, the _ between the { should be removed to make it work.
{_{ %include "/usr/local/websiteincludes/extenso.sn"; %include "/usr/local/websiteextenso/functions/login.snc"; config = config(); request = request(); user = login(); ext = extention(request.filename); if ext ne "sn" && ext ne "snc" then status(-1); sncode = false; else status(0); sncode = true; endif //"Checking request\n"; if request.filename st config.document_root .+ "extranet" then //"Checking User\n"; if user.uid == undefined then if sncode then set_args("page=" .+ request.filename); set_filename("html/fr/login.snc"); else status(HTTP_FORBIDDEN); endif else status(0); endif endif }}
AUTHOR
Written by Pierre Laplante, <laplante@sednove.com>