Example #1
0
 foreach ($commit['files'] as $file) {
     if (isInvisible($file['filename'])) {
         if (isFiltered(basename($file['filename']))) {
             $parts = explode('/', $file['filename']);
             if (!in_array($parts[0], $changes)) {
                 $changes[] = $parts[0];
             }
         }
     }
 }
 /* make a list of viewable files in the commit tree */
 $tree = array();
 $currentDir = '@';
 foreach ($commitTree['tree'] as $leaf) {
     if (isInvisible($leaf['path'])) {
         if (isFiltered(basename($leaf['path']))) {
             $parts = explode('/', dirname($leaf['path']));
             $leaf['changed'] = in_array($parts[0], $changes);
             $leaf['filename'] = basename($leaf['path']);
             $leaf['path_parts'] = $parts;
             $tree[$leaf['path']] = $leaf;
         }
     }
 }
 $commit['commit']['message'] = \Michelf\Markdown::defaultTransform('### ' . $commit['commit']['message']);
 $smarty->assign('commit', $commit['commit']);
 $smarty->assign('tree', $tree);
 $smarty->assign('formTemplate', 'files.tpl');
 $smarty->assign('formHidden', array('step' => STEP_DISPLAY));
 $smarty->display('picker.tpl');
 break;
Example #2
0
    $filtered_email = filter_var($email_str, FILTER_VALIDATE_EMAIL);
    if ($filtered_email) {
        return true;
    } else {
        return false;
    }
}
$message = '';
# if change requested
if (isset($_POST['contactedit'])) {
    $message = "Invalid Submission. Please Retry.";
    if (isset($_POST['contactname']) && isset($_POST['contactemail']) && isset($_POST['url'])) {
        $contact_name = trim(htmlspecialchars($_POST['contactname']));
        $survey_url = trim(htmlspecialchars($_POST['url']));
        $emailEdit = trim(htmlspecialchars($_POST['contactemail']));
        if (isFiltered($emailEdit) && !isInjected($emailEdit)) {
            $contact_email = $emailEdit;
            $message = "Information Successfully Changed.";
            $contactInfo = array($contact_name, $contact_email, $survey_url);
            file_put_contents('contact.txt', implode("\n", $contactInfo));
        } else {
            $message = "Change Unsuccessful.\nInvalid Email.";
        }
    }
}
# Retrieves contact information.
$infoParts = file('contact.txt', FILE_IGNORE_NEW_LINES);
$contact_name = $infoParts[0];
$contact_email = $infoParts[1];
$survey_url = $infoParts[2];
?>
Example #3
0
     touch($filename);
     chmod($filename, 0746);
     $outFile = fopen($filename, 'a');
     $namelist = explode('+', $tutor[0]);
     $ed = $tutor[2];
     $hrs = $tutor[3];
     $entry = array($namelist[0] . $namelist[1] . $hrs . $ed . '.csv');
     fputcsv($outFile, $entry);
     fclose($outFile);
     # Email
     $emailadd = $tutor[1];
     $subject = "Availability Survey";
     $content = "\n          <html>\n          <head>\n            <title>Availability Survey</title>\n          </head>\n          <body>\n            <p>\n              {$namelist['0']} {$namelist['1']}, <br /><br />\n              You are currently listed as a tutor for the upcoming \n              semester. <br />\n              Please take a few minutes and fill out this survey regarding\n              your schedule and times you are available for tutoring. <br />\n              You must be on the campus network to access the survey. <br />\n              Also, from personal experience, the survey works best when\n              completed using Google Chrome.\n            </p>\n            <br />\n            <p>\n              <a href={$survey_url}>Tutoring Survey</a>\n            </p>\n            <br />\n            <p>\n              {$contact_name}\n            </p>\n          </body>\n          </html>\n        ";
     $headers = "From: {$contact_name} <{$contact_email}>" . "\r\n";
     $headers .= "Content-type: text/html; charset=utf-8" . "\r\n";
     if (isFiltered($emailadd) && !isInjected($emailadd)) {
         mail($emailadd, $subject, $content, $headers);
     } else {
         $subj = "Availability Survey: Email Issue";
         $alt_content = "There was an issue with {$namelist['0']} {$namelist['1']}'s\n            email.";
         $alt_headers = "From: Scheduling System <{$contact_email}>";
         mail($contact_email, $subj, $alt_content, $alt_headers);
     }
 }
 # Put number of tutors into text file
 $tutorcount = count($tutorinfo);
 // count of tutors in db
 $filename = 'counts/' . $title . 'tutorcount.txt';
 touch($filename);
 chmod($filename, 0606);
 file_put_contents($filename, $tutorcount);