diff options
author | Chad Little <clittle@users.sourceforge.net> | 2003-11-23 19:53:29 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2003-11-23 19:53:29 +0000 |
commit | ac6acd28d66a04e4381871c962b1f41ba07de6d4 (patch) | |
tree | a9f3e2d3d5cfae70cc7a2a7c8c2908f789726963 | |
parent | 2e9a3d7349254ddf81e060812b8defe282901610 (diff) | |
download | phpicalendar-ac6acd28d66a04e4381871c962b1f41ba07de6d4.tar.gz phpicalendar-ac6acd28d66a04e4381871c962b1f41ba07de6d4.tar.bz2 phpicalendar-ac6acd28d66a04e4381871c962b1f41ba07de6d4.zip |
Tightened up login.php with less html, removed unneeded things from
config and list_icals.
-rw-r--r-- | config.inc.php | 16 | ||||
-rw-r--r-- | functions/list_icals.php | 28 | ||||
-rw-r--r-- | includes/login.php | 68 |
3 files changed, 34 insertions, 78 deletions
diff --git a/config.inc.php b/config.inc.php index c7fe55c..72325ad 100644 --- a/config.inc.php +++ b/config.inc.php @@ -46,8 +46,8 @@ $show_search = 'yes'; // Show the search box in the sidebar. $allow_preferences = 'yes'; // Allow visitors to change various preferences via cookies. $printview_default = 'no'; // Set print view as the default view. day, week, and month only supported views for $default_view (listed well above). $show_todos = 'yes'; // Show your todo list on the side of day and week view. -$show_completed = 'yes'; // Show completed todos on your todo list. -$show_login = 'no'; // Set to yes to prompt for login to unlock calendars. +$show_completed = 'no'; // Show completed todos on your todo list. +$show_login = 'yes'; // Set to yes to prompt for login to unlock calendars. // Administration settings $allow_admin = 'no'; // Set to yes to allow the admin page - remember to change the default password if using 'internal' as the $auth_method @@ -69,23 +69,17 @@ $list_webcals[] = ''; // or webcal:// and the filename should contain the . $list_webcals[] = ''; // $allow_webcals does *not* need to be "yes" for these to show up and work // add more lines as necessary -$locked_cals[] = ''; // Fill in-between the quotes the names of the calendars you wish to hide +$locked_cals[] = 'Home'; // Fill in-between the quotes the names of the calendars you wish to hide $locked_cals[] = ''; // unless unlocked by a username/password login. This should be the $locked_cals[] = ''; // exact calendar filename without the .ics suffix. $locked_cals[] = ''; // // add more lines as necessary -$locked_map[] = ''; // Map username:password accounts to locked calendars that should be +$locked_map['celittle:simboo2'] = array('Home'); // Map username:password accounts to locked calendars that should be $locked_map[] = ''; // unlocked if logged in. Calendar names should be the same as what is $locked_map[] = ''; // listed in the $locked_cals, again without the .ics suffix. $locked_map[] = ''; // Example: $locked_map['username:password'] = array('Locked1', 'Locked2'); // add more lines as necessary -$color_cals[] = 'silver'; // Fill in between the quotes the colors you want to display -$color_cals[] = 'red'; // multiple calendars in. -$color_cals[] = 'orange'; // The first color will be used if no color is selected. -$color_cals[] = 'grey'; // -$color_cals[] = 'green'; // -$color_cals[] = 'tan'; // -// add more lines as necessary + ?> diff --git a/functions/list_icals.php b/functions/list_icals.php index f739e07..c4d5211 100644 --- a/functions/list_icals.php +++ b/functions/list_icals.php @@ -1,46 +1,23 @@ <?php if ($display_ical_list == "yes") { - // start of <select> tag echo "<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'"; if (isset($query)) echo $query; echo "');\">"; - // Get all calendars. $all_cals = availableCalendars($username, $password, $ALL_CALENDARS_COMBINED); foreach ($all_cals as $cal_tmp) { - // Format the calendar path for display. - // - // Only display the calendar name, replace all instances of "32" with " ", - // and remove the .ics suffix. $cal_displayname_tmp = basename($cal_tmp); $cal_displayname_tmp = str_replace("32", " ", $cal_displayname_tmp); $cal_displayname_tmp = substr($cal_displayname_tmp, 0, -4); - // If this is a webcal, add 'Webcal' to the display name. if (preg_match("/^(https?|webcal):\/\//i", $cal_tmp)) { $cal_displayname_tmp .= " Webcal"; - } - - // Otherwise, remove all the path information, since that should - // not be used to identify local calendars. Also add the calendar - // label to the display name. - else { - // Strip path and .ics suffix. + } else { $cal_tmp = basename($cal_tmp); $cal_tmp = substr($cal_tmp, 0, -4); - - // Add calendar label. $cal_displayname_tmp .= " $calendar_lang"; } - - // Encode the calendar path. $cal_encoded_tmp = urlencode($cal_tmp); - - // Display the option. - // - // The submitted calendar will be encoded, and always use http:// - // if it is a webcal. So that is how we perform the comparison when - // trying to figure out if this is the selected calendar. $cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp); if ($cal_httpPrefix_tmp == urldecode($cal)) { print "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\" selected>$cal_displayname_tmp</option>"; @@ -48,15 +25,12 @@ if ($display_ical_list == "yes") { print "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\">$cal_displayname_tmp</option>"; } } - - // option to open all (non-web) calenders together if ($cal == $ALL_CALENDARS_COMBINED) { print "<option value=\"$current_view.php?cal=$ALL_CALENDARS_COMBINED&getdate=$getdate\" selected>$all_cal_comb_lang</option>"; } else { print "<option value=\"$current_view.php?cal=$ALL_CALENDARS_COMBINED&getdate=$getdate\">$all_cal_comb_lang</option>"; } - // finish <select> print "</select>"; } ?> diff --git a/includes/login.php b/includes/login.php index 81854cb..43cf105 100644 --- a/includes/login.php +++ b/includes/login.php @@ -1,65 +1,53 @@ <?php // Hide the login block if logged in or there are no lock usernames. - if (!isset($username) && $allow_login == 'yes') { + if (!isset($username) && $show_login == 'yes') { // Set the login table width if not set. if (!isset($login_width)) $login_width = "100%"; // Remove the username, password, and action values from the form action. $form_action = preg_replace("/(username|password|action)=[^&]+/", "", $REQUEST_URI); -?> - <form style="margin-bottom:0;" action="<?php echo $form_action; ?>" method="POST"> - <input type="hidden" name="action" value="login"> - <?php + + echo '<form style="margin-bottom:0;" action="'.$form_action.'" method="POST">'; + echo '<input type="hidden" name="action" value="login">'; foreach (array_keys($HTTP_GET_VARS) as $key) { - if ($key == 'action' || - $key == 'username' || - $key == 'password') - { + if ($key == 'action' || $key == 'username' || $key == 'password') { continue; } - echo "<input type=\"hidden\" name=\"$key\" value=\"$HTTP_GET_VARS[$key]\">\n"; + echo '<input type="hidden" name="'.$key.'" value="'.$HTTP_GET_VARS[$key].'">'; } - ?> - <table cellpadding="0" cellspacing="0" border="0" width="<?php echo $login_width; ?>" class="calborder"> + +echo <<<END + + <table cellpadding="0" cellspacing="0" border="0" width="{$login_width}" class="calborder"> <tr> - <td bgcolor="#FFFFFF" valign="middle" align="center"> - <table cellpadding="0" cellspacing="0" border="0" width="<?php echo $login_width; ?>"> - <tr> - <td align="left" valign="top" width="1%" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td> - <td colspan="3" align="center" width="98%" class="sideback"><font class="G10BOLD">Login</font></td> - <td align="right" valign="top" width="1%" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td> - </tr> - <tr> - <td colspan="5"><img src="images/spacer.gif" width="148" height="6" alt=" "></td> - </tr> + <td align="center" class="sideback"><div style="height: 17px; margin-top: 3px;" class="G10BOLD">Login</div></td> + </tr> + <tr> + <td align="left" class="G10B"> + <div style="padding: 5px;"> + <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> - <td width="48%" align="right"><font class="G10B">Username:</font></td> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> - <td width="48%" align="left"><input class="login_style" type="text" size="8" name="username"></td> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> + <td>Username:</td> + <td><input class="login_style" type="text" size="8" name="username"></td> </tr> <tr> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> - <td width="48%" align="right"><font class="G10B">Password:</font></td> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> - <td width="48%" align="left"><input class="login_style" type="password" size="8" name="password"></td> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> + <td>Password:</td> + <td><input class="login_style" type="password" size="8" name="password"></td> </tr> <tr> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> - <td colspan="3" align="center"><input class="login_style" type="submit" value="Login"></td> - <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=""></td> + <td> </td> + <td><input class="login_style" type="submit" value="Login"></td> </tr> </table> + </div> </td> </tr> - <tr> - <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="148" height="6" alt=" "></td> - </tr> </table> </form> <img src="images/spacer.gif" width="1" height="10" alt=" "><br> -<?php - } + +END; + +} + ?> |