103 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
		
		
			
		
	
	
			103 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
| 
								 | 
							
								<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
							 | 
						||
| 
								 | 
							
								<html>
							 | 
						||
| 
								 | 
							
								<head>
							 | 
						||
| 
								 | 
							
								  <meta content="text/html; charset=ISO-8859-15"
							 | 
						||
| 
								 | 
							
								 http-equiv="content-type">
							 | 
						||
| 
								 | 
							
								  <title>File upload</title>
							 | 
						||
| 
								 | 
							
								  <link rel="stylesheet" type="text/css" href="style/layout.css">
							 | 
						||
| 
								 | 
							
								</head>
							 | 
						||
| 
								 | 
							
								<body>
							 | 
						||
| 
								 | 
							
								<h1 style="text-align: center;">File upload<br>
							 | 
						||
| 
								 | 
							
								</h1>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<div style="text-align: center;"><img
							 | 
						||
| 
								 | 
							
								 style="width: 886px; height: 162px;" alt="upload"
							 | 
						||
| 
								 | 
							
								 src="images/lam_upload.png"><br>
							 | 
						||
| 
								 | 
							
								<div style="text-align: left;"><br>
							 | 
						||
| 
								 | 
							
								<h2>Account selection (masscreate.php)<br>
							 | 
						||
| 
								 | 
							
								</h2>
							 | 
						||
| 
								 | 
							
								This is the initial page of the file upload. The user selects the
							 | 
						||
| 
								 | 
							
								account type for the new upload.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<h2>Attribute overview (masscreate.php)</h2>
							 | 
						||
| 
								 | 
							
								After the account selection LAM will display an overview of the
							 | 
						||
| 
								 | 
							
								possible and required input columns.<br>
							 | 
						||
| 
								 | 
							
								The <span style="font-style: italic;">DN</span> attributes (<span
							 | 
						||
| 
								 | 
							
								 style="font-style: italic;">DN suffix</span> and <span
							 | 
						||
| 
								 | 
							
								 style="font-style: italic;">RDN</span>) are static and are always
							 | 
						||
| 
								 | 
							
								displayed. The default suffix is read from config with <span
							 | 
						||
| 
								 | 
							
								 style="font-weight: bold;">getAccountSuffix()</span> and the list of
							 | 
						||
| 
								 | 
							
								RDN possibilities is taken from modules.inc - <span
							 | 
						||
| 
								 | 
							
								 style="font-weight: bold;">getRDNAttributes()</span>.<br>
							 | 
						||
| 
								 | 
							
								The next attributes are read from modules.inc - <span
							 | 
						||
| 
								 | 
							
								 style="font-weight: bold;">getUploadColumns()</span>. LAM will display
							 | 
						||
| 
								 | 
							
								all attributes of one module in a separate fieldset. The <span
							 | 
						||
| 
								 | 
							
								 style="font-weight: bold;">getUploadColumns()</span> function also
							 | 
						||
| 
								 | 
							
								returns if an attribute is required and additional information like an
							 | 
						||
| 
								 | 
							
								example value.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								After clicking the upload button the user will be forwarded to the
							 | 
						||
| 
								 | 
							
								account building page.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<h2>Account building (massBuildAccounts.php)<br>
							 | 
						||
| 
								 | 
							
								</h2>
							 | 
						||
| 
								 | 
							
								This part takes the submitted <span style="font-weight: bold;">CSV file</span>
							 | 
						||
| 
								 | 
							
								and generates the LDAP accounts.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								The scripts separates the head row from the data rows in the CSV file.
							 | 
						||
| 
								 | 
							
								The head array is used to find the position of the input values. The
							 | 
						||
| 
								 | 
							
								data array contains one subarray for each account.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								After the data has been extracted there are some basic checks done,
							 | 
						||
| 
								 | 
							
								e.g. checking required and unique columns. The modules provide the
							 | 
						||
| 
								 | 
							
								necessary information for this.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								Then all data is given to the modules with <span
							 | 
						||
| 
								 | 
							
								 style="font-weight: bold;">buildUploadAccounts()</span> in
							 | 
						||
| 
								 | 
							
								modules.inc. They return a list of accounts which can be uploaded with <span
							 | 
						||
| 
								 | 
							
								 style="font-style: italic;">ldap-add()</span> and generate possible
							 | 
						||
| 
								 | 
							
								error messages.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								If the accounts are built the script will give the user the possibility
							 | 
						||
| 
								 | 
							
								to check the result with an <span style="font-style: italic;">LDIF-file</span>
							 | 
						||
| 
								 | 
							
								or to do the upload.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<h2>LDIF export (massBuildAccounts.php)<br>
							 | 
						||
| 
								 | 
							
								</h2>
							 | 
						||
| 
								 | 
							
								LAM simply takes the built accounts and generates an <span
							 | 
						||
| 
								 | 
							
								 style="font-style: italic;">LDIF-file</span> from them. This is passed
							 | 
						||
| 
								 | 
							
								to the user's browser.<br>
							 | 
						||
| 
								 | 
							
								The <span style="font-style: italic;">LDIF-file</span> will only
							 | 
						||
| 
								 | 
							
								contain the accounts itself. If modules do additional tasks after the
							 | 
						||
| 
								 | 
							
								upload (e.g. adding users to groups) this will not be covered.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								<h2>Account creation (massDoUpload.php)<br>
							 | 
						||
| 
								 | 
							
								</h2>
							 | 
						||
| 
								 | 
							
								This script finally uploads the LDAP accounts with <span
							 | 
						||
| 
								 | 
							
								 style="font-style: italic;">ldap_add()</span>.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								The upload can last longer than the maximum execution time of PHP.
							 | 
						||
| 
								 | 
							
								Therefore the script will check regulary how much time is left and
							 | 
						||
| 
								 | 
							
								pause the upload. This is resumed with a meta refresh which loads the
							 | 
						||
| 
								 | 
							
								script again.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								After all accounts were created in LDAP the modules may do additional
							 | 
						||
| 
								 | 
							
								tasks. LAM will call <span style="font-weight: bold;">doUploadPostActions()</span>
							 | 
						||
| 
								 | 
							
								and also provide a list of failed accounts which can be ignored. The
							 | 
						||
| 
								 | 
							
								function is called as long the returned status is <span
							 | 
						||
| 
								 | 
							
								 style="font-style: italic;">"inProgress"</span>. The script uses again
							 | 
						||
| 
								 | 
							
								a
							 | 
						||
| 
								 | 
							
								meta refresh to handle the maximum execution time.<br>
							 | 
						||
| 
								 | 
							
								Typical post actions are setting quotas or adding an user to groups.<br>
							 | 
						||
| 
								 | 
							
								<br>
							 | 
						||
| 
								 | 
							
								A progress bar is shown for the LDAP adding and the module actions to
							 | 
						||
| 
								 | 
							
								give the user a hint how long it will still take.<br>
							 | 
						||
| 
								 | 
							
								</div>
							 | 
						||
| 
								 | 
							
								</div>
							 | 
						||
| 
								 | 
							
								</body>
							 | 
						||
| 
								 | 
							
								</html>
							 |