From 20d98a3ede60982451df49961638d6a4ac68db4a Mon Sep 17 00:00:00 2001 From: Cal Henderson Date: Wed, 25 Aug 2010 04:08:51 +0000 Subject: [PATCH] guest access, login in, logout, etc etc git-svn-id: https://svn.iamcal.com/public/php/iTunesServer/trunk@5769 ac7c8259-0de0-4f3c-bb6a-12394caf8efd --- css/player.css | 8 ++++ include/lib_auth.php | 7 ++++ index.php | 30 +++++++++++--- login.php | 93 ++++++++++++++++++++++++++++++++++++++++++++ logout.php | 12 ++++++ 5 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 login.php create mode 100644 logout.php diff --git a/css/player.css b/css/player.css index df92453..2b736a7 100644 --- a/css/player.css +++ b/css/player.css @@ -538,3 +538,11 @@ table#playlist th.sort-rev div { +#login { + margin: 0.5em; + padding: 0.5em; + background-color: #C0C9D8; + border: 1px solid #8496B4; + font-size: 13px; + font-family: Helvetica, Arial, sans-serif; +} diff --git a/include/lib_auth.php b/include/lib_auth.php index a6172a8..d4f49db 100644 --- a/include/lib_auth.php +++ b/include/lib_auth.php @@ -36,6 +36,13 @@ function auth_set_login($row){ setcookie('u', $value, $expire, $GLOBALS[cfg][cookie_path], $GLOBALS[cfg][cookie_domain]); } + function auth_logout(){ + + $expire = time() - (60 * 60); + + setcookie('u', '0', $expire, $GLOBALS[cfg][cookie_path], $GLOBALS[cfg][cookie_domain]); + } + ############################################################## function auth_hash_password($password){ diff --git a/index.php b/index.php index e324b2b..8994ce5 100644 --- a/index.php +++ b/index.php @@ -1,10 +1,13 @@ @@ -19,7 +22,16 @@ - + + @@ -54,8 +66,16 @@