Files
digFTP/src/auth.h
T
2024-10-17 16:49:05 -05:00

27 lines
575 B
C++

#ifndef AUTHMETHODS_H
#define AUTHMETHODS_H
#include <string>
class Auth {
public:
Auth() {};
virtual void setOptions(ConfigSection* options) {};
virtual bool isChroot() { return false; };
virtual bool check(std::string username, std::string password) { return false; };
virtual std::string getUserDirectory(std::string username) { return ""; };
};
#include "auth/noauth.h"
#include "auth/passdb.h"
Auth* getAuthByName(std::string name) {
if (name == "noauth") return new NoAuth();
if (name == "passdb") return new PassdbAuth();
return new Auth();
}
#endif