Permalink
Browse files

Updated

  • Loading branch information...
1 parent f4b9ca6 commit 7b9abda5e82317c6f54cac93f7218dd99b066431 @jheusala committed Jun 6, 2012
Showing with 13 additions and 1 deletion.
  1. +1 −0 README.md
  2. +8 −0 backend.php
  3. +3 −0 config-sample.php
  4. +1 −1 scripts/main.js
View
@@ -25,6 +25,7 @@ The project uses and includes some external 3rd party libraries:
* [bootstrap](http://twitter.github.com/bootstrap/) under the Apache License, Version 2.0
* [showdown.js](https://github.com/coreyti/showdown) under BSD-style licence
* [moment.js](http://momentjs.com/) under MIT license
+* [jquery.cookies](http://code.google.com/p/cookies/) under MIT license
TODO
----
View
@@ -2,6 +2,14 @@
try {
require_once(dirname(__FILE__) . '/main.php');
+ /* Check optional authentication */
+ if(defined('GLOBAL_AUTH_KEY')) {
+ $pw = isset($_COOKIES['InfoLogAuthKey']) ? (string)$_COOKIES['InfoLogAuthKey'] : '';
+ if(crypt($pw, GLOBAL_AUTH_KEY) !== GLOBAL_AUTH_KEY) {
+ throw Exception("Authentication failed.");
+ }
+ }
+
/* Test server environment */
if(isset($_POST['test']) || isset($_GET['test'])) {
if(!extension_loaded('intl')) {
View
@@ -33,5 +33,8 @@
//define('USER_ID_SALT', 'YOUR SECRET SALT');
+// Setup global authentication key
+//define('GLOBAL_AUTH_KEY', '[crypt(3) hash]');
+
return;
?>
View
@@ -13,7 +13,7 @@ requirejs.config({
}
});
-require(["jquery", "moment", "bootstrap", "showdown"], function(jquery, moment, bootstrap, Showdown) {
+require(["jquery", "moment", "bootstrap", "showdown", "jquery.cookies"], function(jquery, moment, bootstrap, Showdown, cookies) {
var SERVER_CONFIG = {};
var INFODESK_GLOBAL = {};

0 comments on commit 7b9abda

Please sign in to comment.