Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Access denied to all users except globeadmin

Questions related to using nuBuilder Forte.
Post Reply
Lala
Posts: 43
Joined: Thu Nov 07, 2024 11:46 pm
Has thanked: 10 times
Been thanked: 4 times

Access denied to all users except globeadmin

Unread post by Lala »

Help

I updated nubuilder and now access is denied to all the users except globeadmin.

The debug information says:

[0] : ===PDO MESSAGE===

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sfo_status' in 'SELECT'

===SQL===========

SELECT `sfo_status` FROM `zzzzsys_form` WHERE `zzzzsys_form_id` = ?

===BACK TRACE====

/home/u150737126/domains/kiribatidb.com/public_html/lep/core/nudatabase.php - line 361 (nuRunQuery)

/home/u150737126/domains/kiribatidb.com/public_html/lep/core/nuform.php - line 1533 (db_fetch_value)

/home/u150737126/domains/kiribatidb.com/public_html/lep/core/nuform.php - line 61 (nuGetFormStatus)

/home/u150737126/domains/kiribatidb.com/public_html/lep/core/nuapi.php - line 95 (nuBeforeEdit)

I can't attach a backup because I get the following message if I try to back it up:

Image

HELP!
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Access denied to all users except globeadmin

Unread post by kev1n »

Hi,

You’ll need to run the database update as well, since it adds the sfo_status column to the zzzzsys_form table.
Also, the procedure will include '../third_party/mysqldump/Mysqldump.php', whereas your error shows a path to core/libs/, which strongly indicates that your database still needs updating.
Lala
Posts: 43
Joined: Thu Nov 07, 2024 11:46 pm
Has thanked: 10 times
Been thanked: 4 times

Re: Access denied to all users except globeadmin

Unread post by Lala »

Far out - that's a relief! I've got a clinic full of leprosy patients whose records couldn't be seen! Thank you so much!
nac
Posts: 132
Joined: Tue Dec 12, 2017 11:28 pm
Location: Aberdeen, UK
Has thanked: 9 times
Been thanked: 13 times

Re: Access denied to all users except globeadmin

Unread post by nac »

Hello Lala,

I read this thread last month and considered replying but was on holiday at the time. Anyway, here is my (rather tardy) response.

As I am sure you know, it is quite a good idea to test any changes to your database application before applying them to your live, production system. Sometimes, even updates can cause unexpected changes, as you found out. When I saw that you had “a clinic full of leprosy patients whose records couldn't be seen”, I thought I would share with you what I do, which could help you if have this problem in future.

The idea is to have a ‘clone’ of your nuBuilder application, running on the same platform as your live system. You can apply the update (or any other changes you want to test) to the clone and check that all is well before doing the same on the live system. To this end, I wrote a simple procedure that, with a single click, makes and exact copy of the live application (database structure, contents and all files). You can then switch over to this clone and test the update etc. Because it is identical to the original, running on the same platform, you can be confident that the test system will behave in the same way as the live one. It gives you time to resolve any issues whilst the live system can continue to be used as normal.

Here is what you would need to do:

1. Install a brand new, empty nuBuilder application on your hosting platform.
2. Using the code in CloneDatabaseProcedure.txt, create a new procedure in your live application.
3. Using the variables from nuconfig.php file in the new, empty application, modify the procedure so that it has the correct credentials for the 'target'.

CloneDatabaseProcedure.txt
These are the lines that need to be altered.

Code: Select all

//== These are the target database parameters that need to be modified 
$targetHost = "enter_your_value";       // use $nuConfigDBHost from the target installation
$targetDB = "enter_your_value";         // use $nuConfigDBName from the target installation
$targetUsername = "enter_your_value";   // use $nuConfigDBUser from the target installation
$targetPassword = "enter_your_value";   // use $nuConfigDBPassword from the target installation
$targetCharset = "enter_your_value";    // use $nuConfigDBCharacterSet from the target installation
$targetPort = 3306;                   // use $nuConfigDBPort from the target installation
$sourcePath = realpath("..");  //  copy all files in the parent folder and below. (You can probably leave this unchanged.)
$targetPath = realpath("../../") . "/clone_directory_name";  // the target folder which will contain all of the copied files
//== end of parameters
The procedure should then be ready to run. When it completes, you should have a perfect copy of your live application. You can run it whenever you want to take a snapshot of your current live system in order to do some testing.

Finally, because the live and test versions will look identical, it is useful to have reminder of which one you are using. This works for me. Just add something like this to the nuOnLoad() function. It will insert a “TEST VERSION” string into the breadcrumb bar, before the refresh button.

Code: Select all

function nuOnLoad() {
   if (window.location.href.includes("_test")) { // look for a string that is unique to the test version's URL
     $('#nuRefreshButton').append('<input id="testInfo" style="float:left; margin-right:5px; width:125px; color:red; font-weight:bold" type="button" value="-- TEST VERSION --">');
   }   
}
I hope this is helpful for you. Let me know if you have any questions if you decide to give it a go. . I will freely admit that this is not the most efficient and elegant code … but it does work for me.

Finally, it is really interesting to get a glimpse of how nuBuilder is being used. I hope it is making a positive contribution to your work treating leprosy.

Neil
You do not have the required permissions to view the files attached to this post.
Post Reply