com web/pecl: fix auth_require: include/pear-auth.php

From: Date: Tue, 31 Mar 2015 09:25:03 +0000
Subject: com web/pecl: fix auth_require: include/pear-auth.php
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-21999@lists.php.net to get a copy of this message
Commit: ab5f6a0aa5cce6fd2dfa755e0bf4fd741b9e4644 Author: Pierre Joye <pierre.php@gmail.com> Tue, 31 Mar 2015 11:25:03 +0200 Parents: ca1d8f5803ef30156fde713e403dcadb568666cc Branches: master Link: http://git.php.net/?p=web/pecl.git;a=commitdiff;h=ab5f6a0aa5cce6fd2dfa755e0bf4fd741b9e4644 Log: fix auth_require Changed paths: M include/pear-auth.php Diff: diff --git a/include/pear-auth.php b/include/pear-auth.php index 30810f1..6959d43 100644 --- a/include/pear-auth.php +++ b/include/pear-auth.php @@ -20,7 +20,6 @@ function auth_reject($realm = null, $message = null) { - global $format; if ($realm === null) { $realm = PEAR_AUTH_REALM; } @@ -29,54 +28,54 @@ function auth_reject($realm = null, $message = null) } response_header('Login'); - if ($format == 'html') { - $GLOBALS['ONLOAD'] = "document.login.PEAR_USER.focus();"; - if ($message) { - report_error($message); - } - print "<form name=\"login\" action=\"/login.php\" method=\"post\">\n"; - print '<table class="form-holder" cellspacing="1">' . "\n"; - print " <tr>\n"; - print ' <th class="form-label_left">'; - print 'Use<span class="accesskey">r</span>name:</th>' . "\n"; - print ' <td class="form-input">'; - print '<input size="20" name="PEAR_USER" accesskey="r" /></td>' . "\n"; - print " </tr>\n"; - print " <tr>\n"; - print ' <th class="form-label_left">Password:</th>' . "\n"; - print ' <td class="form-input">'; - print '<input size="20" name="PEAR_PW" type="password" /></td>' . "\n"; - print " </tr>\n"; - print " <tr>\n"; - print ' <th class="form-label_left">&nbsp;</th>' . "\n"; - print ' <td class="form-input" style="white-space: nowrap">'; - print '<input type="checkbox" name="PEAR_PERSIST" value="on" id="pear_persist_chckbx" '.((!empty($_COOKIE['REMEMBER_ME']) || !empty($_POST['PEAR_PERSIST']))?'checked="checked " ':'').'/> '; - print '<label for="pear_persist_chckbx">Remember username and password.</label></td>' . "\n"; - print " </tr>\n"; - print " <tr>\n"; - print ' <th class="form-label_left">&nbsp;</td>' . "\n"; - print ' <td class="form-input"><input type="submit" value="Log in!" /></td>' . "\n"; - print " </tr>\n"; - print "</table>\n"; - print '<input type="hidden" name="PEAR_OLDURL" value="'; - if (isset($_GET['redirect'])) { - print htmlspecialchars(urldecode($_GET['redirect'])); - } elseif (isset($_POST['PEAR_OLDURL'])) { - print htmlspecialchars($_POST['PEAR_OLDURL']); - } elseif (isset($_SERVER['REQUEST_URI'])) { - print htmlspecialchars($_SERVER['REQUEST_URI']); - } else { - print 'login.php'; - } - print "\" />\n"; - print "</form>\n"; - print hdelim(); - print "<p><strong>Note:</strong> If you just want to browse the website, "; - print "you will not need to log in. For all tasks that require "; - print "authentication, you will be redirected to this form "; - print "automatically. You can sign up for an account "; - print "<a href=\"/account-request.php\">over here</a>.</p>"; - } + + $GLOBALS['ONLOAD'] = "document.login.PEAR_USER.focus();"; + if ($message) { + report_error($message); + } + print "<form name=\"login\" action=\"/login.php\" method=\"post\">\n"; + print '<table class="form-holder" cellspacing="1">' . "\n"; + print " <tr>\n"; + print ' <th class="form-label_left">'; + print 'Use<span class="accesskey">r</span>name:</th>' . "\n"; + print ' <td class="form-input">'; + print '<input size="20" name="PEAR_USER" accesskey="r" /></td>' . "\n"; + print " </tr>\n"; + print " <tr>\n"; + print ' <th class="form-label_left">Password:</th>' . "\n"; + print ' <td class="form-input">'; + print '<input size="20" name="PEAR_PW" type="password" /></td>' . "\n"; + print " </tr>\n"; + print " <tr>\n"; + print ' <th class="form-label_left">&nbsp;</th>' . "\n"; + print ' <td class="form-input" style="white-space: nowrap">'; + print '<input type="checkbox" name="PEAR_PERSIST" value="on" id="pear_persist_chckbx" '.((!empty($_COOKIE['REMEMBER_ME']) || !empty($_POST['PEAR_PERSIST']))?'checked="checked " ':'').'/> '; + print '<label for="pear_persist_chckbx">Remember username and password.</label></td>' . "\n"; + print " </tr>\n"; + print " <tr>\n"; + print ' <th class="form-label_left">&nbsp;</td>' . "\n"; + print ' <td class="form-input"><input type="submit" value="Log in!" /></td>' . "\n"; + print " </tr>\n"; + print "</table>\n"; + print '<input type="hidden" name="PEAR_OLDURL" value="'; + if (isset($_GET['redirect'])) { + print htmlspecialchars(urldecode($_GET['redirect'])); + } elseif (isset($_POST['PEAR_OLDURL'])) { + print htmlspecialchars($_POST['PEAR_OLDURL']); + } elseif (isset($_SERVER['REQUEST_URI'])) { + print htmlspecialchars($_SERVER['REQUEST_URI']); + } else { + print 'login.php'; + } + print "\" />\n"; + print "</form>\n"; + print hdelim(); + print "<p><strong>Note:</strong> If you just want to browse the website, "; + print "you will not need to log in. For all tasks that require "; + print "authentication, you will be redirected to this form "; + print "automatically. You can sign up for an account "; + print "<a href=\"/account-request.php\">over here</a>.</p>"; + response_footer(); exit; }

« previous php.pecl.cvs (#21999) next »