-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
darthmolly
committed
Oct 10, 2011
1 parent
bd64224
commit a3c2088
Showing
6 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
<?php | ||
|
||
$constants = array( | ||
"APPLICATION_NAME" => "SSN Remediation", # this will be the page title and the header for each page | ||
"DATABASE_HOST" => "localhost", # your database server | ||
"DATABASE_NAME" => "remediation", # the name of your database | ||
"DATABASE_USER" => "remediator", # the database username | ||
"DATABASE_PASSWORD" => "remediate", # the database password | ||
"DATABASE_TABLE" => "users", # the database table -- no need to change unless you modified the schema | ||
"USER_FIELD" => "computing_id", # the user identifier field -- no need to change unless you modified the schema | ||
"STATUS_FIELD" => "completion_date", # the completion date field -- no need to change unless you modified the schema | ||
"ADMINISTRATORS_TABLE" => "administrators" # the administrators table -- no need to change unless you modified the schema | ||
"APPLICATION_NAME" => "SSN Remediation", # this will be the page title and the header for each page | ||
"ADMIN_EMAIL" => "mst3k@virginia.edu", # the email address where confirmation emails are sent | ||
"EMAIL_SUBJECT" => "Remediation Confirmation",# subject line of confirmation emails | ||
"DATABASE_HOST" => "localhost", # your database server | ||
"DATABASE_NAME" => "remediation", # the name of your database | ||
"DATABASE_USER" => "remediator", # the database username | ||
"DATABASE_PASSWORD" => "remediate", # the database password | ||
"DATABASE_TABLE" => "users", # the database table -- no need to change unless you modified the schema | ||
"USER_FIELD" => "computing_id", # the user identifier field -- no need to change unless you modified the schema | ||
"STATUS_FIELD" => "completion_date", # the completion date field -- no need to change unless you modified the schema | ||
"ADMINISTRATORS_TABLE" => "administrators" # the administrators table -- no need to change unless you modified the schema | ||
); | ||
|
||
foreach ($constants as $name => $value) { | ||
define($name, $value); | ||
define($name, $value); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
function sendUserConfirmation($user) { | ||
$to = $user->getEmail(); | ||
$subject = EMAIL_SUBJECT; | ||
$file = "partials/user_confirmation_email.inc.php"; | ||
$handle = fopen($file, "r"); | ||
$body = fread($handle, filesize($file)); | ||
fclose($handle); | ||
$headers = "From: " . ADMIN_EMAIL; | ||
$extra = "-f" . ADMIN_EMAIL; | ||
mail($to, $subject, $body, $headers, $extra); | ||
} | ||
|
||
function sendAdminConfirmation($user) { | ||
$to = ADMIN_EMAIL; | ||
$subject = EMAIL_SUBJECT . " [" . $user->getComputingId() . "]"; | ||
$file = "partials/admin_confirmation_email.inc.php"; | ||
$handle = fopen($file, "r"); | ||
$body = fread($handle, filesize($file)); | ||
fclose($handle); | ||
$body = str_replace("{first_name}", $user->getFirstName(), $body); | ||
$body = str_replace("{last_name}", $user->getLastName(), $body); | ||
$body = str_replace("{computing_id}", $user->getComputingId(), $body); | ||
$headers = "From: " . ADMIN_EMAIL; | ||
$extra = "-f" . ADMIN_EMAIL; | ||
mail($to, $subject, $body, $headers, $extra); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The following user has completed remediation: | ||
|
||
{first_name} {last_name} ({computing_id}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Thank you for completing remediation. Please keep this email in your records. |