diff --git a/adhoc.js b/adhoc.js index dc49262..6359027 100644 --- a/adhoc.js +++ b/adhoc.js @@ -1585,7 +1585,7 @@ Event.observe(window, 'load', function(){ erMsg = erMsg.replace(erRxp, ''); adhoc.message(erStatus, erMsg); -// TODO: highlight results.nodeId, if present + // TODO: highlight results.nodeId, if present // If the errors are fatal, return; if(erStatus == 'Error') return; @@ -1855,9 +1855,9 @@ Event.observe(window, 'load', function(){ case adhoc.nodeWhich.LITERAL_HASH: case adhoc.nodeWhich.LITERAL_STRCT: adhoc.deactivateAllTools(); -// TODO: Prompt for literal value -adhoc.message('This type of literal is not yet implemented'); break; -adhoc.createNode(null, prnt, repl, type, which, childType); + // TODO: Prompt for literal value + adhoc.message('This type of literal is not yet implemented'); break; + adhoc.createNode(null, prnt, repl, type, which, childType); break; default: @@ -2561,7 +2561,7 @@ adhoc.rootNode = adhoc.createNode( n.height = 100; // Darw the items -// TODO: draw shorthand for array items + // TODO: draw shorthand for array items // Draw the brackets ctx.strokeStyle = '#000000'; @@ -2604,11 +2604,11 @@ adhoc.rootNode = adhoc.createNode( break; case adhoc.nodeWhich.LITERAL_HASH: -// TODO: render a literal hash + // TODO: render a literal hash break; case adhoc.nodeWhich.LITERAL_STRCT: -// TODO: render a literal struct + // TODO: render a literal struct break; } diff --git a/index.php b/index.php index effd564..828a93e 100644 --- a/index.php +++ b/index.php @@ -75,12 +75,6 @@ // Add password back to settings (if requested) and pass settings in the cookie if(!count($errors)){ $_SESSION['username'] = $username; - if($settings->remember){ - $settingsTemp = json_decode($settingsTemp); - $settingsTemp->password = sha1($_POST['password']); - $settingsTemp = json_encode($settingsTemp); - } - $settings = $settingsTemp; setcookie( 'adhocSettings' ,$settingsTemp @@ -88,9 +82,27 @@ ,'/adhoc_demo/' ,'' ); + if($settings->remember){ + $settingsTemp = json_decode($settingsTemp); + $settingsTemp->password = $settings->password; + $settingsTemp = json_encode($settingsTemp); + } + $settings = json_decode($settingsTemp); } } +// If the user was not loaded, clear the settings +if(!$_SESSION['username']){ + setcookie( + 'adhocSettings' + ,'' + ,strtotime('+1 year') + ,'/adhoc_demo/' + ,'' + ); + $settings = (object) array(); +} + // If the user was found, try to load their projects $projects = array(); if(!count($errors) && $_SESSION['username']){ diff --git a/login/index.php b/login/index.php index bfad867..e49c50c 100644 --- a/login/index.php +++ b/login/index.php @@ -106,6 +106,7 @@ ,'' ); header('Location: /adhoc_demo/'); + exit; } }?>