Commit Graph

378 Commits

Author SHA1 Message Date
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 db9d381a43 added: to thread manager: names of the threads
the names are shown in the log file


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@837 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-19 17:04:33 +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 67099d5d06 changed: misc::OnlyDigit()
a comma is changed to a dot


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@835 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-12 20:30:34 +00:00
Tomasz Sowa 07e8e0c63c updated: to the new Space API (pikotools)
changed: in locale txt files:
         the '(' and ')' characters should be escaped '\(' and '\)'
         or the whole string should be quoted
added:   when parsing locale files we print the line number where there was a syntax error



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@833 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-12 16:37:44 +00:00
Tomasz Sowa ecc89d8596 added: two plugin's messages
// a session is going to be removed
// it is called from session manager's thread (with lock/unlock)
#define WINIX_PREPARE_SESSION_TO_REMOVE          30027

// a session has been removed
// it is called from session manager's thread (with lock/unlock)
// in l1 you have the old session id
#define WINIX_SESSION_REMOVED                    30029




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@832 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-05-01 17:58:42 +00:00
Tomasz Sowa c94b0311b6 updated: to the new Pikotools API
ConfParser is now SpaceParser
added:   to SessionManager
         Session * SessionManager::FindSession(long id)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@831 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-30 22:53:54 +00:00
Tomasz Sowa fc33b4f882 added: a deadlock counter to Synchro class
now we can use Lock() more than one in the same thread
       and next Unlock() will recognize it
       sample:
       Lock(); // first lock -- resources locked
       Lock(); // second lock -- skipped (counter incremented)
       ...
       Unlock(); // first unlock -- skipped (because counter greater than zero)
       Unlock(); // second unlock -- actually unlocking


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@830 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-28 20:57:57 +00:00
Tomasz Sowa 1da1eef768 fixed: ThreadMenager should use Lock/Unlock in StartAll() method
added: Job class (system->job object)
       a general mechanism for jobs (by using PT::Space as a job structure)
       WINIX_JOB plugin message will be sent with a pointer to PT::Space



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@829 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-25 22:24:37 +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 bcea4f9464 fixed: base_url_redirect config option was not read from the config file
and was not used when checking for base url redirect
fixed: return values from plugins should be given in a special structure
       they were remembered in plugin object (ret_false, ret_true)
       and consequently were not thread safe
       now all plugin.Call() methods return PluginRes structure 
       in which there are ret_false and ret_true variables       
changed: small refactoring in AddUser winix function



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@827 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-22 13:30:07 +00:00
Tomasz Sowa 920290e9dc changed: permission to winix function 'who' and 'last'
(only logged users can use these functions)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@826 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-04-06 08:11:25 +00:00
Tomasz Sowa 1d83cf42a1 fixed: passwd winix funtion always changed a password for current user
(even if it was an administrator and has selected other people)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@825 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-30 06:44:38 +00:00
Tomasz Sowa 09bfdf9e77 added: two ezc functions:
void winix_postvar_value_is(Info & i);
       void winix_postvar_value_is_not(Info & i);



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@824 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-28 00:09:27 +00:00
Tomasz Sowa e83fd91423 rewritten: sessions management
(Session, SessionContainer, SessionManager)
           now a Session object don't copy all fields in its copy constructor (only id)
           the rest fields are set after the object is inserted in SessionContainer
added:     after successfully login a session id is changed
added:     plugin.Call() methods with a first argument a pointer to a Session object



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@823 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-17 05:11:23 +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 b1b3cea64e added: new plugin message: WINIX_PREPARE_USER_TO_LOGIN
a user will be logged in
        set PluginInfo::res to false (it is by default) to prevent logging the user
        directly after this message (if you do not return false)
        a WINIX_USER_LOGGED is sent
        in p1 you have a pointer to User struct
        (if at least one plugin returns false then the user will not be logged)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@820 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-14 20:25:30 +00:00
Tomasz Sowa 2712c57f15 changed: Makefile dep (dependencies from pikotools and tito were missing)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@819 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-12 20:30:36 +00:00
Tomasz Sowa 0b528c7225 added: to misc:
void OnlyDigit(StringType & s, bool allow_comma = true)
       removes all non-digit characters from a string


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@818 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-11 16:21:52 +00:00
Tomasz Sowa b7007da5a9 fixed: misc: ValidateEmail() buffer overflow
added: notifications for resetting a user's password
       (there is no a winix function for this yet)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@817 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-09 22:56:54 +00:00
Tomasz Sowa 489310ba1c added: winix function: rmuser
changed: UGContainer<> now uses std::list as a storage
         (previously it was using std::vector with pointers)
removed: now we don't have the operator[] for UGContainer<>



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@816 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-09 02:36:25 +00:00
Tomasz Sowa 6c2c12fe5e added: html/fun_pw.html
default view for pw winix function


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@815 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-03 21:00:48 +00:00
Tomasz Sowa e61f0db57e changed: export plugin:
password is stored as a string (in database)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@814 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-01 15:39:13 +00:00
Tomasz Sowa 3e3546a2fd fixed: plugin 'menu' incorrectly read directory items when the directory was en empty string
(the current directory should be used)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@813 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-03-01 15:14:46 +00:00
Tomasz Sowa d2fa3b7171 corrected: in some places declarations of classes where mixed with struct (class/struct)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@812 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-29 22:52:55 +00:00
Tomasz Sowa 0e9f587591 added: to IsWhite (core/misc)
other unicode white characters
       25 characters -- without a new line character (10)
added: config option: account_need_email_verification
       if true then when creating an account a user has to provide
       his email address and a message with an activation link will be sent 
       back to him
added: 'pw' winix function (not finished yet)
       at the moment only one parameter 'activate'



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@810 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-28 21:09:44 +00:00
Tomasz Sowa 9208b15167 fixed: in winix function 'mv':
a recurrence loop - incorrect function was called (typo)
updated: to the new EZC api:
         templates from plugin menu
         templates from 'man' winix function


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@809 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-27 17:43:59 +00:00
Tomasz Sowa a45fb30e0a rewritten: plugin 'menu'
now we have a cache for the plugin
           (this limits the number of database requests)
added:     to plugin 'menu'
           menu_dir_tab can have a 'current' parameter (first argument)
           (it uses the last path from the previous menu_dir_tab) 
changed:   updated to the new EZC api
added:     new message to plugins: WINIX_DIR_ADDED


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@808 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-24 12:09:38 +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 9d2be5c50d added: to misc:
void MaxSize(StringType & str, size_t max_size)
       if a string is larger than max_size then it is truncated to max_size characters


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@805 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-14 20:35:35 +00:00
Tomasz Sowa f381f24402 fixed: in DbBase: removed:
DbBase::AssertQuery(const std::wstring & q)
       there was a recurrence calling (the method called itself)
       we don't need a method which get a wstring as an argument
added: DbBase::AssertQuery(const char * q, ExecStatusType t)
       DbBase::AssertQuery(const DbTextStream & query, ExecStatusType t)
       (AssertQuery with a second argument -- the same as to AssertResult)
       we don't have to use AssertQuery and AssertResult
       only one AssertQuery now
added: to plugins: two messages:
       // preparing a current user to logout
       // send from 'logout' winix function
       // !! IMPROVE ME this message can be sent when winix is making the shutdown
       // (for sessions which are not mark as 'remember me')
       // and when the SessionManager deletes a session (from the special thread)
       #define WINIX_PREPARE_USER_LOGGED_OUT          30610

       // a user has been logged out
       // send from 'logout' winix function
       // in l1 you have the old user_id
       // !! IMPROVE ME this message can be sent when winix is making the shutdown
       // (for sessions which are not mark as 'remember me')
       // and when the SessionManager deletes a session (from the special thread)
       #define WINIX_USER_LOGGED_OUT                          30620



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@804 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-12 14:52:52 +00:00
Tomasz Sowa f6db85fcdb fixed: uninitialized variable in 'rm' winix function (in HasAccess method)
sometimes for directories the rm function could return 'access true' (even without 'r' parameter)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@803 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-10 00:50:05 +00:00
Tomasz Sowa 9687d5cd66 removed: operator<<(const PT::Space * space)
from textstream, log, dbtextstream, htmltextstream
added: compile option: -pthread



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@802 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-02-10 00:29:54 +00:00
Tomasz Sowa 6e2d00bc5b added: now we have a fourth part in permissions (guests)
e.g.: 07555 means:
           7 for owner
           5 for group
           5 for others
           5 for guests (not logged users)
added:     the sticky bit for directories
           e.g. permissions to a directory with a sticky bit set
           can be set to: 017555
rewritten: rm/mv winix functions to correctly understand the sticky bit
added:     Dir::FollowLink() recognizes ".." and "." now
           consequently System::FollowAllLinks recognizes it too
added:     umask -- calculating privileges for new files/directories
           all users have their own umask (in meta)
           and there is one in the config
           (for guests and when a user has not definied its own one)
removed:   mount option: only_root_remove



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@801 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-24 23:03:36 +00:00
Tomasz Sowa 5aaab89cd8 added: to locale: comparing lexicographically two characters/strings
int Compare(wchar_t c1, wchar_t c2);
       int Compare(const std::wstring & str1, const std::wstring & str2);
       
	   


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@800 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-21 20:51:13 +00:00
Tomasz Sowa 7407d24586 added: new ezc filter: fil_first_wordup
first character in a word is capitalized


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@799 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-21 17:13:00 +00:00
Tomasz Sowa c9931da5ba fixed: plugin ticket: when a session expires all files from editticket were removed
it should be removed only those new added


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@798 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-21 12:29:44 +00:00
Tomasz Sowa 4311f06ade added: to TextStream<> and Log:
operator<<(const tm & tm_)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@797 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-19 20:50:42 +00:00
Tomasz Sowa 8b64b5d372 updated plugins/ticket templates functions
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@796 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-18 17:55:28 +00:00
Tomasz Sowa 631ca4f8a3 plugin ticket: rewritten templates ezc functions
(now images/files are working fine)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@795 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-17 22:54:41 +00:00
Tomasz Sowa 424618de38 added: to templates: an interface for getting information from Space
miscspace.h, miscspace.cpp
changed: plugin ticket
         now as a config we use a PT::Space struct
         (not finished yet, only 'integer', 'select' and 'progress' are done)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@794 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-16 10:12:38 +00:00
Tomasz Sowa b2d3ca9543 now winix is using 'pikotools' (confparser, utf8, mainparser)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@792 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-12 02:24:08 +00:00
Tomasz Sowa cb33f20a24 removing: confparser.h confparser.cpp
(moving to pikotools)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@791 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-11 11:32:01 +00:00
Tomasz Sowa 973d804db2 added: TextStream<> DbTextStream<> and HtmlTextStream<> have operator<<(Space&) now
added: to db: bool DbBase::AssertValueSpace(PGresult * r, int row, int col, Space & space, bool split_single)
added: environment variables for users
       User::env (of type Space) and
       User::aenv (of type Space) for admin variables (can be changed only by a super user)
added: winix function 'env'
       for changing User::env and User::aenv ('env' winix function with a 'a' parameter)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@790 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-08 03:59:51 +00:00
Tomasz Sowa 84eaa6b7b6 changed: rewritten templates/man
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@789 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-06 12:55:08 +00:00
Tomasz Sowa f967a428ce added: winix function 'man'
displaying all winix functions and ezc templates functions


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@787 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-06 12:07:23 +00:00
Tomasz Sowa 543d464cbc changed: plugin 'menu': ezc funtion: menu_dir_tab
now we have two parameters: first is a path and second is: "images", "dirs", "files" or empty
          


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@786 e52654a7-88a9-db11-a3e9-0013d4bc506e
2012-01-02 02:05:12 +00:00
Tomasz Sowa 43470b2a41 forgotten to add html/index_rawcontent.html
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@785 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-12-17 22:02:49 +00:00