![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| tias Sun May 20 20:14:43 2007 UTC Modified files: /pear/PEAR_Frontend_Web pearfrontendweb.php /pear/PEAR_Frontend_Web/Frontend Web.php /pear/PEAR_Frontend_Web/data style.css /pear/PEAR_Frontend_Web/data/templates top.inc.tpl.html /pear/PEAR_Frontend_Web/docs example.php index.php.txt Log: Not Protected warning for non-htaccess'd webfrontends http://cvs.php.net/viewvc.cgi/pear/P...&diff_format=u Index: pear/PEAR_Frontend_Web/pearfrontendweb.php diff -u pear/PEAR_Frontend_Web/pearfrontendweb.php:1.58 pear/PEAR_Frontend_Web/pearfrontendweb.php:1.59 --- pear/PEAR_Frontend_Web/pearfrontendweb.php:1.58 Sat May 19 16:02:17 2007 +++ pear/PEAR_Frontend_Web/pearfrontendweb.php Sun May 20 20:14:42 2007 @@ -29,7 +29,7 @@ * @author Tias Guns <tias@ulyssis.org> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/2_02.txt PHP License 2.02 - * @version CVS: $Id: pearfrontendweb.php,v 1.58 2007/05/19 16:02:17 tias Exp $ + * @version CVS: $Id: pearfrontendweb.php,v 1.59 2007/05/20 20:14:42 tias Exp $ * @link http://pear.php.net/package/PEAR_Frontend_Web * @since File available since Release 0.1 */ @@ -183,6 +183,11 @@ die(); } +// Check _isProtected() override (disables the 'not protected' warning) +if (isset($pear_frontweb_protected) && $pear_frontweb_protected === true) { + $GLOBALS['_PEAR_Frontend_Web_protected'] = true; +} + $cache_dir = $config->get('cache_dir'); if (!is_dir($cache_dir)) { include_once 'System.php'; http://cvs.php.net/viewvc.cgi/pear/P...&diff_format=u Index: pear/PEAR_Frontend_Web/Frontend/Web.php diff -u pear/PEAR_Frontend_Web/Frontend/Web.php:1.74 pear/PEAR_Frontend_Web/Frontend/Web.php:1.75 --- pear/PEAR_Frontend_Web/Frontend/Web.php:1.74 Sat May 19 16:02:18 2007 +++ pear/PEAR_Frontend_Web/Frontend/Web.php Sun May 20 20:14:42 2007 @@ -23,7 +23,7 @@ * @author Tias Guns <tias@ulyssis.org> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/2_02.txt PHP License 2.02 - * @version CVS: $Id: Web.php,v 1.74 2007/05/19 16:02:18 tias Exp $ + * @version CVS: $Id: Web.php,v 1.75 2007/05/20 20:14:42 tias Exp $ * @link http://pear.php.net/package/PEAR_Frontend_Web * @since File available since Release 0.1 */ @@ -50,7 +50,7 @@ * @author Tias Guns <tias@ulyssis.org> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/2_02.txt PHP License 2.02 - * @version CVS: $Id: Web.php,v 1.74 2007/05/19 16:02:18 tias Exp $ + * @version CVS: $Id: Web.php,v 1.75 2007/05/20 20:14:42 tias Exp $ * @link http://pear.php.net/package/PEAR_Frontend_Web * @since File available since Release 0.1 */ @@ -2106,6 +2106,12 @@ $tpl = $this->_initTemplate('top.inc.tpl.html'); $tpl->setCurrentBlock('Search'); $tpl->parseCurrentBlock(); + + if (!$this->_isProtected()) { + $tpl->setCurrentBlock('NotProtected'); + $tpl->setVariable('Filler', ' '); + $tpl->parseCurrentBlock(); + } } // Initialise begin vars @@ -2188,6 +2194,30 @@ // }}} /** + * Checks if this webfrontend is protected: + * - when the client sais so + * - when having .htaccess authentication + * + * @return boolean + */ + function _isProtected() + { + if ($GLOBALS['_PEAR_Frontend_Web_protected'] === true) { + return true; + } + + if (isset($_SERVER['PHP_AUTH_USER'])) { + return true; + } + + if (!empty($_SERVER['PHP_AUTH_DIGEST'])) { + return true; + } + + return false; + } + + /** * Prepare packagename for HTML output: * make it a link * http://cvs.php.net/viewvc.cgi/pear/P...&diff_format=u Index: pear/PEAR_Frontend_Web/data/style.css diff -u pear/PEAR_Frontend_Web/data/style.css:1.2 pear/PEAR_Frontend_Web/data/style.css:1.3 --- pear/PEAR_Frontend_Web/data/style.css:1.2 Sat May 19 15:36:40 2007 +++ pear/PEAR_Frontend_Web/data/style.css Sun May 20 20:14:42 2007 @@ -33,19 +33,19 @@ } a.blue { - color:#3163ce; + color:#0022cc; text-decoration: none; } a.blue:visited { - color:#3163ce; + color:#0022cc; text-decoration: none; } a.blue:active { - color:#3163ce; + color:#0022cc; text-decoration: none; } a.blue:hover { - color:#3163ce; + color:#0022cc; text-decoration: underline; } @@ -216,3 +216,11 @@ padding: 0.5em 0.5em 0.5em 0.5em; border-style: double; } + +#warning { + padding: 0.5em 0em 0.5em 0.5em; + margin: 1em 2em 1em 2em; + border-style: solid; + border-color: #ff0000; + background-color: #ffbaba; +} http://cvs.php.net/viewvc.cgi/pear/P...&diff_format=u Index: pear/PEAR_Frontend_Web/data/templates/top.inc.tpl.html diff -u pear/PEAR_Frontend_Web/data/templates/top.inc.tpl.html:1.1 pear/PEAR_Frontend_Web/data/templates/top.inc.tpl.html:1.2 --- pear/PEAR_Frontend_Web/data/templates/top.inc.tpl.html:1.1 Wed May 16 13:14:38 2007 +++ pear/PEAR_Frontend_Web/data/templates/top.inc.tpl.html Sun May 20 20:14:42 2007 @@ -52,3 +52,10 @@ </table> <br> <!-- END TitleBlock --> + + <!-- BEGIN NotProtected --> + <div id="warning">{Filler} + <b>Warning:</b> This package management website is <b>not protected</b> with a password, this is a MAJOR security risk. Please read the <a href="{_InstallerURL}?command=doc-show&pkg=pear.php.net/PEAR_Frontend_Web&file=README" class="green">README</a>. + </div> + <!-- END NotProtected --> + http://cvs.php.net/viewvc.cgi/pear/P...&diff_format=u Index: pear/PEAR_Frontend_Web/docs/example.php diff -u pear/PEAR_Frontend_Web/docs/example.php:1.18 pear/PEAR_Frontend_Web/docs/example.php:1.19 --- pear/PEAR_Frontend_Web/docs/example.php:1.18 Sat May 19 14:50:54 2007 +++ pear/PEAR_Frontend_Web/docs/example.php Sun May 20 20:14:43 2007 @@ -16,6 +16,10 @@ // uncomment and supply it here: //$pear_user_config = ''; +// OPTIONAL: If you have protected this webfrontend with a password in a +// custom way, then uncomment to disable the 'not protected' warning: +//$pear_frontweb_protected = true; + /************************************************** ********* * Following code tests $pear_dir and loads the webfrontend: http://cvs.php.net/viewvc.cgi/pear/P...&diff_format=u Index: pear/PEAR_Frontend_Web/docs/index.php.txt diff -u pear/PEAR_Frontend_Web/docs/index.php.txt:1.3 pear/PEAR_Frontend_Web/docs/index.php.txt:1.4 --- pear/PEAR_Frontend_Web/docs/index.php.txt:1.3 Sat May 19 14:50:54 2007 +++ pear/PEAR_Frontend_Web/docs/index.php.txt Sun May 20 20:14:43 2007 @@ -11,6 +11,10 @@ // uncomment and supply it here: //$pear_user_config = ''; +// OPTIONAL: If you have protected this webfrontend with a password in a +// custom way, then uncomment to disable the 'not protected' warning: +//$pear_frontweb_protected = true; + /************************************************** ********* * Following code tests $pear_dir and loads the webfrontend: | |||
| Featured Websites | ||||
|
![]() |
| Tags: cvs, examplephp, indexphptxt, pear, pearfrontendwebphp, pear_frontend_web, stylecss, topinctplhtml, webphp |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cvs: pear /PEAR_Frontend_Web package.xml pearfrontendweb.php pearweb.php /PEAR_Frontend_Web/docs example.php index.php.txt | Pear | 0 | 05-20-2007 7:42 PM | |
| cvs: pear /PEAR_Frontend_Web pearfrontendweb.php /PEAR_Frontend_Web/Frontend Web.php /PEAR_Frontend_Web/Frontend/Web Docviewer.php /PEAR_Frontend_Web/data style.css | Pear | 0 | 05-20-2007 7:42 PM | |
| cvs: pear /PEAR_Frontend_Web pearfrontendweb.php /PEAR_Frontend_Web/Frontend Web.php | Pear | 0 | 05-20-2007 7:42 PM | |
| cvs: pear /PEAR_Frontend_Web/Frontend/Web/data package.js style.css /PEAR_Frontend_Web/Frontend/Web/data/images category.jpg config.gif download.gif error.gif info.gif infoplus.gif install.gif install_fail.gif install_ok.gif install_wait.gif login.g | Pear | 0 | 05-20-2007 7:42 PM | |
| cvs: pear /PEAR_Frontend_Web package.xml pearweb.php /PEAR_Frontend_Web/Frontend Web.php /PEAR_Frontend_Web/docs example.php index.php.txt | Pear | 0 | 05-20-2007 7:42 PM | |
| Featured Websites | ||||
|