cvs: pearweb /include pear-database.php pear-format-html.php pear-manual.php

From: Date: Mon, 08 Apr 2002 13:48:03 +0000
Subject: cvs: pearweb /include pear-database.php pear-format-html.php pear-manual.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3141@lists.php.net to get a copy of this message
mj Mon Apr 8 09:48:03 2002 EDT Modified files: /pearweb/include pear-database.php pear-format-html.php pear-manual.php Log: * register_globals=off fixes. Index: pearweb/include/pear-database.php diff -u pearweb/include/pear-database.php:1.71 pearweb/include/pear-database.php:1.72 --- pearweb/include/pear-database.php:1.71 Sun Apr 7 18:14:23 2002 +++ pearweb/include/pear-database.php Mon Apr 8 09:48:02 2002 @@ -17,7 +17,7 @@ | Tomas V.V.Cox <cox@php.net> | | Martin Jansen <mj@php.net> | +----------------------------------------------------------------------+ - $Id: pear-database.php,v 1.71 2002/04/07 22:14:23 cox Exp $ + $Id: pear-database.php,v 1.72 2002/04/08 13:48:02 mj Exp $ */ require_once 'DB/storage.php'; @@ -580,7 +580,7 @@ function validateUpload($package, $version, $state, $relnotes, $tarball, $md5sum) { - global $dbh, $auth_user, $PHP_AUTH_USER; + global $dbh, $auth_user; // (2) verify that package exists $package_id = package::info($package, 'id'); if (PEAR::isError($package_id) || empty($package_id)) { @@ -644,7 +644,7 @@ function confirmUpload($upload_ref) { - global $dbh, $PHP_AUTH_USER; + global $dbh; $fp = @fopen($upload_ref, "r"); if (!is_resource($fp)) { return PEAR::raiseError("invalid upload reference: $upload_ref"); @@ -659,7 +659,7 @@ $sth = $dbh->prepare($query); $release_id = $dbh->nextId("releases"); $dbh->execute($sth, array($release_id, $package_id, $version, $state, - $PHP_AUTH_USER, gmdate('Y-m-d H:i'), + $_SERVER['PHP_AUTH_USER'], gmdate('Y-m-d H:i'), $relnotes)); // Update files table $query = "INSERT INTO files ". @@ -924,12 +924,11 @@ function add($key, $value, $note) { - global $dbh, $PHP_AUTH_USER; - $nby = $PHP_AUTH_USER; + global $dbh; $nid = $dbh->nextId("notes"); $stmt = $dbh->prepare("INSERT INTO notes (id,$key,nby,ntime,note) ". "VALUES(?,?,?,?,?)"); - $res = $dbh->execute($stmt, array($nid, $value, $nby, + $res = $dbh->execute($stmt, array($nid, $value, $_SERVER['PHP_AUTH_USER'], gmdate('Y-m-d H:i'), $note)); if (DB::isError($res)) { return $res; @@ -984,13 +983,13 @@ function rejectRequest($uid, $reason) { - global $PHP_AUTH_USER, $dbh; + global $dbh; list($email) = $dbh->getRow('SELECT email FROM users WHERE handle = ?', array($uid)); note::add("uid", $uid, "Account rejected: $reason"); - $msg = "Your PEAR account request was rejected by $PHP_AUTH_USER:\n". + $msg = "Your PEAR account request was rejected by " . $_SERVER['PHP_AUTH_USER'] . ":\n". "$reason\n"; - $xhdr = "From: $PHP_AUTH_USER@php.net"; + $xhdr = "From: " . $_SERVER['PHP_AUTH_USER'] . "@php.net"; mail($email, "Your PEAR Account Request", $msg, $xhdr); return true; } @@ -1000,7 +999,7 @@ function activate($uid) { - global $PHP_AUTH_USER, $dbh; + global $dbh; $user =& new PEAR_User($dbh, $uid); if (@$user->registered) { @@ -1013,13 +1012,13 @@ $user->set('userinfo', $arr[1]); } $user->set('created', gmdate('Y-m-d H:i')); - $user->set('createdby', $PHP_AUTH_USER); + $user->set('createdby', $_SERVER['PHP_AUTH_USER']); $user->store(); note::add("uid", $uid, "Account opened"); $msg = "Your PEAR account request has been opened.\n". "To log in, go to http://pear.php.net/ and click on \"login\" in\n". "the top-right menu.\n"; - $xhdr = "From: $PHP_AUTH_USER@php.net"; + $xhdr = "From: " . $_SERVER['PHP_AUTH_USER'] . "@php.net"; mail($user->email, "Your PEAR Account Request", $msg, $xhdr); return true; } Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.27 pearweb/include/pear-format-html.php:1.28 --- pearweb/include/pear-format-html.php:1.27 Tue Apr 2 04:47:17 2002 +++ pearweb/include/pear-format-html.php Mon Apr 8 09:48:03 2002 @@ -56,7 +56,6 @@ function &draw_navigation($data, $menu_title='') { - global $PHP_SELF; $html = "<br />\n"; if (!empty($menu_title)) { $html .= "<b>$menu_title</b>\n"; @@ -65,7 +64,7 @@ foreach ($data as $url => $tit) { $tt = str_replace(" ", "&nbsp;", $tit); - if ($url == $PHP_SELF) { + if ($url == $_SERVER['PHP_SELF']) { $html .= "&nbsp;&nbsp;&nbsp;" . make_image("box-1.gif") . "<b>$tt</b><br />\n"; } else { $html .= "&nbsp;&nbsp;&nbsp;" . make_image("box-0.gif") . "<a href=\"$url\">$tt</a><br />\n"; @@ -258,7 +257,6 @@ */ function html_category_urhere($id, $link_lastest = false) { - global $PHP_SELF; $html = "<a href=\"packages.php\">Top Level</a>"; if ($id !== null) { global $dbh; @@ -298,7 +296,7 @@ function display_user_notes($user, $width = "50%") { - global $dbh, $PHP_AUTH_USER; + global $dbh; $bb = new BorderBox("Notes for user $user", $width); $notes = $dbh->getAssoc("SELECT id,nby,ntime,note FROM notes ". "WHERE uid = ? ORDER BY ntime", true, array($user)); Index: pearweb/include/pear-manual.php diff -u pearweb/include/pear-manual.php:1.10 pearweb/include/pear-manual.php:1.11 --- pearweb/include/pear-manual.php:1.10 Sat Mar 16 13:13:33 2002 +++ pearweb/include/pear-manual.php Mon Apr 8 09:48:03 2002 @@ -16,7 +16,7 @@ } function makeBorderTOC($this) { - global $NEXT, $PREV, $UP, $HOME, $TOC, $PHP_SELF, $DOCUMENT_ROOT; + global $NEXT, $PREV, $UP, $HOME, $TOC, $DOCUMENT_ROOT; global $SIDEBAR_DATA, $LANG; @@ -80,7 +80,7 @@ } function navigationBar($title,$id,$loc) { - global $NEXT, $PREV, $tstamp, $SERVER_NAME,$SERVER_PORT,$PHP_SELF; + global $NEXT, $PREV, $tstamp; echo '<table border="0" width="620" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4">'; @@ -212,8 +212,8 @@ } function manualUserNotes($title, $id) { - global $PHP_SELF, $SERVER_NAME, $SERVER_PORT, $LANG, $MYSITE; - $cur = substr(dirname($PHP_SELF),-2); + global $LANG, $MYSITE; + $cur = substr(dirname($_SERVER['PHP_SELF']),-2); if($cur=='al') $cur='en'; # don't want .php at the end of the id. @@ -223,9 +223,9 @@ $notes = manualGetUserNotes($title, $id); - $back_url = 'http://' . $SERVER_NAME . - (($SERVER_PORT==80) ? '' : ':'.$SERVER_PORT ) . - $PHP_SELF; + $back_url = 'http://' . $_SERVER['SERVER_NAME'] . + (($_SERVER['SERVER_PORT'] == 80) ? '' : ':'.$_SERVER['SERVER_PORT'] ) . + $_SERVER['PHP_SELF']; echo "<tr bgcolor=\"#d0d0d0\" valign=\"top\">\n"; echo "<td><small>User Contributed Notes<br></small><b>$title</b><br></td>\n";

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