From: <jo...@us...> - 2003-11-22 21:16:13
|
Update of /cvsroot/phpicalendar/phpicalendar In directory sc8-pr-cvs1:/tmp/cvs-serv505 Modified Files: admin.php config.inc.php preferences.php Log Message: Added username/password login to access locked calendars. Moved calendar availability logic (with support for login) to a calendar_functions.php file. RSS feeds support the login feature when determining which calendars to return. Styles updated for the login box. Index: admin.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/admin.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin.php 20 Sep 2003 21:46:17 -0000 1.6 --- admin.php 22 Nov 2003 21:16:10 -0000 1.7 *************** *** 5,8 **** --- 5,9 ---- include (BASE.'functions/init.inc.php'); include (BASE.'functions/admin_functions.php'); + include (BASE.'functions/calendar_functions.php'); // Redirect if administration is not allowed *************** *** 235,239 **** $COLUMNS_TO_PRINT = 3; $column = 1; ! $filelist = get_calendar_files($calendar_path); foreach ($filelist as $file) { if ($column > $COLUMNS_TO_PRINT) { --- 236,240 ---- $COLUMNS_TO_PRINT = 3; $column = 1; ! $filelist = availableCalendarNames('', '', '', true); foreach ($filelist as $file) { if ($column > $COLUMNS_TO_PRINT) { Index: config.inc.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/config.inc.php,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** config.inc.php 22 Nov 2003 03:45:33 -0000 1.123 --- config.inc.php 22 Nov 2003 21:16:10 -0000 1.124 *************** *** 48,51 **** --- 48,52 ---- $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. // Administration settings *************** *** 67,70 **** --- 68,83 ---- $list_webcals[] = ''; // or webcal:// and the filename should contain the .ics suffix $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[] = ''; // 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[] = ''; // 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 Index: preferences.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/preferences.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** preferences.php 21 Sep 2003 03:22:08 -0000 1.34 --- preferences.php 22 Nov 2003 21:16:10 -0000 1.35 *************** *** 3,6 **** --- 3,7 ---- define('BASE','./'); include(BASE.'functions/ical_parser.php'); + include(BASE.'functions/calendar_functions.php'); $display_date = $preferences_lang; *************** *** 158,169 **** // print "<select name=\"cookie_calendar\" class=\"query_style\">\n"; ! $dir_handle = @opendir($calendar_path) or die(error(sprintf($error_path_lang, $calendar_path), $cal_filename)); ! $filelist = array(); ! while ($file = readdir($dir_handle)) { ! if (preg_match("/^[^.].+\.ics$/", $file)) { ! array_push($filelist, $file); ! } ! } ! natcasesort($filelist); foreach ($filelist as $file) { $cal_filename_tmp = substr($file,0,-4); --- 159,163 ---- // print "<select name=\"cookie_calendar\" class=\"query_style\">\n"; ! $filelist = availableCalendarNames($username, $password, $ALL_CALENDARS_COMBINED); foreach ($filelist as $file) { $cal_filename_tmp = substr($file,0,-4); |