|
5 | 5 | * config.php script used by submitty_student_auto_feed
|
6 | 6 | * By Peter Bailie, Systems Programmer (RPI dept of computer science)
|
7 | 7 | *
|
8 |
| - * Requires minimum PHP version 5.6 with pgsql, iconv, and ssh2 extensions. |
| 8 | + * Requires minimum PHP version 7.0 with pgsql and iconv extensions. |
9 | 9 | *
|
10 | 10 | * Configuration of submitty_student_auto_feed is structured through defined
|
11 | 11 | * constants. Expanded instructions can be found at
|
|
49 | 49 | // add all pertinant student-is-registered codes that can be found in
|
50 | 50 | // your CSV data dump. EXAMPLE: 'RA' may mean "registered by advisor"
|
51 | 51 | // and 'RW' may mean "registered via web"
|
52 |
| -define('STUDENT_REGISTERED_CODES', serialize( array( |
53 |
| -'RA', |
54 |
| -'RW', |
55 |
| -))); |
| 52 | +define('STUDENT_REGISTERED_CODES', array('RA', 'RW')); |
56 | 53 |
|
57 | 54 | //An exceptionally small file size can indicate a problem with the feed, and
|
58 | 55 | //therefore the feed should not be processed to preserve data integrity of the
|
|
68 | 65 | // The following constants are used to read the CSV auto feed file provided by
|
69 | 66 | // the registrar / data warehouse. ***THESE NEED TO BE SET.
|
70 | 67 | //
|
71 |
| -// CSV_AUTH can be set to 'local' or 'remote_password' or 'remote_keypair'. |
72 |
| -// |
73 |
| -// 'local' means the CSV file can be read locally by the script, so no |
74 |
| -// remote authentication details are needed. |
75 |
| -// |
76 |
| -// 'remote_password' means that the file must be accessed on another |
77 |
| -// server, and authentication is by password. |
78 |
| -// q.v. CSV_AUTH_PASSWORD |
79 |
| -// |
80 |
| -// 'remote_key' means that the file must be accessed on another |
81 |
| -// server, and authentication is by RSA key pair. |
82 |
| -// q.v. CSV_AUTH_PUBKEY, CSV_AUTH_PRIVKEY, CSV_PRIVKEY_PASSPHRASE |
83 |
| -// |
84 | 68 | // CSV_FILE is the full path of the student auto feed file, regardless if it is
|
85 | 69 | // accessed locally or remotely.
|
86 |
| -// |
87 |
| -// CSV_REMOTE_SERVER is the fully qualified domain name of the server that hosts |
88 |
| -// the student feed CSV file. This constant is ignored when |
89 |
| -// CSV_AUTH is set to 'local'. |
90 |
| -// |
91 |
| -// CSV_AUTH_USER is the user account to access the student feed CSV, when the |
92 |
| -// file exists on a remote server. This constant is ignored when |
93 |
| -// CSV_AUTH is set to 'local'. |
94 |
| -// |
95 |
| -// CSV_AUTH_PASSWORD is the user account password required to access the student |
96 |
| -// feed CSV on a remote server. This constant is ignored when |
97 |
| -// CSV_AUTH is set to anything other than 'remote_password'. |
98 |
| -// |
99 |
| -// CSV_AUTH_PUBKEY is the path to the public key used to authenticate with the |
100 |
| -// remote server that has the student feed CSV. The public key |
101 |
| -// needs to be in OpenSSH format. This constant is ignored |
102 |
| -// when CSV_AUTH is set to anything other than 'remote_keypair'. |
103 |
| -// |
104 |
| -// CSV_AUTH_PRIVKEY is the path to the private key used to communicate with the |
105 |
| -// remote server that has the student feed CSV. This constant |
106 |
| -// is ignored when CSV_AUTH is set to anything other than |
107 |
| -// 'remote_keypair'. |
108 |
| -// |
109 |
| -// CSV_PRIVKEY_PASSPHRASE is the passphrase used to encrypt the private key. |
110 |
| -// Set to null, if the private key is not encrypted. |
111 |
| -// This constant is ignored when CSV_AUTH is set to |
112 |
| -// anything other than 'remote_keypair'. |
113 |
| -// NOTE: To use encrypted keys with an Ubuntu SSH/SFTP |
114 |
| -// host, libssh2 needs be manually recompiled with |
115 |
| -// OpenSSH. Otherwise, authentication will always |
116 |
| -// fail. q.v. https://bugs.php.net/bug.php?id=58573 |
117 |
| -// and http://php.net/manual/en/function.ssh2-auth-pubkey-file.php |
118 |
| -define('CSV_AUTH', 'remote_keypair'); |
119 |
| -define('CSV_FILE', '/path/to/datafile.csv'); |
120 |
| -define('CSV_REMOTE_SERVER', 'fileserver.myuniversity.edu'); |
121 |
| -define('CSV_AUTH_USER', 'remote_user'); |
122 |
| -define('CSV_AUTH_PASSWORD', null); |
123 |
| -define('CSV_AUTH_PUBKEY', '/path/to/rsa_key.pub'); |
124 |
| -define('CSV_AUTH_PRIVKEY', '/path/to/rsa_key.pfx'); |
125 |
| -define('CSV_PRIVKEY_PASSPHRASE', 'MySecretPassphrase'); |
| 70 | +define('CSV_FILE', '/path/to/datafile.csv'); |
126 | 71 |
|
127 | 72 | //Define what character is delimiting each field. ***THIS NEEDS TO BE SET.
|
128 | 73 | //EXAMPLE: chr(9) is the tab character.
|
|
161 | 106 | //Allows "\r" EOL encoding. This is rare but exists (e.g. Excel for Macintosh).
|
162 | 107 | ini_set('auto_detect_line_endings', true);
|
163 | 108 |
|
164 |
| -//Needed to access student feed on a remote server. |
165 |
| -//You can comment this out if the student feed is accessed locally. |
166 |
| -ini_set("allow_url_fopen", true); |
167 |
| - |
168 | 109 | ?>
|
0 commit comments