add func parm type
This commit is contained in:
@@ -10,7 +10,11 @@ from utils.database.connection import connetti_db
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def ftp_SITE_ADDU(self: object, line: str) -> None:
|
||||
"""Adds a virtual user, creates their directory, and saves their details to the database.
|
||||
"""
|
||||
Adds a virtual user, creates their directory, and saves their details to the database.
|
||||
|
||||
Args:
|
||||
line (str): A string containing the username and password separated by a space.
|
||||
"""
|
||||
cfg = self.cfg
|
||||
try:
|
||||
@@ -51,7 +55,12 @@ def ftp_SITE_ADDU(self: object, line: str) -> None:
|
||||
print(e)
|
||||
|
||||
def ftp_SITE_DISU(self: object, line: str) -> None:
|
||||
"""Removes a virtual user from the authorizer and marks them as deleted in the database."""
|
||||
"""
|
||||
Removes a virtual user from the authorizer and marks them as deleted in the database.
|
||||
|
||||
Args:
|
||||
line (str): A string containing the username to be disabled.
|
||||
"""
|
||||
cfg = self.cfg
|
||||
parms = line.split()
|
||||
user = os.path.basename(parms[0]) # Extract the username
|
||||
@@ -78,7 +87,12 @@ def ftp_SITE_DISU(self: object, line: str) -> None:
|
||||
print(e)
|
||||
|
||||
def ftp_SITE_ENAU(self: object, line: str) -> None:
|
||||
"""Restores a virtual user by updating their status in the database and adding them back to the authorizer."""
|
||||
"""
|
||||
Restores a virtual user by updating their status in the database and adding them back to the authorizer.
|
||||
|
||||
Args:
|
||||
line (str): A string containing the username to be enabled.
|
||||
"""
|
||||
cfg = self.cfg
|
||||
parms = line.split()
|
||||
user = os.path.basename(parms[0]) # Extract the username
|
||||
@@ -117,7 +131,12 @@ def ftp_SITE_ENAU(self: object, line: str) -> None:
|
||||
print(e)
|
||||
|
||||
def ftp_SITE_LSTU(self: object, line: str) -> None:
|
||||
"""Lists all virtual users from the database."""
|
||||
"""
|
||||
Lists all virtual users from the database.
|
||||
|
||||
Args:
|
||||
line (str): An empty string (no arguments needed for this command).
|
||||
"""
|
||||
cfg = self.cfg
|
||||
users_list = []
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user