Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 3 additions & 62 deletions student_auto_feed/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* config.php script used by submitty_student_auto_feed
* By Peter Bailie, Systems Programmer (RPI dept of computer science)
*
* Requires minimum PHP version 5.6 with pgsql, iconv, and ssh2 extensions.
* Requires minimum PHP version 7.0 with pgsql and iconv extensions.
*
* Configuration of submitty_student_auto_feed is structured through defined
* constants. Expanded instructions can be found at
Expand Down Expand Up @@ -49,10 +49,7 @@
// add all pertinant student-is-registered codes that can be found in
// your CSV data dump. EXAMPLE: 'RA' may mean "registered by advisor"
// and 'RW' may mean "registered via web"
define('STUDENT_REGISTERED_CODES', serialize( array(
'RA',
'RW',
)));
define('STUDENT_REGISTERED_CODES', array('RA', 'RW'));

//An exceptionally small file size can indicate a problem with the feed, and
//therefore the feed should not be processed to preserve data integrity of the
Expand All @@ -68,61 +65,9 @@
// The following constants are used to read the CSV auto feed file provided by
// the registrar / data warehouse. ***THESE NEED TO BE SET.
//
// CSV_AUTH can be set to 'local' or 'remote_password' or 'remote_keypair'.
//
// 'local' means the CSV file can be read locally by the script, so no
// remote authentication details are needed.
//
// 'remote_password' means that the file must be accessed on another
// server, and authentication is by password.
// q.v. CSV_AUTH_PASSWORD
//
// 'remote_key' means that the file must be accessed on another
// server, and authentication is by RSA key pair.
// q.v. CSV_AUTH_PUBKEY, CSV_AUTH_PRIVKEY, CSV_PRIVKEY_PASSPHRASE
//
// CSV_FILE is the full path of the student auto feed file, regardless if it is
// accessed locally or remotely.
//
// CSV_REMOTE_SERVER is the fully qualified domain name of the server that hosts
// the student feed CSV file. This constant is ignored when
// CSV_AUTH is set to 'local'.
//
// CSV_AUTH_USER is the user account to access the student feed CSV, when the
// file exists on a remote server. This constant is ignored when
// CSV_AUTH is set to 'local'.
//
// CSV_AUTH_PASSWORD is the user account password required to access the student
// feed CSV on a remote server. This constant is ignored when
// CSV_AUTH is set to anything other than 'remote_password'.
//
// CSV_AUTH_PUBKEY is the path to the public key used to authenticate with the
// remote server that has the student feed CSV. The public key
// needs to be in OpenSSH format. This constant is ignored
// when CSV_AUTH is set to anything other than 'remote_keypair'.
//
// CSV_AUTH_PRIVKEY is the path to the private key used to communicate with the
// remote server that has the student feed CSV. This constant
// is ignored when CSV_AUTH is set to anything other than
// 'remote_keypair'.
//
// CSV_PRIVKEY_PASSPHRASE is the passphrase used to encrypt the private key.
// Set to null, if the private key is not encrypted.
// This constant is ignored when CSV_AUTH is set to
// anything other than 'remote_keypair'.
// NOTE: To use encrypted keys with an Ubuntu SSH/SFTP
// host, libssh2 needs be manually recompiled with
// OpenSSH. Otherwise, authentication will always
// fail. q.v. https://bugs.php.net/bug.php?id=58573
// and http://php.net/manual/en/function.ssh2-auth-pubkey-file.php
define('CSV_AUTH', 'remote_keypair');
define('CSV_FILE', '/path/to/datafile.csv');
define('CSV_REMOTE_SERVER', 'fileserver.myuniversity.edu');
define('CSV_AUTH_USER', 'remote_user');
define('CSV_AUTH_PASSWORD', null);
define('CSV_AUTH_PUBKEY', '/path/to/rsa_key.pub');
define('CSV_AUTH_PRIVKEY', '/path/to/rsa_key.pfx');
define('CSV_PRIVKEY_PASSPHRASE', 'MySecretPassphrase');
define('CSV_FILE', '/path/to/datafile.csv');

//Define what character is delimiting each field. ***THIS NEEDS TO BE SET.
//EXAMPLE: chr(9) is the tab character.
Expand Down Expand Up @@ -161,8 +106,4 @@
//Allows "\r" EOL encoding. This is rare but exists (e.g. Excel for Macintosh).
ini_set('auto_detect_line_endings', true);

//Needed to access student feed on a remote server.
//You can comment this out if the student feed is accessed locally.
ini_set("allow_url_fopen", true);

?>
Loading