stefanpejcic / OpenPanel

A highly customizable web hosting control panel built with Docker 🐳
https://openpanel.com
216 stars 33 forks source link

Command for user status #248

Closed caesarmind closed 3 weeks ago

caesarmind commented 3 weeks ago

OpenPanel version(s) affected

0.3.3

What OS are you using?

Ubuntu

Description

don't u think it would be good if we had command or api that will check user status and provide info if it suspend or not. I needed this kind of command to create logic for whmcs module

How to reproduce

...

Possible Solution

No response

Additional Context

No response

stefanpejcic commented 3 weeks ago

Sure, /api/users/USERNAME should already return that information - I'll check and add to the docs

stefanpejcic commented 3 weeks ago

/api/users/USERNAME can be used for this, it already returns user data:

{
  "user": {
    "email": "stefan@pejcic.rs",
    "id": 1,
    "plan_id": 1,
    "registered_date": "Mon, 28 Oct 2024 10:03:16 GMT",
    "services": "1,2,3,4,5,6,7,8,9,10,11,12",
    "user_domains": null,
    "username": "grdt5mn0"
  }
}

when user is suspended username will have prefix SUSPENDEDDATE:

{
  "user": {
    "email": "stefan@pejcic.rs",
    "id": 1,
    "plan_id": 1,
    "registered_date": "Mon, 28 Oct 2024 10:03:16 GMT",
    "services": "1,2,3,4,5,6,7,8,9,10,11,12",
    "user_domains": null,
    "username": "SUSPENDED_20241028100650_grdt5mn0"
  }
}