From: SomeDude Date: Mon, 28 Jul 2008 05:59:00 +0000 (+0200) Subject: version 0.3.14 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=822f84f5dac64183c556bd86fea8cd7b0527f528;p=fms.git version 0.3.14 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 08eed47..27de288 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,9 @@ IF(APPLE) ENDIF(APPLE) OPTION(DO_CHARSET_CONVERSION "Do charset conversion on sent messages to UTF-8. This requires libiconv." ON) OPTION(I_HAVE_READ_THE_README "I have fully read and understood the readme.txt." OFF) +OPTION(ALTERNATE_CAPTCHA "Use alternate captcha. This requires the FreeImage library." OFF) -SET(FMS_SRC +SET(FMS_SRC src/base64.cpp src/bitmapvalidator.cpp src/board.cpp @@ -116,6 +117,13 @@ IF(DO_CHARSET_CONVERSION) SET(FMS_SRC ${FMS_SRC} src/charsetconverter.cpp) ENDIF(DO_CHARSET_CONVERSION) +IF(ALTERNATE_CAPTCHA) + SET(FMS_SRC ${FMS_SRC} + src/freenet/captcha/alternatecaptcha1.cpp + src/freenet/captcha/freeimage/bitmap.cpp + src/freenet/captcha/freeimage/font.cpp) +ENDIF(ALTERNATE_CAPTCHA) + IF(NOT I_HAVE_READ_THE_README) MESSAGE(FATAL_ERROR "You must fully read the readme.txt before continuing.") ENDIF(NOT I_HAVE_READ_THE_README) @@ -158,6 +166,12 @@ FIND_LIBRARY(POCO_UTIL_LIBRARY NAMES PocoUtil PocoUtilmt) FIND_LIBRARY(POCO_XML_LIBRARY NAMES PocoXML PocoXMLmt) FIND_LIBRARY(PTHREADS_LIBRARY NAMES pthread pthreads pthreadvc2) FIND_LIBRARY(ICONV_LIBRARY NAMES iconv iconv_s libiconv libiconv_s) +IF(ALTERNATE_CAPTCHA) + FIND_FILE(FREEIMAGE_LIBRARY NAMES libfreeimage.a PATHS /usr/lib/) + IF(NOT FREEIMAGE_LIBRARY) + FIND_LIBRARY(FREEIMAGE_LIBRARY NAMES FreeImage libFreeImage libfreeimage) + ENDIF(NOT FREEIMAGE_LIBRARY) +ENDIF(ALTERNATE_CAPTCHA) IF(POCO_FOUNDATION_LIBRARY) TARGET_LINK_LIBRARIES(fms ${POCO_FOUNDATION_LIBRARY}) @@ -214,6 +228,15 @@ IF(DO_CHARSET_CONVERSION) ENDIF(ICONV_LIBRARY) ENDIF(DO_CHARSET_CONVERSION) +IF(ALTERNATE_CAPTCHA) + IF(FREEIMAGE_LIBRARY) + TARGET_LINK_LIBRARIES(fms ${FREEIMAGE_LIBRARY}) + ADD_DEFINITIONS("-DALTERNATE_CAPTCHA") + ELSE(FREEIMAGE_LIBRARY) + MESSAGE(FATAL_ERROR "Could not find the FreeImage library. Set the location manually, or turn off the alternate captchas.") + ENDIF(FREEIMAGE_LIBRARY) +ENDIF(ALTERNATE_CAPTCHA) + # FreeBSD won't find Poco include files without this IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") INCLUDE_DIRECTORIES(AFTER /usr/local/include) diff --git a/fonts/font1.bmp b/fonts/font1.bmp new file mode 100644 index 0000000..47e5d46 Binary files /dev/null and b/fonts/font1.bmp differ diff --git a/fonts/font2.bmp b/fonts/font2.bmp new file mode 100644 index 0000000..fd1ed7b Binary files /dev/null and b/fonts/font2.bmp differ diff --git a/fonts/font3.bmp b/fonts/font3.bmp new file mode 100644 index 0000000..4e2d868 Binary files /dev/null and b/fonts/font3.bmp differ diff --git a/fonts/font4.bmp b/fonts/font4.bmp new file mode 100644 index 0000000..c5750ee Binary files /dev/null and b/fonts/font4.bmp differ diff --git a/fonts/font5.bmp b/fonts/font5.bmp new file mode 100644 index 0000000..b0e81a8 Binary files /dev/null and b/fonts/font5.bmp differ diff --git a/fonts/font6.bmp b/fonts/font6.bmp new file mode 100644 index 0000000..96fc7e1 Binary files /dev/null and b/fonts/font6.bmp differ diff --git a/fonts/font7.bmp b/fonts/font7.bmp new file mode 100644 index 0000000..18da6c1 Binary files /dev/null and b/fonts/font7.bmp differ diff --git a/include/freenet/captcha/alternatecaptcha1.h b/include/freenet/captcha/alternatecaptcha1.h new file mode 100644 index 0000000..a47f2c3 --- /dev/null +++ b/include/freenet/captcha/alternatecaptcha1.h @@ -0,0 +1,36 @@ +#ifndef _alternate_captcha1_ +#define _alternate_captcha1_ + +#ifdef ALTERNATE_CAPTCHA + +#include + +#include "icaptcha.h" +#include "freeimage/bitmap.h" +#include "freeimage/font.h" + +class AlternateCaptcha1:public ICaptcha +{ +public: + AlternateCaptcha1(); + + void Generate(); + + const bool GetPuzzle(std::vector &puzzle); + const bool GetSolution(std::vector &solution); + +private: + void LoadFonts(); + const std::string GenerateRandomString(const int len); + + static bool m_fontsloaded; + static std::vector m_fonts; + + std::vector m_puzzle; + std::vector m_solution; + +}; + +#endif // ALTERNATE_CAPTCHA + +#endif // _alternate_captcha1_ diff --git a/include/freenet/captcha/freeimage/bitmap.h b/include/freenet/captcha/freeimage/bitmap.h new file mode 100644 index 0000000..9e00af3 --- /dev/null +++ b/include/freenet/captcha/freeimage/bitmap.h @@ -0,0 +1,66 @@ +#ifndef _freeimage_bitmap_ +#define _freeimage_bitmap_ + +#include + +#include +#include + +namespace FreeImage +{ + +class Bitmap +{ +public: + Bitmap(); + Bitmap(const Bitmap &bmp); + Bitmap(const std::string &typestr, const std::string &filename); + Bitmap(FIBITMAP *bmp); + Bitmap(const int width, const int height, const int bpp); + ~Bitmap(); + + const bool Create(const int width, const int height, const int bpp); + + inline const unsigned int Height() const { return m_bmp ? FreeImage_GetHeight(m_bmp) : 0 ; } + inline const unsigned int Width() const { return m_bmp ? FreeImage_GetWidth(m_bmp) : 0 ; } + inline const unsigned int BPP() const { return m_bmp ? FreeImage_GetBPP(m_bmp) : 0 ; } + void ConvertBPP(const int bpp); + + void Clear(const RGBQUAD color); + void ClearTransparent(); + + const bool Save(const std::string &filename) const; + const bool SaveToMemory(const std::string &typestr, std::vector &data) const; + const bool Load(const std::string &typestr, const std::string &filename); + const bool LoadFromMemory(const std::string &typestr, std::vector &data); + + void SetTransparent(); + + void PutPixel(const int x, const int y, RGBQUAD color); + RGBQUAD GetPixel(const int x, const int y) const; + const int GetPixelIndex(const int x, const int y) const; + void Line(const int x1, const int y1, const int x2, const int y2, const RGBQUAD color); + void FastLine(const int x1, const int y1, const int x2, const int y2, const RGBQUAD color); + //void Arc(const int cx, const int cy, const int r, const float start, const float end, const RGBQUAD color); + void Rect(const int x1, const int y1, const int w, const int h, const bool filled, const RGBQUAD color); + void Rotate(const double angle, const int shiftx, const int shifty, const int originx, const int originy); + void HorizontalOffset(const int y, const double shift); + void VerticalOffset(const int x, const double shift); + + void Blit(const Bitmap &bmp, const int destx, const int desty, const int sourcex, const int sourcey, const int w, const int h, const int alpha); + void BlitTrans(const Bitmap &bmp, const int destx, const int desty, const int sourcex, const int sourcey, const int w, const int h); + + Bitmap &operator=(const Bitmap &rhs); + +private: + void Destroy(); + void AALine(const int x1, const int y1, const int x2, const int y2, const RGBQUAD color); + double LineFunction(const double slopex, const double slopey, const int startx, const int starty, const double testx, const double texty); + + FIBITMAP *m_bmp; + +}; + +} + +#endif // _freeimage_bitmap_ diff --git a/include/freenet/captcha/freeimage/font.h b/include/freenet/captcha/freeimage/font.h new file mode 100644 index 0000000..047cd19 --- /dev/null +++ b/include/freenet/captcha/freeimage/font.h @@ -0,0 +1,33 @@ +#ifndef _freeimage_font_ +#define _freeimage_font_ + +#include "bitmap.h" + +namespace FreeImage +{ + +class Font +{ +public: + Font(); + Font(const Bitmap &bmp); + ~Font(); + + const bool Load(const Bitmap &bmp); + + const Bitmap &Char(const int num); + + const int FontWidth() const { return m_fontwidth; } + const int FontHeight() const { return m_fontheight; } + +private: + int m_fontwidth; + int m_fontheight; + Bitmap m_blank; + std::vector m_chars; + +}; + +} + +#endif // _freeimage_font_ diff --git a/include/global.h b/include/global.h index 868e753..7104808 100644 --- a/include/global.h +++ b/include/global.h @@ -7,7 +7,7 @@ #define VERSION_MAJOR "0" #define VERSION_MINOR "3" -#define VERSION_RELEASE "13" +#define VERSION_RELEASE "14" #define FMS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_RELEASE typedef Poco::ScopedLock Guard; diff --git a/readme.txt b/readme.txt index 4ac04fc..6f278bf 100644 --- a/readme.txt +++ b/readme.txt @@ -11,7 +11,9 @@ If you want to use the bundled SQLite3 library, add a -D USE_BUNDLED_SQLITE=ON to the cmake command. Use of the bundled SQLite3 library is on by default when compiling on a Mac. To turn off charset conversion to UTF-8 when sending messages, add a -D DO_CHARSET_CONVERSION=OFF. Compiling with charset -conversion turned on is recommended. +conversion turned on is recommended. If you would like to compile using the +alternate captchas, add a -D ALTERNATE_CAPTCHA=ON to the cmake command line. +This option requires the FreeImage library to be installed. UPGRADING --------- @@ -22,11 +24,12 @@ keep the same database unless otherwise noted. INSTALLATION ------------ -Place the binary and any templates in a directory of your choice. Windows -users may need to download the runtime DLLs available from the fms Freesite and -place in the fms directory if they are not already installed on the system. On -the first run, a database file will also be created in this directory. Make -sure the user that runs FMS has read/write access to this directory. +Place the binary, any templates, and the fonts directory in a directory of your +choice. Windows users may need to download the runtime DLLs available from the +fms Freesite and place in the fms directory if they are not already installed +on the system. On the first run, a database file will also be created in this +directory. Make sure the user that runs FMS has read/write access to this +directory. RUNNING ------- diff --git a/src/freenet/captcha/alternatecaptcha1.cpp b/src/freenet/captcha/alternatecaptcha1.cpp new file mode 100644 index 0000000..07f4dde --- /dev/null +++ b/src/freenet/captcha/alternatecaptcha1.cpp @@ -0,0 +1,148 @@ +#include "../../../include/freenet/captcha/alternatecaptcha1.h" + +#include +#include + +#include + +#ifdef ALTERNATE_CAPTCHA + +bool AlternateCaptcha1::m_fontsloaded(false); +std::vector AlternateCaptcha1::m_fonts; + +AlternateCaptcha1::AlternateCaptcha1() +{ + if(m_fontsloaded==false) + { + FreeImage_Initialise(true); + LoadFonts(); + m_fontsloaded=true; + } +} + +void AlternateCaptcha1::Generate() +{ + std::string puzzlestring=GenerateRandomString(5); + FreeImage::Bitmap tempchar(50,50,32); + tempchar.SetTransparent(); + FreeImage::Bitmap bmp(110,50,32); + bmp.SetTransparent(); + + m_solution.clear(); + m_puzzle.clear(); + + // draw the text + if(m_fonts.size()>0) + { + for(int i=0; i &puzzle) +{ + puzzle=m_puzzle; + return true; +} + +const bool AlternateCaptcha1::GetSolution(std::vector &solution) +{ + solution=m_solution; + return true; +} + +void AlternateCaptcha1::LoadFonts() +{ + FreeImage::Bitmap bmp; + Poco::Path path("fonts"); + Poco::DirectoryIterator di(path); + Poco::DirectoryIterator end; + + while(di!=end) + { + if(di.name().find("bmp")!=std::string::npos) + { + bmp.Load("bmp",di.path().toString()); + m_fonts.push_back(FreeImage::Font(bmp)); + } + ++di; + } + +} + +#endif // ALTERNATE_CAPTCHA diff --git a/src/freenet/captcha/freeimage/bitmap.cpp b/src/freenet/captcha/freeimage/bitmap.cpp new file mode 100644 index 0000000..4c90fc1 --- /dev/null +++ b/src/freenet/captcha/freeimage/bitmap.cpp @@ -0,0 +1,661 @@ +#include "../../../../include/freenet/captcha/freeimage/bitmap.h" + +#include + +namespace FreeImage +{ + +Bitmap::Bitmap() +{ + m_bmp=0; +} + +Bitmap::Bitmap(const Bitmap &bmp) +{ + m_bmp=0; + *this=bmp; +} + +Bitmap::Bitmap(const std::string &typestr, const std::string &filename) +{ + m_bmp=0; + Load(typestr,filename); +} + +Bitmap::Bitmap(FIBITMAP *bmp):m_bmp(bmp) +{ + +} + +Bitmap::Bitmap(const int width, const int height, const int bpp) +{ + m_bmp=FreeImage_Allocate(width,height,bpp,0,0,0); +} + +Bitmap::~Bitmap() +{ + Destroy(); +} + +void Bitmap::AALine(const int x1, const int y1, const int x2, const int y2, const RGBQUAD color) +{ + RGBQUAD tempcol; + int height=Height(); + int width=Width(); + int fromx=x1; + int fromy=y1; + int tox=x2; + int toy=y2; + double sx=x2-x1; + double sy=y2-y1; + + if(fabs(sx)<=0.8 && fabs(sy)<=0.8) + { + return; + } + + double hypot=sqrt((sx*sx)+(sy*sy)); + sx/=hypot; + sy/=hypot; + + fromx<0 ? fromx=0 : false; + fromx>=width ? fromx=width-1 : false; + tox<0 ? tox=0 : false; + tox>=width ? tox=width-1 : false; + fromy<0 ? fromy=0 : false; + fromy>=height ? fromy=height-1 : false; + toy<0 ? toy=0 : false; + toy>=height ? toy=height-1 : false; + + int lx=fromx; + int rx=tox; + if(rxminval) + { + FreeImage_GetPixelColor(m_bmp,i,(height-1)-j,&tempcol); + tempcol.rgbRed=((1.0-temp)*((double)tempcol.rgbRed)+temp*((double)color.rgbRed)); + tempcol.rgbGreen=((1.0-temp)*((double)tempcol.rgbGreen)+temp*((double)color.rgbGreen)); + tempcol.rgbBlue=((1.0-temp)*((double)tempcol.rgbBlue)+temp*((double)color.rgbBlue)); + FreeImage_SetPixelColor(m_bmp,i,(height-1)-j,&tempcol); + } + + } + } + +} + +void Bitmap::Blit(const Bitmap &bmp, const int destx, const int desty, const int sourcex, const int sourcey, const int w, const int h, const int alpha) +{ + if(m_bmp && bmp.m_bmp) + { + int width=w; + int height=h; + if(destx+width-1>=Width()) + { + width=Width()-destx+1; + } + if(desty+height-1>=Height()) + { + height=Height()-desty+1; + } + FIBITMAP *temp=FreeImage_Copy(bmp.m_bmp,sourcex,sourcey,sourcex+width-1,sourcey+height-1); + FreeImage_Paste(m_bmp,temp,destx,desty,alpha); + FreeImage_Unload(temp); + } +} + +void Bitmap::BlitTrans(const Bitmap &bmp, const int destx, const int desty, const int sourcex, const int sourcey, const int w, const int h) +{ + if(m_bmp && bmp.m_bmp) + { + RGBQUAD sourcecol; + RGBQUAD destcol; + int sourcew=bmp.Width(); + int sourceh=bmp.Height(); + int destw=Width(); + int desth=Height(); + int dx=destx; + int dy=desty; + double alpha=0.0; + for(int y=sourcey; y=0 && y=0 && x=0 && dx=0 && dy0) // some translucency + { + FreeImage_GetPixelColor(m_bmp,dx,(desth-1)-dy,&destcol); + alpha=(double)sourcecol.rgbReserved/255.0; + sourcecol.rgbRed=(sourcecol.rgbRed*alpha)+(destcol.rgbRed*(1.0-alpha)); + sourcecol.rgbGreen=(sourcecol.rgbGreen*alpha)+(destcol.rgbGreen*(1.0-alpha)); + sourcecol.rgbBlue=(sourcecol.rgbBlue*alpha)+(destcol.rgbBlue*(1.0-alpha)); + sourcecol.rgbReserved=width ? fromx=width-1 : false; + tox<0 ? tox=0 : false; + tox>=width ? tox=width-1 : false; + fromy<0 ? fromy=0 : false; + fromy>=height ? fromy=height-1 : false; + toy<0 ? toy=0 : false; + toy>=height ? toy=height-1 : false; + + int dx=tox-fromx; + int dy=toy-fromy; + + if(dx==0 && dy==0) + { + return; + } + + int xinc1=1; + if(dx<0) + { + xinc1=-1; + dx=-dx; + } + int yinc1=1; + if(dy<0) + { + yinc1=-1; + dy=-dy; + } + + int x=fromx; + int y=fromy; + int xinc2=xinc1; + int yinc2=yinc1; + + double den; + double num; + int numadd; + int numpixels; + + if(dx>=dy) + { + xinc1=0; + yinc2=0; + den=dx+0.0; + num=0.5*dx; + numadd=dy; + numpixels=dx; + } + else + { + xinc2=0; + yinc1=0; + den=dy+0.0; + num=0.5*dy; + numadd=dx; + numpixels=dy; + } + + int cpixel; + for(cpixel=0; cpixel<=numpixels; cpixel++) + { + FreeImage_SetPixelColor(m_bmp,x,(height-1)-y,&color); + num+=numadd; + if(num>=den) + { + num=-den; + x+=xinc1; + y+=yinc1; + } + x+=xinc2; + y+=yinc2; + } + } +} + +RGBQUAD Bitmap::GetPixel(const int x, const int y) const +{ + RGBQUAD color; + color.rgbRed=0; + color.rgbGreen=0; + color.rgbBlue=0; + color.rgbReserved=0; + + if(m_bmp && x>=0 && x=0 && y &data) +{ + bool loaded=false; + Destroy(); + if(data.size()>0) + { + FREE_IMAGE_FORMAT type=FIF_BMP; + if(typestr.find("png")!=std::string::npos) + { + type=FIF_PNG; + } + + FIMEMORY *mem=FreeImage_OpenMemory((BYTE *)&data[0],data.size()); + m_bmp=FreeImage_LoadFromMemory(type,mem,0); + if(m_bmp) + { + loaded=true; + } + FreeImage_CloseMemory(mem); + } + return loaded; +} + +Bitmap &Bitmap::operator=(const Bitmap &rhs) +{ + if(this!=&rhs) + { + Destroy(); + if(rhs.Width()>0 && rhs.Height()>0) + { + m_bmp=FreeImage_Allocate(rhs.Width(),rhs.Height(),rhs.BPP(),0,0,0); + //FIBITMAP *temp=FreeImage_Copy(rhs.m_bmp,0,0,rhs.Width()-1,rhs.Height()-1); + //FreeImage_Paste(m_bmp,rhs.m_bmp,0,0,-1); + //FreeImage_Unload(temp); + Blit(rhs,0,0,0,0,rhs.Width(),rhs.Height(),-1); + } + } + return *this; +} + +void Bitmap::PutPixel(const int x, const int y, RGBQUAD color) +{ + if(m_bmp && x>=0 && x=0 && y=0 && y=0 && x &data) const +{ + bool saved=false; + if(m_bmp) + { + FREE_IMAGE_FORMAT type=FIF_BMP; + if(typestr.find("png")!=std::string::npos) + { + type=FIF_PNG; + } + FIMEMORY *mem=FreeImage_OpenMemory(0,0); + if(FreeImage_SaveToMemory(type,m_bmp,mem,0)) + { + FreeImage_SeekMemory(mem,0,SEEK_END); + data.resize(FreeImage_TellMemory(mem)); + FreeImage_SeekMemory(mem,0,SEEK_SET); + FreeImage_ReadMemory(&data[0],1,data.size(),mem); + saved=true; + } + FreeImage_CloseMemory(mem); + } + return saved; +} + +void Bitmap::SetTransparent() +{ + if(m_bmp) + { + FreeImage_SetTransparent(m_bmp,true); + } +} + +void Bitmap::VerticalOffset(const int x, const double shift) +{ + if(m_bmp) + { + int width=Width(); + int height=Height(); + int starty=width-1; + int endy=ceil(shift); + int dy=-1; + int offset1=-(floor(shift)); + int offset2=-(ceil(shift)); + RGBQUAD color1; + RGBQUAD color2; + RGBQUAD newcolor; + double part2=shift-floor(shift); + double part1=1.0-part2; + + if(shift<0) + { + starty=0; + endy=width-1-ceil(abs(shift)); + dy=1; + offset1=-ceil(shift); + offset2=-floor(shift); + part2=abs(shift-ceil(shift)); + part1=1.0-part2; + } + + FreeImage_GetPixelColor(m_bmp,x,(height-1)-(starty+offset1),&color1); + for(int y=starty+dy; y!=endy; y+=dy) + { + FreeImage_GetPixelColor(m_bmp,x,(height-1)-(y+offset2),&color2); + + newcolor.rgbRed=(color1.rgbRed*part1)+(color2.rgbRed*part2); + newcolor.rgbGreen=(color1.rgbGreen*part1)+(color2.rgbGreen*part2); + newcolor.rgbBlue=(color1.rgbBlue*part1)+(color2.rgbBlue*part2); + + FreeImage_SetPixelColor(m_bmp,x,(height-1)-y,&newcolor); + + color1=color2; + } + } +} + +} // namespace FreeImage diff --git a/src/freenet/captcha/freeimage/font.cpp b/src/freenet/captcha/freeimage/font.cpp new file mode 100644 index 0000000..0f9541c --- /dev/null +++ b/src/freenet/captcha/freeimage/font.cpp @@ -0,0 +1,92 @@ +#include "../../../../include/freenet/captcha/freeimage/font.h" + +namespace FreeImage +{ + +Font::Font() +{ + m_fontwidth=0; + m_fontheight=0; +} + +Font::Font(const Bitmap &bmp) +{ + m_fontwidth=0; + m_fontheight=0; + Load(bmp); +} + +Font::~Font() +{ + +} + +const Bitmap &Font::Char(const int num) +{ + if(num>=0 && num<256 && m_chars.size()>num) + { + return m_chars[num]; + } + else + { + return m_blank; + } +} + +const bool Font::Load(const Bitmap &bmp) +{ + m_fontwidth=bmp.Width()/16; + m_fontheight=bmp.Height()/14; + + m_chars.clear(); + m_chars.resize(256); + + int charnum=32; + for(int yy=0; yyxx && found==false; x--) + { + for(int y=yy; ym_fontwidth ? width=m_fontwidth : false; + m_chars[charnum].Create(width,m_fontheight,32); + m_chars[charnum].Blit(bmp,0,0,xx,yy,width,m_fontheight,-1); + m_chars[charnum].SetTransparent(); + RGBQUAD col=m_chars[charnum].GetPixel(m_chars[charnum].Width()-1,0); + for(int y=0; y @@ -71,7 +74,12 @@ void IntroductionPuzzleInserter::CheckForNeededInsert() void IntroductionPuzzleInserter::GenerateCaptcha(std::string &encodeddata, std::string &solution) { +#ifdef ALTERNATE_CAPTCHA + AlternateCaptcha1 captcha; + m_log->trace("IntroductionPuzzleInserter::GenerateCaptcha using alternate captcha generator"); +#else SimpleCaptcha captcha; +#endif std::vector puzzle; std::vector puzzlesolution; diff --git a/src/http/fmshttprequesthandlerfactory.cpp b/src/http/fmshttprequesthandlerfactory.cpp index e91fb51..6adb09f 100644 --- a/src/http/fmshttprequesthandlerfactory.cpp +++ b/src/http/fmshttprequesthandlerfactory.cpp @@ -23,7 +23,7 @@ FMSHTTPRequestHandlerFactory::FMSHTTPRequestHandlerFactory() { // set template std::string templatestr="Home

Could not open template.htm! Place in program directory and restart!


[CONTENT]"; - FILE *infile=fopen("template.htm","r+b"); + FILE *infile=fopen("template.htm","rb"); if(infile) { fseek(infile,0,SEEK_END); diff --git a/src/http/pages/homepage.cpp b/src/http/pages/homepage.cpp index 417e1af..d251fd5 100644 --- a/src/http/pages/homepage.cpp +++ b/src/http/pages/homepage.cpp @@ -71,7 +71,7 @@ const std::string HomePage::GeneratePage(const std::string &method, const std::m if(showgenericupdate) { - content+="Check for new versions at the FMS Freesite
"; + content+="Check for new versions at the FMS Freesite
"; } content+="Use these pages to administer your FMS installation."; diff --git a/src/http/pages/peerdetailspage.cpp b/src/http/pages/peerdetailspage.cpp index 9e70ca8..4148c57 100644 --- a/src/http/pages/peerdetailspage.cpp +++ b/src/http/pages/peerdetailspage.cpp @@ -20,7 +20,7 @@ const std::string PeerDetailsPage::GeneratePage(const std::string &method, const std::string dateadded=""; std::string addedmethod=""; std::string usk=""; - std::string fcphost=""; + std::string fcphost="127.0.0.1"; std::string hidden=""; int freesiteedition=-1; std::string publishtrustlist=""; diff --git a/src/optionssetup.cpp b/src/optionssetup.cpp index 6cb16b4..ef7d939 100644 --- a/src/optionssetup.cpp +++ b/src/optionssetup.cpp @@ -68,7 +68,7 @@ void SetupDefaultOptions() upd.Reset(); st.Bind(0,"FMSVersionEdition"); - st.Bind(1,"12"); + st.Bind(1,"15"); st.Step(); st.Reset(); upd.Bind(0,"Program");