Commit Graph

378 Commits

Author SHA1 Message Date
Tomasz Sowa 01892d2766 added: flag has_pass to User structure
if false that means the user has not set a password yet 
       (this can be used by a plugins to create a new account without a password set)
       in order to login the user first has to set a new password
       (this can be done from a some kind of activation link send via email etc)
       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@954 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-06-07 11:20:44 +00:00
Tomasz Sowa 222955a2e7 fixed: in Synchro: we should have a table (map) of reference counters
each one for each thread
fixed: on Linux: pthread mutexes by default behaves differently than on FreeBSD
       we have to set PTHREAD_MUTEX_ERRORCHECK attribute 
       when creating a mutex
       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@953 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-02-14 11:20:22 +00:00
Tomasz Sowa 37b22c3559 added: some debug logs to export plugin
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@952 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-02-12 22:32:06 +00:00
Tomasz Sowa afbd522362 fixed: in Makefile: 'cp' in Linux behaves differently
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@951 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-02-12 20:49:50 +00:00
Tomasz Sowa a4bed3ab14 fixed: compiling on Debian with GCC 4.8
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@950 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-02-12 17:21:42 +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 145445c713 changed: now we use curl to fetch a page from the special thread when winix quits
(before we were using BSD's fetch)
fixed:   we didn't use FCGX_Finish_r() on the request made from the special thread
         so the thread hangs (now we can use pthread_join correctly from the main thread)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@947 e52654a7-88a9-db11-a3e9-0013d4bc506e
2014-02-11 21:00:32 +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 5d37b6c6ae fixed: winix incorrectly sent the binary stream
headers and cookies were not sent
       (instead of headers the content was sent, so the client's browser was unable to open it correctly)
added: standard http headers are added by winix only if there are not such headers already
       e.g. if a plugin adds "Content-Type" header then winix will not overwrite it 
       (headers names are case sensitive)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@945 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-12-19 17:19:47 +00:00
Tomasz Sowa fe1f84e29d added: -O0 -g for CXXFLAGS for temporarily debugging
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@944 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-12-18 12:13:28 +00:00
Tomasz Sowa 83e27a6653 fixed: problem with building
added #include <utility> to App (for std::move)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@943 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-12-09 16:03:45 +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 c04874397b fixed: security vulnerability in 'ln' winix function
a user could create a hardlink to any file and the new link 
       had user_id, group_id and permissions the same as for new generated files,
       this allowes to overwrite any existing file in the filesystem,
       now user_id, group_id, permissions are the same as from the oryginal file



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@941 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-12-03 12:33:41 +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 3e32f3784f removed: -O0 -g from production Makefile
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@939 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-11-25 23:44:01 +00:00
Tomasz Sowa 5c4a54d998 added: -O0 -g to the production Makefile
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@938 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-11-25 23:37:52 +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 d801f53154 changed: now we are using the C++ 11 language (-std=c++11) and we are using
the clang compiler by default
changed: Makefile files have been a little cleaned
         the main Makefile now will not compile winix and winix.so if there
         were not any changes to source files (it's faster)
         (added Makefile.dep in the global directory with list of all source/header files)
changed: winix version to 0.5.5




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@933 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-10-15 21:57:51 +00:00
Tomasz Sowa a6b06f82e9 fixed: compiling in the clang (new version of c++ std lib)
(added some header files)
added: three messsages in ticket plugin:
       // send by showtickets winix function when tickets are loaded (and sorted)
       // in p1 you have a pointer to the ticket tab: std::vector<Ticket::Ticket> (include "ticket.h")
       // in p2 you have a pointer to the sort tab:   std::vector<Item*>
       // those tables don't have to be equal in size (in the case when there is no some tickets in the database)
       #define WINIX_PL_TICKET_TICKETS_LOADED                 4106
       
       // a new ticket has been added
       // in p1 you have a pointer to the Ticket::Ticket structure (include "ticket.h")
       // in p2 you have a pointer to the Item structure
       #define WINIX_PL_TICKET_ADDED_NEW                              4107
       
       // a ticket has been changed
       // in p1 you have a pointer to the Ticket::Ticket structure (include "ticket.h")
       // in p2 you have a pointer to the Item structure
       #define WINIX_PL_TICKET_CHANGED                                        4108

added: two ezc functions for tickets:
       ticket_does_param_id_have_value()
       tickets_tab_does_param_id_have_value()
       (they take two integer arguments -- testing whether a specified param_id has the given value)
changed: some more minor additions in tickets templates




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@932 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-10-10 11:59:21 +00:00
Tomasz Sowa b7f3f84080 changed: in 'showtickets' winix function
now tickets are sorted by the sort_index and then by date
changed: html in 'sort' winix function (added items' subjects to the item lists)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@931 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-07-08 14:42:14 +00:00
Tomasz Sowa 26715bdd4c changed: html for 'upload' winix function
all static files (css/js) are downloaded from our server now



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@930 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-07-02 07:14:19 +00:00
Tomasz Sowa 083fa7857f fixed: in notify/notify.cpp: a correct locale id should be taken
(we were not able to send: a mail with an activation link and 
        a mail with the reset password link when we didn't have a locale with id 0 loaded)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@929 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-05-16 21:02:17 +00:00
Tomasz Sowa 9ffda3e070 changed: in passwd: a redirect make only if a password has been changed
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@928 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-05-16 20:11:27 +00:00
Tomasz Sowa 81160dbbe9 fixed: a passwd winix function should allow a non loged person to reset his password (permission fix)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@927 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-05-16 20:08:07 +00:00
Tomasz Sowa 7c266b85e2 added: winix function 'account'
code for activating an account has been moved here from Pw
changed: the form for reseting a user's password has been moved
         to 'passwd' winix function (it was in Pw before)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@926 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-05-16 19:26:44 +00:00
Tomasz Sowa 48cdca7549 changed: in fun_gallery.html: added js code to get the proper image id from url
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@925 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-05-14 08:37:22 +00:00
Tomasz Sowa 1c401eae3b added: to Rm function:
bool Rm::RemoveFileOrSymlink(long item_id, bool check_access)
added: in ticket plugin: possibility to remove a file/image
       (not finished yet)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@924 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-05-06 07:23:44 +00:00
Tomasz Sowa 0e9eb30b5d added: some ezc function to ticket plugin:
ticket_param_value_for_param_id
       tickets_tab_param_value_for_param_id
       tickets_tab_conf_tab_param_name
       tickets_tab_conf_tab_file_tab
       tickets_tab_conf_tab_file_tab_index
       tickets_tab_conf_tab_file_tab_path
       tickets_tab_conf_tab_file_tab_itemid
       tickets_tab_conf_tab_file_tab_meta




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@923 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-04-24 01:21:19 +00:00
Tomasz Sowa c10c9393c0 changed: plugin 'export': export winix function
the checkbox is now selected when we want to export static files too 
         (default it is not checked)
         



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@922 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-04-17 00:37:39 +00:00
Tomasz Sowa 8705b3437c fixed: imgcrop winix function should load only images
(when called in a directory)
added: to reload winix function:
       reloading (clearing) the cache from 'menu' plugin
added: to 'menu' plugin
       possibility to read 'meta' information from files 
       third argument 'withmeta' to menu_dir_tab ezc function
       e.g. [for menu_dir_tab "/directory" "..." "withmeta"]...[end]
       and some ezc functions to retrieve the meta values




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@921 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-04-16 09:51:36 +00:00
Tomasz Sowa aed891764a added: to config: HasValue() methods
for checking if a value exists (useful for checking lists -- they don't have to be copied out)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@920 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-04-02 22:24:30 +00:00
Tomasz Sowa 495499d12f added: a new winix function: imgcrop
for cropping images (and thumbnails)
       www.domain.com/dir/file.jpg/imgcrop  -- crop an image
       www.domain.com/dir/file.jpg/imgcrop/thumb  -- crop an image's thumbnail
       www.domain.com/dir/file.jpg/imgcrop/newthumb  -- crop and create a new thumbnail (from an original image)
       www.domain.com/dir/imgcrop -- show images' list with above options
added: to Image class: some methods for cropping




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@919 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-03-29 22:03:28 +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 be6e09c5af added: some ezc functions (item_tab_meta*)
added: some ezc functions (gallery_tab_meta*) to gallery plugin
added: to gallery plugin: a new gallery: Gallery version 1.2.9



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@917 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-02-26 11:49:22 +00:00
Tomasz Sowa 293e426ed4 fixed: plugin 'group'
Groups::ReindexGroups incorrectly read a field from a PT::Space (it used 'table' object directly)
       but the value was in 'table_single' 
       now we are using GetValue method



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@916 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-02-01 21:14:56 +00:00
Tomasz Sowa 60f2337b73 updated: paths in Makefile (prog subdirectory)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@915 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-01-19 16:31:15 +00:00
Tomasz Sowa ce8152de2f changed: added 'logsave' when we are waiting for the database to be ready
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@913 e52654a7-88a9-db11-a3e9-0013d4bc506e
2013-01-19 10:10:17 +00:00
Tomasz Sowa 496a1979d2 fixed: in ticket plugin: editticket incorrectly used ticket_info->Clear() method
it was called after some objects were set consequently we were not allowed to edit a ticket



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@912 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-12-30 15:33:08 +00:00
Tomasz Sowa fd698ca7b9 added: put the rebus answer into the log (when user has entered an incorrect answer)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@911 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-12-26 23:08:57 +00:00
Tomasz Sowa b4b368d324 changed: Makefile dep
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@910 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-11-17 01:10:00 +00:00
Tomasz Sowa 825694c880 changed: in editticket: closing ticket is better to do via POST request
added:   a new message sent by editticket when closing a ticket:
         #define WINIX_PL_TICKET_CLOSED                                 4105
         // a ticket has been closed (closed button pressed)
         // in p1 you have a pointer to the Item struct
         // in p2 you have a pointer to the Ticket struct





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@909 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-11-05 23:13:52 +00:00
Tomasz Sowa 32750a7d50 changed: ticket plugin: redirect type in editticket winix function (when there is 'close' parameter)
fixed:   prototype doesn't work with jquery (in ticket winix function)
         (prototype was loaded for lightbox)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@908 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-11-04 22:39:02 +00:00
Tomasz Sowa 0045c6c72c added: to Item struct: ameta (PT::Space)
admin meta information
added: option "a" to meta winix function
       editing admin meta information
changed: now if you don't have write access to an item
         you can't see the meta information
         previous if you had read access you could have seen them
added: in plugin ticket and thread
       support for 'closing' (ticket, thread)
       (this is only logic, we need some html yet)
added: some ezc function for getting meta/admin meta information
       (for the current item and the last directory)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@907 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-11-04 21:01:02 +00:00
Tomasz Sowa 4809016b78 changed: html (slog.html)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@906 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-11-01 17:56:00 +00:00
Tomasz Sowa 6e2ba65524 changed: added 'check_abuse' parameter to Login::LoginUser
bool Login::LoginUser(const std::wstring & login, const std::wstring & password, bool remember_me,
                               bool use_ses_log, bool check_abuse)
         default 'false' -- it test the time between GET and POST and the rebus (if exists)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@905 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-27 11:17:52 +00:00
Tomasz Sowa 8033ac66c4 added: locales to fun_ipban.html
changed: cosmetic changes in IPBanContainer




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@904 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-27 10:14:07 +00:00
Tomasz Sowa 9ef3736989 added: to 'ipban' winix function:
possibility to remove a ban (or all bans)
added: to SessionManager: sorting of the ban list (in the second thread)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@903 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-27 09:03:49 +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 53b4175d00 added: plugin message: WINIX_CHECK_PLUGIN_ACCESS
this message is sent before calling MakePost() or MakeGet()
       if you return false (which is default) you can prevent the access
       to the resource
       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@901 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-17 19:52:55 +00:00
Tomasz Sowa 8aa6f08e08 updated: html (login and passwd)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@900 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-10-17 06:48:48 +00:00