home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
WinFiles.com 1998 June
/
WF0698_3.ISO
/
servers-websrv
/
websuite.exe
/
USERADD2.AP_
/
USERADD2.AP
Wrap
Text File
|
1998-04-01
|
3KB
|
135 lines
<[
// Virtual Name Server - User Input Routine
// (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
if ( ! webUserDirOpen( session, webServerBaseDir( websrvr ) ) )
return( 0 )
end
]>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- SmartDesk Active Page, www.smartdesk.com -->
<HTML>
<HEAD>
<TITLE>Virtual Name Server - User Add Results</TITLE>
</HEAD>
<BODY BGCOLOR="#000000" TEXT="#FFFFFF" LINK="#00FFFF" VLINK="#00FFFF" ALINK="#00FFFF">
<P>
<[
msg = ""
fname = session.var( "fname" )
if ( strempty( fname ) )
msg += "Must specifiy your first name.<BR>"
end
mname = session.var( "mname" )
lname = session.var( "lname" )
if ( strempty( lname ) )
msg = "Must specifiy your last name.<BR>"
end
street = session.var( "street" )
city = session.var( "city" )
state = session.var( "state" )
zip = session.var( "zip" )
country = session.var( "country" )
c_name = session.var( "c_name" )
if ( strempty( c_name ) )
msg += "Must specifiy a company name.<BR>"
end
c_title = session.var( "c_title" )
if ( strempty( c_title ) )
msg += "Must specifiy a descriptive title.<BR>"
end
phone1 = session.var( "phone1" )
phone2 = session.var( "phone2" )
phone3 = session.var( "phone3" )
phone4 = session.var( "phone4" )
email = session.var( "email" )
if ( ! strempty( msg ) )
! "<P><FONT SIZE=4 COLOR=\"#00FFFF\"><B>Errors present, unable to process form.</B></FONT></P>"
! "<P><B>" + msg + "</B>"
else
// append the record
users->dbAppend( )
users->status = 1
users->fname = fname
users->mname = mname
users->lname = lname
users->street = street
users->city = city
users->state = state
users->zip = zip
users->country = country
users->c_name = c_name
users->c_title = c_title
users->phone1 = phone1
users->phone2 = phone2
users->phone3 = phone3
users->phone4 = phone4
users->email = email
users->goto_url = ""
users->msg = ""
users->unused = ""
users->dbUnlock( )
! "<H2>Record <FONT COLOR=\"#FFFF00\">#" + ( users->recno( ) + 16384 ) + "</FONT> for <FONT COLOR=\"#FFFF00\">" + rtrim( users->fname ) + " " + rtrim( users->lname ) + "</FONT><BR>has been successfully added to the directory!</H2>"
! "<A HREF=\"useradmn.htm\"> Continue</A>..."
end
users->dbClose( )
]>
</P>
</BODY>
</HTML>