Skip to content

Commit c67e513

Browse files
committed
Add methods to disable and enable a subscriber
1 parent bb6126f commit c67e513

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

plugins/Common/DAO/UserTrait.php

+22
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,28 @@ public function confirmUser($email)
6969
return $this->dbCommand->queryAffectedRows($sql);
7070
}
7171

72+
public function disableUser($email)
73+
{
74+
$email = sql_escape($email);
75+
$sql =
76+
"UPDATE {$this->tables['user']} u
77+
SET disabled = 1
78+
WHERE email = '$email'";
79+
80+
return $this->dbCommand->queryAffectedRows($sql);
81+
}
82+
83+
public function enableUser($email)
84+
{
85+
$email = sql_escape($email);
86+
$sql =
87+
"UPDATE {$this->tables['user']} u
88+
SET disabled = 0
89+
WHERE email = '$email'";
90+
91+
return $this->dbCommand->queryAffectedRows($sql);
92+
}
93+
7294
public function updateUserAttribute($email, $attributeId, $value)
7395
{
7496
$sql = <<<END

0 commit comments

Comments
 (0)