added: function adduser

changed: errors (removed enum, there are macros now)
added: error messages to locales (winix_err_NN)
removed: templates: err_abuse.html err_others.html


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@593 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-02-28 00:08:10 +00:00
parent 3702efc5be
commit 71a63cc70e
160 changed files with 912 additions and 607 deletions

View File

@@ -1,8 +1,8 @@
/*
* This file is a part of CMSLU -- Content Management System like Unix
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
@@ -13,84 +13,61 @@
#include <iostream>
#include "log.h"
#define WINIX_ERR_OK 0
//#define WINIX_ERR_INCORRECT_PATH 1
//#define WINIX_ERR_NO_POSTVAR 2
#define WINIX_ERR_INCORRECT_DIR 3
#define WINIX_ERR_CANT_CHANGE_USER 4
#define WINIX_ERR_CANT_CHANGE_GROUP 5
#define WINIX_ERR_CANT_CHANGE_PRIVILEGES 6
#define WINIX_ERR_PERMISSION_DENIED 7
#define WINIX_ERR_NO_ROOT_DIR 8
#define WINIX_ERR_NO_FUNCTION 9
#define WINIX_ERR_NO_ITEM 10
#define WINIX_ERR_UNKNOWN_PARAM 11
#define WINIX_ERR_MOUNT_UNKNOWN 12
#define WINIX_ERR_UNKNOWN_FILESYSTEM 13
#define WINIX_ERR_NO_MOUNTPOINT 14
//#define WINIX_ERR_MOUNT_NO_PARAM 15
#define WINIX_ERR_NO_THREAD 16
#define WINIX_ERR_EMPTY 17
#define WINIX_ERR_SPAM 18
#define WINIX_ERR_INCORRECT_REBUS 19
class Error
{
#define WINIX_ERR_NO_BOUNDARY 20
#define WINIX_ERR_BROKEN_INPUT 21
#define WINIX_ERR_INPUT_TOO_LARGE 22
#define WINIX_ERR_CANT_CREATE_FILE 23
public:
#define WINIX_ERR_NO_TICKET 24
enum Code
{
ok = 0,
incorrect_path,
db_fatal_error_during_connecting,
db_incorrect_query,
db_incorrent_result_status,
db_no_column,
db_incorrect_login,
db_more_than_one_login,
db_err_currval,
no_postvar,
incorrect_dir,
cant_change_user,
cant_change_group,
cant_change_privileges,
permission_denied,
no_root_dir,
no_function,
no_item,
unknown_param,
mount_unknown,
unknown_filesystem,
no_mountpoint,
mount_no_param,
no_thread,
empty,
spam,
incorrect_rebus,
no_boundary,
broken_input,
input_too_large,
cant_create_file,
no_ticket,
unknown = 1000
};
Error();
Error(Code c);
Error(int i);
Error(const Error & e);
Error & operator=(Code c);
Error & operator=(const Error & e);
operator int() const;
bool operator==(Code c) const;
bool operator!=(Code c) const;
bool operator==(const Error & e) const;
bool operator!=(const Error & e) const;
friend std::ostream & operator<<(std::ostream & out, const Error & e);
friend Log & operator<<(Log & out, const Error & e);
#define WINIX_ERR_PASSWORDS_DIFFERENT 25
#define WINIX_ERR_PASSWORD_TOO_SHORT 26
#define WINIX_ERR_USER_EXISTS 27
#define WINIX_ERR_LOGIN_EMPTY 28
private:
#define WINIX_ERR_DB_FATAL_ERROR_DURING_CONNECTING 100
#define WINIX_ERR_DB_INCORRECT_QUERY 101
#define WINIX_ERR_DB_INCORRENT_RESULT_STATUS 102
#define WINIX_ERR_DB_NO_COLUMN 103
#define WINIX_ERR_DB_INCORRECT_LOGIN 104
#define WINIX_ERR_DB_MORE_THAN_ONE_LOGIN 105
#define WINIX_ERR_DB_ERR_CURRVAL 106
Code code;
};
//#define WINIX_ERR_UNKNOWN 1000
typedef int Error;