home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
WinFiles.com 1998 June
/
WF0698_3.ISO
/
servers-websrv
/
websuite.exe
/
LOGON.AP_
/
LOGON.AP
Wrap
Text File
|
1998-04-01
|
2KB
|
75 lines
<[
// Virtual Name Server - User Logon
// (c) 1997-98 SmartDesk, Inc., All Rights Reserved
FUNCTION webUserDirOpen( session, path )
local dbname, dbindex, db
dbname = fileFixPath( path + '\userdir.db' )
if ( ! fileExists( dbname ) )
session.error( "Unable to open " + dbname + " data file.", "FFFFFF", "000000" )
return(0)
end
db = dbuse( dbname, "users", 1 )
if ( ! db )
session.error( "Unable to open " + dbname + " data file.", "FFFFFF", "000000" )
return(0)
end
dbindex = fileFixPath( path + '\userdir.dx' )
if ( ! fileExists( dbindex ) )
users->dbClose( )
session.error( "Unable to open " + dbindex + " index file.", "FFFFFF", "000000" )
return(0)
end
users->dbOpenIndex( dbindex )
users->dbOrder( 1 )
return( db )
END
// Main code
_apGenerate( )
websrvr = 0 + param( 1 )
sessionId = 0 + param( 2 )
session = new( "session", websrvr, sessionId )
// if ( ! session.secure( "UserDir.Admin" ) )
// return( 0 )
// end
data = session.data( "QUERY_STRING" )
if ( strempty( data ) )
session.error( "No Record Provided!" )
return( 0 )
end
rec = ( 0 + data ) - 16384
if ( rec < 1 )
session.error( "Invalid Record Specified!" )
return( 0 )
end
if ( ! webUserDirOpen( session, webServerBaseDir( websrvr ) ) )
return( 0 )
end
if ( ! users->dbGoto( rec ) )
session.error( "Invalid Record Specified!" )
return( 0 )
end
users->goto_url = "http://" + session.data( "REMOTE_ADDR" )
users->dbUnlock( )
users->dbClose( )
session.response( "Record successfully updated", "FFFFFF", "000000" )
return( 1 )
]>