Sf_Admin
Sf_Admin is a class which allows to manage Seafile accounts via web-api/v2.1-admin
You may create, modify, migrate, delete and get the attributes of a Seafile account using this class
For the usage examples of all class methods check the source code of test.php
Table of Contents
- $sfToken : mixed
- $constructorSuccess : mixed
- $loginSuccess : mixed
- $sfAdminName : mixed
- $sfConType : mixed
- $sfPassword : mixed
- $sfPort : mixed
- $sfSecure : mixed
- $sfURL : mixed
- __construct() : mixed
- Constructor
- constructorSuccess() : mixed
- createAccount() : array<string|int, mixed>
- getAccount
- deleteAccount() : array<string|int, mixed>
- deleteAccount
- getAccount() : array<string|int, mixed>
- getAccount
- getAllAccounts() : array<string|int, mixed>
- getAllAccounts
- login() : array<string|int, mixed>
- login
- loginSuccess() : bool
- loginSuccess
- migrateAccount() : array<string|int, mixed>
- migrateAccount
- modifyAccount() : array<string|int, mixed>
- modifyAccount
Properties
$sfToken
protected
mixed
$sfToken
$constructorSuccess
private
mixed
$constructorSuccess
$loginSuccess
private
mixed
$loginSuccess
$sfAdminName
private
mixed
$sfAdminName
$sfConType
private
mixed
$sfConType
$sfPassword
private
mixed
$sfPassword
$sfPort
private
mixed
$sfPort
$sfSecure
private
mixed
$sfSecure
$sfURL
private
mixed
$sfURL
Methods
__construct()
Constructor
public
__construct(string $seafileURL, string $username, string $password[, string $secure = true ]) : mixed
Parameters
- $seafileURL : string
-
Seafile URL (example: https://seafile.my.lan)
- $username : string
-
admin/user account's e-mail
- $password : string
-
admin/user account's password
- $secure : string = true
-
optional false to force unsecure (default true)
Return values
mixed —constructorSuccess()
public
constructorSuccess() : mixed
Return values
mixed —createAccount()
getAccount
public
createAccount(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
avvount informations, email required.
Tags
Return values
array<string|int, mixed> —of account informations or error message
deleteAccount()
deleteAccount
public
deleteAccount(string $email) : array<string|int, mixed>
Parameters
- $email : string
-
login e-mail
Return values
array<string|int, mixed> —success => true or error message
getAccount()
getAccount
public
getAccount(string $email) : array<string|int, mixed>
Parameters
- $email : string
-
login e-mail
Return values
array<string|int, mixed> —of account informations or error message
getAllAccounts()
getAllAccounts
public
getAllAccounts() : array<string|int, mixed>
Return values
array<string|int, mixed> —of seafile accounts array of informations or error message
login()
login
public
login() : array<string|int, mixed>
fetch and set seafile lofin token
Return values
array<string|int, mixed> —error or true
loginSuccess()
loginSuccess
public
loginSuccess() : bool
Return values
bool —migrateAccount()
migrateAccount
public
migrateAccount(string $from, string $to) : array<string|int, mixed>
Parameters
- $from : string
-
source account login e-mail
- $to : string
-
destination account login e-mail (must exist)
Return values
array<string|int, mixed> —success => true or error message
modifyAccount()
modifyAccount
public
modifyAccount(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
avvount informations, email required.
Tags
Return values
array<string|int, mixed> —of account informations or error message