fixed: winix incorrectly used config options: upload_dirs_chmod and upload_files_chmod
added: to config: upload_group
a group name for newly uploaded files (and created necessary directories in the file system)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@961 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
1 parent
f064ff6b3d
commit
e3284dcfbc
10 files changed
+123
-23
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
winix.src.files = ./templates/htmltextstream.cpp ./templates/textextstream.h ./templates/adduser.cpp ./templates/ipban.cpp ./templates/misc.cpp ./templates/indexpatterns.h ./templates/item.cpp ./templates/templates.cpp ./templates/winix.cpp ./templates/locale.h ./templates/slog.cpp ./templates/localefilter.cpp ./templates/config.cpp ./templates/patterns.h ./templates/changepatterns.h ./templates/stat.cpp ./templates/template.cpp ./templates/miscspace.h ./templates/sys.cpp ./templates/user.cpp ./templates/textextstream.cpp ./templates/upload.cpp ./templates/env.cpp ./templates/indexpatterns.cpp ./templates/patterncacher.h ./templates/htmltextstream.h ./templates/who.cpp ./templates/locale.cpp ./templates/misc.h ./templates/patterns.cpp ./templates/passwd.cpp ./templates/mount.cpp ./templates/last.cpp ./templates/templates.h ./templates/uptime.cpp ./templates/insert.cpp ./templates/doc.cpp ./templates/changepatterns.cpp ./templates/miscspace.cpp ./templates/filters.cpp ./templates/login.cpp ./templates/localefilter.h ./templates/man.cpp ./templates/dir.cpp ./templates/ls.cpp ./templates/rebus.cpp ./templates/priv.cpp ./templates/patterncacher.cpp ./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/stats/statssession.h ./plugins/stats/bot.h ./plugins/gallery/gallery.cpp ./plugins/gallery/galleryinfo.h ./plugins/gallery/init.cpp ./plugins/gallery/gallery.h ./plugins/gallery/galleryinfo.cpp ./plugins/gallery/templates.cpp ./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/export/init.cpp ./plugins/export/export.h ./plugins/ticket/sessiondata.h ./plugins/ticket/ticket.h ./plugins/ticket/editticket.cpp ./plugins/ticket/funticket.cpp ./plugins/ticket/editticket.h ./plugins/ticket/templates.cpp ./plugins/ticket/ticketinfo.cpp ./plugins/ticket/funticket.h ./plugins/ticket/init.cpp ./plugins/ticket/ticketinfo.h ./plugins/ticket/createticket.cpp ./plugins/ticket/showtickets.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/menu/cache.cpp ./plugins/menu/init.cpp ./plugins/menu/cache.h ./plugins/menu/templates.cpp ./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/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/group/groupinfo.h ./plugins/group/templates.cpp ./plugins/group/groups.cpp ./plugins/group/init.cpp ./plugins/group/groups.h ./plugins/group/groupinfo.cpp ./main/main.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 ./db/dbconn.cpp ./db/db.cpp ./db/dbbase.h ./db/dbitemcolumns.cpp ./core/users.h ./core/threadmanager.h ./core/slog.h ./core/pluginmsg.h ./core/config.h ./core/httpsimpleparser.h ./core/loadavg.cpp ./core/mountparser.cpp ./core/htmlfilter.h ./core/groups.cpp ./core/dircontainer.cpp ./core/timezones.h ./core/postmultiparser.h ./core/image.cpp ./core/requesttypes.h ./core/ugcontainer.h ./core/logmanipulators.h ./core/rebus.h ./core/synchro.cpp ./core/log.h ./core/session.h ./core/misc.cpp ./core/lock.h ./core/item.cpp ./core/cur.h ./core/dirs.cpp ./core/threadmanager.cpp ./core/slog.cpp ./core/httpsimpleparser.cpp ./core/postparser.h ./core/run.h ./core/htmlfilter.cpp ./core/lastcontainer.h ./core/rebus.cpp ./core/loadavg.h ./core/sessionmanager.h ./core/mountparser.h ./core/groups.h ./core/app.h ./core/dircontainer.h ./core/lock.cpp ./core/synchro.h ./core/compress.cpp ./core/plugindata.h ./core/misc.h ./core/crypt.cpp ./core/group.h ./core/run.cpp ./core/sessionparser.h ./core/lastcontainer.cpp ./core/dirs.h ./core/mount.h ./core/acceptbaseparser.cpp ./core/sessionmanager.cpp ./core/job.h ./core/app.cpp ./core/user.h ./core/mounts.cpp ./core/plugindata.cpp ./core/system.h ./core/version.h ./core/sessioncontainer.h ./core/cookieparser.h ./core/bbcodeparser.cpp ./core/request.h ./core/ipban.h ./core/timezone.h ./core/compress.h ./core/sessionparser.cpp ./core/users.cpp ./core/ipbancontainer.h ./core/mount.cpp ./core/plugin.h ./core/config.cpp ./c
Line truncated
|
||||
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/basethread.cpp ./core/item.h ./core/slog.h ./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/threadmanager.cpp ./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/app.h ./core/image.h ./core/plugindata.cpp ./core/request.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/s
Line truncated
|
||||
+4
-1
@@ -132,6 +132,7 @@ void Config::AssignValues(bool stdout_is_closed)
|
||||
NoLastSlash(upload_dir);
|
||||
NoLastSlash(common_dir);
|
||||
|
||||
upload_group = AText(L"upload_group");
|
||||
upload_dirs_chmod = Int(L"upload_dirs_chmod", 0750);
|
||||
upload_files_chmod = Int(L"upload_files_chmod", 0640);
|
||||
ListText(L"static_dirs", static_dirs);
|
||||
@@ -239,7 +240,7 @@ void Config::AssignValues(bool stdout_is_closed)
|
||||
pattern_cacher_how_many_delete = Size(L"pattern_cacher_how_many_delete", 30);
|
||||
|
||||
content_type_header = Int(L"content_type_header", 0);
|
||||
umask = Int(L"umask", 0222);
|
||||
umask = Int(L"umask", 0222);
|
||||
|
||||
ezc_max_elements = Size(L"ezc_max_elements", 50000);
|
||||
ezc_max_loop_elements = Size(L"ezc_max_loop_elements", 5000);
|
||||
@@ -294,6 +295,8 @@ void Config::SetAdditionalVariables()
|
||||
|
||||
if( locale_files.empty() )
|
||||
locale_files.push_back(L"en");
|
||||
|
||||
upload_group_int = GetGroupId(upload_group);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -268,6 +268,14 @@ public:
|
||||
// default: empty
|
||||
std::wstring common_dir;
|
||||
|
||||
// system group's name for new uploaded files (created directories in the file system)
|
||||
// it can be empty (it is not used then)
|
||||
std::string upload_group;
|
||||
|
||||
// this value will be set based on upload_group
|
||||
// will be -1 if upload_group is empty or if it is invalid
|
||||
int upload_group_int;
|
||||
|
||||
// chmod of newly created directories (under upload_dir)
|
||||
// default: 0750
|
||||
int upload_dirs_chmod;
|
||||
|
||||
+7
-1
@@ -514,10 +514,16 @@ void Image::SaveImage()
|
||||
item_work.type == WINIX_IMAGE_TYPE_CROP_THUMB ||
|
||||
item_work.type == WINIX_IMAGE_TYPE_CREATE_CROP_NEW_THUMB );
|
||||
|
||||
if( system->MakeFilePath(file_work, dst_path, thumb, true, config->upload_dirs_chmod) )
|
||||
if( system->MakeFilePath(file_work, dst_path, thumb, true, config->upload_dirs_chmod, config->upload_group_int) )
|
||||
{
|
||||
if( RenameFile(stream_tmp_path.Str(), dst_path) )
|
||||
{
|
||||
// it doesn't matter for us if there is an error when chmod/chown on a file
|
||||
// the admin (root) will correct it
|
||||
std::string dst_patha; // IMPROVE ME temporary -- in the futere there'll be SetPriv() with std::wstring
|
||||
PT::WideToUTF8(dst_path, dst_patha);
|
||||
SetPriv(dst_patha, config->upload_files_chmod, config->upload_group_int);
|
||||
|
||||
ImageSavedCorrectly();
|
||||
}
|
||||
else
|
||||
|
||||
+77
-8
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <grp.h>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include "misc.h"
|
||||
@@ -780,7 +781,10 @@ bool IsFile(const std::wstring & file)
|
||||
}
|
||||
|
||||
|
||||
bool CreateDir(const wchar_t * dir, int priv)
|
||||
/*
|
||||
* group can be -1 (it is not used then)
|
||||
*/
|
||||
bool CreateDir(const wchar_t * dir, int priv, int group)
|
||||
{
|
||||
static std::string adir;
|
||||
|
||||
@@ -788,27 +792,29 @@ static std::string adir;
|
||||
{
|
||||
PT::WideToUTF8(dir, adir);
|
||||
|
||||
if( mkdir(adir.c_str(), priv) < 0 )
|
||||
if( mkdir(adir.c_str(), 0777) < 0 )
|
||||
{
|
||||
log << log1 << "Can't create a directory on fs: " << adir << logend;
|
||||
return false;
|
||||
}
|
||||
|
||||
return SetPriv(adir, priv, group);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CreateDir(const std::wstring & dir, int priv)
|
||||
bool CreateDir(const std::wstring & dir, int priv, int group)
|
||||
{
|
||||
return CreateDir(dir.c_str(), priv);
|
||||
return CreateDir(dir.c_str(), priv, group);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// creating directories (can be more than one)
|
||||
// 'dirs' can begin with a slash (will be skipped)
|
||||
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv, bool skip_last)
|
||||
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv, int group, bool skip_last)
|
||||
{
|
||||
static std::wstring temp;
|
||||
const wchar_t * p = dirs;
|
||||
@@ -834,7 +840,7 @@ const wchar_t * p = dirs;
|
||||
temp += *p;
|
||||
|
||||
if( !skip_last || *p!=0 )
|
||||
if( !CreateDir(temp.c_str(), priv) )
|
||||
if( !CreateDir(temp.c_str(), priv, group) )
|
||||
return false;
|
||||
|
||||
temp += '/';
|
||||
@@ -845,9 +851,72 @@ return true;
|
||||
|
||||
|
||||
|
||||
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv, bool skip_last)
|
||||
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv, int group, bool skip_last)
|
||||
{
|
||||
return CreateDirs(base_dir.c_str(), dirs.c_str(), priv, skip_last);
|
||||
return CreateDirs(base_dir.c_str(), dirs.c_str(), priv, group, skip_last);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int GetGroupId(const char * name)
|
||||
{
|
||||
struct group gr;
|
||||
struct group * result;
|
||||
char buffer[512];
|
||||
|
||||
if( getgrnam_r(name, &gr, buffer, sizeof(buffer)/sizeof(char), &result) != 0 )
|
||||
{
|
||||
log << log1 << "I cannot get the group_id for group name: " << name << logend;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* there is no such a group in /etc/group
|
||||
*/
|
||||
if( result == 0 )
|
||||
{
|
||||
log << log1 << "There is no a group with name: " << name << logend;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return gr.gr_gid;
|
||||
}
|
||||
|
||||
|
||||
int GetGroupId(const std::string & name)
|
||||
{
|
||||
return GetGroupId(name.c_str());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* setting priveleges and a group id on a file or on a directory
|
||||
* group can be -1 (it is not used then)
|
||||
*/
|
||||
bool SetPriv(const char * name, int priv, int group)
|
||||
{
|
||||
if( chmod(name, priv) < 0 )
|
||||
{
|
||||
log << log1 << "Can't set proper fs privileges on: " << name << logend;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( group != -1 )
|
||||
{
|
||||
if( chown(name, geteuid(), group) < 0 )
|
||||
{
|
||||
log << log1 << "Can't set proper fs group on: " << name << logend;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool SetPriv(const std::string & name, int priv, int group)
|
||||
{
|
||||
return SetPriv(name.c_str(), priv, group);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
-4
@@ -723,13 +723,19 @@ bool ValidateEmail(const std::wstring & email);
|
||||
|
||||
bool IsFile(const wchar_t * file);
|
||||
bool IsFile(const std::wstring & file);
|
||||
bool CreateDir(const wchar_t * dir, int priv);
|
||||
bool CreateDir(const std::wstring & dir, int priv);
|
||||
bool CreateDir(const wchar_t * dir, int priv, int group = -1);
|
||||
bool CreateDir(const std::wstring & dir, int priv, int group = -1);
|
||||
|
||||
// creating directories (dirs) under base_dir (base_dir must exist)
|
||||
// if skip_last == true then last part from dir is treated as a file (the last directory is not created)
|
||||
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv = 0755, bool skip_last = false);
|
||||
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv = 0755, bool skip_last = false);
|
||||
bool CreateDirs(const wchar_t * base_dir, const wchar_t * dirs, int priv = 0755, int group = -1, bool skip_last = false);
|
||||
bool CreateDirs(const std::wstring & base_dir, const std::wstring & dirs, int priv = 0755, int group = -1, bool skip_last = false);
|
||||
|
||||
int GetGroupId(const char * name);
|
||||
int GetGroupId(const std::string & name);
|
||||
|
||||
bool SetPriv(const char * name, int priv, int group = -1);
|
||||
bool SetPriv(const std::string & name, int priv, int group = -1);
|
||||
|
||||
bool CopyFile(FILE * in, FILE * out);
|
||||
bool CopyFile(const wchar_t * src, const wchar_t * dst);
|
||||
|
||||
+2
-2
@@ -852,7 +852,7 @@ return res;
|
||||
|
||||
// making a global file path (in the unix file system)
|
||||
// you should call CreateNewFile before
|
||||
bool System::MakeFilePath(const Item & item, std::wstring & path, bool thumb, bool create_dir, int chmod)
|
||||
bool System::MakeFilePath(const Item & item, std::wstring & path, bool thumb, bool create_dir, int chmod, int group)
|
||||
{
|
||||
path.clear();
|
||||
|
||||
@@ -882,7 +882,7 @@ bool System::MakeFilePath(const Item & item, std::wstring & path, bool thumb, bo
|
||||
path += L"/normal";
|
||||
|
||||
|
||||
if( create_dir && !CreateDirs(path, item.file_path, chmod, true) )
|
||||
if( create_dir && !CreateDirs(path, item.file_path, chmod, group, true) )
|
||||
return false;
|
||||
|
||||
path += '/';
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ public:
|
||||
|
||||
// creating item.file_path and item.file_fs (the mountpoint where the item is located)
|
||||
bool CreateNewFile(Item & item);
|
||||
bool MakeFilePath(const Item & item, std::wstring & path, bool thumb = false, bool create_dir = false, int chmod = 0755);
|
||||
bool MakeFilePath(const Item & item, std::wstring & path, bool thumb = false, bool create_dir = false, int chmod = 0755, int group = -1);
|
||||
|
||||
bool MakePath(const Item & item, std::wstring & path, bool clear_path = true);
|
||||
|
||||
|
||||
+10
-2
@@ -76,7 +76,7 @@ return true;
|
||||
|
||||
bool Upload::UploadSaveStaticFile(const Item & item, const std::wstring & tmp_filename)
|
||||
{
|
||||
if( !system->MakeFilePath(item, path, false, true, config->upload_dirs_chmod) )
|
||||
if( !system->MakeFilePath(item, path, false, true, config->upload_dirs_chmod, config->upload_group_int) )
|
||||
{
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
@@ -84,7 +84,15 @@ bool Upload::UploadSaveStaticFile(const Item & item, const std::wstring & tmp_fi
|
||||
|
||||
if( RenameFile(tmp_filename, path) )
|
||||
{
|
||||
log << log1 << "Upload: uploaded a new file: " << path << logend;
|
||||
PT::WideToUTF8(path, patha);
|
||||
|
||||
if( !SetPriv(patha, config->upload_files_chmod, config->upload_group_int) )
|
||||
{
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
|
||||
log << log2 << "Upload: uploaded a new file: " << path << logend;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<h1>{subject_header}</h1>
|
||||
|
||||
|
||||
<form id="additem" method="post" action="[doc_base_url][dir][if-one item_is][item_url]/[end]subject">
|
||||
<form method="post" action="[doc_base_url][dir][if-one item_is][item_url]/[end]subject">
|
||||
|
||||
<div class="winix_input_a">
|
||||
<label>{title}</label>
|
||||
<input type="text" name="subject" value="[if-one item_is][item_subject][else][dir_last_subject][end]">
|
||||
<label for="winix_title_id">{title}</label>
|
||||
<input id="winix_title_id" type="text" name="subject" value="[if-one item_is][item_subject][else][dir_last_subject][end]">
|
||||
</div>
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
|
||||
Reference in new issue
Block a user