locked_map)) { // Remember the invalid login, because we may want to display // a message elsewhere or check validity. return array($username, $password, true); } // Set the login cookie or session authentication values. if ($login_cookies == 'yes') { $the_cookie = serialize(array('username' => $username, 'password' => $password)); setcookie('phpicalendar_login', $the_cookie, time()+(60*60*24*7*12*10), '/', $cookie_uri, 0); } else { $_SESSION['username'] = $username; $_SESSION['password'] = $password; } // Return the username and password. return array($username, $password, $invalid_login); } // Logout the user. The username and password stored in cookies or the // session will be deleted. // // Returns an empty username and password. function user_logout() { global $login_cookies, $cookie_uri, $phpiCal_config; // Clear the login cookie or session authentication values. if ($login_cookies == 'yes') { setcookie('phpicalendar_login', '', time()-(60*60*24*7), '/', $cookie_uri, 0); } else { // Check if the session has already been started. if (!session_id()) { session_start(); setcookie(session_name(), session_id(), time()+(60*60*24*7*12*10), '/', $cookie_uri, 0); } // Clear the session authentication values. unset($_SESSION['username']); unset($_SESSION['password']); } // Return empty username and password. return array('', ''); } ?>