Computer Webmaster Gaming Console Graphics Forum

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.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > Pear
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

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.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 05-27-2007, 7:47 PM   #1
Helgi Þormar Þorbjörnsson
 
Helgi Þormar Þorbjörnsson's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default cvs: pearweb /include pear-database-user.php

dufuz Fri May 25 22:38:30 2007 UTC

Modified files:
/pearweb/include pear-database-user.php
Log:
Mostly cosmetics but also always pass registered field when we are fetching only one field from the user table

http://cvs.php.net/viewvc.cgi/pearwe...&diff_format=u
Index: pearweb/include/pear-database-user.php
diff -u pearweb/include/pear-database-user.php:1.11 pearweb/include/pear-database-user.php:1.12
--- pearweb/include/pear-database-user.php:1.11 Wed May 23 05:00:46 2007
+++ pearweb/include/pear-database-user.php Fri May 25 22:38:30 2007
@@ -174,14 +174,15 @@
$handle = strpos($user, '@') ? 'email' : 'handle';

if ($field === null) {
- if ($registered === 'any') {
- $row = $dbh->getRow('SELECT * FROM users WHERE ' . $handle . ' = ?',
- array($user), DB_FETCHMODE_ASSOC);
- } else {
- $registered = $registered === true ? '1' : '0';
- $row = $dbh->getRow('SELECT * FROM users WHERE registered = ? AND ' . $handle . ' = ?',
- array($registered, $user), DB_FETCHMODE_ASSOC);
+ $sql = 'SELECT * FROM users WHERE ' . $handle . ' = ?';
+ $data = array($user);
+ if ($registered !== 'any') {
+ $sql.= ' AND registered = ?';
+ $data[] = $registered === true ? '1' : '0';
}
+
+ $row = $dbh->getRow($sql, $data, DB_FETCHMODE_ASSOC);
+
if ($hidePassword) {
unset($row['password']);
}
@@ -192,9 +193,14 @@
return null;
}

- return $dbh->getRow('SELECT ! FROM users WHERE handle = ?',
- array($field, $user), DB_FETCHMODE_ASSOC);
+ $sql = 'SELECT ! FROM users WHERE handle = ?';
+ $data = array($field, $user);
+ if ($registered !== 'any') {
+ $sql.= ' AND registered = ?';
+ $data[] = $registered === true ? '1' : '0';
+ }

+ return $dbh->getRow($sql, $data, DB_FETCHMODE_ASSOC);
}

// }}}
@@ -234,11 +240,6 @@
* During most of this method's operation, PEAR's error handling
* is set to PEAR_ERROR_RETURN.
*
- * But, during the DB_storage::set() phase error handling is set to
- * PEAR_ERROR_CALLBACK the report_warning() function. So, if an
- * error happens a warning message is printed AND the incomplete
- * user information is removed.
- *
* @param array $data Information about the user
* @param boolean $md5ed true if the password has been hashed already
* @param boolean $automatic true if this is an automatic account request
@@ -405,6 +406,10 @@
{
global $dbh;

+ if (!isset($data['handle'])) {
+ return false;
+ }
+
$fields = array(
'name',
'email',
@@ -419,7 +424,9 @@
'password',
);

- if ($admin) $fields[] = 'registered';
+ if ($admin) {
+ $fields[] = 'registered';
+ }
$info = user::info($data['handle'], null, 'any');
// In case a active value isn't passed in
$active = isset($info['active']) ? $info['active'] : true;
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
cvs: pearweb /include pear-database-category.php Greg Beaver Pear 0 05-27-2007 7:46 PM
cvs: pearweb /include pear-rest.php Greg Beaver Pear 0 05-27-2007 7:46 PM
cvs: pearweb /include pear-database-package.php /public_html account-request-newpackage.php Arnaud Limbourg Pear 0 05-27-2007 7:46 PM
cvs: pearweb /include pear-database-package.php Mark Wiesemann Pear 0 05-20-2007 7:42 PM
cvs: pearweb /include pear-database-user.php Greg Beaver Pear 0 05-20-2007 7:42 PM


Featured Websites




All times are GMT +1. The time now is 1:03 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98