Go to main content

set_filename

Set current filename to process.

SET_FILENAME

NAME

set_filename - Set current filename to process.

SYNOPSIS

set_filename (string filename);

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
}}

SEE ALSO

AUTHOR

Written by Pierre Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.