When creating a site the 'admin' and 'root' users do not have ctime set

Bug #1702198 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Robert Lyon

Bug Description

All true users should have a ctime set when they are first created

So we should fix this up for 'admin' user but not the 'root' user

This will be useful for statistics / reports

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/7848

Revision history for this message
Niranjan (niranjan528) wrote :

Steps to reproduce-

1. Connect to database using below credential

    <<sudo -u postgres psql>>
    <<\c "name of the database"

2. Run below SQL command to check the time of admin user creation

    <<Select ctime from usr where username='admin';>>

Expected result- Creation time and date of admin user should be displayed.

Actual result- No rows displayed and the database is empty.

3. Run the patch and upgrade the site.

4. Run the step 2 SQL command again.

Expected result- Creation time and date of admin user should be displayed.

Actual result- 2017-07-26 11:48:28 ( This is the date when refreshed the databse)

5. Clean the dababase by running below command-

     <<sudo -u postgres dropdb "name of the database">>
6. Create a new database using below commnad-

     <<sudo -u postgres createdb -Omaharauser "name of the database">>

7. upgrade the site and run step2 again-

Expected result- Creation time and date of admin user should be displayed.

Actual result- 2017-08-01 12:28:52

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7848
Committed: https://git.mahara.org/mahara/mahara/commit/fd9bc4e2d5e792396c2f7c79107e61151e086057
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit fd9bc4e2d5e792396c2f7c79107e61151e086057
Author: Robert Lyon <email address hidden>
Date: Tue Jul 4 13:27:35 2017 +1200

Bug 1702198: Record the ctime when creating the initial 'admin' user

As part of the install process

behatnotneeded

Change-Id: I0d74698a61f74508d2ab8ed5dcb4695e39a0c3fd
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.