home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
WinFiles.com 1998 June
/
WF0698_3.ISO
/
servers-websrv
/
websuite.exe
/
USERDEL.AP_
/
USERDEL.AP
Wrap
Text File
|
1998-04-01
|
2KB
|
83 lines
<[
// Virtual Name Server - User Delete
// (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.var( "USERID" )
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
endtime = seconds( ) + 3
while ( ! users->dbRLock( ) )
if ( seconds( ) > endtime )
session.error( "Unable to lock record, please try again." )
return( 0 )
end
end
users->dbDelete( )
users->dbUnlock( )
users->dbClose( )
session.response( "<H2>Record successfully deleted.</H2><A HREF=\"useradmn.htm\"> Continue</A>...", "FFFFFF", "000000", "00FFFF" )
return( 1 )
]>