Files
SkyArtShop/test-user-system.sh

65 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
echo "============================================"
echo "Testing User Management System"
echo "============================================"
echo ""
echo "1. Master Admin Login Test"
echo "-------------------------"
echo "Email: admin@skyartshop.com"
echo "Password: ChangeThisPassword123!"
echo ""
echo "2. Checking Identity Database"
echo "-----------------------------"
sqlite3 /var/www/SkyArtShop/publish/identity.db << 'EOF'
.mode column
.headers on
SELECT UserName, Email, DisplayName FROM AspNetUsers;
EOF
echo ""
echo "3. Checking MongoDB AdminUsers"
echo "------------------------------"
mongosh SkyArtShopDB --eval "db.AdminUsers.find({}, {Name: 1, Email: 1, Role: 1, IsActive: 1}).forEach(function(u){ print('Name: ' + u.Name + ', Email: ' + u.Email + ', Role: ' + u.Role + ', Active: ' + u.IsActive); });" --quiet
echo ""
echo "4. User Management URLs"
echo "----------------------"
echo "List Users: http://192.168.10.130/admin/users"
echo "Create User: http://192.168.10.130/admin/users/create"
echo "Admin Login: http://192.168.10.130/admin/login"
echo ""
echo "============================================"
echo "How to Create a New User:"
echo "============================================"
echo "1. Login as Master Admin"
echo "2. Go to User Management in sidebar"
echo "3. Click 'Add New User'"
echo "4. Fill in all required fields:"
echo " - Name, Email, Password (min 6 chars)"
echo " - Select Role (MasterAdmin/Admin/Cashier/Accountant)"
echo " - Set Status (Active/Inactive)"
echo "5. Click 'Create User'"
echo "6. User can immediately login with their credentials"
echo ""
echo "Password Change:"
echo "----------------"
echo "1. Go to User Management"
echo "2. Click Edit button for the user"
echo "3. Enter new password in 'New Password' field"
echo "4. Leave blank to keep current password"
echo "5. Click 'Update User'"
echo "6. Password is immediately updated in BOTH databases"
echo ""
echo "Both Systems Synchronized:"
echo "--------------------------"
echo "✓ ASP.NET Identity (SQLite) - For authentication/login"
echo "✓ MongoDB AdminUsers - For profile, roles, permissions"
echo "✓ Changes in admin panel update BOTH systems"
echo "============================================"