cvs: pearweb /include pear-auth.php pear-format-html.php /public_html login.php

From: Date: Sun, 02 Oct 2005 17:10:28 +0000
Subject: cvs: pearweb /include pear-auth.php pear-format-html.php /public_html login.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-35222@lists.php.net to get a copy of this message
mj Sun Oct 2 13:10:28 2005 EDT Modified files: /pearweb/include pear-auth.php pear-format-html.php /pearweb/public_html login.php Log: * Pass the login system through SSL. http://cvs.php.net/diff.php/pearweb/include/pear-auth.php?r1=1.54&r2=1.55&ty=u Index: pearweb/include/pear-auth.php diff -u pearweb/include/pear-auth.php:1.54 pearweb/include/pear-auth.php:1.55 --- pearweb/include/pear-auth.php:1.54 Sat Oct 1 06:15:54 2005 +++ pearweb/include/pear-auth.php Sun Oct 2 13:10:25 2005 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: pear-auth.php,v 1.54 2005/10/01 10:15:54 mj Exp $ + $Id: pear-auth.php,v 1.55 2005/10/02 17:10:25 mj Exp $ */ function auth_reject($realm = null, $message = null) @@ -38,6 +38,12 @@ if ($message) { report_error($message); } + + if (DEVBOX == false) { + $action = "https://" . $_SERVER['SERVER_NAME'] . "/login.php"; + } else { + $action = "/login.php"; + } print "<script type=\"text/javascript\" src=\"/javascript/md5.js\"></script>\n"; print "<script type=\"text/javascript\">\n"; print "function doMD5(frm) {\n"; @@ -45,7 +51,7 @@ print " frm.isMD5.value = 1;\n"; print "}\n"; print "</script>\n"; - print "<form onsubmit=\"javascript:doMD5(document.forms['login'])\" name=\"login\" action=\"/login.php\" method=\"post\">\n"; + print "<form onsubmit=\"javascript:doMD5(document.forms['login'])\" name=\"login\" action=\"" . $action . "\" method=\"post\">\n"; print "<input type=\"hidden\" name=\"isMD5\" value=\"0\" />\n"; print '<table class="form-holder" cellspacing="1">' . "\n"; print " <tr>\n"; http://cvs.php.net/diff.php/pearweb/include/pear-format-html.php?r1=1.174&r2=1.175&ty=u Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.174 pearweb/include/pear-format-html.php:1.175 --- pearweb/include/pear-format-html.php:1.174 Sat Sep 10 09:24:22 2005 +++ pearweb/include/pear-format-html.php Sun Oct 2 13:10:25 2005 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: pear-format-html.php,v 1.174 2005/09/10 13:24:22 pajoye Exp $ + $Id: pear-format-html.php,v 1.175 2005/10/02 17:10:25 mj Exp $ */ PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler'); @@ -651,10 +651,15 @@ * does not return. * * @param string $url Full/partial url to redirect to + * @param bool $keepProtocol Whether to keep the current protocol or to force HTTP */ -function localRedirect($url) +function localRedirect($url, $keepProtocol = true) { - header('Location: ' . getURL($url)); + $url = getURL($url, $keepProtocol); + if ($keepProtocol == false) { + $url = preg_replace("/^https/", "http", $url); + } + header('Location: ' . $url); exit; } http://cvs.php.net/diff.php/pearweb/public_html/login.php?r1=1.26&r2=1.27&ty=u Index: pearweb/public_html/login.php diff -u pearweb/public_html/login.php:1.26 pearweb/public_html/login.php:1.27 --- pearweb/public_html/login.php:1.26 Sat Oct 1 06:16:01 2005 +++ pearweb/public_html/login.php Sun Oct 2 13:10:27 2005 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: login.php,v 1.26 2005/10/01 10:16:01 mj Exp $ + $Id: login.php,v 1.27 2005/10/02 17:10:27 mj Exp $ */ /* @@ -76,11 +76,9 @@ if (isset($_POST['PEAR_OLDURL']) && basename($_POST['PEAR_OLDURL']) != 'login.php') { - localRedirect($_POST['PEAR_OLDURL']); + localRedirect($_POST['PEAR_OLDURL'], false); } else { - response_header('Login'); - report_success('Welcome.'); - response_footer(); + localRedirect("/index.php", false); exit; }

« previous php.pear.cvs (#35222) next »