From 8ad2eb254717b68f4413da74e75639d48e648fab Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Fri, 19 Dec 2008 21:15:53 +0000 Subject: add login to month view --- functions/userauth_functions.php | 2 +- includes/login.php | 2 +- month.php | 13 ++++++++++++- templates/default/calendar_nav.tpl | 40 +++++++++++++++++++++++++++++++++++++- templates/green/calendar_nav.tpl | 40 +++++++++++++++++++++++++++++++++++++- templates/grey/calendar_nav.tpl | 40 +++++++++++++++++++++++++++++++++++++- templates/red/calendar_nav.tpl | 40 +++++++++++++++++++++++++++++++++++++- templates/tan/calendar_nav.tpl | 40 +++++++++++++++++++++++++++++++++++++- year.php | 4 ++-- 9 files changed, 211 insertions(+), 10 deletions(-) diff --git a/functions/userauth_functions.php b/functions/userauth_functions.php index 3808653..2875fd4 100644 --- a/functions/userauth_functions.php +++ b/functions/userauth_functions.php @@ -96,7 +96,7 @@ function user_login() { } // Check to make sure the username and password is valid. - if (!array_key_exists("$username:$password", $phpiCal_config->locked_map)) { + if (!array_key_exists("$username:$password", $locked_map)) { // Remember the invalid login, because we may want to display // a message elsewhere or check validity. return array($username, $password, true); diff --git a/includes/login.php b/includes/login.php index e7713c1..83a7f1c 100644 --- a/includes/login.php +++ b/includes/login.php @@ -1,7 +1,7 @@ allow_login == 'yes' && !isset($_SERVER['PHP_AUTH_USER'])) { // Set the login table width if not set. if (!isset($login_width)) $login_width = "100%"; diff --git a/month.php b/month.php index 989fe9e..b931740 100644 --- a/month.php +++ b/month.php @@ -46,6 +46,12 @@ $list_jumps = list_jumps(); $list_calcolors = list_calcolors(); $list_icals_pick = display_ical_list(availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED), TRUE); +// login/logout +$is_logged_in = ($username != '' && !$invalid_login) ? true : false; +$show_user_login = (!$is_logged_in && $phpiCal_config->allow_login == 'yes'); +$login_querys = login_querys(); +$logout_querys = logout_querys(); + $page = new Page(BASE.'templates/'.$phpiCal_config->template.'/month.tpl'); $page->replace_files(array( @@ -74,7 +80,12 @@ $page->replace_tags(array( 'next_month' => $next_month, 'prev_month' => $prev_month, 'show_goto' => '', - 'is_logged_in' => '', + 'show_user_login' => $show_user_login, + 'invalid_login' => $invalid_login, + 'login_querys' => $login_querys, + 'is_logged_in' => $is_logged_in, + 'username' => $username, + 'logout_querys' => $logout_querys, 'list_jumps' => $list_jumps, 'list_icals' => $list_icals, 'list_icals_pick' => $list_icals_pick, diff --git a/templates/default/calendar_nav.tpl b/templates/default/calendar_nav.tpl index 111fa35..7a51c29 100644 --- a/templates/default/calendar_nav.tpl +++ b/templates/default/calendar_nav.tpl @@ -65,6 +65,44 @@  + +
+ + + + + + + + + + + + + + + + + + + + + +
{L_LOGIN}
+
+ {L_INVALID_LOGIN} +
+
{L_USERNAME}:
{L_PASSWORD}:
+
+ + + + + + +
+
+ @@ -82,7 +120,7 @@ {L_SUBSCRIBE} | {L_DOWNLOAD}
- Logout {USERNAME} + {L_LOGOUT} {USERNAME} diff --git a/templates/green/calendar_nav.tpl b/templates/green/calendar_nav.tpl index 111fa35..7a51c29 100644 --- a/templates/green/calendar_nav.tpl +++ b/templates/green/calendar_nav.tpl @@ -65,6 +65,44 @@
{SIDEBAR_DATE}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
{L_LOGIN}
+
+ {L_INVALID_LOGIN} +
+
{L_USERNAME}:
{L_PASSWORD}:
+
+ + + + + + +
+
+ @@ -82,7 +120,7 @@ {L_SUBSCRIBE} | {L_DOWNLOAD}
- Logout {USERNAME} + {L_LOGOUT} {USERNAME} diff --git a/templates/grey/calendar_nav.tpl b/templates/grey/calendar_nav.tpl index 111fa35..7a51c29 100644 --- a/templates/grey/calendar_nav.tpl +++ b/templates/grey/calendar_nav.tpl @@ -65,6 +65,44 @@
{SIDEBAR_DATE}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
{L_LOGIN}
+
+ {L_INVALID_LOGIN} +
+
{L_USERNAME}:
{L_PASSWORD}:
+
+ + + + + + +
+
+ @@ -82,7 +120,7 @@ {L_SUBSCRIBE} | {L_DOWNLOAD}
- Logout {USERNAME} + {L_LOGOUT} {USERNAME} diff --git a/templates/red/calendar_nav.tpl b/templates/red/calendar_nav.tpl index 111fa35..7a51c29 100644 --- a/templates/red/calendar_nav.tpl +++ b/templates/red/calendar_nav.tpl @@ -65,6 +65,44 @@
{SIDEBAR_DATE}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
{L_LOGIN}
+
+ {L_INVALID_LOGIN} +
+
{L_USERNAME}:
{L_PASSWORD}:
+
+ + + + + + +
+
+ @@ -82,7 +120,7 @@ {L_SUBSCRIBE} | {L_DOWNLOAD}
- Logout {USERNAME} + {L_LOGOUT} {USERNAME} diff --git a/templates/tan/calendar_nav.tpl b/templates/tan/calendar_nav.tpl index 111fa35..7a51c29 100644 --- a/templates/tan/calendar_nav.tpl +++ b/templates/tan/calendar_nav.tpl @@ -65,6 +65,44 @@
{SIDEBAR_DATE}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
{L_LOGIN}
+
+ {L_INVALID_LOGIN} +
+
{L_USERNAME}:
{L_PASSWORD}:
+
+ + + + + + +
+
+ @@ -82,7 +120,7 @@ {L_SUBSCRIBE} | {L_DOWNLOAD}
- Logout {USERNAME} + {L_LOGOUT} {USERNAME} diff --git a/year.php b/year.php index 7bec7a7..9bcf802 100644 --- a/year.php +++ b/year.php @@ -36,7 +36,7 @@ $list_icals_pick = display_ical_list(availableCalendars($username, $password, $p // login/logout $is_logged_in = ($username != '' && !$invalid_login) ? true : false; -$show_user_login = (!$is_logged_in && $allow_login == 'yes'); +$show_user_login = (!$is_logged_in && $phpiCal_config->allow_login == 'yes'); $login_querys = login_querys(); $logout_querys = logout_querys(); @@ -78,7 +78,7 @@ $page->replace_tags(array( 'next_year' => $next_year, 'prev_year' => $prev_year, 'show_goto' => '', - 'show_user_login' => $phpiCal_config->show_user_login, + 'show_user_login' => $show_user_login, 'invalid_login' => $invalid_login, 'login_querys' => $login_querys, 'is_logged_in' => $is_logged_in, -- cgit v1.2.3
{SIDEBAR_DATE}