diff -urN phpTodo-0.8.1beta.orig/doc/sql/todo.sql phpTodo-0.8.1beta/doc/sql/todo.sql --- phpTodo-0.8.1beta.orig/doc/sql/todo.sql 2007-03-07 04:58:04.000000000 +1100 +++ phpTodo-0.8.1beta/doc/sql/todo.sql 2007-09-22 20:00:22.000000000 +1000 @@ -26,7 +26,7 @@ password CHAR(40) NOT NULL, admin TINYINT UNSIGNED NOT NULL DEFAULT 0, full_name CHAR(40), - email CHAR(320) NOT NULL, + email CHAR(255) NOT NULL, PRIMARY KEY (id), UNIQUE (username), INDEX (password)); @@ -150,4 +150,4 @@ INSERT INTO user_prefs VALUES (NULL, 1, 0, 0, 0, 0, 0, 0, 'none', 'asc'); # Change the following line to reflect the correct user, host, database name, and password -GRANT insert, update, delete, select ON phpTodo.* TO phpTodo@localhost IDENTIFIED BY 'password'; +# GRANT insert, update, delete, select ON phpTodo.* TO phpTodo@localhost IDENTIFIED BY 'password'; diff -urN phpTodo-0.8.1beta.orig/feed.php phpTodo-0.8.1beta/feed.php --- phpTodo-0.8.1beta.orig/feed.php 2007-04-07 03:54:16.000000000 +1000 +++ phpTodo-0.8.1beta/feed.php 2007-09-20 19:07:45.000000000 +1000 @@ -52,8 +52,19 @@ if (! $feed_param = feed_authenticate($user_id, $feed_id, $secret)) { // Set up the channel with info indicating an invalid feed $feed->title = 'Invalid RSS Feed'; - $feed->link = 'http://' . $_SERVER['SERVER_NAME'] . - $phpTodo_serverpath . $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING']; + + // bugfix for https and/or non standard ports - Marc Bradshaw <marc@marcbradshaw.co.uk> + $location = 'http'; + if ( isset($_SERVER['HTTPS'])) { $location .= 's'; } + $location .= '://'.$_SERVER['SERVER_NAME']; + if ( isset($_SERVER['HTTPS'])) { + if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } else { + if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } + $location .= $phpTodo_serverpath . $_SERVER['REQUEST_URI']; + $feed->link = $location; + $feed->description = 'phpTodo Version ' . $phpTodo_version . "\n" . 'Auto-generated RSS feed' . "\n" . $phpTodo_homepage; @@ -73,8 +84,19 @@ // Set up the channel $feed->title = $feed_param->name . ' - phpTodo RSS Feed'; - $feed->link = 'http://' . $_SERVER['SERVER_NAME'] . - $_SERVER['REQUEST_URI']; + + // bugfix for https and/or non standard ports - Marc Bradshaw <marc@marcbradshaw.co.uk> + $location = 'http'; + if ( isset($_SERVER['HTTPS'])) { $location .= 's'; } + $location .= '://'.$_SERVER['SERVER_NAME']; + if ( isset($_SERVER['HTTPS'])) { + if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } else { + if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } + $location .= $_SERVER['REQUEST_URI']; + $feed->link = $location; + $feed->description = 'phpTodo Version ' . $phpTodo_version . "\n" . 'Auto-generated RSS feed' . "\n" . $phpTodo_homepage; @@ -161,8 +183,19 @@ # Take the data and put it into the rss object $item = new FeedItem(); $item->title = "$feedSubject ($priority)"; - $item->link = 'http://' . $_SERVER['SERVER_NAME'] . $phpTodo_serverpath . - "taskmodify.php?edit=Edit&task_id=$id"; + + // bugfix for https and/or non standard ports - Marc Bradshaw <marc@marcbradshaw.co.uk> + $location = 'http'; + if ( isset($_SERVER['HTTPS'])) { $location .= 's'; } + $location .= '://'.$_SERVER['SERVER_NAME']; + if ( isset($_SERVER['HTTPS'])) { + if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } else { + if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } + $location .= $phpTodo_serverpath ."taskmodify.php?edit=Edit&task_id=$id"; + $item->link = $location; + $item->description = nl2br("$feedDesc"); $item->date = "$create_date $itemTZOffset"; $item->source = ''; diff -urN phpTodo-0.8.1beta.orig/index.php phpTodo-0.8.1beta/index.php --- phpTodo-0.8.1beta.orig/index.php 2007-04-07 03:54:16.000000000 +1000 +++ phpTodo-0.8.1beta/index.php 2007-09-20 19:07:45.000000000 +1000 @@ -58,8 +58,19 @@ if (isset($_SESSION['redirect'])) { header('Location: ' . $_SESSION['redirect']); } else { - header('Location: http://' . $_SERVER['HTTP_HOST'] . - dirname($_SERVER['PHP_SELF']) . '/todolist.php'); + + // bugfix for https and/or non standard ports - Marc Bradshaw <marc@marcbradshaw.co.uk> + $location = 'http'; + if ( isset($_SERVER['HTTPS'])) { $location .= 's'; } + $location .= '://'.$_SERVER['HTTP_HOST']; + if ( isset($_SERVER['HTTPS'])) { + if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } else { + if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } + $location .= dirname($_SERVER['PHP_SELF']) . '/todolist.php'; + header('Location: ' . $location); + } unset($_SESSION['redirect']); diff -urN phpTodo-0.8.1beta.orig/libs/sec_check.php phpTodo-0.8.1beta/libs/sec_check.php --- phpTodo-0.8.1beta.orig/libs/sec_check.php 2007-03-07 04:58:04.000000000 +1100 +++ phpTodo-0.8.1beta/libs/sec_check.php 2007-09-20 19:07:45.000000000 +1000 @@ -164,15 +164,35 @@ } } - $_SESSION['redirect'] = 'http://' . $_SERVER['HTTP_HOST'] . - dirname($_SERVER['PHP_SELF']) . '/'; + + // bugfix for https and/or non standard ports - Marc Bradshaw <marc@marcbradshaw.co.uk> + $location = 'http'; + if ( isset($_SERVER['HTTPS'])) { $location .= 's'; } + $location .= '://'.$_SERVER['HTTP_HOST']; + if ( isset($_SERVER['HTTPS'])) { + if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } else { + if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } + $location .= dirname($_SERVER['PHP_SELF']) . '/'; + $_SESSION['redirect'] = $location; if (isset($redirect)) { $_SESSION['redirect'] .= $redirect; } - header('Location: http://' . $_SERVER['HTTP_HOST'] . - dirname($_SERVER['PHP_SELF']) . '/index.php'); + // bugfix for https and/or non standard ports - Marc Bradshaw <marc@marcbradshaw.co.uk> + $location = 'http'; + if ( isset($_SERVER['HTTPS'])) { $location .= 's'; } + $location .= '://'.$_SERVER['HTTP_HOST']; + if ( isset($_SERVER['HTTPS'])) { + if ( $_SERVER["SERVER_PORT"] != '443' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } else { + if ( $_SERVER["SERVER_PORT"] != '80' ) { $location .= ':' . $_SERVER["SERVER_PORT"]; } + } + $location .= dirname($_SERVER['PHP_SELF']) . '/index.php'; + header('Location: ' . $location); + } ?> diff -urN phpTodo-0.8.1beta.orig/sample_config.php phpTodo-0.8.1beta/sample_config.php --- phpTodo-0.8.1beta.orig/sample_config.php 2007-04-07 04:17:12.000000000 +1000 +++ phpTodo-0.8.1beta/sample_config.php 2007-09-20 20:48:51.000000000 +1000 @@ -21,20 +21,35 @@ // The work directory contains all of the private // smarty data. This directory should be below the // httpd root -$phpTodo_work_dir = '/path/to/private/phptodo'; +$phpTodo_work_dir = '/var/cache/phpTodo'; // The http directory is the first level directory // where the phpTodo distribution was uncompressed -$phpTodo_http_dir = '/path/to/public/phptodo'; +$phpTodo_http_dir = '/usr/share/phpTodo'; // The smarty directory is the location of the Smarty.class.php file -$phpTodo_smarty_dir = 'smarty/'; +// F7 Smarty builds are in /usr/share/php/Smarty/ +// FC6 and earlier Smarty builds are in /usr/share/Smarty/ instead. +// We will default to F7 but check for a class file in the FC6 location +// You may edit this to a single line pointing to the locaton of your Smarty +// install to save a couple of cycles if you wish. +$phpTodo_smarty_dir = '/usr/share/php/Smarty/'; +if (file_exists("/usr/share/Smarty/Smarty.class.php")) +{ + $phpTodo_smarty_dir = "/usr/share/Smarty/"; +} // This is the default stylesheet used by phpTodo // The location of the stylesheet is relative to // the http directory $phpTodo_stylesheet = 'css/default.css'; + +// The following line **MUST** be removed from the config file +// once the database has been setup and configured. +header("Content-type: text/plain");die("Welcome to phpTodo - Web based todo lists\n\nPlease setup and configure the database and edit the\n/etc/phpTodo/config.php configuration file.\n\nInstructions for setting up the database can be found\nin the ##DOCLOCATION##/INSTALL file.\n\nThe SQL required for setting up the database can be found\nin the ##DOCLOCATION##/sql/ directory."); + + // This is the name of the phpTodo database $phpTodo_dbName = 'phpTodo'; @@ -47,6 +62,7 @@ // This is the password for the database $phpTodo_dbPass = 'password'; + // Default session time (in seconds) $phpTodo_sessTime = 600;