We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1acfae4 commit 137a863Copy full SHA for 137a863
lib/DiscourseAPI.php
@@ -307,5 +307,22 @@ function changeSiteSetting($siteSetting, $value)
307
$params = array($siteSetting => $value);
308
return $this->_putRequest('/admin/site_settings/' . $siteSetting, $params);
309
}
310
+
311
+ function getIDByEmail($email)
312
+ {
313
+ $username = $this->getUsernameByEmail($email);
314
+ if ($username) {
315
+ return $this->_getRequest('/users/' . $username . '/activity.json')->apiresult->user->id;
316
+ } else {
317
+ return false;
318
+ }
319
320
321
+ function logoutByEmail($email)
322
323
+ $user_id = $this->getIDByEmail($email);
324
+ $params = array('username_or_email' => $email);
325
+ return $this->_postRequest('/admin/users/' . $user_id . '/log_out', $params);
326
327
328
0 commit comments