cvs: pearweb /include pear-database-user.php /public_html account-edit.php account-info.php /sql pearweb_mdb2schema.xml users.sql
| From: | Greg Beaver | Date: | Wed, 25 Apr 2007 03:25:25 +0000 |
| Subject: | cvs: pearweb /include pear-database-user.php /public_html account-edit.php account-info.php /sql pearweb_mdb2schema.xml users.sql | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-46156@lists.php.net to get a copy of this message | ||
cellog Wed Apr 25 03:25:25 2007 UTC
Modified files:
/pearweb/include pear-database-user.php
/pearweb/public_html account-edit.php account-info.php
/pearweb/sql pearweb_mdb2schema.xml users.sql
Log:
implement Request #10562 Mark complete user as inactive
http://cvs.php.net/viewvc.cgi/pearweb/include/pear-database-user.php?r1=1.2&r2=1.3&diff_format=u
Index: pearweb/include/pear-database-user.php
diff -u pearweb/include/pear-database-user.php:1.2 pearweb/include/pear-database-user.php:1.3
--- pearweb/include/pear-database-user.php:1.2 Mon Apr 23 04:21:41 2007
+++ pearweb/include/pear-database-user.php Wed Apr 25 03:25:25 2007
@@ -54,6 +54,7 @@
include_once 'pear-database-note.php';
note::removeAll("uid", $uid);
$user->set('registered', 1);
+ $user->set('active', 1);
/* $user->set('ppp_only', 0); */
if (is_array($arr)) {
$user->set('userinfo', $arr[1]);
@@ -392,9 +393,11 @@
'wishlist',
'latitude',
'longitude',
+ 'active',
);
$user =& new PEAR_User($dbh, $data['handle']);
+ $active = $user->active;
foreach ($data as $key => $value) {
if (!in_array($key, $fields)) {
continue;
@@ -403,6 +406,10 @@
}
$user->store();
+ if (!$user->active && $active) {
+ // this user is completely inactive, so mark all maintains as not active.
+ $dbh->query('UPDATE maintains SET active=0 WHERE handle=?',
array($user->handle));
+ }
return $user;
}
http://cvs.php.net/viewvc.cgi/pearweb/public_html/account-edit.php?r1=1.57&r2=1.58&diff_format=u
Index: pearweb/public_html/account-edit.php
diff -u pearweb/public_html/account-edit.php:1.57 pearweb/public_html/account-edit.php:1.58
--- pearweb/public_html/account-edit.php:1.57 Sun Apr 22 01:51:35 2007
+++ pearweb/public_html/account-edit.php Wed Apr 25 03:25:25 2007
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: account-edit.php,v 1.57 2007/04/22 01:51:35 dufuz Exp $
+ $Id: account-edit.php,v 1.58 2007/04/25 03:25:25 cellog Exp $
*/
auth_require();
@@ -70,7 +70,7 @@
switch ($command) {
case 'update':
- $fields_list = array("name", "email", "homepage",
"showemail", "userinfo", "pgpkeyid", "wishlist",
"latitude", "longitude");
+ $fields_list = array("name", "email", "homepage",
"showemail", "userinfo", "pgpkeyid", "wishlist",
"latitude", "longitude", "active");
$user_data_post = array('handle' => $handle);
foreach ($fields_list as $k) {
@@ -79,6 +79,11 @@
continue;
}
+ if ($k == 'active') {
+ $user_data_post['active'] = isset($_POST['active']) ? 1 : 0;
+ continue;
+ }
+
if ($k == 'wishlist') {
$user_data_post['wishlist'] = isset($_POST['wishlist']) ?
strip_tags($_POST['wishlist']) : '';
continue;
@@ -203,6 +208,8 @@
$form = new HTML_Form('account-edit.php', 'post');
$form->setDefaultFromInput(false);
+$form->addCheckbox('active', 'Active User?',
+ htmlspecialchars($row['active']));
$form->addText('name', '<span
class="accesskey">N</span>ame:',
htmlspecialchars($row['name']), 40, null, 'accesskey="n"');
$form->addText('email', 'Email:',
http://cvs.php.net/viewvc.cgi/pearweb/public_html/account-info.php?r1=1.51&r2=1.52&diff_format=u
Index: pearweb/public_html/account-info.php
diff -u pearweb/public_html/account-info.php:1.51 pearweb/public_html/account-info.php:1.52
--- pearweb/public_html/account-info.php:1.51 Sun Apr 22 01:51:35 2007
+++ pearweb/public_html/account-info.php Wed Apr 25 03:25:25 2007
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: account-info.php,v 1.51 2007/04/22 01:51:35 dufuz Exp $
+ $Id: account-info.php,v 1.52 2007/04/25 03:25:25 cellog Exp $
*/
/**
@@ -125,6 +125,12 @@
<li>Username: <?php echo $row['handle']; ?></li>
<?php
+if ($row['active']) {
+ echo '<li>Active: <strong>Yes</strong></li>';
+} else {
+ echo '<li>Active: <strong>NO</strong></li>';
+}
+
if (isset($auth_user)) {
echo "<li>Email: ";
echo make_mailto_link($row['email']);
http://cvs.php.net/viewvc.cgi/pearweb/sql/pearweb_mdb2schema.xml?r1=1.34&r2=1.35&diff_format=u
Index: pearweb/sql/pearweb_mdb2schema.xml
diff -u pearweb/sql/pearweb_mdb2schema.xml:1.34 pearweb/sql/pearweb_mdb2schema.xml:1.35
--- pearweb/sql/pearweb_mdb2schema.xml:1.34 Wed Apr 25 02:58:45 2007
+++ pearweb/sql/pearweb_mdb2schema.xml Wed Apr 25 03:25:25 2007
@@ -2429,6 +2429,14 @@
<default></default>
</field>
+ <field>
+ <name>active</name>
+ <type>integer</type>
+ <length>4</length>
+ <notnull>true</notnull>
+ <default>1</default>
+ </field>
+
<index>
<name>handle</name>
<field>
http://cvs.php.net/viewvc.cgi/pearweb/sql/users.sql?r1=1.19&r2=1.20&diff_format=u
Index: pearweb/sql/users.sql
diff -u pearweb/sql/users.sql:1.19 pearweb/sql/users.sql:1.20
--- pearweb/sql/users.sql:1.19 Mon Mar 12 05:21:09 2007
+++ pearweb/sql/users.sql Wed Apr 25 03:25:25 2007
@@ -14,6 +14,7 @@
pgpkeyid varchar(20) default NULL,
pgpkey text,
wishlist varchar(255) NOT NULL default '',
+ active tinyint(1) NOT NULL default 1,
PRIMARY KEY (handle),
KEY handle (handle,registered),
KEY pgpkeyid (pgpkeyid),