From: <jo...@us...> - 2003-11-25 22:13:59
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1:/tmp/cvs-serv6823/functions Modified Files: ical_parser.php init.inc.php Log Message: Fleshed out invalid login error response. Only checks for invalid logins for non-HTTP authentication (even if there is no calendar map for an HTTP authenticated user). Switched some include() directives to include_once() to prevent possible future redeclaration errors. Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** ical_parser.php 23 Nov 2003 21:41:51 -0000 1.135 --- ical_parser.php 25 Nov 2003 22:13:56 -0000 1.136 *************** *** 2,10 **** if (!defined('BASE')) define('BASE', './'); ! include(BASE.'functions/init.inc.php'); ! include(BASE.'functions/date_functions.php'); ! include(BASE.'functions/draw_functions.php'); ! include(BASE.'functions/overlapping_events.php'); ! include(BASE.'functions/timezones.php'); $fillTime = $day_start; --- 2,10 ---- if (!defined('BASE')) define('BASE', './'); ! include_once(BASE.'functions/init.inc.php'); ! include_once(BASE.'functions/date_functions.php'); ! include_once(BASE.'functions/draw_functions.php'); ! include_once(BASE.'functions/overlapping_events.php'); ! include_once(BASE.'functions/timezones.php'); $fillTime = $day_start; Index: init.inc.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/init.inc.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** init.inc.php 25 Nov 2003 21:50:13 -0000 1.51 --- init.inc.php 25 Nov 2003 22:13:56 -0000 1.52 *************** *** 7,11 **** // uncomment when developing, comment for shipping version ! error_reporting (E_ERROR | E_WARNING); // Older versions of PHP do not define $_SERVER. Define it here instead. --- 7,11 ---- // uncomment when developing, comment for shipping version ! error_reporting (E_ERROR | E_WARNING | E_PARSE); // Older versions of PHP do not define $_SERVER. Define it here instead. *************** *** 19,25 **** // Pull in the configuration and some functions. if (!defined('BASE')) define('BASE', './'); ! include(BASE.'config.inc.php'); ! include(BASE.'functions/error.php'); ! include(BASE.'functions/calendar_functions.php'); if (isset($HTTP_COOKIE_VARS['phpicalendar'])) { $phpicalendar = unserialize(stripslashes($HTTP_COOKIE_VARS['phpicalendar'])); --- 19,25 ---- // Pull in the configuration and some functions. if (!defined('BASE')) define('BASE', './'); ! include_once(BASE.'config.inc.php'); ! include_once(BASE.'functions/error.php'); ! include_once(BASE.'functions/calendar_functions.php'); if (isset($HTTP_COOKIE_VARS['phpicalendar'])) { $phpicalendar = unserialize(stripslashes($HTTP_COOKIE_VARS['phpicalendar'])); *************** *** 55,60 **** else if (isset($HTTP_POST_VARS['password'])) $password = $HTTP_POST_VARS['password']; ! // Set the login cookie if logging in. Clear it if logging out. $action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : ''; if ($action == 'login') { $the_cookie = serialize(array('username' => $username, 'password' => $password)); --- 55,74 ---- else if (isset($HTTP_POST_VARS['password'])) $password = $HTTP_POST_VARS['password']; ! // Grab the action (login or logout). $action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : ''; + + // Check to make sure the username and password is valid. + if (!key_exists("$username:$password", $locked_map)) { + // Don't login, instead logout. + $action = 'logout'; + + // Remember the invalid login, because we may want to + // display a message elsewhere. + $invalid_login = true; + } else { + $invalid_login = false; + } + + // Set the login cookie if logging in. Clear it if logging out. if ($action == 'login') { $the_cookie = serialize(array('username' => $username, 'password' => $password)); |