gbook / nidb

NeuroInformatics Database
GNU General Public License v3.0
26 stars 8 forks source link

Admin cannot add users, create projects or edit admin account info #73

Closed NinjMenon closed 3 years ago

NinjMenon commented 4 years ago

Hi @gbook,

I've been testing out the container at http://olinnidb.org/download/CentOS8-NiDB.ova and I am able to log in to the instance as admin. However, I can't seem to add any new users, create new projects, get access to the existing projects (Clincal Scan and Generic Project) or edit the admin user profile to change any information.

Here is the error when trying to add a new user:

SQL error occured
Query failed on [Fri, 03 Jan 2020 14:18:04 -0500]: /var/www/html/adminusers.php (line 246)
Error: Field 'user_id' doesn't have a default value
SQL: insert into users (username, password, login_type, user_instanceid, user_fullname, user_firstname, user_midname, user_lastname, user_institution, user_country, user_email, user_email2, user_address1, user_address2, user_city, user_state, user_zip, user_phone1, user_phone2, user_website, user_dept, user_lastlogin, user_logincount, user_enabled, user_isadmin, sendmail_dailysummary) values ('Test', sha1('test'), 'Standard','1', 'NinjMenon', '', '', '', '', '', 'test@gmail.com', '', '', '', '', '', '', '', '', '', '', now(), 0, 1, '1', 0)
Username: Test
SESSION

Array
(
    [enablebeta] => 0
    [username] => admin
    [validlogin] => true
    [userid] => 1
    [isadmin] => true
    [instanceid] => 1
    [instancename] => NiDB
)

SERVER

Array
(
    [USER] => apache
    [HOME] => /usr/share/httpd
    [SCRIPT_NAME] => /adminusers.php
    [REQUEST_URI] => /adminusers.php
    [QUERY_STRING] =>
    [REQUEST_METHOD] => POST
    [SERVER_PROTOCOL] => HTTP/1.1
    [GATEWAY_INTERFACE] => CGI/1.1
    [REMOTE_PORT] => 53814
    [SCRIPT_FILENAME] => /var/www/html/adminusers.php
    [SERVER_ADMIN] => root@localhost
    [CONTEXT_DOCUMENT_ROOT] => /var/www/html
    [CONTEXT_PREFIX] =>
    [REQUEST_SCHEME] => http
    [DOCUMENT_ROOT] => /var/www/html
    [REMOTE_ADDR] => ::1
    [SERVER_PORT] => 80
    [SERVER_ADDR] => ::1
    [SERVER_NAME] => localhost
    [SERVER_SOFTWARE] => Apache/2.4.37 (centos)
    [SERVER_SIGNATURE] =>
    [PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
    [HTTP_COOKIE] => PHPSESSID=7ilneqs80hdno7mm8ntfvhab2t
    [HTTP_CONNECTION] => keep-alive
    [CONTENT_LENGTH] => 124
    [CONTENT_TYPE] => application/x-www-form-urlencoded
    [HTTP_REFERER] => http://localhost/adminusers.php?action=addform
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_USER_AGENT] => Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
    [HTTP_HOST] => localhost
    [proxy-nokeepalive] => 1
    [UNIQUE_ID] => Xg@TbEtRo-uwEGiatMfqkgAAAEY
    [FCGI_ROLE] => RESPONDER
    [PHP_SELF] => /adminusers.php
    [REQUEST_TIME_FLOAT] => 1578079084.2604
    [REQUEST_TIME] => 1578079084
)

POST

Array
(
    [action] => add
    [id] =>
    [username] => Test
    [fullname] => NinjMenon
    [password] => test
    [password-check] => test
    [email] => test@gmail.com
    [enabled] => 1
    [isadmin] => 1
)

GET

Array
(
)

I get similar errors when adding/editing projects, referring to the fields on those sql pages. I want to be able to add projects, create user accounts for our collaborators, and allow them selective access to certain projects.

Thanks for your help! Niranjana

Neuroimaging Analyst Vanderbilt Memory & Alzheimer's Center Vanderbilt University Medical Center 1207 17th Avenue South, 2nd Floor, Suite 204 Nashville, TN 37212-2838

Phone: 615-875-3632 Fax: 615-875-2727 www.vanderbiltalzheimers.com

gbook commented 3 years ago

I somehow missed this! Try downloading the current version of NiDB and installing into a CentOS VM that you create on your own.