diff --git a/Makefile.dep b/Makefile.dep index 366cd58..594c68e 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -1 +1 @@ -winix.src.files = ./main/main.cpp ./db/dbconn.cpp ./db/db.cpp ./db/dbbase.h ./db/dbitemcolumns.cpp ./db/dbtextstream.cpp ./db/dbconn.h ./db/db.h ./db/dbitemcolumns.h ./db/dbitemquery.cpp ./db/dbtextstream.h ./db/dbitemquery.h ./db/dbbase.cpp ./core/synchro.h ./core/sessioncontainer.h ./core/cookieparser.h ./core/misc.cpp ./core/item.cpp ./core/error.h ./core/timezone.h ./core/compress.h ./core/crypt.cpp ./core/dirs.cpp ./core/slog.cpp ./core/config.cpp ./core/lastcontainer.cpp ./core/users.h ./core/httpsimpleparser.cpp ./core/threadmanager.h ./core/postparser.h ./core/pluginmsg.h ./core/acceptbaseparser.h ./core/loadavg.cpp ./core/job.h ./core/mountparser.cpp ./core/timezones.h ./core/sessionmanager.h ./core/groups.h ./core/system.cpp ./core/synchro.cpp ./core/rebus.h ./core/lock.cpp ./core/acceptencodingparser.h ./core/version.h ./core/compress.cpp ./core/ipbancontainer.cpp ./core/request.h ./core/plugindata.h ./core/plugin.cpp ./core/sessionparser.cpp ./core/bbcodeparser.h ./core/users.cpp ./core/mount.cpp ./core/item.h ./core/slog.h ./core/threadmanager.cpp ./core/acceptbaseparser.cpp ./core/lastcontainer.h ./core/httpsimpleparser.h ./core/timezones.cpp ./core/groups.cpp ./core/requesttypes.h ./core/system.h ./core/bbcodeparser.cpp ./core/lock.h ./core/ipbancontainer.h ./core/group.h ./core/plugin.h ./core/run.cpp ./core/textstream.h ./core/sessionparser.h ./core/basethread.h ./core/mount.h ./core/htmlfilter.cpp ./core/user.cpp ./core/app.cpp ./core/image.cpp ./core/ugcontainer.h ./core/postmultiparser.h ./core/logmanipulators.h ./core/sessioncontainer.cpp ./core/dircontainer.h ./core/log.h ./core/session.h ./core/timezone.cpp ./core/mounts.h ./core/ipban.h ./core/cur.h ./core/misc.h ./core/dirs.h ./core/crypt.h ./core/run.h ./core/config.h ./core/job.cpp ./core/postmultiparser.cpp ./core/sessionmanager.cpp ./core/htmlfilter.h ./core/rebus.cpp ./core/dircontainer.cpp ./core/log.cpp ./core/user.h ./core/loadavg.h ./core/session.cpp ./core/mountparser.h ./core/mounts.cpp ./core/image.h ./core/plugindata.cpp ./core/request.cpp ./core/app.h ./core/basethread.cpp ./core/sessionidmanager.h ./core/winix_const.h ./core/sessionidmanager.cpp ./functions/upload.cpp ./functions/priv.h ./functions/env.cpp ./functions/default.h ./functions/node.h ./functions/specialdefault.h ./functions/timezone.cpp ./functions/pw.h ./functions/adduser.h ./functions/chmod.h ./functions/imgcrop.cpp ./functions/vim.h ./functions/account.h ./functions/mount.cpp ./functions/uptime.cpp ./functions/ckeditor.cpp ./functions/mkdir.cpp ./functions/reload.cpp ./functions/functionparser.h ./functions/logout.cpp ./functions/rmuser.cpp ./functions/rm.cpp ./functions/chown.h ./functions/nicedit.h ./functions/mv.h ./functions/node.cpp ./functions/specialdefault.cpp ./functions/adduser.cpp ./functions/upload.h ./functions/vim.cpp ./functions/env.h ./functions/timezone.h ./functions/who.h ./functions/cp.cpp ./functions/run.cpp ./functions/locale.h ./functions/imgcrop.h ./functions/passwd.h ./functions/mount.h ./functions/privchanger.cpp ./functions/functions.cpp ./functions/last.h ./functions/ckeditor.h ./functions/mkdir.h ./functions/reload.h ./functions/cat.h ./functions/download.h ./functions/ln.h ./functions/nicedit.cpp ./functions/functionbase.cpp ./functions/man.h ./functions/rm.h ./functions/meta.cpp ./functions/emacs.cpp ./functions/sort.h ./functions/who.cpp ./functions/ipban.h ./functions/locale.cpp ./functions/passwd.cpp ./functions/last.cpp ./functions/subject.h ./functions/download.cpp ./functions/cp.h ./functions/cat.cpp ./functions/login.cpp ./functions/tinymce.cpp ./functions/ln.cpp ./functions/run.h ./functions/uname.h ./functions/man.cpp ./functions/functions.h ./functions/privchanger.h ./functions/ls.cpp ./functions/template.h ./functions/stat.h ./functions/priv.cpp ./functions/default.cpp ./functions/functionbase.h ./functions/pw.cpp ./functions/sort.cpp ./functions/ipban.cpp ./functions/chmod.cpp ./functions/meta.h ./functions/account.cpp ./functions/emacs.h ./functions/subject.cpp ./functions/functionparser.cpp ./functions/uname.cpp ./functions/uptime.h ./functions/template.cpp ./functions/stat.cpp ./functions/tinymce.h ./functions/login.h ./functions/chown.cpp ./functions/logout.h ./functions/mv.cpp ./functions/rmuser.h ./functions/ls.h ./notify/notifypool.h ./notify/templatesnotify.cpp ./notify/notify.cpp ./notify/templatesnotify.h ./notify/notify.h ./notify/notifythread.cpp ./notify/notifypool.cpp ./notify/notifythread.h ./templates/who.cpp ./templates/item.cpp ./templates/mount.cpp ./templates/templates.h ./templates/locale.h ./templates/slog.cpp ./templates/doc.cpp ./templates/localefilter.cpp ./templates/config.cpp ./templates/patterns.h ./templates/miscspace.cpp ./templates/filters.cpp ./templates/login.cpp ./templates/man.cpp ./templates/changepatterns.h ./templates/stat.cpp ./templates/template.cpp ./templates/dir.cpp ./templates/user.cpp ./templates/rebus.cpp ./templates/patterncacher.cpp ./templates/upload.cpp ./templates/textextstream.h ./templates/adduser.cpp ./templates/ipban.cpp ./templates/htmltextstream.h ./templates/indexpatterns.h ./templates/templates.cpp ./templates/winix.cpp ./templates/locale.cpp ./templates/misc.h ./templates/patterns.cpp ./templates/passwd.cpp ./templates/last.cpp ./templates/uptime.cpp ./templates/insert.cpp ./templates/changepatterns.cpp ./templates/localefilter.h ./templates/miscspace.h ./templates/ls.cpp ./templates/sys.cpp ./templates/priv.cpp ./templates/textextstream.cpp ./templates/htmltextstream.cpp ./templates/env.cpp ./templates/indexpatterns.cpp ./templates/patterncacher.h ./templates/misc.cpp ./templates/generic.cpp ./templates/currentdate.cpp ./templates/server.cpp ./plugins/group/init.cpp ./plugins/group/groups.h ./plugins/group/groupinfo.cpp ./plugins/group/groupinfo.h ./plugins/group/templates.cpp ./plugins/group/groups.cpp ./plugins/stats/statssession.h ./plugins/stats/bot.h ./plugins/stats/stats.cpp ./plugins/stats/templates.cpp ./plugins/stats/init.cpp ./plugins/stats/stats.h ./plugins/stats/templates.h ./plugins/stats/bot.cpp ./plugins/gallery/galleryinfo.cpp ./plugins/gallery/templates.cpp ./plugins/gallery/gallery.cpp ./plugins/gallery/galleryinfo.h ./plugins/gallery/init.cpp ./plugins/gallery/gallery.h ./plugins/export/init.cpp ./plugins/export/export.h ./plugins/export/exportthread.cpp ./plugins/export/message.h ./plugins/export/edb.cpp ./plugins/export/funexport.cpp ./plugins/export/exportinfo.cpp ./plugins/export/exportthread.h ./plugins/export/edb.h ./plugins/export/funexport.h ./plugins/export/exportinfo.h ./plugins/ticket/funticket.h ./plugins/ticket/init.cpp ./plugins/ticket/ticketinfo.h ./plugins/ticket/showtickets.cpp ./plugins/ticket/createticket.cpp ./plugins/ticket/tdb.cpp ./plugins/ticket/pluginmsg.h ./plugins/ticket/createticket.h ./plugins/ticket/showtickets.h ./plugins/ticket/sessiondata.cpp ./plugins/ticket/tdb.h ./plugins/ticket/sessiondata.h ./plugins/ticket/ticket.h ./plugins/ticket/editticket.cpp ./plugins/ticket/funticket.cpp ./plugins/ticket/templates.cpp ./plugins/ticket/editticket.h ./plugins/ticket/ticketinfo.cpp ./plugins/menu/cache.cpp ./plugins/menu/init.cpp ./plugins/menu/cache.h ./plugins/menu/templates.cpp ./plugins/thread/funthread.cpp ./plugins/thread/threadinfo.cpp ./plugins/thread/funthread.h ./plugins/thread/threadinfo.h ./plugins/thread/createthread.cpp ./plugins/thread/reply.cpp ./plugins/thread/showthreads.cpp ./plugins/thread/templates.cpp ./plugins/thread/createthread.h ./plugins/thread/reply.h ./plugins/thread/showthreads.h ./plugins/thread/init.cpp ./plugins/thread/templates.h ./plugins/thread/tdb.cpp ./plugins/thread/pluginmsg.h ./plugins/thread/thread.h ./plugins/thread/tdb.h ./plugins/mailregister/init.cpp ./plugins/mailregister/mdb.h ./plugins/mailregister/mdb.cpp ./plugins/mailregister/funregistermail.h ./plugins/mailregister/funregistermail.cpp ../ezc/src/funinfo.h ../ezc/src/patternparser.cpp ../ezc/src/generator.h ../ezc/src/functions.h ../ezc/src/pattern.cpp ../ezc/src/item.cpp ../ezc/src/patternparser.h ../ezc/src/pattern.h ../ezc/src/item.h ../ezc/src/ezc.h ../ezc/src/cache.cpp ../ezc/src/cache.h ../ezc/src/blocks.h ../ezc/src/blocks.cpp ../ezc/src/objects.h ../ezc/src/outstreams.h ../tito/src/crypto.cpp ../tito/src/misc.h ../tito/src/base64.cpp ../tito/src/crypto.h ../tito/src/aes.cpp ../tito/src/base64.h ../tito/src/misc.cpp ../tito/src/aes.h ../pikotools/mainparser/sample/sample.cpp ../pikotools/mainparser/mainparser.cpp ../pikotools/mainparser/mainparser.h ../pikotools/space/space.h ../pikotools/space/spaceparser.cpp ../pikotools/space/space.cpp ../pikotools/space/spaceparser.h ../pikotools/space/jsontospaceparser.cpp ../pikotools/space/spacetojson.cpp ../pikotools/space/jsontospaceparser.h ../pikotools/space/spacetojson.h ../pikotools/date/date.h ../pikotools/date/date.cpp ../pikotools/membuffer/membuffer.h ../pikotools/utf8/utf8.cpp ../pikotools/utf8/utf8.h ../pikotools/textstream/textstream.h ../pikotools/textstream/types.h ../pikotools/convert/convert.h ../pikotools/convert/inttostr.h ../pikotools/mainspaceparser/mainspaceparser.cpp ../pikotools/mainspaceparser/mainspaceparser.h \ No newline at end of file +winix.src.files = ./plugins/group/init.cpp ./plugins/group/groups.h ./plugins/group/groupinfo.cpp ./plugins/group/groupinfo.h ./plugins/group/templates.cpp ./plugins/group/groups.cpp ./plugins/stats/statssession.h ./plugins/stats/bot.h ./plugins/stats/stats.cpp ./plugins/stats/templates.cpp ./plugins/stats/init.cpp ./plugins/stats/stats.h ./plugins/stats/templates.h ./plugins/stats/bot.cpp ./plugins/gallery/galleryinfo.cpp ./plugins/gallery/templates.cpp ./plugins/gallery/gallery.cpp ./plugins/gallery/galleryinfo.h ./plugins/gallery/init.cpp ./plugins/gallery/gallery.h ./plugins/export/init.cpp ./plugins/export/export.h ./plugins/export/exportthread.cpp ./plugins/export/message.h ./plugins/export/edb.cpp ./plugins/export/funexport.cpp ./plugins/export/exportinfo.cpp ./plugins/export/exportthread.h ./plugins/export/edb.h ./plugins/export/funexport.h ./plugins/export/exportinfo.h ./plugins/ticket/funticket.h ./plugins/ticket/init.cpp ./plugins/ticket/ticketinfo.h ./plugins/ticket/showtickets.cpp ./plugins/ticket/createticket.cpp ./plugins/ticket/tdb.cpp ./plugins/ticket/pluginmsg.h ./plugins/ticket/createticket.h ./plugins/ticket/showtickets.h ./plugins/ticket/sessiondata.cpp ./plugins/ticket/tdb.h ./plugins/ticket/sessiondata.h ./plugins/ticket/ticket.h ./plugins/ticket/editticket.cpp ./plugins/ticket/funticket.cpp ./plugins/ticket/templates.cpp ./plugins/ticket/editticket.h ./plugins/ticket/ticketinfo.cpp ./plugins/menu/cache.cpp ./plugins/menu/init.cpp ./plugins/menu/cache.h ./plugins/menu/templates.cpp ./plugins/thread/funthread.cpp ./plugins/thread/threadinfo.cpp ./plugins/thread/funthread.h ./plugins/thread/threadinfo.h ./plugins/thread/createthread.cpp ./plugins/thread/reply.cpp ./plugins/thread/showthreads.cpp ./plugins/thread/templates.cpp ./plugins/thread/createthread.h ./plugins/thread/reply.h ./plugins/thread/showthreads.h ./plugins/thread/init.cpp ./plugins/thread/templates.h ./plugins/thread/tdb.cpp ./plugins/thread/pluginmsg.h ./plugins/thread/thread.h ./plugins/thread/tdb.h ./plugins/mailregister/funregistermail.h ./plugins/mailregister/mdb.h ./plugins/mailregister/funregistermail.cpp ./plugins/mailregister/mdb.cpp ./plugins/mailregister/init.cpp ./plugins/mailregister/templates.cpp ./plugins/mailregister/registermail_info.h ./plugins/mailregister/funregistermail_showusers.h ./plugins/mailregister/funregistermail_showusers.cpp ./main/main.cpp ./db/dbconn.cpp ./db/db.cpp ./db/dbbase.h ./db/dbitemcolumns.cpp ./db/dbtextstream.cpp ./db/dbconn.h ./db/db.h ./db/dbitemcolumns.h ./db/dbitemquery.cpp ./db/dbtextstream.h ./db/dbitemquery.h ./db/dbbase.cpp ./core/synchro.h ./core/sessioncontainer.h ./core/cookieparser.h ./core/misc.cpp ./core/item.cpp ./core/error.h ./core/timezone.h ./core/compress.h ./core/crypt.cpp ./core/dirs.cpp ./core/slog.cpp ./core/config.cpp ./core/lastcontainer.cpp ./core/users.h ./core/httpsimpleparser.cpp ./core/threadmanager.h ./core/postparser.h ./core/pluginmsg.h ./core/acceptbaseparser.h ./core/loadavg.cpp ./core/job.h ./core/mountparser.cpp ./core/timezones.h ./core/sessionmanager.h ./core/groups.h ./core/system.cpp ./core/rebus.h ./core/synchro.cpp ./core/lock.cpp ./core/acceptencodingparser.h ./core/version.h ./core/compress.cpp ./core/ipbancontainer.cpp ./core/request.h ./core/plugindata.h ./core/plugin.cpp ./core/sessionparser.cpp ./core/bbcodeparser.h ./core/users.cpp ./core/mount.cpp ./core/item.h ./core/slog.h ./core/threadmanager.cpp ./core/acceptbaseparser.cpp ./core/lastcontainer.h ./core/httpsimpleparser.h ./core/timezones.cpp ./core/groups.cpp ./core/requesttypes.h ./core/system.h ./core/bbcodeparser.cpp ./core/lock.h ./core/ipbancontainer.h ./core/group.h ./core/plugin.h ./core/run.cpp ./core/textstream.h ./core/sessionparser.h ./core/basethread.h ./core/mount.h ./core/htmlfilter.cpp ./core/user.cpp ./core/app.cpp ./core/image.cpp ./core/ugcontainer.h ./core/postmultiparser.h ./core/logmanipulators.h ./core/sessioncontainer.cpp ./core/dircontainer.h ./core/log.h ./core/session.h ./core/timezone.cpp ./core/mounts.h ./core/ipban.h ./core/cur.h ./core/misc.h ./core/dirs.h ./core/crypt.h ./core/run.h ./core/config.h ./core/job.cpp ./core/postmultiparser.cpp ./core/sessionmanager.cpp ./core/htmlfilter.h ./core/rebus.cpp ./core/dircontainer.cpp ./core/log.cpp ./core/user.h ./core/loadavg.h ./core/session.cpp ./core/mountparser.h ./core/mounts.cpp ./core/image.h ./core/plugindata.cpp ./core/request.cpp ./core/app.h ./core/basethread.cpp ./core/sessionidmanager.h ./core/winix_const.h ./core/sessionidmanager.cpp ./functions/upload.cpp ./functions/priv.h ./functions/env.cpp ./functions/default.h ./functions/node.h ./functions/specialdefault.h ./functions/timezone.cpp ./functions/pw.h ./functions/adduser.h ./functions/chmod.h ./functions/imgcrop.cpp ./functions/vim.h ./functions/account.h ./functions/mount.cpp ./functions/uptime.cpp ./functions/ckeditor.cpp ./functions/mkdir.cpp ./functions/reload.cpp ./functions/functionparser.h ./functions/logout.cpp ./functions/rmuser.cpp ./functions/rm.cpp ./functions/chown.h ./functions/nicedit.h ./functions/mv.h ./functions/node.cpp ./functions/specialdefault.cpp ./functions/adduser.cpp ./functions/upload.h ./functions/vim.cpp ./functions/env.h ./functions/timezone.h ./functions/who.h ./functions/cp.cpp ./functions/run.cpp ./functions/locale.h ./functions/imgcrop.h ./functions/passwd.h ./functions/mount.h ./functions/privchanger.cpp ./functions/functions.cpp ./functions/last.h ./functions/ckeditor.h ./functions/mkdir.h ./functions/reload.h ./functions/cat.h ./functions/download.h ./functions/ln.h ./functions/nicedit.cpp ./functions/functionbase.cpp ./functions/man.h ./functions/rm.h ./functions/meta.cpp ./functions/emacs.cpp ./functions/sort.h ./functions/who.cpp ./functions/ipban.h ./functions/locale.cpp ./functions/passwd.cpp ./functions/last.cpp ./functions/subject.h ./functions/download.cpp ./functions/cp.h ./functions/cat.cpp ./functions/login.cpp ./functions/tinymce.cpp ./functions/ln.cpp ./functions/run.h ./functions/uname.h ./functions/man.cpp ./functions/functions.h ./functions/privchanger.h ./functions/ls.cpp ./functions/template.h ./functions/stat.h ./functions/priv.cpp ./functions/default.cpp ./functions/functionbase.h ./functions/pw.cpp ./functions/sort.cpp ./functions/ipban.cpp ./functions/chmod.cpp ./functions/meta.h ./functions/account.cpp ./functions/emacs.h ./functions/subject.cpp ./functions/functionparser.cpp ./functions/uname.cpp ./functions/uptime.h ./functions/template.cpp ./functions/stat.cpp ./functions/tinymce.h ./functions/login.h ./functions/chown.cpp ./functions/logout.h ./functions/mv.cpp ./functions/rmuser.h ./functions/ls.h ./notify/notifypool.h ./notify/templatesnotify.cpp ./notify/notify.cpp ./notify/templatesnotify.h ./notify/notify.h ./notify/notifythread.cpp ./notify/notifypool.cpp ./notify/notifythread.h ./templates/who.cpp ./templates/item.cpp ./templates/mount.cpp ./templates/templates.h ./templates/locale.h ./templates/slog.cpp ./templates/doc.cpp ./templates/localefilter.cpp ./templates/config.cpp ./templates/patterns.h ./templates/miscspace.cpp ./templates/filters.cpp ./templates/login.cpp ./templates/man.cpp ./templates/changepatterns.h ./templates/stat.cpp ./templates/template.cpp ./templates/dir.cpp ./templates/user.cpp ./templates/rebus.cpp ./templates/patterncacher.cpp ./templates/upload.cpp ./templates/textextstream.h ./templates/adduser.cpp ./templates/ipban.cpp ./templates/htmltextstream.h ./templates/indexpatterns.h ./templates/templates.cpp ./templates/winix.cpp ./templates/locale.cpp ./templates/misc.h ./templates/patterns.cpp ./templates/passwd.cpp ./templates/last.cpp ./templates/uptime.cpp ./templates/insert.cpp ./templates/changepatterns.cpp ./templates/localefilter.h ./templates/miscspace.h ./templates/ls.cpp ./templates/sys.cpp ./templates/priv.cpp ./templates/textextstream.cpp ./templates/htmltextstream.cpp ./templates/env.cpp ./templates/indexpatterns.cpp ./templates/patterncacher.h ./templates/misc.cpp ./templates/generic.cpp ./templates/currentdate.cpp ./templates/server.cpp ../ezc/src/funinfo.h ../ezc/src/functions.h ../ezc/src/pattern.cpp ../ezc/src/item.cpp ../ezc/src/pattern.h ../ezc/src/item.h ../ezc/src/ezc.h ../ezc/src/cache.cpp ../ezc/src/cache.h ../ezc/src/blocks.h ../ezc/src/blocks.cpp ../ezc/src/patternparser.cpp ../ezc/src/objects.h ../ezc/src/patternparser.h ../ezc/src/generator.h ../ezc/src/outstreams.h ../tito/src/crypto.cpp ../tito/src/misc.h ../tito/src/base64.cpp ../tito/src/crypto.h ../tito/src/aes.cpp ../tito/src/base64.h ../tito/src/misc.cpp ../tito/src/aes.h ../pikotools/mainparser/sample/sample.cpp ../pikotools/mainparser/mainparser.cpp ../pikotools/mainparser/mainparser.h ../pikotools/space/space.h ../pikotools/space/spaceparser.cpp ../pikotools/space/space.cpp ../pikotools/space/spaceparser.h ../pikotools/space/jsontospaceparser.cpp ../pikotools/space/spacetojson.cpp ../pikotools/space/jsontospaceparser.h ../pikotools/space/spacetojson.h ../pikotools/date/date.h ../pikotools/date/date.cpp ../pikotools/membuffer/membuffer.h ../pikotools/utf8/utf8.cpp ../pikotools/utf8/utf8.h ../pikotools/textstream/textstream.h ../pikotools/textstream/types.h ../pikotools/convert/convert.h ../pikotools/convert/inttostr.h ../pikotools/mainspaceparser/mainspaceparser.h ../pikotools/mainspaceparser/mainspaceparser.cpp \ No newline at end of file diff --git a/functions/functionparser.cpp b/functions/functionparser.cpp index 8de0926..df1462b 100644 --- a/functions/functionparser.cpp +++ b/functions/functionparser.cpp @@ -335,6 +335,12 @@ int c; path += 3; } else + if( *path == '+' ) + { + c = ' '; + path += 1; + } + else { c = *path; path += 1; diff --git a/plugins/mailregister/Makefile.dep b/plugins/mailregister/Makefile.dep index e7b6410..cf7f4a6 100644 --- a/plugins/mailregister/Makefile.dep +++ b/plugins/mailregister/Makefile.dep @@ -69,7 +69,101 @@ funregistermail.o: ../../../winix/core/image.h funregistermail.o: ../../../winix/core/threadmanager.h funregistermail.o: ../../../winix/core/timezones.h funregistermail.o: ../../../winix/core/timezone.h -funregistermail.o: ../../../winix/core/synchro.h +funregistermail.o: ../../../winix/core/synchro.h registermail_info.h mdb.h +funregistermail.o: ../../../winix/db/dbbase.h ../../../winix/core/dirs.h +funregistermail_showusers.o: funregistermail_showusers.h +funregistermail_showusers.o: ../../../winix/functions/functionbase.h +funregistermail_showusers.o: ../../../winix/core/item.h +funregistermail_showusers.o: ../../../pikotools/space/space.h +funregistermail_showusers.o: ../../../pikotools/textstream/types.h +funregistermail_showusers.o: ../../../pikotools/date/date.h +funregistermail_showusers.o: ../../../winix/db/db.h +funregistermail_showusers.o: ../../../winix/db/dbbase.h +funregistermail_showusers.o: ../../../winix/db/dbconn.h +funregistermail_showusers.o: ../../../winix/db/dbtextstream.h +funregistermail_showusers.o: ../../../winix/core/textstream.h +funregistermail_showusers.o: ../../../winix/core/misc.h +funregistermail_showusers.o: ../../../winix/core/item.h +funregistermail_showusers.o: ../../../winix/core/requesttypes.h +funregistermail_showusers.o: ../../../pikotools/textstream/textstream.h +funregistermail_showusers.o: ../../../pikotools/convert/convert.h +funregistermail_showusers.o: ../../../pikotools/convert/inttostr.h +funregistermail_showusers.o: ../../../pikotools/membuffer/membuffer.h +funregistermail_showusers.o: ../../../pikotools/textstream/types.h +funregistermail_showusers.o: ../../../pikotools/utf8/utf8.h +funregistermail_showusers.o: ../../../winix/core/winix_const.h +funregistermail_showusers.o: ../../../winix/core/error.h +funregistermail_showusers.o: ../../../pikotools/space/spaceparser.h +funregistermail_showusers.o: ../../../pikotools/space/space.h +funregistermail_showusers.o: ../../../winix/db/dbitemquery.h +funregistermail_showusers.o: ../../../winix/db/dbitemcolumns.h +funregistermail_showusers.o: ../../../winix/core/user.h +funregistermail_showusers.o: ../../../winix/core/group.h +funregistermail_showusers.o: ../../../winix/core/dircontainer.h +funregistermail_showusers.o: ../../../winix/core/ugcontainer.h +funregistermail_showusers.o: ../../../winix/core/log.h +funregistermail_showusers.o: ../../../winix/core/textstream.h +funregistermail_showusers.o: ../../../winix/core/logmanipulators.h +funregistermail_showusers.o: ../../../winix/core/slog.h +funregistermail_showusers.o: ../../../winix/core/cur.h +funregistermail_showusers.o: ../../../winix/core/request.h +funregistermail_showusers.o: ../../../winix/core/error.h +funregistermail_showusers.o: ../../../winix/core/config.h +funregistermail_showusers.o: ../../../winix/core/htmlfilter.h +funregistermail_showusers.o: ../../../winix/templates/htmltextstream.h +funregistermail_showusers.o: ../../../pikotools/space/spacetojson.h +funregistermail_showusers.o: ../../../ezc/src/outstreams.h +funregistermail_showusers.o: ../../../winix/core/session.h +funregistermail_showusers.o: ../../../winix/core/user.h +funregistermail_showusers.o: ../../../winix/core/plugindata.h +funregistermail_showusers.o: ../../../winix/core/rebus.h +funregistermail_showusers.o: ../../../winix/core/ipban.h +funregistermail_showusers.o: ../../../winix/core/mount.h +funregistermail_showusers.o: ../../../winix/templates/locale.h +funregistermail_showusers.o: ../../../winix/core/request.h +funregistermail_showusers.o: ../../../winix/core/config.h +funregistermail_showusers.o: ../../../winix/core/system.h +funregistermail_showusers.o: ../../../winix/core/job.h +funregistermail_showusers.o: ../../../winix/core/basethread.h +funregistermail_showusers.o: ../../../winix/core/synchro.h +funregistermail_showusers.o: ../../../winix/core/dirs.h +funregistermail_showusers.o: ../../../winix/core/dircontainer.h +funregistermail_showusers.o: ../../../winix/notify/notify.h +funregistermail_showusers.o: ../../../winix/notify/notifypool.h +funregistermail_showusers.o: ../../../winix/templates/patterns.h +funregistermail_showusers.o: ../../../winix/templates/locale.h +funregistermail_showusers.o: ../../../winix/templates/localefilter.h +funregistermail_showusers.o: ../../../ezc/src/ezc.h +funregistermail_showusers.o: ../../../ezc/src/generator.h +funregistermail_showusers.o: ../../../ezc/src/blocks.h +funregistermail_showusers.o: ../../../ezc/src/cache.h +funregistermail_showusers.o: ../../../ezc/src/functions.h +funregistermail_showusers.o: ../../../ezc/src/funinfo.h +funregistermail_showusers.o: ../../../ezc/src/objects.h +funregistermail_showusers.o: ../../../ezc/src/pattern.h +funregistermail_showusers.o: ../../../ezc/src/patternparser.h +funregistermail_showusers.o: ../../../winix/notify/notifythread.h +funregistermail_showusers.o: ../../../winix/core/basethread.h +funregistermail_showusers.o: ../../../winix/notify/templatesnotify.h +funregistermail_showusers.o: ../../../winix/core/users.h +funregistermail_showusers.o: ../../../winix/core/ugcontainer.h +funregistermail_showusers.o: ../../../winix/core/lastcontainer.h +funregistermail_showusers.o: ../../../winix/core/mounts.h +funregistermail_showusers.o: ../../../winix/core/mountparser.h +funregistermail_showusers.o: ../../../winix/core/crypt.h +funregistermail_showusers.o: ../../../winix/core/run.h +funregistermail_showusers.o: ../../../winix/core/users.h +funregistermail_showusers.o: ../../../winix/core/groups.h +funregistermail_showusers.o: ../../../winix/core/group.h +funregistermail_showusers.o: ../../../winix/core/loadavg.h +funregistermail_showusers.o: ../../../winix/core/image.h +funregistermail_showusers.o: ../../../winix/core/threadmanager.h +funregistermail_showusers.o: ../../../winix/core/timezones.h +funregistermail_showusers.o: ../../../winix/core/timezone.h +funregistermail_showusers.o: ../../../winix/core/synchro.h +funregistermail_showusers.o: registermail_info.h mdb.h +funregistermail_showusers.o: ../../../winix/db/dbbase.h +funregistermail_showusers.o: ../../../winix/core/dirs.h init.o: ../../../winix/core/log.h ../../../winix/core/textstream.h init.o: ../../../winix/core/logmanipulators.h init.o: ../../../pikotools/textstream/textstream.h @@ -155,7 +249,9 @@ init.o: ../../../winix/templates/patterns.h init.o: ../../../winix/templates/changepatterns.h init.o: ../../../winix/templates/htmltextstream.h init.o: ../../../winix/core/sessionmanager.h mdb.h ../../../winix/db/dbbase.h -init.o: ../../../winix/core/dirs.h +init.o: ../../../winix/core/dirs.h funregistermail.h +init.o: ../../../winix/functions/functionbase.h registermail_info.h +init.o: funregistermail_showusers.h mdb.o: mdb.h ../../../winix/db/dbbase.h ../../../winix/core/dirs.h mdb.o: ../../../winix/core/log.h ../../../winix/core/textstream.h mdb.o: ../../../winix/core/logmanipulators.h @@ -178,3 +274,108 @@ mdb.o: ../../../winix/core/session.h ../../../winix/core/user.h mdb.o: ../../../winix/core/plugindata.h ../../../winix/core/rebus.h mdb.o: ../../../winix/core/ipban.h ../../../winix/core/mount.h mdb.o: ../../../winix/templates/locale.h +templates.o: ../../../winix/templates/templates.h ../../../ezc/src/ezc.h +templates.o: ../../../ezc/src/generator.h ../../../ezc/src/blocks.h +templates.o: ../../../winix/core/item.h ../../../ezc/src/cache.h +templates.o: ../../../ezc/src/functions.h ../../../pikotools/utf8/utf8.h +templates.o: ../../../ezc/src/funinfo.h ../../../ezc/src/objects.h +templates.o: ../../../ezc/src/pattern.h ../../../ezc/src/outstreams.h +templates.o: ../../../ezc/src/patternparser.h ../../../winix/core/misc.h +templates.o: ../../../winix/core/requesttypes.h +templates.o: ../../../pikotools/textstream/textstream.h +templates.o: ../../../pikotools/space/space.h +templates.o: ../../../pikotools/textstream/types.h +templates.o: ../../../pikotools/date/date.h +templates.o: ../../../pikotools/convert/convert.h +templates.o: ../../../pikotools/convert/inttostr.h +templates.o: ../../../pikotools/membuffer/membuffer.h +templates.o: ../../../pikotools/textstream/types.h +templates.o: ../../../winix/core/winix_const.h +templates.o: ../../../winix/templates/patterncacher.h +templates.o: ../../../winix/core/item.h +templates.o: ../../../winix/templates/indexpatterns.h +templates.o: ../../../winix/templates/patterns.h +templates.o: ../../../winix/templates/locale.h +templates.o: ../../../winix/templates/changepatterns.h +templates.o: ../../../winix/templates/htmltextstream.h +templates.o: ../../../winix/templates/localefilter.h +templates.o: ../../../winix/core/config.h ../../../winix/core/cur.h +templates.o: ../../../winix/core/system.h ../../../winix/core/job.h +templates.o: ../../../winix/core/basethread.h ../../../winix/core/synchro.h +templates.o: ../../../winix/core/dirs.h ../../../winix/core/dircontainer.h +templates.o: ../../../winix/db/db.h ../../../winix/db/dbbase.h +templates.o: ../../../winix/db/dbconn.h ../../../winix/db/dbtextstream.h +templates.o: ../../../winix/core/textstream.h ../../../winix/core/error.h +templates.o: ../../../pikotools/space/spaceparser.h +templates.o: ../../../pikotools/space/space.h ../../../winix/db/dbitemquery.h +templates.o: ../../../winix/db/dbitemcolumns.h ../../../winix/core/user.h +templates.o: ../../../winix/core/group.h ../../../winix/core/dircontainer.h +templates.o: ../../../winix/core/ugcontainer.h ../../../winix/core/log.h +templates.o: ../../../winix/core/textstream.h +templates.o: ../../../winix/core/logmanipulators.h ../../../winix/core/slog.h +templates.o: ../../../winix/core/cur.h ../../../winix/core/request.h +templates.o: ../../../winix/core/error.h ../../../winix/core/config.h +templates.o: ../../../winix/core/htmlfilter.h +templates.o: ../../../winix/templates/htmltextstream.h +templates.o: ../../../pikotools/space/spacetojson.h +templates.o: ../../../winix/core/session.h ../../../winix/core/user.h +templates.o: ../../../winix/core/plugindata.h ../../../winix/core/rebus.h +templates.o: ../../../winix/core/ipban.h ../../../winix/core/mount.h +templates.o: ../../../winix/templates/locale.h ../../../winix/notify/notify.h +templates.o: ../../../winix/notify/notifypool.h +templates.o: ../../../winix/templates/patterns.h +templates.o: ../../../winix/notify/notifythread.h +templates.o: ../../../winix/core/basethread.h +templates.o: ../../../winix/notify/templatesnotify.h +templates.o: ../../../winix/core/users.h ../../../winix/core/ugcontainer.h +templates.o: ../../../winix/core/lastcontainer.h ../../../winix/core/mounts.h +templates.o: ../../../winix/core/mountparser.h ../../../winix/core/crypt.h +templates.o: ../../../winix/core/run.h ../../../winix/core/users.h +templates.o: ../../../winix/core/groups.h ../../../winix/core/group.h +templates.o: ../../../winix/core/loadavg.h ../../../winix/core/image.h +templates.o: ../../../winix/core/threadmanager.h +templates.o: ../../../winix/core/timezones.h ../../../winix/core/timezone.h +templates.o: ../../../winix/core/sessionmanager.h +templates.o: ../../../winix/core/htmlfilter.h ../../../winix/core/plugin.h +templates.o: ../../../winix/core/pluginmsg.h ../../../winix/core/system.h +templates.o: ../../../winix/core/sessionmanager.h +templates.o: ../../../winix/core/sessioncontainer.h +templates.o: ../../../winix/core/ipbancontainer.h +templates.o: ../../../winix/core/sessionidmanager.h +templates.o: ../../../tito/src/base64.h ../../../tito/src/aes.h +templates.o: ../../../winix/functions/functions.h +templates.o: ../../../winix/functions/functionbase.h +templates.o: ../../../winix/core/request.h ../../../winix/core/synchro.h +templates.o: ../../../winix/functions/functionparser.h +templates.o: ../../../winix/functions/account.h +templates.o: ../../../winix/functions/adduser.h +templates.o: ../../../winix/functions/cat.h ../../../winix/functions/chmod.h +templates.o: ../../../winix/functions/privchanger.h +templates.o: ../../../winix/functions/chown.h +templates.o: ../../../winix/functions/ckeditor.h +templates.o: ../../../winix/functions/cp.h ../../../winix/functions/default.h +templates.o: ../../../winix/functions/download.h +templates.o: ../../../winix/functions/emacs.h ../../../winix/functions/env.h +templates.o: ../../../winix/functions/imgcrop.h +templates.o: ../../../winix/functions/last.h ../../../winix/functions/login.h +templates.o: ../../../winix/functions/logout.h ../../../winix/functions/ln.h +templates.o: ../../../winix/functions/ls.h ../../../winix/functions/man.h +templates.o: ../../../winix/functions/meta.h ../../../winix/functions/mkdir.h +templates.o: ../../../winix/functions/mv.h ../../../winix/functions/nicedit.h +templates.o: ../../../winix/functions/node.h +templates.o: ../../../winix/functions/passwd.h +templates.o: ../../../winix/functions/priv.h ../../../winix/functions/pw.h +templates.o: ../../../winix/functions/reload.h ../../../winix/functions/rm.h +templates.o: ../../../winix/functions/rmuser.h +templates.o: ../../../winix/functions/sort.h +templates.o: ../../../winix/functions/specialdefault.h +templates.o: ../../../winix/functions/stat.h +templates.o: ../../../winix/functions/subject.h +templates.o: ../../../winix/functions/template.h +templates.o: ../../../winix/functions/tinymce.h +templates.o: ../../../winix/functions/uname.h +templates.o: ../../../winix/functions/upload.h +templates.o: ../../../winix/functions/uptime.h ../../../winix/functions/who.h +templates.o: ../../../winix/functions/vim.h ../../../winix/core/log.h +templates.o: ../../../winix/core/misc.h ../../../winix/templates/miscspace.h +templates.o: ../../../winix/templates/templates.h registermail_info.h diff --git a/plugins/mailregister/Makefile.o.dep b/plugins/mailregister/Makefile.o.dep index 6ad722a..35d4a76 100644 --- a/plugins/mailregister/Makefile.o.dep +++ b/plugins/mailregister/Makefile.o.dep @@ -1 +1 @@ -o = funregistermail.o init.o mdb.o +o = funregistermail.o funregistermail_showusers.o init.o mdb.o templates.o diff --git a/plugins/mailregister/funregistermail.cpp b/plugins/mailregister/funregistermail.cpp index 1aaa019..de9ec6f 100644 --- a/plugins/mailregister/funregistermail.cpp +++ b/plugins/mailregister/funregistermail.cpp @@ -46,10 +46,24 @@ namespace MailRegister FunRegisterMail::FunRegisterMail() { - fun.url = L"register_mail"; + fun.url = L"registermail"; + pmdb = 0; + pinfo = 0; } +void FunRegisterMail::SetMDb(MDb * pmdb_) +{ + pmdb = pmdb_; +} + +void FunRegisterMail::SetInfo(RegisterMailInfo * info) +{ + pinfo = info; +} + + + bool FunRegisterMail::HasAccess() { return true; @@ -65,6 +79,14 @@ void FunRegisterMail::MakePost() void FunRegisterMail::MakeGet() { + mail = cur->request->ParamValue(L"mail"); + TrimWhite(mail); + + if( ValidateEmail(mail) ) + { + log << log3 << "RM: registering e-mail address: " << mail << logend; + pmdb->AddMail(mail); + } } diff --git a/plugins/mailregister/funregistermail.h b/plugins/mailregister/funregistermail.h index bd96aa7..fd5caaa 100644 --- a/plugins/mailregister/funregistermail.h +++ b/plugins/mailregister/funregistermail.h @@ -37,7 +37,9 @@ #include "functions/functionbase.h" -#include "db/db.h" +#include "registermail_info.h" +#include "mdb.h" + namespace Winix @@ -54,6 +56,10 @@ public: FunRegisterMail(); + + void SetMDb(MDb * pmdb_); + void SetInfo(RegisterMailInfo * info); + bool HasAccess(); void MakePost(); @@ -62,6 +68,9 @@ public: private: + std::wstring mail; + MDb * pmdb; + RegisterMailInfo * pinfo; }; diff --git a/plugins/mailregister/funregistermail_showusers.cpp b/plugins/mailregister/funregistermail_showusers.cpp new file mode 100644 index 0000000..67d9b2b --- /dev/null +++ b/plugins/mailregister/funregistermail_showusers.cpp @@ -0,0 +1,95 @@ +/* + * This file is a part of Winix + * and is distributed under the 2-Clause BSD licence. + * Author: Tomasz Sowa + */ + +/* + * Copyright (c) 2016, Tomasz Sowa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "funregistermail_showusers.h" + +namespace Winix +{ + + + + +namespace MailRegister +{ + + +FunRegisterMailShowUsers::FunRegisterMailShowUsers() +{ + fun.url = L"registermailshowusers"; + pmdb = 0; + pinfo = 0; +} + + +void FunRegisterMailShowUsers::SetMDb(MDb * pmdb_) +{ + pmdb = pmdb_; +} + +void FunRegisterMailShowUsers::SetInfo(RegisterMailInfo * info) +{ + pinfo = info; +} + + + +bool FunRegisterMailShowUsers::HasAccess() +{ + return cur->session->puser; +} + + + +void FunRegisterMailShowUsers::MakePost() +{ + +} + + +void FunRegisterMailShowUsers::MakeGet() +{ + pmdb->GetUsers(pinfo->mail_list); + + +} + + + + + + +} // namespace + +} // namespace Winix + diff --git a/plugins/mailregister/funregistermail_showusers.h b/plugins/mailregister/funregistermail_showusers.h new file mode 100644 index 0000000..14cde3d --- /dev/null +++ b/plugins/mailregister/funregistermail_showusers.h @@ -0,0 +1,83 @@ +/* + * This file is a part of Winix + * and is distributed under the 2-Clause BSD licence. + * Author: Tomasz Sowa + */ + +/* + * Copyright (c) 2016, Tomasz Sowa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef headerfile_winix_plugins_mailregister_funregistermailshowusers +#define headerfile_winix_plugins_mailregister_funregistermailshowusers + + +#include "functions/functionbase.h" +#include "registermail_info.h" +#include "mdb.h" + + + +namespace Winix +{ + + +namespace MailRegister +{ + + +class FunRegisterMailShowUsers : public FunctionBase +{ +public: + + FunRegisterMailShowUsers(); + + + void SetMDb(MDb * pmdb_); + void SetInfo(RegisterMailInfo * info); + + bool HasAccess(); + + void MakePost(); + void MakeGet(); + + +private: + + MDb * pmdb; + RegisterMailInfo * pinfo; + +}; + + + +} // namespace + +} // namespace Winix + +#endif + diff --git a/plugins/mailregister/init.cpp b/plugins/mailregister/init.cpp index 4bcabdb..d3af12b 100644 --- a/plugins/mailregister/init.cpp +++ b/plugins/mailregister/init.cpp @@ -36,6 +36,9 @@ #include "core/log.h" #include "core/plugin.h" #include "mdb.h" +#include "funregistermail.h" +#include "registermail_info.h" +#include "funregistermail_showusers.h" namespace Winix @@ -54,12 +57,15 @@ namespace MailRegister const wchar_t plugin_name[] = L"mailregister"; MDb mdb; - +FunRegisterMail fun_rm; +FunRegisterMailShowUsers fun_rm_showusers; +RegisterMailInfo rm_info; void AddWinixFunctions(PluginInfo & info) { -// info.functions->Add(fun_export); + info.functions->Add(fun_rm); + info.functions->Add(fun_rm_showusers); } @@ -86,7 +92,13 @@ using namespace MailRegister; mdb.SetConn(info.db->GetConn()); mdb.LogQueries(info.config->log_db_query); -// plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions); + fun_rm.SetMDb(&mdb); + fun_rm.SetInfo(&rm_info); + + fun_rm_showusers.SetMDb(&mdb); + fun_rm_showusers.SetInfo(&rm_info); + + plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions); plugin.Assign(WINIX_CREATE_FUNCTIONS, AddWinixFunctions); plugin.Assign(WINIX_PLUGIN_INIT, InitPlugin); diff --git a/plugins/mailregister/mdb.cpp b/plugins/mailregister/mdb.cpp index 7ff9b7d..1d30e79 100644 --- a/plugins/mailregister/mdb.cpp +++ b/plugins/mailregister/mdb.cpp @@ -35,16 +35,75 @@ #include "mdb.h" #include "core/log.h" + namespace Winix { -namespace Export +namespace MailRegister { +bool MDb::AddMail(const std::wstring & mail) +{ + PGresult * r = 0; + Error status = WINIX_ERR_OK; + + try + { + query.Clear(); + query << R("insert into plugins.registermail (mail) values (") + << mail + << R(");"); + + r = AssertQuery(query); + AssertResult(r, PGRES_COMMAND_OK); + + //.id = AssertCurrval("core.user_id_seq"); + } + catch(const Error & e) + { + status = e; + } + + ClearResult(r); + +return status == WINIX_ERR_OK; +} +bool MDb::GetUsers(std::vector & container, bool clear_container) +{ + PGresult * r = 0; + Error result = WINIX_ERR_OK; + container.clear(); + + try + { + query.Clear(); + query << R("select * from plugins.registermail") + << R(";"); + + r = AssertQuery(query); + AssertResult(r, PGRES_TUPLES_OK); + + int rows = Rows(r); + + for(int i=0 ; i < rows ; ++i) + { + AssertValueWide(r, i, 0, mail); + container.push_back(mail); + } + } + catch(const Error & e) + { + result = e; + } + + ClearResult(r); + +return result == WINIX_ERR_OK; +} diff --git a/plugins/mailregister/mdb.h b/plugins/mailregister/mdb.h index 10eadda..0cfe901 100644 --- a/plugins/mailregister/mdb.h +++ b/plugins/mailregister/mdb.h @@ -35,6 +35,7 @@ #ifndef headerfile_winix_plugins_mailregister_mdb #define headerfile_winix_plugins_mailregister_mdb +#include #include #include "db/dbbase.h" #include "core/dirs.h" @@ -52,11 +53,15 @@ class MDb : public DbBase { public: + bool AddMail(const std::wstring & mail); + bool GetUsers(std::vector & container, bool clear_container = true); private: + DbTextStream query; + std::wstring mail; }; diff --git a/plugins/mailregister/registermail_info.h b/plugins/mailregister/registermail_info.h new file mode 100644 index 0000000..1aecb9d --- /dev/null +++ b/plugins/mailregister/registermail_info.h @@ -0,0 +1,56 @@ +/* + * This file is a part of Winix + * and is distributed under the 2-Clause BSD licence. + * Author: Tomasz Sowa + */ + +/* + * Copyright (c) 2016, Tomasz Sowa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef headerfile_winix_plugins_mailregister_registermail_info +#define headerfile_winix_plugins_mailregister_registermail_info + +#include +#include + + + +class RegisterMailInfo +{ +public: + + std::vector mail_list; + + + + + + +}; + +#endif diff --git a/plugins/mailregister/templates.cpp b/plugins/mailregister/templates.cpp new file mode 100644 index 0000000..cf53034 --- /dev/null +++ b/plugins/mailregister/templates.cpp @@ -0,0 +1,97 @@ +/* + * This file is a part of Winix + * and is distributed under the 2-Clause BSD licence. + * Author: Tomasz Sowa + */ + +/* + * Copyright (c) 2016, Tomasz Sowa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "templates/templates.h" +#include "core/plugin.h" +#include "core/item.h" +#include "core/log.h" +#include "core/misc.h" +#include "cache.h" +#include "templates/miscspace.h" +#include "registermail_info.h" + + +namespace Winix +{ +namespace MailRegister +{ +using TemplatesFunctions::Info; +using TemplatesFunctions::EzcFun; +using TemplatesFunctions::R; + + +extern RegisterMailInfo rm_info; +static size_t mails_tab_index = 0; + + +void registermail_mails_tab(Info & i) +{ + mails_tab_index = i.iter; + i.res = mails_tab_index < rm_info.mail_list.size(); +} + + +void registermail_mails_tab_index(Info & i) +{ + i.out << (mails_tab_index + 1); +} + + +void registermail_mails_tab_mail(Info & i) +{ + if( mails_tab_index < rm_info.mail_list.size() ) + i.out << rm_info.mail_list[mails_tab_index]; +} + + + +void AddEzcFunctions(PluginInfo & info) +{ + using TemplatesFunctions::EzcFun; + EzcFun * fun = reinterpret_cast(info.p1); + + fun->Insert("registermail_mails_tab", registermail_mails_tab); + fun->Insert("registermail_mails_tab_index", registermail_mails_tab_index); + fun->Insert("registermail_mails_tab_mail", registermail_mails_tab_mail); +} + + +} // namespace + + + +} // namespace Winix + + +