nhttpd: allows relative path for scripts

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@557 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
yjogol
2010-05-01 10:40:01 +00:00
parent 6fdbb34680
commit ad0cf74ee3
2 changed files with 10 additions and 11 deletions

View File

@@ -54,10 +54,10 @@ void CyParser::init(CyhookHandler *hh) {
if (HTML_DIRS[0] == "") { if (HTML_DIRS[0] == "") {
CyParser::HTML_DIRS[0] = hh->WebserverConfigList["WebsiteMain.override_directory"]; CyParser::HTML_DIRS[0] = hh->WebserverConfigList["WebsiteMain.override_directory"];
HTML_DIRS[1] = hh->WebserverConfigList["WebsiteMain.directory"]; HTML_DIRS[1] = hh->WebserverConfigList["WebsiteMain.directory"];
PLUGIN_DIRS[0] = HTML_DIRS[0]; PLUGIN_DIRS[0]=PLUGIN_DIRS[1] = HTML_DIRS[0];
PLUGIN_DIRS[0].append("/scripts");
PLUGIN_DIRS[1] = HTML_DIRS[1];
PLUGIN_DIRS[1].append("/scripts"); PLUGIN_DIRS[1].append("/scripts");
PLUGIN_DIRS[2]=PLUGIN_DIRS[3] = HTML_DIRS[1];
PLUGIN_DIRS[3].append("/scripts");
} }
} }
//============================================================================= //=============================================================================
@@ -727,7 +727,7 @@ std::string CyParser::func_change_httpd(CyhookHandler *hh, std::string para) {
// y-func : get_header_data // y-func : get_header_data
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
std::string CyParser::func_get_languages_as_dropdown(CyhookHandler *, std::string CyParser::func_get_languages_as_dropdown(CyhookHandler *,
std::string) { std::string para) {
std::string yresult, sel; std::string yresult, sel;
DIR *d; DIR *d;
struct dirent *dir; struct dirent *dir;
@@ -739,12 +739,11 @@ std::string CyParser::func_get_languages_as_dropdown(CyhookHandler *,
if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0)
continue; continue;
if (dir->d_type != DT_DIR) { if (dir->d_type != DT_DIR) {
sel sel = (act_language == std::string(dir->d_name)) ? "selected=\"selected\"" : "";
= (act_language == std::string(dir->d_name)) ? "selected=\"selected\"" yresult += string_printf("<option value=%s %s>%s</option>",
: ""; dir->d_name, sel.c_str(), (encodeString(std::string(dir->d_name))).c_str());
yresult += string_printf("<option value=%s %s>%s</option>\n", if(para != "nonl")
dir->d_name, sel.c_str(), (encodeString(std::string( yresult += "\n";
dir->d_name))).c_str());
} }
} }
closedir(d); closedir(d);

View File

@@ -42,7 +42,7 @@ private:
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
static const unsigned int HTML_DIR_COUNT = 2; static const unsigned int HTML_DIR_COUNT = 2;
static std::string HTML_DIRS[HTML_DIR_COUNT]; static std::string HTML_DIRS[HTML_DIR_COUNT];
static const unsigned int PLUGIN_DIR_COUNT = 2; static const unsigned int PLUGIN_DIR_COUNT = 4;
static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT]; static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT];
// CGI call Dispatcher Array // CGI call Dispatcher Array