130 Commits

Author SHA1 Message Date
Harald Eilertsen
ced3113516 Remove unneccessary use statements 2026-03-07 12:00:56 +01:00
Harald Eilertsen
cbd208eea3 Remove use of NULL_DATE constant in core
The NULL_DATE constant is defined conditionally in the DBA static class.
This causes issues with static analyzing tools like PHPStan, because
they can not really know if the constant is defined or not.

We could make PHPStan ignore this, but since there already is a
`get_null_date()` method on the `dba_driver` class, this patch
changes the code to use this method instead.

We could also use the public static attribute `$null_date` on the DBA
class directly, but using a method feels cleaner, and allows for making
the attribute private, or even removing it completely at some later
time.

I'm not removing the NULL_DATE constant for now, in case it is in use by
any extensions.
2026-03-07 11:15:46 +01:00
Mario
5cb4db0353 Merge branch 'dev-send_reg_approval' into 'dev'
(Re?)enable email to user after account approval

See merge request hubzilla/core!2263
2026-01-29 10:45:25 +00:00
ltning
268fccdb30 Fix SQL in send_reg_confirmation_email_from_register 2026-01-28 20:06:59 +00:00
ltning
bb7689be93 Return boolean instead of nonexistent array 2026-01-28 02:51:58 +00:00
ltning
bd63af69b2 (Re?)enable email to user after account approval
Existing function account_allow() does not seem to be used a whole
lot, and certainly not when approving a registration request.

Created new function send_reg_confirmation_email_from_register
(going for longest-function-name-in-Hubzilla) which attempts to
send such a confirmation email, and also a new email template.

Plugged this into the create_account_from_register function.

Open question: Should the sending of this email be among the success
criteria for the create_account_from_register function?
2026-01-28 02:51:46 +00:00
ltning
e5d4358d61 Clean up send_reg_approval_email_from_register, new email template
Since there is no easy way to produce direct links to approve/reject
registrations, create new email template which simply links to the
Accounts admin page.

In response to comments:
 - Add type annotations
 - Simplify some 'if' statements
 - add and fix some whitespace
 - simplify input arguments to the function
2026-01-27 16:32:16 +00:00
ltning
fe4d6229a4 Add new send_reg_approval_email_from_register function
Current send_reg_approval_email function expects account to already
exist, and does not seem to be called anywhere. New function takes
necessary information from the register table.

Added call to new function in Regate.php after verification is
done. Will fail and roll back if the function call fails or if no
admin accounts were found to notify (delivered<1).
2026-01-27 16:32:16 +00:00
Mario
1a68dbccf1 remove check for current user and apply update 2025-10-06 20:42:27 +00:00
Harald Eilertsen
330c8ca890 Fix ref to undefined var in account.php 2025-09-12 21:51:24 +02:00
Harald Eilertsen
f8795288a1 More misc fixes in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
107b8e67d2 Fix/complete template args in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
5a36a37b9f Fix template language in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
0910ae0e52 Fix db query in verify_email_address 2025-09-12 21:51:24 +02:00
Harald Eilertsen
c6c5a8b5e0 Cleanup verify_email_address
- Add type annotations, and change arg to a string instead of array.
  Only the email address was used anyways.
- Fix indentation
- Improve API doc and remove unnecessary comments.
2025-09-12 21:51:24 +02:00
Harald Eilertsen
da2c57c432 Fix undefined var $hash in verify_email_address 2025-09-12 21:51:24 +02:00
SK
644e3b790c uncommented register_account hook
Hook is required for notify-admin addon to work.
2025-09-02 19:43:35 +05:30
Mario Vavti
d636e71024 remove code that would never execute and make sure the first account to register is the admin account 2025-06-25 17:26:41 +02:00
Harald Eilertsen
66e02c5e3a A bit of cleanup for account functions 2025-06-24 07:53:42 +00:00
Harald Eilertsen
0e4924d7c5 Remove obsolete verify_email_addressNOP function 2025-06-08 22:46:26 +02:00
Harald Eilertsen
5316ebfe7c Remove obsolete functions in account.php 2025-06-08 09:43:14 +02:00
Harald Eilertsen
0189d04614 Fix and refactor module Admin\Accounts part I 2024-11-27 08:15:59 +00:00
Harald Eilertsen
0dc959d9fe Deprecate *_config() functions in core. 2024-03-24 09:58:21 +00:00
Mario Vavti
d8811b499d improved item_expire() 2023-04-14 09:21:33 +02:00
Mario
5e07ebe7fa fix registration bug - issue #1574 2021-05-31 09:07:50 +00:00
Mario
ebd0333256 register: postgres - add default values for timestamps 2021-05-07 12:15:00 +00:00
Mario
2ad6f6e11f remove logging 2021-05-07 11:08:40 +00:00
Mario
b5ce207344 register: implement remove_expired_registrations() and minor fixes 2021-05-07 10:03:12 +00:00
Mario
1fd5f5c893 register: redirect unverified registration emails to the verification form 2021-05-06 19:06:53 +00:00
Mario
43260891b7 register: we have already checked for existing email in check_account_email() 2021-05-06 13:54:02 +00:00
Mario
94f1c001f1 register: more testing and fixes 2021-04-28 13:17:45 +02:00
Mario
2932ac9d86 register: only log to separate file if configured that way. default to standard logging via logger() 2021-04-26 18:31:08 +00:00
Mario
20ca6676d2 registration: reveal possibility to show all registrations in the UI 2021-04-19 19:07:50 +00:00
Mario
88f7c2041d register: add option to show all register entries 2021-04-16 18:13:20 +00:00
Mario
e35ab97b7e register: provide a possibility to leave a message id registration is by approval 2021-04-14 19:40:51 +00:00
Mario
f0e5ce7fd1 register: more work on ui/ux 2021-04-10 20:44:04 +00:00
Mario
01b081d809 register: only return verified registrations in get_pending_accounts(), more invite handling fixes 2021-04-09 09:49:36 +00:00
Mario
cf62e07bec register: default to auto-create channel and fix auto create channel if register approval is configured 2021-04-08 12:38:38 +00:00
Mario
18d990a034 air: more ui/ux and provide a possibility to lookup your registration id in mod regate (raw and unfinished) 2021-03-28 20:40:26 +00:00
Mario
13355d42f7 air security: saving the password as hex string is not acceptable 2021-03-22 09:50:12 +01:00
Mario
3ba42d3dcf air: deal with timezones when displaying open/close time - this should finally fix issue #1544 2021-03-18 14:55:01 +01:00
Mario
febf766be0 air: make sure we always save date_time in UTC - issue #1544 2021-03-17 14:37:16 +01:00
Mario
c658bbca24 simplify get_pending_accounts query so that it will work in postgres. this will introduce a regression in rendering the table background color. 2021-03-16 12:32:20 +01:00
Mario
bd24224b76 air: fix register notifications 2021-03-15 12:45:39 +00:00
Mario
3f053611bd Merge branch 'dev' into air 2021-03-12 10:07:15 +00:00
Mario
3d264f5a55 php8: fix warnings during install procedure
(cherry picked from commit 48bae9d421)
2021-03-03 14:11:29 +01:00
Hilmar R
d434490bdf melt include/account 2021-03-02 15:54:51 +01:00
Hilmar R
c26dede97f get dev 2021-03-01 18:48:11 +01:00
Mario
b4693870ba port Lib/Crypto from zap 2021-02-09 13:50:03 +00:00
Hilmar R
67db1c6e9b melt diff prod fork 4.6.2 air onto 5.2.1 to 5.2.2 DB 1241 2021-01-23 15:24:24 +01:00