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

From: Date: Sun, 10 Feb 2008 21:27:47 +0000
Subject: cvs: pearweb /include pear-database-user.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-50965@lists.php.net to get a copy of this message
dufuz Sun Feb 10 21:27:47 2008 UTC Modified files: /pearweb/include pear-database-user.php Log: Add created and createdby into allowed fields but only when admin is passed as true, the election account code was depending on it. http://cvs.php.net/viewvc.cgi/pearweb/include/pear-database-user.php?r1=1.19&r2=1.20&diff_format=u Index: pearweb/include/pear-database-user.php diff -u pearweb/include/pear-database-user.php:1.19 pearweb/include/pear-database-user.php:1.20 --- pearweb/include/pear-database-user.php:1.19 Wed Dec 5 22:14:28 2007 +++ pearweb/include/pear-database-user.php Sun Feb 10 21:27:47 2008 @@ -151,7 +151,7 @@ if ($field === null) { $sql = 'SELECT * FROM users WHERE ' . $handle . ' = ?'; $data = array($user); - if ($registered !== 'any') { + if ($registered != 'any') { $sql.= ' AND registered = ?'; $data[] = $registered === true ? '1' : '0'; } @@ -392,6 +392,8 @@ if ($admin) { $fields[] = 'registered'; + $fields[] = 'created'; + $fields[] = 'createdby'; } $info = user::info($data['handle'], null, 'any'); // In case a active value isn't passed in @@ -421,7 +423,7 @@ if (isset($data['active']) && $data['active'] === 0 && $active) { // this user is completely inactive, so mark all maintains as not active. - $dbh->query('UPDATE maintains SET active=0 WHERE handle=?', array($info['handle'])); + $dbh->query('UPDATE maintains SET active = 0 WHERE handle = ?', array($info['handle'])); } return true; }

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