From 9c2080e8bc15acebacac8ba8c724a904c935f6b8 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 31 Dec 2008 11:16:33 +0000 Subject: bump version to 2.31rc2 --- functions/calendar_functions.php | 8 +++----- functions/init/configs.php | 1 - functions/userauth_functions.php | 42 ++++++++++++++++------------------------ 3 files changed, 20 insertions(+), 31 deletions(-) (limited to 'functions') diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php index 020396f..2362686 100644 --- a/functions/calendar_functions.php +++ b/functions/calendar_functions.php @@ -14,7 +14,6 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) { // Import globals. global $list_webcals, $blacklisted_cals, $locked_cals, $locked_map, $apache_map, $lang, $_SERVER, $phpiCal_config; - // Create the list of available calendars. $calendars = array(); @@ -29,7 +28,6 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) if (isset($locked_map["$username:$password"])) { $unlocked_cals = $locked_map["$username:$password"]; } - // Make a local copy of the requested calendars. if (!is_array($cal_filename)) $cal_filename_local = array($cal_filename); @@ -101,10 +99,10 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) } // Make sure the file is real. if (!is_file($file)) continue; - // Make sure the file ends in .ics. - if (!preg_match("/^.*\.ics$/i", $file)) continue; + // Remove any php files. + if (preg_match("/^.*\.php$/i", $file)) continue; // Make sure this is not a blacklisted calendar. - $cal_name = getCalendarName($file); + $cal_name = getCalendarName($file); if (in_array($cal_name, $blacklisted_cals)) continue; // If HTTP authenticated, make sure this calendar is available // to the user. diff --git a/functions/init/configs.php b/functions/init/configs.php index d47f367..1a553af 100644 --- a/functions/init/configs.php +++ b/functions/init/configs.php @@ -56,7 +56,6 @@ if (is_file($lang_file)) { if (isset($phpicalendar['cookie_timeformat']) && $phpicalendar['cookie_timeformat'] !=''){ $timeFormat = $phpicalendar['cookie_timeformat']; -echo "here $timeFormat
";print_r($phpicalendar);
 	switch($timeFormat){
 		case 'h:i':
 		case 'h:i A':
diff --git a/functions/userauth_functions.php b/functions/userauth_functions.php
index 2875fd4..abe2b5a 100644
--- a/functions/userauth_functions.php
+++ b/functions/userauth_functions.php
@@ -43,8 +43,7 @@ function logout_querys() {
 // if no valid login is found. Returns a boolean invalid_login to
 // indicate that the login is invalid.
 function user_login() {
-	global $_COOKIE, $_GET, $_POST, $_SERVER, $phpiCal_config;
-	global $login_cookies, $cookie_uri, $locked_map;
+	global $phpiCal_config, $locked_map;
 	
 	// Initialize return values.
 	$invalid_login = false;
@@ -56,41 +55,34 @@ function user_login() {
 	}
 
 	// Look for a login cookie.
-	if ($login_cookies == 'yes' &&
-		isset($_COOKIE['phpicalendar_login']))
-	{
+	if ($phpiCal_config->login_cookies == 'yes' && isset($_COOKIE['phpicalendar_login'])){
 		$login_cookie = unserialize(stripslashes($_COOKIE['phpicalendar_login']));
-		if (isset($login_cookie['username']) &&
-			isset($login_cookie['password']))
-		{
+		if (isset($login_cookie['username']) &&	isset($login_cookie['password'])){
 			$username = $login_cookie['username'];
 			$password = $login_cookie['password'];
 		}
 	}
 	
 	// Look for session authentication.
-	if ($login_cookies != 'yes') {
+	if ($phpiCal_config->login_cookies != 'yes') {
 		if (!session_id()) {
 			session_start();
-			setcookie(session_name(), session_id(), time()+(60*60*24*7*12*10), '/', $cookie_uri, 0);
+			setcookie(session_name(), session_id(), time()+(60*60*24*7*12*10), '/', $phpiCal_config->cookie_uri, 0);
 		}
-		if (isset($_SESSION['username']) &&
-			isset($_SESSION['password']))
-		{
+		if (isset($_SESSION['username'], $_SESSION['password'])){
 			$username = $_SESSION['username'];
 			$password = $_SESSION['password'];
 		}
 	}
 	
 	// Look for a new username and password.
-	if (isset($_GET['username']) &&
-		isset($_GET['password']))
-	{
-		$username = $_GET['username'];
-		$password = $_GET['password'];
-	} else if (isset($_POST['username']) &&
-			   isset($_POST['password']))
-	{
+# Should only take these from post?	
+#	if (isset($_GET['username'], $_GET['password'])){
+#		$username = $_GET['username'];
+#		$password = $_GET['password'];
+#	} else 
+	
+	if (isset($_POST['username'], $_POST['password'])){
 		$username = $_POST['username'];
 		$password = $_POST['password'];
 	}
@@ -120,16 +112,16 @@ function user_login() {
 //
 // Returns an empty username and password.
 function user_logout() {
-	global $login_cookies, $cookie_uri, $phpiCal_config;
+	global $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);
+	if ($phpiCal_config->login_cookies == 'yes') {
+		setcookie('phpicalendar_login', '', time()-(60*60*24*7), '/', $phpiCal_config->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);
+			setcookie(session_name(), session_id(), time()+(60*60*24*7*12*10), '/', $phpiCal_config->cookie_uri, 0);
 		}
 	
 		// Clear the session authentication values.
-- 
cgit v1.2.3