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
This commit is contained in:
2012-02-28 21:09:44 +00:00
parent 9208b15167
commit 0e9f587591
45 changed files with 1489 additions and 946 deletions

View File

@@ -15,6 +15,41 @@
#include "confparser/space.h"
#define WINIX_ACCOUNT_MAX_LOGIN_SIZE 250
#define WINIX_ACCOUNT_MAX_PASSWORD_SIZE 250
#define WINIX_ACCOUNT_MAX_EMAIL_SIZE 250
// account status
// 1 - a user has created its account -- an email was sent back to him
#define WINIX_ACCOUNT_NOT_ACTIVATED 1
// 2 - a user clicked on the link in the mail and now can normally use his account
#define WINIX_ACCOUNT_READY 2
// 3 - account was suspended
#define WINIX_ACCOUNT_SUSPENDED 3
// 4 - account was banned
#define WINIX_ACCOUNT_BLOCKED 4
/*
a user can login only to an account which status is equal to WINIX_ACCOUNT_READY
actually there is no difference between WINIX_ACCOUNT_SUSPENDED and WINIX_ACCOUNT_BANNED
only a different message will be present on the website
you can use other values of status in your plugins - this not have any impact on winix
the default 'login' winix function only allowes to login a user who has WINIX_ACCOUNT_READY value
but you can provide your own 'login' function which can work in a different way
winix knows that user is login when cur->session->puser pointer is set
(when the pointer is not null then winix do not check what the value of 'status' is --
the status is only tested in 'login' function)
*/
/*
a temporary struct used for hashing and encrypting a user's password
@@ -51,6 +86,12 @@ struct User
// an administrator can use 'env' winix function with 'a' parameter
PT::Space aenv;
// account status
// WINIX_ACCOUNT_*
// a user can normally login only when status is WINIX_ACCOUNT_READY
int status;
User()
@@ -70,6 +111,7 @@ struct User
time_zone_offset = 0;
env.Clear();
aenv.Clear();
status = WINIX_ACCOUNT_BLOCKED;
}