| 199 | } |
| 200 | |
| 201 | func (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 | |
| 215 | func (f *Ftp) LoadList() ([]FtpList, error) { |
| 216 | std, err := cmd.NewCommandMgr(cmd.WithTimeout(20*time.Second)).RunWithStdout("pure-pw", "list") |