Quote
That worked to allow the site to complete the installation. Maybe a quick edit to the instruction readme should suggest removing all infusions in the Upgrade portion.
However, now I cannot log into the website at all. It redirects me without logging me in. I haven't removed all the old files yet, could this be a cause as well? Going to remove them anyway, as they're useless and shouldn't be kept however wanted to post this in case it was something else.
- by Daywalker
Quote
All user_level's remained the same after upgrading.
101 -> 101
Proper levels should include "-" if I'm correct, regardless the logins for member's do not work after upgrading.
Ended up fixing through a sql query:Code Download sourceUPDATE
fusion_users
SETuser_level
= '-103' WHEREfusion_users
.user_level
= '103'
UPDATEfusion_users
SETuser_level
= '-102' WHEREfusion_users
.user_level
= '102'
UPDATEfusion_users
SETuser_level
= '-101' WHEREfusion_users
.user_level
= '101'
- by NetriX
if (db_exists(DB_PREFIX.'users')) {
// Modify All Users Level > 0
$result = dbquery("SELECT user_id, user_level FROM ".DB_USERS);
if (dbrows($result) > 0) {
while ($data = dbarray($result)) {
if ($data['user_level']) { // will omit 0
$result = dbquery("UPDATE ".DB_USERS." SET user_level='-".$data['user_level']."' WHERE user_id='".$data['user_id']."'");
// i added these in my localhost to try to debug
die();
print_p(dbarray(dbquery("SELECT * FROM ".DB_USERS." WHERE user_id =:user_id" , [':user_id' => $data['user_id']);
// results printed OK.
}
}
}
// Remove user_offset which had been replaced with user_timezone
if (column_exists(DB_USERS, 'user_offset')) {
$inf_altertable[] = DB_USERS." DROP COLUMN user_offset";
}
}
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHPFusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: update_users.php
| Author: PHPFusion Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once dirname(__FILE__).'/../maincore.php';
require_once THEMES.'templates/header.php';
ini_set('post_max_size','750M');
ini_set('upload_max_filesize', '750M');
ini_set('upload_max_filesize', '750M');
ini_set('max_execution_time', '300');
ini_set('max_input_time', '540');
ini_set('memory_limit', '1000M');
$result = dbquery("SELECT user_id, user_level FROM ".DB_USERS." ORDER BY user_id ASC");
if (dbrows($result)) {
// Column Upgrade
dbquery("ALTER TABLE ".DB_USERS." ALTER COLUMN user_level
TINYINT(4) NOT NULL DEFAULT '".USER_LEVEL_MEMBER."'");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_timezone
VARCHAR(50) DEFAULT 'Europe/London' AFTER user_hide_email
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_reputation
INT(10) UNSIGNED DEFAULT '0' AFTER user_status
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_inbox
SMALLINT(6) UNSIGNED DEFAULT '0' AFTER user_reputation
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_outbox
SMALLINT(6) UNSIGNED DEFAULT '0' AFTER user_inbox
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_archive
SMALLINT(6) UNSIGNED DEFAULT '0' AFTER user_outbox
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_pm_email_notify
TINYINT(1) DEFAULT '0' AFTER user_archive
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_pm_save_sent
TINYINT(1) DEFAULT '0' AFTER user_pm_email_notify
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_actiontime
INT(10) UNSIGNED DEFAULT '0' AFTER user_pm_save_sent
");
dbquery("ALTER TABLE ".DB_USERS." ADD COLUMN user_language
VARCHAR(50) DEFAULT 'English'");
while ($data = dbarray($result)) {
// Change user level status
if ($data['user_level']) {
dbquery("UPDATE ".DB_USERS." SET user_level
=:level WHERE user_id
=:user_id", [':level'=>'-'.$data['user_level'], ':user_id'=>$data['user_id']]);
}
}
addNotice('success', 'Upgrade Users Successful');
}
require_once THEMES.'templates/footer.php';
Category Forum
Upgrading issues - 9Labels
None yet
Statistics
4 participants
Notifications
You are not receiving notifications from this thread.
Related Questions