phpScheduleIt
May 21, 2013, 09:45:22 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: index.php should check for POST method rather than specific variable  (Read 15405 times)
Zanchey
Newbie
*

Karma: 0
Posts: 5


« on: September 27, 2008, 03:46:00 AM »

This is a bug report for phpScheduleIt 1.2.8, under PHP 5.2.5 running in ISAPI mode on IIS 6.0 on Windows Server 2003. SQL server is Microsoft SQL Server Express Edition 2005. I have examined the source code and confirmed that it still exists on 1.2.10.

Under Internet Explorer, hitting the enter key to submit a form does not have the same effect as clicking the 'submit' button - it does not include the submit button's value in the posted form data.

This means that the login form in index.php cannot be submitted without clicking the log in button, as it checks for a particular POST variable. Many people are used to being able to submit forms by simply hitting return, particularly on login pages.

The patch below fixes this behaviour by changing index.php to check for a POST form, rather than a specific field in that form.

Code:
--- index.php-ORIG Sat Sep 27 11:36:48 2008
+++ index.php Sat Sep 27 11:36:11 2008
@@ -26,7 +26,7 @@
 if (isset($_GET['logout'])) {
     $auth->doLogout();   
 }
-else if (isset($_POST['login'])) {
+else if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  $msg = $auth->doLogin($_POST['email'], $_POST['password'], (isset($_POST['setCookie']) ? 'y' : null), false, $resume, $_POST['language']);
 }
 else if (isset($_COOKIE['ID'])) {
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: September 29, 2008, 09:42:17 AM »

Good find.  I'll get this fixed.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!