Function Description
|
If the volunteer has selected the Delete button from a previous invocation of the form:
-
Get the User_Number from the hidden field, then delete the corresponding Upgrade_Request record, and update the corresponding User table User_Status_Msg with the string “Upgrade request declined on <date> by <REMOTE_USER> because: <Delete_Reason>.” where the appropriate values are inserted into the variables. Delete the corresponding record in the Invoice table and Invoice_Item table for this Upgrade_Request.
If the volunteer has selected the Approve button:
-
If Upgrade_User-Ind or Upgrade_User-Inst fields are True and no Member table record exists for this User_Number: insert a new record in the Member Table, setting the User_Number to User_Number, Member_Since to today’s date, Member_EnteredBy to REMOTE_USER, Member_UserName to the value of UserName supplied from the form, and the Value of Member_Type to “Institution” in the case of a Upgrade_User-Inst request or “Individual” for a Upgrade_User-Ind request. Call the add_alias command with parameters User_UserName as the old address and Member_UserName as the new address to map to. Call the change_username command to rename the user’s home directory and alter the appropriate entries in the /etc/password and /etc/shadow files. Call the edquota command with parameter “Prototype-Ind” or “Prototype-Inst” depending on the value of the Member_Type field.
-
If there is a corresponding record in the Member table for this User_Name:
-
If the Upgrade_toPPP is True, then call the add_ppp configuration command to add this user to the radiusd server.
-
If the Upgrade_toDB is True, then call the add_db command with the name from the Upgrade_DBName value and the Username of the user making the request passed as parameters.
-
If the Upgrade_Quota1 is greater than 0, then call the add_quota command with the parameters Sys_Quota1_Mnt, the value of the Upgrade_Quota1 multiplied by 1024, and the user’s Username who is making the request. Repeat this step for Quota2 and Quota3.
-
If Upgrade_toVirtualDomain is True, then call add_virtualdomain with the name from the Upgrade_VirtualDomainName and the user’s Username and Groupname passed as parameters. The Groupname should be set to “users”, the default UNIX user group for new users.
-
If Upgrade_toSSL is True, then call add_ssl with the value of the Service_VirtualDomainName (if one exists) or the value of the Upgrade_VirtualDomainName field.
-
If Upgrade_toAliases is True, then verify that the Upgrade_AliasGPFNAddress is not a UserName assigned to another user by checking whether it exists in the User or Member tables and that it is not an existing Alias for another user by checking whether it exists in the E-mail Alias table. If the alias is not assigned, then call the add_alias command with the values from the Upgrade_AliasExtAddress and Upgrade_AliasGPFNAddress as parameters.
-
If Upgrade_toListserver is True, then call the add_listserver command with the name from the Upgrade_ListserverName and the user’s Username as parameters.
-
Update the Upgrade table record and the Services table record by inserting the value of the REMOTE_USER variable into the User_EnteredBy, Upgrade_ApprovedBy and Services_EnteredBy fields.
-
Create a new receipt table record with the value of the Invoice_Number matching this User_Number, the User_Number, the current timestamp as the Receipt_Date, and the values from the CGI form for the values of Receipt_Amount, and Receipt_Payment_Type and REMOTE_USER as the Receipt_Entered_By
For all invocations of the script including the first:
-
Select all records in the Upgrade_Request table where the matching record in the User table with the same User_Number does not have User_IsActive = “Pending”
-
For each record found in step 1, list the following information in a formatted table for each record.
-
Each table listed in step 2 should contain an HTML form with a hidden field containing the User_Number.
-
Display the User_FirstName, User_LastName, User_Initial, User_Salutation, User_Organization (if exists), User_Title (if exists), User_StreetAddress1, User_StreetAddress2 (if exists), User_City, User_Province, User_Country, User_PostalCode, User_HomePhone (if exists), and User_WorkPhone (if exists).
-
In addition to the above fields, display the following additional values:
Upgrade_User-Ind or Upgrade_User-Inst (as a radio button)
Upgrade_toPPP (checkbox)
Upgrade_toDB (checkbox) and show Upgrade_DBName (textfield) if Upgrade_toDB is True
Upgrade_Quota1 (textfield)
Upgrade_Quota2 (textfield)
Upgrade_Quota3 (textfield)
Upgrade_toVirtualDomain (checkbox) and show Upgrade_VirtualDomainName (textfield) if Upgrade_toVirtualDomain is True
Upgrade_toSSL (checkbox)
Upgrade_toAliases (textfield) and show Upgrade_AliasExtAddress (textfield) and Upgrade_AliasGPFNAddress(textfield if Upgrade_toAliases is an integer > 0
Upgrade_toListserver (checkbox) and Upgrade_ListserverName (textfield) if Upgrade_toListserver is True
-
Get the Invoice table record with this User_Number and display the Invoice_Date and Invoice_Amount.
-
Display a textfield named Receipt_Amount and a radio button array named Receipt_Payment_Type with values “Cash”, “Cheque”, “In-Kind”, “Visa”, or “MasterCard”.
-
Get the Invoice table record with this User_Number and display the Invoice_Date and Invoice_Amount.
-
Display a textfield named Receipt_Amount and a radio button array named Receipt_Payment_Type with values “Cash”, “Cheque”, “In-Kind”, “Visa”, or “MasterCard”.
-
Display a textfield named “Delete_Reason”.
-
Display a “Approve” Submit Button and a “Delete” Submit Button for each Form.
|
Possible Exit Conditions and Return Values
|
-
If there are no pending applications, the list should be empty and volunteers can click a link to return to vol/index.html or the GPFN home page.
-
Any application from the list can be left it is current pending state, deleted from the system, or approved.
|