cvs: pearweb /public_html account-edit.php account-info.php

From: Date: Sat, 22 Dec 2001 02:35:27 +0000
Subject: cvs: pearweb /public_html account-edit.php account-info.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1652@lists.php.net to get a copy of this message
ssb Fri Dec 21 21:35:27 2001 EDT Modified files: /pearweb/public_html account-edit.php account-info.php Log: * updated database field names Index: pearweb/public_html/account-edit.php diff -u pearweb/public_html/account-edit.php:1.1 pearweb/public_html/account-edit.php:1.2 --- pearweb/public_html/account-edit.php:1.1 Fri Nov 16 04:21:06 2001 +++ pearweb/public_html/account-edit.php Fri Dec 21 21:35:27 2001 @@ -33,17 +33,17 @@ $HTTP_POST_VARS['userinfo'], isset($HTTP_POST_VARS['showemail']) ? 1 : 0, isset($HTTP_POST_VARS['admin']) ? 1 : 0); - $query .= " WHERE handle = '" . $HTTP_POST_VARS['handle'] . "'"; + $query .= " WHERE username = '" . $HTTP_POST_VARS['handle'] . "'"; $sth = $dbh->query($query); $old_acl = $dbh->getCol("SELECT path FROM cvs_acl ". - "WHERE handle = ? AND access = 1", 0, + "WHERE username = ? AND access = 1", 0, array($handle)); $new_acl = preg_split("/[\r\n]+/", trim($cvs_acl)); $lost_entries = array_diff($old_acl, $new_acl); $new_entries = array_diff($new_acl, $old_acl); if (sizeof($lost_entries) > 0) { - $sth = $dbh->prepare("DELETE FROM cvs_acl WHERE handle = ? ". + $sth = $dbh->prepare("DELETE FROM cvs_acl WHERE username = ? ". "AND path = ?"); foreach ($lost_entries as $ent) { $del = $dbh->affectedRows(); @@ -52,7 +52,7 @@ } } if (sizeof($new_entries) > 0) { - $sth = $dbh->prepare("INSERT INTO cvs_acl (handle,path,access) ". + $sth = $dbh->prepare("INSERT INTO cvs_acl (username,path,access) ". "VALUES(?,?,?)"); foreach ($new_entries as $ent) { print "Adding CVS access to $ent for $handle...<br />\n"; @@ -74,10 +74,10 @@ default : { $dbh->setFetchmode(DB_FETCHMODE_ASSOC); - $row = $dbh->getRow("SELECT * FROM users WHERE handle = ?", + $row = $dbh->getRow("SELECT * FROM users WHERE username = ?", array($handle)); $cvs_acl_arr = $dbh->getCol("SELECT path FROM cvs_acl ". - "WHERE handle = ? AND access = 1", 0, + "WHERE username = ? AND access = 1", 0, array($handle)); $cvs_acl = implode("\n", $cvs_acl_arr); if ($row === null) { @@ -89,12 +89,12 @@ print "<input type=\"hidden\" name=\"command\" value=\"update\" />\n"; print "<input type=\"hidden\" name=\"handle\" value=\"$handle\" />\n"; - print "<h1>Editing account \"".$handle."\"</h1>\n"; + print "<h1>Editing account \"$handle\"</h1>\n"; print "<table border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\n"; print " <tr>\n"; print " <th bgcolor=\"#CCCCCC\">Handle:</th>\n"; - print " <td bgcolor=\"#e8e8e8\">".$handle."</td>\n"; + print " <td bgcolor=\"#e8e8e8\">$handle</td>\n"; print " </tr>\n"; print " <tr>\n"; Index: pearweb/public_html/account-info.php diff -u pearweb/public_html/account-info.php:1.1 pearweb/public_html/account-info.php:1.2 --- pearweb/public_html/account-info.php:1.1 Fri Nov 16 04:21:06 2001 +++ pearweb/public_html/account-info.php Fri Dec 21 21:35:27 2001 @@ -2,7 +2,7 @@ /** * Details about PEAR accounts * - * $Id: account-info.php,v 1.1 2001/11/16 09:21:06 ssb Exp $ + * $Id: account-info.php,v 1.2 2001/12/22 02:35:27 ssb Exp $ */ /** @@ -18,17 +18,17 @@ $dbh->setFetchmode(DB_FETCHMODE_ASSOC); -$row = $dbh->getRow("SELECT * FROM users WHERE registered = 1 AND handle = ?", - array($handle)); +$row = $dbh->getRow("SELECT * FROM users WHERE registered = 1 ". + "AND username = ?", array($handle)); if ($row === null) { PEAR::raiseError("No account information found!"); } -$access = $dbh->getCol("SELECT path FROM cvs_acl WHERE handle = ?", 0, +$access = $dbh->getCol("SELECT path FROM cvs_acl WHERE username = ?", 0, array($handle)); -print "<h1>Information about account \"".$handle."\"</h1>\n"; +print "<h1>Information about account \"$handle\"</h1>\n"; print "<a href=\"account-edit.php?handle=$handle\">[Edit]</a>"; print "<br />\n"; print "<br />\n"; @@ -36,7 +36,7 @@ print "<table border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\n"; print " <tr>\n"; print " <th bgcolor=\"#CCCCCC\">Handle:</th>\n"; -print " <td bgcolor=\"#e8e8e8\">".$handle."</td>\n"; +print " <td bgcolor=\"#e8e8e8\">$handle</td>\n"; print " </tr>\n"; print " <tr>\n";

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