You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
8.[PAM Authentication and `accounts.php`](#8-pam-authentication-and-accountsphp)
33
+
34
+
### 1. Requirements
35
35
* Submitty Student Auto Feed is intended to be managed by a systems administrator or similar IT professional.
36
36
* PHP 5.6 or higher with `pgsql` and `iconv` extensions.
37
37
* Although not a necessity, the auto feed script can operate on the same server that Submitty is running on.
38
38
* The `ssh2` extension is also required if the data feed CSV resides on a different server than the script is running from (this also includes running the script on the Submitty server).
39
39
* A regularly updated CSV data feed of student enrollment.
40
40
* Contact your university's registrar and/or data warehouse for assistance.
41
41
42
-
<small>[Back To Table of Contents](#top)</small>
43
-
### 2. Files <aname="files"></a>
42
+
<small>[Back To Table of Contents](#table-of-contents)</small>
43
+
### 2. Files
44
44
Latest version of the auto feed script and supplmental files will be checked into the `master` branch in [`SysadminTools/student_auto_feed/`](https://github.com/Submitty/SysadminTools/tree/master/student_auto_feed)
45
45
*`submitty_student_auto_feed.php` -- Executable PHP script to read student registration CSV and update Submitty classlist enrollment.
46
46
*`config.php` -- **REQUIRED** config file for `submitty_student_auto_feed.php`
47
47
*`accounts.php` -- **IMPORTANT** for Submitty servers utilizing PAM authentication.
<small>[Back To Table of Contents](#table-of-contents)</small>
50
+
### 3. Course Database Backups
51
51
Please use `db_backup.py` (located in [`SysadminTools/nightly_db_backup/`](https://github.com/Submitty/SysadminTools/tree/master/nightly_db_backup)) on a cron schedule to create nightly backups of course databases.
52
52
53
53
Run `db_backup.py -h` to see extended help and argument list.
54
54
55
-
<small>[Back To Table of Contents](#top)</small>
56
-
### 4. Before Installing Auto Feed Script <aname="student_csv"></a>
55
+
<small>[Back To Table of Contents](#table-of-contents)</small>
56
+
### 4. Before Installing Auto Feed Script
57
57
It is important that you can receive a regularly updated data feed of student enrollment.
58
58
The data should be tabulated (like a spreadsheet), but must be written as a CSV file.
59
59
You will likely need the cooperation from your university's data warehouse and/or registrar.
@@ -66,32 +66,36 @@ student enrollment data protected by FERPA ([U.S. federal statute 20 U.S.C. § 1
66
66
Please take appropriate information protection measures.
67
67
**_SUBMITTY IS NOT RESPONSIBLE FOR YOUR COURSE'S, DEPARTMENT'S, OR UNIVERSITY'S INFORMATION CONTROL POLICIES OR ACTIVITIES._**
<small>[Back To Table of Contents](#table-of-contents)</small>
70
+
### 4.1 Student CSV Layout
71
71
72
-
There are nine_required_ columns/fields, and one optional column/field processed by the submitty auto feed script.
73
-
The student CSV data file may have additional fields, which will be ignored by, _but there may not be less than the nine columns/fields required_.
72
+
There are ten_required_ columns/fields, and one optional column/field processed by the submitty auto feed script.
73
+
The student CSV data file may have additional fields, which will be ignored by, _but there may not be less than the ten columns/fields required_.
74
74
The columns/fields may be in any order.
75
75
`config.php` will map the requisite (and optional) columns/fields to their respective data points.
76
-
(q.v. [CSV Fields Mapping](#csv_fields_mapping) for additional explanation)
76
+
(q.v. [CSV Fields Mapping](#csv-fields-mapping) for additional explanation)
77
77
78
78
##### The student CSV file _must_ have fields/columns for these data points:
79
79
1. Student's legal first name
80
80
2. Student's legal last name
81
81
3. Student's campus computer systems user account ID
82
82
* The student CSV file should **_NEVER_** contain account passwords.
83
-
4. Student's email address
84
-
5. Course that student is enrolled in
83
+
4. An alternate numeric ID.
84
+
* This is intended to be the student's campus assign ID number, but could be
85
+
any alternate alphanumeric ID code assigned to the student by the data feed.
86
+
* This ID code can contain delimiter characters, such as dashes.
87
+
5. Student's email address
88
+
6. Course the student is enrolled in
85
89
* This is actually **_two_** fields/columns.
86
90
One is the course "prefix" (often the dept. code), and the other is the course "number".
87
91
Combined, they make up the course code as listed in the course catalog.
88
92
e.g. Prefix is "CSIS" and number is "101" as in "CSIS 101" in the course catalog.
89
-
6. Student's registration status
93
+
7. Student's registration status
90
94
* A student can drop enrollment during an academic term, and this may be reflected by a code in the student CSV file.
91
95
Alternatively, the student's enrollment entry, in the CSV file, can be entirely omitted when a course is dropped.
92
96
The student auto feed script is intended to work with either case.
93
-
7. Which lab/course section a student is enrolled in.
94
-
8. The "term code" for the current academic term must exist in every data row.
97
+
8. Which lab/course section a student is enrolled in.
98
+
9. The "term code" for the current academic term must exist in every data row.
95
99
96
100
##### This data point is _optional_ in the student CSV file:
97
101
1. Student's "preferred" first name
@@ -104,8 +108,8 @@ The columns/fields may be in any order.
104
108
* Columns/field data should *not* be enclosed by quotes.
105
109
Quotation marks may be picked up as part of the data and fail certain validation checks.
106
110
107
-
<small>[Back To Table of Contents](#top)</small>
108
-
### 5. Install On Ubuntu Server <aname="install"></a>
111
+
<small>[Back To Table of Contents](#table-of-contents)</small>
112
+
### 5. Install On Ubuntu Server
109
113
As these are PHP scripts, they _should_ run on any computer that has PHP 5.6+ and the appropriate extensions installed.
110
114
However, these instructions will focus on Ubuntu server (same OS that is supported for Submitty). Ubuntu 16.04 uses PHP 7.0 by default, and Ubuntu 18.04 uses PHP 7.2 by default.
### 6. Command Line Arguments <aname="cli_arguments"></a>
139
+
<small>[Back To Table of Contents](#table-of-contents)</small>
140
+
### 6. Command Line Arguments
137
141
138
142
--- | ---
139
143
`-h``--help` | Extended help including usage and argument list.
@@ -150,8 +154,8 @@ Notes:
150
154
-**YY** is the two digit year.
151
155
- e.g. **s18** is Spring of 2018.
152
156
153
-
<small>[Back To Table of Contents](#top)</small>
154
-
### 7. Configuration <aname="configuration"></a>
157
+
<small>[Back To Table of Contents](#table-of-contents)</small>
158
+
### 7. Configuration
155
159
Configuration options exist in `config.php` as "constants".
156
160
The goal, here, is to define each constant to a value reflective of your use of Submitty.
157
161
The provided defaults, while illustrative, typically will not work.
@@ -191,13 +195,13 @@ Summaries are also provided as "code comments" within `config.php`.
191
195
Consistent with C and Java styles, PHP code comments either begin with double slashes `//` or are multiple lines between `/*` and `*/`.
192
196
Using a text editor with syntax highlighting will be highly beneficial as code comments will be given a unique text color (text coloring will vary from editor to editor).
@@ -210,8 +214,8 @@ These options specify the login to the Submitty database for the hostname of the
210
214
211
215
Note that the database is often on the same server as Submitty, but this is not required. The database can be hosted on a separate server from Submitty.
212
216
213
-
<small>[Back To Table of Contents](#top)</small>
214
-
#### Error Logging <aname="config_logs"></a>
217
+
<small>[Back To Table of Contents](#table-of-contents)</small>
@@ -405,8 +413,8 @@ In this case, `RA` may mean "Registered by Adviser" and `RW` may mean "Registere
405
413
* Any student not associated with a registration code as listed in this option is assumed to have dropped the course or has otherwise been unregistered for some reason.
406
414
In which case, an update will occur in Submitty's database to reflect the student is no longer enrolled in that course.
407
415
408
-
<small>[Back To Table of Contents](#top)</small>
409
-
#### Expected Term Code <aname="expected_term_code"></a>
416
+
<small>[Back To Table of Contents](#table-of-contents)</small>
417
+
#### Expected Term Code
410
418
```php
411
419
define('EXPECTED_TERM_CODE', '201705');
412
420
```
@@ -423,8 +431,8 @@ The student auto feed will check every row for this code and compare it with thi
423
431
Rows that do not match the `define` value will be ignored.
424
432
It is possible that when one row does not match, all rows will not match.
425
433
426
-
<small>[Back To Table of Contents](#top)</small>
427
-
#### Windows Encoding Conversion <aname="text_encoding"></a>
434
+
<small>[Back To Table of Contents](#table-of-contents)</small>
435
+
#### Windows Encoding Conversion
428
436
```php
429
437
define('CONVERT_CP1252', true);
430
438
```
@@ -433,16 +441,16 @@ If your student CSV originates from a Windows computer, the auto feed may need t
433
441
Set `CONVERT_CP1252` to `true` if the student CSV originates from a Windows computer.
434
442
Otherwise, set to `false`.
435
443
436
-
<small>[Back To Table of Contents](#top)</small>
437
-
#### End of Line Detection <aname="eol_detection"></a>
444
+
<small>[Back To Table of Contents](#table-of-contents)</small>
445
+
#### End of Line Detection
438
446
```php
439
447
ini_set('auto_detect_line_endings', true);
440
448
```
441
449
In summary, this `define` shouldn't be changed.
442
450
It ensures that CSV files exported by Microsoft Excel for Macintosh are correctly processed.
443
451
444
-
<small>[Back To Table of Contents](#top)</small>
445
-
#### About "allow_url_fopen" <aname="allow_url_fopen"></a>
452
+
<small>[Back To Table of Contents](#table-of-contents)</small>
453
+
#### About "allow_url_fopen"
446
454
```php
447
455
ini_set("allow_url_fopen", true);
448
456
```
@@ -452,8 +460,8 @@ Otherwise, the server would have to be accessed via IP address.
452
460
453
461
This setting is irrelevant when the student CSV can be locally accessed.
454
462
455
-
<small>[Back To Table of Contents](#top)</small>
456
-
#### Timezone <aname="config_timezones"></a>
463
+
<small>[Back To Table of Contents](#table-of-contents)</small>
464
+
#### Timezone
457
465
```php
458
466
date_default_timezone_set('America/New_York');
459
467
```
@@ -474,19 +482,19 @@ Hawaii (no daylight savings) | `Pacific/Honolulu`
474
482
475
483
For a complete list of timezones: <http://php.net/manual/en/timezones.php>
476
484
477
-
<small>[Back To Table of Contents](#top)</small>
485
+
<small>[Back To Table of Contents](#table-of-contents)</small>
478
486
479
-
### 8. PAM Authentication and `accounts.php` <aname="pam_authentication"></a>
487
+
### 8. PAM Authentication and `accounts.php`
480
488
The script `accounts.php` will automate the creation of local accounts used with PAM authentication.
481
489
482
490
*This script is not needed when using database authentication.*
483
491
484
492
`accounts.php` must exist on the same server as Submitty, and it needs to be run as `root`.
485
-
This script is intended to read user entries from Submitty's course databases generate any missing local accounts needed for PAM authentication.
493
+
This script is intended to read user entries from Submitty's "master" database to generate any missing local accounts needed for PAM authentication.
486
494
487
495
Run `accounts.php -h` to see extended help and argument list.
488
496
489
497
It is recommended that this script is run every hour as a cron job.
490
-
Should an instructor manually add a student to their course, the student's access to Submitty will be available "within an hour".
498
+
That way, should an instructor manually add a student to their course, the student's access to Submitty will be available "within an hour".
491
499
492
-
<small>[Back To Table of Contents](#top)</small>
500
+
<small>[Back To Table of Contents](#table-of-contents)</small>
0 commit comments