Commit Graph

79 Commits

Author SHA1 Message Date
Tomasz Sowa 0ecb2ac70e added: to HtmlTextStream: Escape(bool) method
now the output html streams can be turn into no-escaping mode
       default true (set when a request is clearing)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@990 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-06 21:17:41 +00:00
Tomasz Sowa db5572e864 removed: svn:executable attribute from files
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@984 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-11-01 17:05:20 +00:00
Tomasz Sowa 8196fb77d1 changed: now we do not use std::string and char* in the Winix API
everywhere we are using std::wstring and wchar_t*
         (std::string and char* is used only locally in some places
         especially when creating a path to OS file system etc.)
added:   to the special thread when winix closes:
         a write function for curl: FetchPageOnExitCurlCallback()
         without this function the curl library will print
         the page's content to the standart output
changed: TextStream<> class from core can make
         UTF8<->wide strings conversions
removed: from config: utf8 option
         now winix expects UTF8 from the user's input (html forms, url-es)
         and outputs strings in the UTF8 format




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@965 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-10-09 20:44:56 +00:00
Tomasz Sowa 4abf6642f7 setting a Winix Licence: 2 Clause BSD Licence
changed: version to 0.6.2



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@963 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-10-04 18:04:03 +00:00
Tomasz Sowa 7468e7a36c added: namespace Winix over all *.h/*.cpp files
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@948 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-02-12 16:30:49 +00:00
Tomasz Sowa 7fa9314c6b changed: in ClearOutputStreams() referencing 'config' only if not null
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@946 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-12-23 03:29:33 +00:00
Tomasz Sowa ee9c68b04e added: generating Content-Length header when text answer is sent to the client
added:   now we are able to use the html filter for the whole out_streams (when ajax is used the output is filtered too)
         splitted FilterCompressSend() function -- first we are making the filtering
         (after filtering we know the size of the content to send)
added:   to Compress:
         Compressing(const char * source, size_t source_len, BinaryPage & out_stream, int encoding);
changed: some refactoring in App




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@942 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-12-04 01:21:57 +00:00
Tomasz Sowa 375604edd6 removed: Request::debug all stream used for debugging info
some environment variables were put there
removed: config variable: debug_info
removed: Request::role (responder, authorizer)
         now we have only one role: responder
added:   new config variables:
         log_env_variables (default false) - when true then fastcgi environment
         variables are logged to the log file
         log_http_answer_headers (default false) - when true all http headers
         created by winix ale logged (note that the www server can add/adjust other headers)
changed: some refactoring in Request struct
changed: CookieTab to std::map<std::wstring, std::wstring>
         beforehand std::string was used
         (changed CookieParser as well)
changed: Request::SetCookie() to AddCookie()
added:   Request::out_headers (a PT::Space struct)
         http headers (without cookies) send back to the client
added:   Request::out_cookies (a PT::Space struct)
         cookies send to the client
changed: App class to use Request::out_headers and Request::out_cookies
         some SendHeaders...() methods were renamed to PrepareHeaders...()
         and they create output in Request::out_headers first (and out_cookies)
         and later it is sent
added:   two plugin messages:
         // http headers (without cookies) were created and are ready to send
         // here you can make some changes to them
         // in p1 you have a pointer to the PT::Space (Request::out_headers)
         #define WINIX_PREPARE_TO_SEND_HTTP_HEADERS		31070

         // http cookies were created and are ready to send
         // here you can make some changes to them
         // in p1 you have a pointer to the PT::Space (Request::out_cookies)
         #define WINIX_PREPARE_TO_SEND_HTTP_COOKIES		31080
added:   config variable:
         // how many output streams do we have in Request class
         // default: 16 (64 maximum)
         size_t ezc_out_streams_size;




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@940 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-11-29 21:39:23 +00:00
Tomasz Sowa 3af3ac3f6f removed: ezn patterns for rawcontent and ajaxcontent:
index_rawcontent.html, index_ajaxcontent.html
         now we have out_streams in Request and some special
         keyword in ezc templates for sending content to the 
         specified streams
changed: the way how winix answers to the client's browsers:
         info from Request class:
	                                   winix answer send to the client's browser
	                                                       |
	                                                       |
	                                          depending on send_bin_stream
	                               -------------------------------------------------
	                               |                                               |
	                          text answer                                     binary answer
	                               |                                               |
	                   depending on return_json                          sending out_bin_stream
	             ------------------------------------
	             |                                  |
	       normal request                     ajax request
	             |                                  |
	   sending out_streams[0]           depending on return_info_only
	                              ------------------------------------------------------
	                              |                                                    |
	                 generating JSON object from:                   generating JSON object only from info
	                 out_streams and info, e.g.:                    e.g.:
	                 {                                              { info object serialized here }
	                  "stream_1": "some html content",
	                  "stream_2": "some other html content",
	                  "info": { info object serialized here }
	                 }
	                 note that out_streams[0] is not sent
	                 in JSON answers
	
	




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@937 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-11-14 20:59:23 +00:00
Tomasz Sowa 8d9a021eab changed: when there is reqtype:json parameter and there is not set request.ajax_serializer
then we are using a generic json serializer
changed: we are sending the application/json header when returning an json string
added:   to config: log_server_answer (default false)
         when true we put the whole string (server's answer) to the log file
added:   to Request: use_200_status_for_not_found_and_permission_denied
         if this is true then if the server http code would be 403 or 404
         then we return 200 OK (useful when using ajax)
changed: System::RedirectTo() methods take as the last parameter: use_reqtype
         if this is true (default) then reqtype:type parameter is automatically added to the redirecting path
         




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@918 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-03-26 00:04:01 +00:00
Tomasz Sowa 099dd55d0c added: IP ban mechanism (not finished yet -- we need a winix function to remove a ban)
now after some incorrent login attempts your IP can be banned or blocked
       (see new config variables)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@902 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-27 07:44:26 +00:00
Tomasz Sowa d8260d8383 added: a new way: HEX format to saving/reading from PostgreSQL bytea columns
added: to Request:
       // binary page
       BinaryPage binary_page;

       // a compressed page ready to send to the client
       BinaryPage compressed_page;

       // if true then either page or ajaxpage will be sent to the client
       // if false then binary_page is sent
       // default: true
       bool use_text_page;

       BinaryPage is defined as (in requesttypes.h):
       typedef PT::TextStreamBase<char, 1, 4096> BinaryPage;

added: to Compress: now it can gets BinaryPage as arguments (input, output)
changed: winix version to: 0.5.0
added: in templates: TexTextStream class
       for taking input to the TeX typesetting system





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@884 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-09-11 05:19:45 +00:00
Tomasz Sowa 260c12894d added: to Request options used by ezc generators:
bool gen_trim_white;
       bool gen_skip_new_line;
       bool gen_use_special_chars;
added: new ezc filter: fil_csv_escape
       for escaping csv fields





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@877 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-08-26 19:53:47 +00:00
Tomasz Sowa 51d95b49a0 added: to Request:
// used as a JSON output (when ajax_serializer is defined)
       // it will be serialized and have at least:
       // 'content' string - the whole html content
       // 'http_status' integer - http status code (e.g. 200)
       PT::Space ajax;
 
       // if not null then the request will have a JSON as an output
       PT::SpaceToJSON * ajax_serializer;




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@871 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-08-08 16:04:48 +00:00
Tomasz Sowa 0d0f12b394 added: to Requst:
std::wstring * PostVarp(const std::wstring & var);
added: to misc:
       template<class CharType>
       bool Toa(unsigned/signed long/int value, CharType * buffer);
       some Toa methods which don't get the buffer len
       (the buffer has to be sufficient big)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@845 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-06-04 17:51:43 +00:00
Tomasz Sowa 1b858f5782 removed: dependencies to 'tz' system structure
now we are using PT::Date from pikotools



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@839 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-26 23:04:49 +00:00
Tomasz Sowa 5b845f1d03 changed: in Request:
removed start_tm
         added start_date (PT::Date)
changed: in Session:
         removed: tm_time
         added: start_date (PT::Date)
         renamed: time -> start_time
         the same is for last_time
         now we have (last_time and last_date)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@838 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-24 21:09:37 +00:00
Tomasz Sowa 0df088e1e2 fixed: when demonizing there were some logs info put twice in the log file
now we first demonize (fork) and then open the log file
added: start adding support for PT::Date 
       we are using instead of tz system structure



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@836 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-19 15:14:35 +00:00
Tomasz Sowa baf10a9ba9 added: std::wstring Request::subdomain
support for subdomains



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@828 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-22 18:23:44 +00:00
Tomasz Sowa 70421b7bd1 reverted last commit (secure flag to cookie) with some info
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@822 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-15 17:50:19 +00:00
Tomasz Sowa 71ae70f670 added: to cookies: flag "; secure" if a connection is through SSL
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@821 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-15 10:43:29 +00:00
Tomasz Sowa 97c7edafd6 added: to misc:
UrlEncode() for char->wstring
         UrlEncode() for wstring->wstring
removed: Request::redirect_url_encoded flag
         the Request::redirect_to string should always be url-encoded
changed: in UrnEncode()
         now characters like '#' and '/' are not allowed in an url
         (will be url-encoded)
         


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@807 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-19 00:59:08 +00:00
Tomasz Sowa 1a51b1adc7 added: to config:
parameter: ezc_max_elements
          maximum number for elements through the whole template (ezc)
          default: 50000
       parameter: ezc_max_loop_elements
          maximum number of each [for] loop
          default: 5000 (from ezc generator)
added: to Request class:
       time_t start_time;
       tm start_tm;
       they are set when a request starts
       


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@806 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-17 05:19:24 +00:00
Tomasz Sowa 7902389ef1 changed: in plugin 'menu'
menu_dir_tab ezc functions can be nested now
         (not finished yet)
added:   'meta' winix function
         additional meta information for files and directories
         (not finished yet)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@775 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-11-25 04:51:55 +00:00
Tomasz Sowa 72be443414 added: new flag: Request::using_ssl
true if the connections is encrypted by using SSL
changed: in BaseUrlRedirect
         we also check if the connection should use SSL 
         and if so then we make a redirect to "https://.."
changed: in 'static' mount points:
         if the request was e.g. "/styles/default.js?t=B49E5BQ"
         we should return a file "/styles/default.js" (without the "?..." part)
         additionally '#' character is checked



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@762 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-09-06 22:46:15 +00:00
Tomasz Sowa ee6500ac65 added: some more orphans to polish default locale
added: new options to the config:
  url_proto: default: http://
  url_ssl_proto: default: https://
  use_ssl, use_ssl_static, use_ssl_common (whether or not to use SSL protocol)
  use_ssl_only_for_logged_users
  now we are able to use SSL encryption (https) together with normal connections
removed: config option: base_server




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@755 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-08-17 23:09:47 +00:00
Tomasz Sowa 4d87359aca added: Export plugin (not finished yet)
added:   ThreadManager
         all threads are connected to the ThreadManager
         they are started/stopped by the manager
changed: FunctionParser
         now we are parsing directly what is in URI
         (we were using GetParser beforehand)
         we are able to recognize ordinary URI scheme (with '?' and '#' characters)
         sample:
         http://domain.com/dir1/dir2/item/function?par1=val2&par2=val2#htmlanchor
         is the same as:
         http://domain.com/dir1/dir2/item/function/par1:val2/par2:val2#htmlanchor
         'htmlanchor' is put in Request::anchor field,
         and the default function can be used like this:
         http://domain.com/dir1/dir2/item?par1=val2&par2=val2#htmlanchor
         but there is not an equivalent in winix form
         e.g. http://domain.com/dir1/dir2/item/par1:val2/par2:val2#htmlanchor
         because 'par1:val2' would be treated as a function name
removed: GetParser
         now we don't have Request::get_tab structure
removed: CKEditorGetParser
         it is not needed now



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@752 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-07-28 22:18:10 +00:00
Tomasz Sowa ccc02f41bf added: we can use different redirect codes now
(int Request::redirect_type variable)
       we can set following integer values:
       300 - Multiple Choices
       301 - Moved Permanently
       302 - Found
       307 - Temporary Redirect
       303 - See Other
       default is 303 for all redirects



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@749 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-07-07 17:02:14 +00:00
Tomasz Sowa 06f42dd9cb changed: winix 'upload' function is a file manager now
we're using an jquery upload plugin
added:   Item struct has new rows: hash, hash_type, file_size, sort_index
added:   css mount parameter
         you can specify css files there, and javascript wysiwyg editors
         (ckeditor, tinymce) can make use of it
changed: post parsers can parse post variables with the same name
         (a postfix is added in such a case)
added:   common_dir parameter to the config
         this is a path to common directory (directory with common static files)
         it is needed to the 'css' mount parameter
         


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@746 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-06-24 20:53:21 +00:00
Tomasz Sowa 583df13139 added: mount options: thumb_size(cx, cy)
size of a generated thumbnail (size in pixels)
added: plugin gallery: mount option gallery_type
       it can be:
       "lightbox"
       "galleria"
       "galleriathumb"


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@717 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-02-11 21:37:28 +00:00
Tomasz Sowa 915cabdf97 changed: added Cur structure
we have there two pointers: 
 Request * request;
 Session * session;
these are the current request and the current session


the session GC was moved to SessionManager (was in SessionContainer)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-01-23 14:15:30 +00:00
Tomasz Sowa ab84a5169e 'tickets' can use 'threads' now
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@706 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-01-20 18:37:51 +00:00
Tomasz Sowa 35efed9fef - now the mess with threads has gone away
- we have a class BaseThread -- this is a base class -- we can inherit from it when
  creating a new thread
- others treads are correctly stopped (when signal comes) -- pthread_join
- we have a special thread only for signals



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@685 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-12-02 01:02:02 +00:00
Tomasz Sowa 518281e101 fixed: when signal comes winix properly exits
fixed:   when winix exits the session data were not properly destroyed (memory leak)
         we should set request.session pointer to each session when deleting sessions
         from session_container
         the session data were not properly destroyed when winix checked for 
         outdated sessions (and when it was removing them)
fixed:   performance (memcpy used too often)
         in some places there were reserve method used (on std::wstring/std::string objects)
         especially in AssignString() method and TextStream<> object
         if we add a new string we should check the new size
         and only call reserve() if the new size will be greater than existing one
         (plus some constant)
changed: fcgi objects moved to App class (from Request)
         now we use thread safe methods (e.g. FCGX_Accept_r)
added:   log_plugin_call option to the config
         default: false
         when true winix log when a plugin function is called
added:   winix parameter 'nostat' for not calculating statistics
         (useful when making performance tests)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@680 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-11-23 21:52:25 +00:00
Tomasz Sowa 8e72a820dd added support for UTF-8
now the UTF-8 is a default charset


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@677 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-11-21 00:19:17 +00:00
Tomasz Sowa 7bc17a9202 fixed: ticket sets a default function only for directories
fixed: reading a new url and subject in Functions::ReadItem()
added: tickets are sorted now (by date)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@659 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-09-30 20:58:20 +00:00
Tomasz Sowa 1e7d297c0e small changes in template winix function
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@637 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-14 14:45:25 +00:00
Tomasz Sowa 9a199cd834 part II of rewriting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@635 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-12 19:10:12 +00:00
Tomasz Sowa 9901c63ede removed some thread and ticket information from request
they are in FunThread and FunTicket classes now
added funtion FunUptime (I forgot about it)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@631 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-10 20:43:38 +00:00
Tomasz Sowa 217cf1420b the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-08-10 16:12:50 +00:00
Tomasz Sowa 50cb88c5ed added: parameters consist of a name and a value now
sample: /dir/dir2/function/paramname:paramvalue
removed: TemplatesMisc namespace



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@618 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-07-04 20:27:14 +00:00
Tomasz Sowa 16bb238518 added: bbcode
files: core/bbcodeparser.h core/bbcodeparser.cpp


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@615 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-06-30 18:42:50 +00:00
Tomasz Sowa ff3c141138 added: a new editor: tinymce (function tinymce)
added: html filter can check orphans: "i", "a", "o" ... in a text


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@607 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-06-20 22:47:24 +00:00
Tomasz Sowa 6fbcffe63b added: to the Item: auth_path - a path to a static file (if auth is different from auth_none)
added: function 'mv' (move)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@596 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-03-15 01:47:26 +00:00
Tomasz Sowa ebd868fa33 removed: Done class (core/done.h, core/done.cpp)
removed: from Session: done, done_status, timers



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@594 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-28 21:33:06 +00:00
Tomasz Sowa 71a63cc70e added: function adduser
changed: errors (removed enum, there are macros now)
added: error messages to locales (winix_err_NN)
removed: templates: err_abuse.html err_others.html


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@593 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-28 00:08:10 +00:00
Tomasz Sowa 3702efc5be added: parameter 'l' to 'ls' function
added: Db::ItemQuery struct for querying items
changed: some refactoring (renamed some config variables)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@589 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-22 22:52:09 +00:00
Tomasz Sowa 16e51cd4e5 added: to mount points: file systems
we have two file systems now:
       - simplefs - the files stored on the hard drive have the same structure as in the database (dir1/dir2/file)
       - hashfs - files are stored in special directories
extented: the mountparser can read file system 
added: function download
       this is a default function for items which have static content
  


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@588 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-18 23:30:22 +00:00
Tomasz Sowa 87747fab06 added: functions: chmod, chown
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@587 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-16 18:34:41 +00:00
Tomasz Sowa 3c5a7cd664 changed: upload function
select file type by the extension
         param: multi
fixed:   uptime function
         it showed incorrect uptime time (minuts were badly calculated)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@575 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-02-12 23:16:13 +00:00