MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / SetStatus

Method SetStatus

agent/utils/toolbox/pure-ftpd.go:201–213  ·  view source on GitHub ↗
(username, status string)

Source from the content-addressed store, hash-verified

199}
200
201func (f *Ftp) SetStatus(username, status string) error {
202 if cmd.CheckIllegal(username, status) {
203 return buserr.New("ErrCmdIllegal")
204 }
205 statusItem := ""
206 if status == constant.StatusDisable {
207 statusItem = "1"
208 }
209 if err := cmd.NewCommandMgr().Run("pure-pw", "usermod", username, "-r", statusItem); err != nil {
210 return err
211 }
212 return nil
213}
214
215func (f *Ftp) LoadList() ([]FtpList, error) {
216 std, err := cmd.NewCommandMgr(cmd.WithTimeout(20*time.Second)).RunWithStdout("pure-pw", "list")

Callers 1

UpdateMethod · 0.80

Calls 1

RunMethod · 0.65

Tested by

no test coverage detected