]> git.mxchange.org Git - friendica.git/commitdiff
Fixed wrong reference to user.expire in Model\User::getActorName
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 12 Nov 2022 14:58:03 +0000 (09:58 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 14 Nov 2022 22:02:41 +0000 (17:02 -0500)
- Update field documentation to prevent further confusion

database.sql
doc/database/db_user.md
src/Model/User.php
static/dbstructure.config.php

index 71a5f0ae5fe9c9d77ad7ca78bdc7d2e0467c9101..f471aec907a4d04136bc46dfbd8a8259f23a0c8e 100644 (file)
@@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS `user` (
        `pwdreset` varchar(255) COMMENT 'Password reset request token',
        `pwdreset_time` datetime COMMENT 'Timestamp of the last password reset request',
        `maxreq` int unsigned NOT NULL DEFAULT 10 COMMENT '',
-       `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
+       `expire` int unsigned NOT NULL DEFAULT 0 COMMENT 'Delay in days before deleting user-related posts. Scope is controlled by pConfig.',
        `account_removed` boolean NOT NULL DEFAULT '0' COMMENT 'if 1 the account is removed',
        `account_expired` boolean NOT NULL DEFAULT '0' COMMENT '',
        `account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp when account expires and will be deleted',
index 611fb76b05f4f52c32cc3c14d8d354fe95646772..85fe895e98502454f67126590b863214a0fea58e 100644 (file)
@@ -6,53 +6,53 @@ The local users
 Fields
 ------
 
-| Field                    | Description                                               | Type               | Null | Key | Default             | Extra          |
-| ------------------------ | --------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
-| uid                      | sequential ID                                             | mediumint unsigned | NO   | PRI | NULL                | auto_increment |
-| parent-uid               | The parent user that has full control about this user     | mediumint unsigned | YES  |     | NULL                |                |
-| guid                     | A unique identifier for this user                         | varchar(64)        | NO   |     |                     |                |
-| username                 | Name that this user is known by                           | varchar(255)       | NO   |     |                     |                |
-| password                 | encrypted password                                        | varchar(255)       | NO   |     |                     |                |
-| legacy_password          | Is the password hash double-hashed?                       | boolean            | NO   |     | 0                   |                |
-| nickname                 | nick- and user name                                       | varchar(255)       | NO   |     |                     |                |
-| email                    | the users email address                                   | varchar(255)       | NO   |     |                     |                |
-| openid                   |                                                           | varchar(255)       | NO   |     |                     |                |
-| timezone                 | PHP-legal timezone                                        | varchar(128)       | NO   |     |                     |                |
-| language                 | default language                                          | varchar(32)        | NO   |     | en                  |                |
-| register_date            | timestamp of registration                                 | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
-| login_date               | timestamp of last login                                   | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
-| default-location         | Default for item.location                                 | varchar(255)       | NO   |     |                     |                |
-| allow_location           | 1 allows to display the location                          | boolean            | NO   |     | 0                   |                |
-| theme                    | user theme preference                                     | varchar(255)       | NO   |     |                     |                |
-| pubkey                   | RSA public key 4096 bit                                   | text               | YES  |     | NULL                |                |
-| prvkey                   | RSA private key 4096 bit                                  | text               | YES  |     | NULL                |                |
-| spubkey                  |                                                           | text               | YES  |     | NULL                |                |
-| sprvkey                  |                                                           | text               | YES  |     | NULL                |                |
-| verified                 | user is verified through email                            | boolean            | NO   |     | 0                   |                |
-| blocked                  | 1 for user is blocked                                     | boolean            | NO   |     | 0                   |                |
-| blockwall                | Prohibit contacts to post to the profile page of the user | boolean            | NO   |     | 0                   |                |
-| hidewall                 | Hide profile details from unkown viewers                  | boolean            | NO   |     | 0                   |                |
-| blocktags                | Prohibit contacts to tag the post of this user            | boolean            | NO   |     | 0                   |                |
-| unkmail                  | Permit unknown people to send private mails to this user  | boolean            | NO   |     | 0                   |                |
-| cntunkmail               |                                                           | int unsigned       | NO   |     | 10                  |                |
-| notify-flags             | email notification options                                | smallint unsigned  | NO   |     | 65535               |                |
-| page-flags               | page/profile type                                         | tinyint unsigned   | NO   |     | 0                   |                |
-| account-type             |                                                           | tinyint unsigned   | NO   |     | 0                   |                |
-| prvnets                  |                                                           | boolean            | NO   |     | 0                   |                |
-| pwdreset                 | Password reset request token                              | varchar(255)       | YES  |     | NULL                |                |
-| pwdreset_time            | Timestamp of the last password reset request              | datetime           | YES  |     | NULL                |                |
-| maxreq                   |                                                           | int unsigned       | NO   |     | 10                  |                |
-| expire                   |                                                           | int unsigned       | NO   |     | 0                   |                |
-| account_removed          | if 1 the account is removed                               | boolean            | NO   |     | 0                   |                |
-| account_expired          |                                                           | boolean            | NO   |     | 0                   |                |
-| account_expires_on       | timestamp when account expires and will be deleted        | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
-| expire_notification_sent | timestamp of last warning of account expiration           | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
-| def_gid                  |                                                           | int unsigned       | NO   |     | 0                   |                |
-| allow_cid                | default permission for this user                          | mediumtext         | YES  |     | NULL                |                |
-| allow_gid                | default permission for this user                          | mediumtext         | YES  |     | NULL                |                |
-| deny_cid                 | default permission for this user                          | mediumtext         | YES  |     | NULL                |                |
-| deny_gid                 | default permission for this user                          | mediumtext         | YES  |     | NULL                |                |
-| openidserver             |                                                           | text               | YES  |     | NULL                |                |
+| Field                    | Description                                                                       | Type               | Null | Key | Default             | Extra          |
+| ------------------------ | --------------------------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
+| uid                      | sequential ID                                                                     | mediumint unsigned | NO   | PRI | NULL                | auto_increment |
+| parent-uid               | The parent user that has full control about this user                             | mediumint unsigned | YES  |     | NULL                |                |
+| guid                     | A unique identifier for this user                                                 | varchar(64)        | NO   |     |                     |                |
+| username                 | Name that this user is known by                                                   | varchar(255)       | NO   |     |                     |                |
+| password                 | encrypted password                                                                | varchar(255)       | NO   |     |                     |                |
+| legacy_password          | Is the password hash double-hashed?                                               | boolean            | NO   |     | 0                   |                |
+| nickname                 | nick- and user name                                                               | varchar(255)       | NO   |     |                     |                |
+| email                    | the users email address                                                           | varchar(255)       | NO   |     |                     |                |
+| openid                   |                                                                                   | varchar(255)       | NO   |     |                     |                |
+| timezone                 | PHP-legal timezone                                                                | varchar(128)       | NO   |     |                     |                |
+| language                 | default language                                                                  | varchar(32)        | NO   |     | en                  |                |
+| register_date            | timestamp of registration                                                         | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
+| login_date               | timestamp of last login                                                           | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
+| default-location         | Default for item.location                                                         | varchar(255)       | NO   |     |                     |                |
+| allow_location           | 1 allows to display the location                                                  | boolean            | NO   |     | 0                   |                |
+| theme                    | user theme preference                                                             | varchar(255)       | NO   |     |                     |                |
+| pubkey                   | RSA public key 4096 bit                                                           | text               | YES  |     | NULL                |                |
+| prvkey                   | RSA private key 4096 bit                                                          | text               | YES  |     | NULL                |                |
+| spubkey                  |                                                                                   | text               | YES  |     | NULL                |                |
+| sprvkey                  |                                                                                   | text               | YES  |     | NULL                |                |
+| verified                 | user is verified through email                                                    | boolean            | NO   |     | 0                   |                |
+| blocked                  | 1 for user is blocked                                                             | boolean            | NO   |     | 0                   |                |
+| blockwall                | Prohibit contacts to post to the profile page of the user                         | boolean            | NO   |     | 0                   |                |
+| hidewall                 | Hide profile details from unkown viewers                                          | boolean            | NO   |     | 0                   |                |
+| blocktags                | Prohibit contacts to tag the post of this user                                    | boolean            | NO   |     | 0                   |                |
+| unkmail                  | Permit unknown people to send private mails to this user                          | boolean            | NO   |     | 0                   |                |
+| cntunkmail               |                                                                                   | int unsigned       | NO   |     | 10                  |                |
+| notify-flags             | email notification options                                                        | smallint unsigned  | NO   |     | 65535               |                |
+| page-flags               | page/profile type                                                                 | tinyint unsigned   | NO   |     | 0                   |                |
+| account-type             |                                                                                   | tinyint unsigned   | NO   |     | 0                   |                |
+| prvnets                  |                                                                                   | boolean            | NO   |     | 0                   |                |
+| pwdreset                 | Password reset request token                                                      | varchar(255)       | YES  |     | NULL                |                |
+| pwdreset_time            | Timestamp of the last password reset request                                      | datetime           | YES  |     | NULL                |                |
+| maxreq                   |                                                                                   | int unsigned       | NO   |     | 10                  |                |
+| expire                   | Delay in days before deleting user-related posts. Scope is controlled by pConfig. | int unsigned       | NO   |     | 0                   |                |
+| account_removed          | if 1 the account is removed                                                       | boolean            | NO   |     | 0                   |                |
+| account_expired          |                                                                                   | boolean            | NO   |     | 0                   |                |
+| account_expires_on       | timestamp when account expires and will be deleted                                | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
+| expire_notification_sent | timestamp of last warning of account expiration                                   | datetime           | NO   |     | 0001-01-01 00:00:00 |                |
+| def_gid                  |                                                                                   | int unsigned       | NO   |     | 0                   |                |
+| allow_cid                | default permission for this user                                                  | mediumtext         | YES  |     | NULL                |                |
+| allow_gid                | default permission for this user                                                  | mediumtext         | YES  |     | NULL                |                |
+| deny_cid                 | default permission for this user                                                  | mediumtext         | YES  |     | NULL                |                |
+| deny_gid                 | default permission for this user                                                  | mediumtext         | YES  |     | NULL                |                |
+| openidserver             |                                                                                   | text               | YES  |     | NULL                |                |
 
 Indexes
 ------------
index 3f5376e0b85684de6232c68ba18ca9972068dccf..cc6e11a42d3e031ef60e0e5ea36dda08a66ce98d 100644 (file)
@@ -265,7 +265,7 @@ class User
                // List of possible actor names
                $possible_accounts = ['friendica', 'actor', 'system', 'internal'];
                foreach ($possible_accounts as $name) {
-                       if (!DBA::exists('user', ['nickname' => $name, 'account_removed' => false, 'expire' => false]) &&
+                       if (!DBA::exists('user', ['nickname' => $name, 'account_removed' => false, 'account_expired' => false]) &&
                                !DBA::exists('userd', ['username' => $name])) {
                                DI::config()->set('system', 'actor_name', $name);
                                return $name;
index 17064fd959aef19f908b2f8dbadd43d15ddc82b7..f957596b6424571e12d6e4bbd838b1833c73885b 100644 (file)
@@ -136,7 +136,7 @@ return [
                        "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
                        "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
                        "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
-                       "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+                       "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Delay in days before deleting user-related posts. Scope is controlled by pConfig."],
                        "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
                        "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],