diff options
author | Alib <aliboba@free.fr> | 2010-03-23 19:29:29 +0100 |
---|---|---|
committer | Alib <aliboba@free.fr> | 2010-03-23 19:29:29 +0100 |
commit | c32c1785108597b3bb500ea7f85d2c63cef00359 (patch) | |
tree | c7c2a31ae82d9ca20932642f18d4f5bf39c5818b | |
parent | c88db086ecb9d2b77d1ce77a2d29a90862651cf8 (diff) | |
download | istreamdev-c32c1785108597b3bb500ea7f85d2c63cef00359.tar.gz istreamdev-c32c1785108597b3bb500ea7f85d2c63cef00359.tar.bz2 |
added auth
-rw-r--r-- | bin/auth.php | 6 | ||||
-rwxr-xr-x | bin/backend.php | 2 | ||||
-rw-r--r-- | index.php (renamed from index.html) | 7 |
3 files changed, 11 insertions, 4 deletions
diff --git a/bin/auth.php b/bin/auth.php index 1545b7c..7e6eace 100644 --- a/bin/auth.php +++ b/bin/auth.php @@ -4,9 +4,9 @@ global $user, $pass; session_start(); -if (isset($_COOKIE['istream'])) +if (isset($_COOKIE['istreamdev'])) { - if(sha1($pass) == $_COOKIE['istream'] ) { + if(sha1($pass) == $_COOKIE['istreamdev'] ) { setcookie ("istream", sha1($pass), time()+60*60*24*30); $authorized = true; } else { @@ -19,7 +19,7 @@ if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { if (($user == $_SERVER['PHP_AUTH_USER']) && ($pass == ($_SERVER['PHP_AUTH_PW'])) ) { - setcookie ("istream", sha1($pass), time()+60*60*24*30); + setcookie ("istreamdev", sha1($pass), time()+60*60*24*30); $authorized = true; } } diff --git a/bin/backend.php b/bin/backend.php index a27fac0..706dd91 100755 --- a/bin/backend.php +++ b/bin/backend.php @@ -6,7 +6,7 @@ if (file_exists('../config.php')) include ('../config.php'); else include ('../config_default.php'); -//include ('./auth.php'); +include ('./auth.php'); include ('../getid3/getid3.php'); include ('./utils.php'); include ('./files.php'); @@ -1,3 +1,10 @@ +<?php +if (file_exists('config.php')) + include ('config.php'); +else + include ('config_default.php'); +include ('bin/auth.php'); +?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" manifest="istreamdev.manifest"> <head> |