summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-03-23 19:36:24 +0100
committerTheTroll <trolldev@gmail.com>2010-03-23 19:36:24 +0100
commit85b5a9f4c49db6dbbe282e9e8ab60fbc074d6a52 (patch)
tree2140027c1fe137bb139f78d1d4f2715143a31922 /bin
parent7d8bc8ba0454d704bb7be03909a31d0c01a4be1a (diff)
parentc32c1785108597b3bb500ea7f85d2c63cef00359 (diff)
downloadistreamdev-85b5a9f4c49db6dbbe282e9e8ab60fbc074d6a52.tar.gz
istreamdev-85b5a9f4c49db6dbbe282e9e8ab60fbc074d6a52.tar.bz2
Merge branch 'jquery' of projects.vdr-developer.org:istreamdev into jquery
* 'jquery' of projects.vdr-developer.org:istreamdev: added auth removed auth temporarely added auth fixed default segmenter install path removed logos in git default max encoding to 3 . corrected bug when returning back to home
Diffstat (limited to 'bin')
-rw-r--r--bin/auth.php36
-rwxr-xr-xbin/backend.php1
2 files changed, 37 insertions, 0 deletions
diff --git a/bin/auth.php b/bin/auth.php
new file mode 100644
index 0000000..7e6eace
--- /dev/null
+++ b/bin/auth.php
@@ -0,0 +1,36 @@
+<?php
+
+global $user, $pass;
+
+session_start();
+
+if (isset($_COOKIE['istreamdev']))
+{
+ if(sha1($pass) == $_COOKIE['istreamdev'] ) {
+ setcookie ("istream", sha1($pass), time()+60*60*24*30);
+ $authorized = true;
+ } else {
+ $authorised = false;
+ }
+}
+
+# checkup login and password
+if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']))
+{
+ if (($user == $_SERVER['PHP_AUTH_USER']) && ($pass == ($_SERVER['PHP_AUTH_PW'])) )
+ {
+ setcookie ("istreamdev", sha1($pass), time()+60*60*24*30);
+ $authorized = true;
+ }
+}
+
+# login
+if (!$authorized)
+{
+ header('WWW-Authenticate: Basic Realm="Login please"');
+ header('HTTP/1.0 401 Unauthorized');
+ echo "Login";
+ exit;
+}
+
+?>
diff --git a/bin/backend.php b/bin/backend.php
index f312ed0..706dd91 100755
--- a/bin/backend.php
+++ b/bin/backend.php
@@ -6,6 +6,7 @@ if (file_exists('../config.php'))
include ('../config.php');
else
include ('../config_default.php');
+include ('./auth.php');
include ('../getid3/getid3.php');
include ('./utils.php');
include ('./files.php');