Example #1
0
if (isset($_POST['deleteRoad'])) {
    requireCSRF();
    requirePostDataFields('hash');
    $hash = $_POST['hash'];
    if (!$loggedin) {
        dieJSON(array('error' => true, 'errorDesc' => 'Not logged in', 'hash' => $oldhash));
    }
    if ($athena !== hashOwner($hash) && $hash !== 'null') {
        dieJSON(array('error' => true, 'errorDesc' => 'Bad owner or hash', 'hash' => $oldhash));
    }
    if ($hash !== 'null') {
        CourseRoadDB::deleteRoad($hash, $athena);
    }
    dieJSON(array('success' => true, 'hash' => $hash));
}
// When the user saves changes to their user prefs, we update their prefs if
// they're logged in and redisplay the userprefs HTML.
if (isset($_POST['viewUserSettings'])) {
    requireCSRF();
    $_SESSION['user']['class_year'] = intval($_POST['class_year']);
    $_SESSION['user']['view_req_lines'] = $_POST['toggle_view_req_lines'] === '1' ? 1 : 0;
    $_SESSION['user']['autocomplete'] = $_POST['toggle_autocomplete'] === '1' ? 1 : 0;
    $_SESSION['user']['edited'] = $loggedin ? 0 : 1;
    if ($loggedin) {
        CourseRoadDB::updateUserPrefs($athena, $_SESSION['user']);
    }
    dieJSON(array('success' => true, 'html' => makeUserSettingsHTML()));
}
if (__DEV__ && isset($_GET['dev'])) {
    dieJSON(array('debug' => true, '$_POST' => @$_POST, '$_SESSION' => @$_SESSION, '$_SERVER' => @$_SERVER));
}
Example #2
0
      First off, feel free to email me at <a href="mailto:courseroad@mit.edu?subject=[CourseRoad]%20">courseroad@mit.edu</a> if you have any comments/complaints/hate mail/cool historical maps.<br>
      <br>
      CourseRoad is the brainchild of Danny Ben-David '15, and was the Grand Prize Winner in the 2012 <a href="http://icampusprize.mit.edu">iCampus Student Prize Competition</a>. Ever since I showed up at MIT, I've been bothered at how unintuitive the course and major structures are as laid out in the MIT Catalog. Seeking a better way, the iCampus Prize provided the motive for me to build CourseRoad, and here we are. :)<br>
      <br>
      Special thanks to <a href="http://oeit.mit.edu">OEIT<a> for funding and guiding me through the spring and summer, and to the awesome folks at <a href="http://sipb.mit.edu">SIPB</a> for their litany of services and helpful insights.
    </div>
  </div>
</div>
<div id="usersettings" class="bubble my-dialog">
  <div id="usersettings_close" class="my-dialog-close">Close this</div>
  <h3 id="usersettings_header" class="my-dialog-header">User Settings<?php 
echo $athena ? " for {$athena}" : "";
?>
:</h3>
  <div id="usersettings_div"><?php 
echo makeUserSettingsHTML();
?>
</div>
  <input id="usersettings_save" type="button" name="save" value="Save Settings"><span id="usersettings_saved">Settings saved!</span>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/yui/2.9.0/build/utilities/utilities.js"></script>
<script src="js/wireit-min.js"></script>
<script src="<?php 
echo noCacheLink('js/majors.js');
?>
"></script>
<script src="<?php 
echo noCacheLink('js/cr.js');
?>