- updated to the new pikotools api (child spaces were removed)

some plugins need to be fixed yet: ticket, gallery, group, menu
- added current user to default models as "user"
- renamed in User: super_user -> is_super_user, env -> admin_env, pass_hash_salted -> is_pass_hash_salted
- now Users class has a WinixModel as a base class
  some plugin calls have to be fixed yet
- added UserWrapper model with a pointer to User class
- removed from ItemContent: methods for accessing 'meta' and 'admin_meta', now ezc can iterate through Space classes
- fixed in env winix function: if there is "changeuser" parameter then we should only switch the user (not save anything)
This commit is contained in:
2021-06-27 23:31:50 +02:00
parent 472490c239
commit 1d18b7fa12
59 changed files with 1419 additions and 1607 deletions

View File

@@ -41,6 +41,7 @@
#include "space/space.h"
#include "date/date.h"
#include "templates/misc.h"
#include "winixmodel.h"
namespace Winix
@@ -86,13 +87,13 @@ namespace Winix
(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)
*/
class User : public morm::Model
class User : public WinixModel
{
public:
long id;
std::wstring name;
bool super_user;
std::wstring login;
bool is_super_user;
bool has_pass; // true if the user has a password set
@@ -100,7 +101,7 @@ public:
int pass_type; // the kind of hash (WINIX_CRYPT_HASH_* see crypt.h)
std::wstring password; // password hashed or plain text if pass_type==0
std::string pass_encrypted; // password encrypted
bool pass_hash_salted; // true when the hash was salted (plain text passwords are never salted)
bool is_pass_hash_salted; // true when the hash was salted (plain text passwords are never salted)
std::wstring email;
@@ -113,7 +114,7 @@ public:
// environment variables set only by an administrator
// an administrator can use 'env' winix function with 'a' parameter
// IMPROVEME rename me to something better (env_admin?)
pt::Space aenv;
pt::Space admin_env;
// account status
// WINIX_ACCOUNT_*
@@ -149,11 +150,21 @@ public:
void display_name(EzcEnv & env);
bool is_env_object();
bool is_admin_env_object();
private:
bool do_migration_to_1();
bool do_migration_to_2();
void id_is(EzcEnv & env); // takes one argument as a user id
bool is_guest();
MORM_MEMBER_FIELD(User)
};