1 # ===================================================================== 2 # getSession.awk: RPC I/O function for rpclib/getSession. 3 # 4 # Copyright (c) 2010 Carlo Strozzi 5 # 6 # This program is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; version 2 dated June, 1991. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program; if not, write to the Free Software 17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 # 19 # ===================================================================== 20 21 # ===================================================================== 22 # void _userproc(int mode) 23 # ===================================================================== 24 25 function _userproc(mode, value) { 26 27 if (mode == _O_REQUEST) { # request. 28 29 # I use "s" as the session variable name, to leave 30 # numeric arguments at the application's disposal. 31 # The following rexex must match a TagURI string. 32 33 if ((value=_request("s",1)) ~ /^[a-z0-9][-a-z0-9.,:]+$/) 34 _rcset("cgi.session",value) 35 } 36 } 37 38 # EOF