From: Rob H. <for...@us...> - 2002-02-03 03:24:46
|
Update of /cvsroot/sandweb/sandweb/bin In directory usw-pr-cvs1:/tmp/cvs-serv18929 Modified Files: sandweb.cgi Log Message: made sure there were comments for every single subroutine. Also, made comment style for subroutines uniform. Listed all args for given subroutine in it's comments, as well as a list of objects that are created and used within. Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.147 retrieving revision 1.148 diff -U2 -r1.147 -r1.148 --- sandweb.cgi 2002/02/02 01:41:09 1.147 +++ sandweb.cgi 2002/02/03 03:24:44 1.148 @@ -56,4 +56,13 @@ my $prefs_config = 'prefs.cfg'; +############################################################################### +# main +# +# The main subroutine is called at every invocation of sandewb.cgi +# Processes user requests and calls the appropriate subroutine. +# +# Paramaters : +# action - name of the action the user has requested. +############################################################################### sub main { my $action = CGI::param('action'); @@ -260,6 +269,12 @@ ## -# print login template -# get user info +############################################################################### +# login menu +# +# the login_menu subroutine displays the login_menu template, which +# asks users for their username and password. +# +# No args. +############################################################################### sub login_menu { my %args = @_; @@ -284,5 +299,13 @@ } -# main menu, greet the user +############################################################################### +# main menu +# +# greet the user +# deprecated +# +# args : +# ck_auth - cookie data. +############################################################################### sub main_menu { my %args = @_; @@ -317,5 +340,12 @@ #kill fido -# debug menu, dump all config objects +############################################################################### +# debug menu +# +# dump all config objects +# +# args : +# ck_auth - cookie data. +############################################################################### sub debug_menu { my %args = @_; @@ -345,12 +375,15 @@ } -# +############################################################################### # sandbox menu -# -# main menu to do stuff with sandbox section. # -# ck_auth - cookie data. +# displays the sandbox_menu template which displays available checkouts to +# the user, as well as links to make new checkouts and change repository +# settings. # -# +# args : +# ck_auth - cookie data. +############################################################################### + sub sandbox_menu { my %args = @_; @@ -400,11 +433,15 @@ } -# -# calls the Browse object, for viewing/selecting files -# args: +############################################################################### +# browse module menu # -# location - scalar to specify where to browse. -# ck_auth - the sessions cookie +# This is for viewing/selecting files for VCS and File actions. +# A Browse object is created and used. +# A File object is created and used. # +# args: +# location - scalar to specify where to browse. +# ck_auth - the sessions cookie +############################################################################### sub browse_module_menu { my %args = @_; @@ -493,7 +530,16 @@ } +############################################################################### # file operations such as file/folder creation, viewing and editing -# happen in this subroutine. A file object is created and used. +# happen in this subroutine. +# A File object is created and used. # +# args: +# ck_auth - the sessions cookie +# file_command - name of the File object method to be invoked +# filename - name of the file(s) that the File object should +# be invoked with. NOTE: this is an array +# location - system path to the file(s) specified by filename +############################################################################### sub file { my %args = @_; @@ -815,8 +861,19 @@ } +############################################################################### +# vcsaction +# # all VCS actions are caught by this subroutine, and dealt -# with accordingly. The Repository object is created and used. +# with by calling the appropriate Repository method. # - +# A Repository object is created and used. +# +# args: +# ck_auth - the sessions cookie +# vcs_command - name of the Repository object method to be invoked +# filename - name of the file(s) that the vcs_command should +# be used with. NOTE: this is an array +# location - system path to the file(s) specified by filename +############################################################################### sub vcsaction { my %args = @_; @@ -970,5 +1027,12 @@ -# user prefs, this is the preferences menu for configuring the users prefs.cfg +############################################################################### +# preferences menu +# +# user prefs, this is the menu for configuring the users prefs.cfg +# +# args: +# ck_auth - the sessions cookie +############################################################################### sub preferences_menu { my %args = @_; @@ -1004,18 +1068,20 @@ +############################################################################### # repository menu # # manage repository information, add/delete/modify repositories -# -# ck_auth - cookie data -# repository_selected - name of selected repository -# repository_name - name of repository selected -# repo_name - name of repository -# server - name of repositories server -# usr_name - user name for repository -# repo_type - type of repository (CVS, RSH, arch, subversion etc). -# connection - connection type -# root - repository root # +# args : +# ck_auth - cookie data +# repository_selected - name of selected repository +# repository_name - name of repository selected +# repo_name - name of repository +# server - name of repositories server +# usr_name - user name for repository +# repo_type - type of repository (CVS, RSH, arch, SVN etc). +# connection - connection type +# root - root of VCS repository +############################################################################### sub repository_menu { my %args = @_; @@ -1166,4 +1232,13 @@ } +############################################################################### +# vcs prefs menu +# +# being replaced by reopsitory menu? +# deprecated +# +# args: +# ck_auth - the sessions cookie +############################################################################### sub vcs_prefs_menu { my %args = @_; @@ -1253,4 +1328,12 @@ ## +############################################################################### +# preferences commit +# +# Writes user preference data to user's config file. +# +# args: +# ck_auth - the sessions cookie +############################################################################### sub preferences_commit { my %args = @_; @@ -1312,7 +1395,14 @@ ## +############################################################################### +# load prefs +# # check user prefs config file, if it doesn't exist, # call the preferences menu to fill in required info. # if it does exist, load it. +# +# No args. +# +############################################################################### sub load_prefs { my $no_error = shift; @@ -1366,4 +1456,14 @@ } +############################################################################### +# login +# +# Processes login requests. If login is incorrect, the user +# is returned to the login_menu +# +# args: +# username - current user's attempted username +# password - current user's attempted password +############################################################################### sub login { @@ -1397,6 +1497,12 @@ } +############################################################################### +# logout +# +# Expires the user's session. +# +# No args. +############################################################################### sub logout { - my %args = @_; my $stat = $auth->logout(); @@ -1410,5 +1516,11 @@ } +############################################################################### +# set error +# # assign error message to global $error IF it's not yet set. +# +# No args. +############################################################################### sub set_error { if (! $error) { @@ -1421,3 +1533,6 @@ } +############################################################################### +# No subroutine was specified, call the main subroutine +############################################################################### &main(); |