remove check for current user and apply update

This commit is contained in:
Mario
2025-10-06 20:42:27 +00:00
parent 0d3855cd63
commit 1a68dbccf1
3 changed files with 30 additions and 5 deletions

29
Zotlabs/Update/_1264.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
namespace Zotlabs\Update;
use Zotlabs\Lib\Config;
class _1264 {
function run() {
dbq("START TRANSACTION");
$admin_email = trim(Config::Get('system','admin_email'));
$r = q("UPDATE account SET account_roles = 0 WHERE account_created > '2025-06-24 00:00:00' AND account_email <> '%s'",
dbesc($admin_email)
);
if($r) {
dbq("COMMIT");
return UPDATE_SUCCESS;
}
dbq("ROLLBACK");
return UPDATE_FAILED;
}
}

View File

@@ -73,7 +73,7 @@ define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '10.5.8');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1263);
define('DB_UPDATE_VERSION', 1264);
define('PROJECT_BASE', __DIR__);

View File

@@ -145,10 +145,6 @@ function check_account_invite($invite_code) {
}
function check_account_admin($arr) {
if (is_site_admin()) {
return true;
}
$admin_email = trim(Config::Get('system','admin_email'));
if (strlen($admin_email) && $admin_email === trim($arr['reg_email'])) {