Index: trunk/extensions/ConfirmAccount/ConfirmAccount.sql |
— | — | @@ -38,6 +38,9 @@ |
39 | 39 | |
40 | 40 | -- Timestamp of account registration. |
41 | 41 | acr_registration char(14) NOT NULL, |
| 42 | + |
| 43 | + -- Flag for rejected accounts |
| 44 | + acr_deleted bool NOT NULL, |
42 | 45 | -- Time of rejection (if rejected) |
43 | 46 | acr_rejected binary(14), |
44 | 47 | -- The user who rejected it |
— | — | @@ -46,5 +49,5 @@ |
47 | 50 | PRIMARY KEY (acr_id), |
48 | 51 | UNIQUE KEY (acr_name), |
49 | 52 | INDEX (acr_email_token), |
50 | | - INDEX acr_rejected_reg (acr_rejected,acr_registration) |
| 53 | + INDEX acr_deleted_reg (acr_deleted,acr_registration) |
51 | 54 | ) TYPE=InnoDB; |
\ No newline at end of file |
Index: trunk/extensions/ConfirmAccount/ConfirmAccount.pg.sql |
— | — | @@ -18,11 +18,12 @@ |
19 | 19 | acr_notes TEXT, |
20 | 20 | acr_urls TEXT, |
21 | 21 | acr_ip CIDR, |
| 22 | + acr_deleted BOOL NOT NULL, |
22 | 23 | acr_rejected TIMESTAMPTZ, |
23 | 24 | acr_user INTEGER REFERENCES mwuser(user_id) ON DELETE SET NULL |
24 | 25 | ); |
25 | 26 | |
26 | | -CREATE INDEX acr_rejected_reg ON account_requests (acr_rejected,acr_registration); |
| 27 | +CREATE INDEX acr_deleted_reg ON account_requests (acr_deleted,acr_registration); |
27 | 28 | CREATE INDEX acr_email_token ON account_requests (acr_email_token); |
28 | 29 | |
29 | 30 | COMMIT; |
Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php |
— | — | @@ -437,8 +437,10 @@ |
438 | 438 | global $wgUser; |
439 | 439 | # Request can later be recovered |
440 | 440 | $dbw->update( 'account_requests', |
441 | | - array( 'acr_rejected' => wfTimestampNow(), 'acr_user' => $wgUser->getID() ), |
442 | | - array( 'acr_id' => $this->acrID, 'acr_rejected IS NULL' ), |
| 441 | + array( 'acr_rejected' => wfTimestampNow(), |
| 442 | + 'acr_user' => $wgUser->getID(), |
| 443 | + 'acr_deleted' => 1 ), |
| 444 | + array( 'acr_id' => $this->acrID, 'acr_deleted' => 0 ), |
443 | 445 | __METHOD__ ); |
444 | 446 | } else { |
445 | 447 | $dbw->delete( 'account_requests', array('acr_id' => $this->acrID), __METHOD__ ); |
— | — | @@ -733,9 +735,9 @@ |
734 | 736 | $this->mForm = $form; |
735 | 737 | $this->mConds = $conds; |
736 | 738 | if( $rejects ) |
737 | | - $this->mConds[] = 'acr_rejected IS NOT NULL'; |
| 739 | + $this->mConds['acr_deleted'] = 1; |
738 | 740 | else |
739 | | - $this->mConds[] = 'acr_rejected IS NULL'; |
| 741 | + $this->mConds['acr_deleted'] = 0; |
740 | 742 | $this->rejects = $rejects; |
741 | 743 | parent::__construct(); |
742 | 744 | } |