X-Git-Url: http://git.home-dn.net/?p=manu%2Fsuphp.git;a=blobdiff_plain;f=src%2FConfiguration.hpp;fp=src%2FConfiguration.hpp;h=b315ff157f720c97917d79d1eb4f3cd3c9f54a74;hp=a9056d227af01e2d88b186ea913e69eeab786034;hb=849f4a7977b5780eacae8fad7a078d05f4a615ee;hpb=b0eaa3f1fbf491fdc8a3044cf20754f14254338a diff --git a/src/Configuration.hpp b/src/Configuration.hpp index a9056d2..b315ff1 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -1,5 +1,5 @@ /* - suPHP - (c)2002-2005 Sebastian Marsching + suPHP - (c)2002-2008 Sebastian Marsching This file is part of suPHP. @@ -28,6 +28,7 @@ namespace suPHP { #include #include +#include #include "ParsingException.hpp" #include "IOException.hpp" @@ -41,130 +42,130 @@ namespace suPHP { */ class Configuration { private: - std::string logfile; - std::string webserver_user; - std::string docroot; - bool allow_file_group_writeable; - bool allow_directory_group_writeable; - bool allow_file_others_writeable; - bool allow_directory_others_writeable; - bool check_vhost_docroot; - bool errors_to_browser; - std::string env_path; - std::map handlers; - LogLevel loglevel; - int min_uid; - int min_gid; - int umask; - std::string chroot_path; - - /** - * Converts string to bool - */ - bool strToBool(const std::string& str) const throw (ParsingException); - - /** - * Converts string to LogLevel - */ + std::string logfile; + std::string webserver_user; + std::vector docroots; + bool allow_file_group_writeable; + bool allow_directory_group_writeable; + bool allow_file_others_writeable; + bool allow_directory_others_writeable; + bool check_vhost_docroot; + bool errors_to_browser; + std::string env_path; + std::map handlers; + LogLevel loglevel; + int min_uid; + int min_gid; + int umask; + std::string chroot_path; + + /** + * Converts string to bool + */ + bool strToBool(const std::string& str) const throw (ParsingException); + + /** + * Converts string to LogLevel + */ LogLevel strToLogLevel(const std::string& str) const - throw (ParsingException); + throw (ParsingException); public: - /** - * Constructor, initializes configuration with default values. - */ - Configuration(); - - /** - * Reads values from INI file - */ - void readFromFile(File& file) throw (IOException, ParsingException); - - /** - * Return path to logfile; - */ - std::string getLogfile() const; - - /** - Return log level - */ - LogLevel getLogLevel() const; - - /** - * Return username of user the webserver is running as - */ - std::string getWebserverUser() const; - - /** - * Return document root (directory, all script have to be in) - */ - std::string getDocroot() const; - - /** - * Returns wheter suPHP should check if scripts in within the - * document root of the VHost - */ - bool getCheckVHostDocroot() const; - - /** - * Returns wheter suPHP should ignore the group write bit of - * the script file - */ - bool getAllowFileGroupWriteable() const; - - /** - * Returns wheter suPHP should ignore the group write bit of - * the directory the is script in - */ - bool getAllowDirectoryGroupWriteable() const; - - /** - * Returns wheter suPHP should ignore the others write bit of the - * script file - */ - bool getAllowFileOthersWriteable() const; - - /** - * Returns wheter suPHP should ignore the others write bit of - * the directory the is script in - */ - bool getAllowDirectoryOthersWriteable() const; - - /** - * Returns whether (minor) error message should be sent to browser - */ - bool getErrorsToBrowser() const; - - /** - * Returns the content for the PATH environment variable - */ - std::string getEnvPath() const; - - /** - * Returns interpreter string for specified handler - */ - std::string getInterpreter(std::string handler) const - throw (KeyNotFoundException); - - /** - * Returns minimum UID allowed for scripts - */ - int getMinUid() const; - - /** - * Returns minimum GID allowed for scripts - */ - int getMinGid() const; - - /** - * Returns umask to set - */ - int getUmask() const; - - /** - * Return chroot path - */ - std::string getChrootPath() const; + /** + * Constructor, initializes configuration with default values. + */ + Configuration(); + + /** + * Reads values from INI file + */ + void readFromFile(File& file) throw (IOException, ParsingException); + + /** + * Return path to logfile; + */ + std::string getLogfile() const; + + /** + Return log level + */ + LogLevel getLogLevel() const; + + /** + * Return username of user the webserver is running as + */ + std::string getWebserverUser() const; + + /** + * Return document root (list of directories, scripts may be within) + */ + const std::vector& getDocroots() const; + + /** + * Returns wheter suPHP should check if scripts in within the + * document root of the VHost + */ + bool getCheckVHostDocroot() const; + + /** + * Returns wheter suPHP should ignore the group write bit of + * the script file + */ + bool getAllowFileGroupWriteable() const; + + /** + * Returns wheter suPHP should ignore the group write bit of + * the directory the is script in + */ + bool getAllowDirectoryGroupWriteable() const; + + /** + * Returns wheter suPHP should ignore the others write bit of the + * script file + */ + bool getAllowFileOthersWriteable() const; + + /** + * Returns wheter suPHP should ignore the others write bit of + * the directory the is script in + */ + bool getAllowDirectoryOthersWriteable() const; + + /** + * Returns whether (minor) error message should be sent to browser + */ + bool getErrorsToBrowser() const; + + /** + * Returns the content for the PATH environment variable + */ + std::string getEnvPath() const; + + /** + * Returns interpreter string for specified handler + */ + std::string getInterpreter(std::string handler) const + throw (KeyNotFoundException); + + /** + * Returns minimum UID allowed for scripts + */ + int getMinUid() const; + + /** + * Returns minimum GID allowed for scripts + */ + int getMinGid() const; + + /** + * Returns umask to set + */ + int getUmask() const; + + /** + * Return chroot path + */ + std::string getChrootPath() const; }; };