Merge pull request #5 from outis1one/claude/fix-password-popup-01GmYg4mbv6KqLHJN4sFFfR6
Claude/fix password popup 01 gm yg4mbv6 kq lhjn4s f ff r6
This commit is contained in:
@@ -1,11 +1,25 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
################################################################################
|
################################################################################
|
||||||
### Ubuntu Based Kiosk (UBK) v0.9.8 ###
|
### Ubuntu Based Kiosk (UBK) v0.9.9 ###
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# RELEASE v0.9.8 - Password Lock & Bug Fixes
|
# RELEASE v0.9.9 - Menu Reorganization & Inactivity Popup Fixes
|
||||||
#
|
#
|
||||||
# What's in v0.9.8:
|
# What's in v0.9.9:
|
||||||
|
# - Moved Session Lockout configuration from Sites menu to Core Settings menu
|
||||||
|
# * Now accessible as option 7 in Core Settings
|
||||||
|
# * Makes password protection easier to find and configure
|
||||||
|
# - Fixed inactivity popup not appearing on rotation sites
|
||||||
|
# * Popup now appears on ALL sites where user has interacted (not just manual sites)
|
||||||
|
# * Inactivity check now happens BEFORE rotation check
|
||||||
|
# * Prevents rotation from interrupting the inactivity prompt
|
||||||
|
# * Rotation pauses while inactivity prompt is displayed
|
||||||
|
# - Fixed session lockout being interrupted by rotation
|
||||||
|
# * Rotation now pauses completely when session is locked
|
||||||
|
# * Inactivity prompts won't appear while session is locked
|
||||||
|
# * Password lockout screen stays visible until correct password entered
|
||||||
|
#
|
||||||
|
# Previous features (v0.9.8):
|
||||||
# - Added password-protected session lockout
|
# - Added password-protected session lockout
|
||||||
# * Configurable lockout password (separate from sudo user)
|
# * Configurable lockout password (separate from sudo user)
|
||||||
# * Auto-lock after configurable timeout (default 30 minutes)
|
# * Auto-lock after configurable timeout (default 30 minutes)
|
||||||
@@ -26,7 +40,7 @@
|
|||||||
# - Time extension features work correctly
|
# - Time extension features work correctly
|
||||||
# - HTML on-screen keyboard (non-interfering)
|
# - HTML on-screen keyboard (non-interfering)
|
||||||
#
|
#
|
||||||
# Previous features (v0.9.9.1):
|
# Previous features (v0.9.7 and earlier):
|
||||||
# * Screen blanking disabled
|
# * Screen blanking disabled
|
||||||
# * Jitsi audio keep-alive
|
# * Jitsi audio keep-alive
|
||||||
# * PTT spacebar hardcoded
|
# * PTT spacebar hardcoded
|
||||||
@@ -73,7 +87,7 @@ set -euo pipefail
|
|||||||
### SECTION 1: CONSTANTS & GLOBALS
|
### SECTION 1: CONSTANTS & GLOBALS
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
SCRIPT_VERSION="0.9.8"
|
SCRIPT_VERSION="0.9.9"
|
||||||
KIOSK_USER="kiosk"
|
KIOSK_USER="kiosk"
|
||||||
BUILD_USER="${SUDO_USER:-$(whoami)}"
|
BUILD_USER="${SUDO_USER:-$(whoami)}"
|
||||||
KIOSK_HOME="/home/${KIOSK_USER}"
|
KIOSK_HOME="/home/${KIOSK_USER}"
|
||||||
@@ -828,7 +842,6 @@ configure_sites() {
|
|||||||
add_option "Edit a site URL"
|
add_option "Edit a site URL"
|
||||||
add_option "Reorder sites"
|
add_option "Reorder sites"
|
||||||
add_option "Configure Home URL"
|
add_option "Configure Home URL"
|
||||||
add_option "Configure Session Lockout"
|
|
||||||
add_option "Clear all, start over"
|
add_option "Clear all, start over"
|
||||||
show_menu_prompt
|
show_menu_prompt
|
||||||
site_choice=$choice
|
site_choice=$choice
|
||||||
@@ -871,11 +884,6 @@ configure_sites() {
|
|||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
8)
|
8)
|
||||||
configure_lockout
|
|
||||||
save_config
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
9)
|
|
||||||
URLS=()
|
URLS=()
|
||||||
DURS=()
|
DURS=()
|
||||||
USERS=()
|
USERS=()
|
||||||
@@ -3527,7 +3535,7 @@ const path=require('path');
|
|||||||
const os=require('os');
|
const os=require('os');
|
||||||
|
|
||||||
const CONFIG_FILE=path.join(__dirname,'config.json');
|
const CONFIG_FILE=path.join(__dirname,'config.json');
|
||||||
const VERSION='0.9.9.1';
|
const VERSION='0.9.9';
|
||||||
|
|
||||||
let mainWindow,views=[],hiddenViews=[],tabs=[],currentIndex=0,showingHidden=false;
|
let mainWindow,views=[],hiddenViews=[],tabs=[],currentIndex=0,showingHidden=false;
|
||||||
let pinWindow=null,promptWindow=null,htmlKeyboardWindow=null;
|
let pinWindow=null,promptWindow=null,htmlKeyboardWindow=null;
|
||||||
@@ -3825,36 +3833,16 @@ function startMasterTimer(){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6. SITE ROTATION
|
// 6. INACTIVITY CHECK (works on ALL pages where user has interacted!)
|
||||||
if(!showingHidden&&views.length>1){
|
// v0.9.9 FIX: Check inactivity BEFORE rotation to ensure prompt appears on rotation sites
|
||||||
const currentTabIdx=viewIndexToTabIndex(currentIndex);
|
|
||||||
|
|
||||||
if(currentTabIdx>=0&&tabs[currentTabIdx]){
|
|
||||||
const siteDuration=parseInt(tabs[currentTabIdx].duration)||0;
|
|
||||||
|
|
||||||
if(siteDuration>0){
|
|
||||||
const timeOnSite=now-siteStartTime;
|
|
||||||
|
|
||||||
// CRITICAL FIX: Don't auto-rotate if time extension is active
|
|
||||||
const hasActiveExtension=(inactivityExtensionUntil>0&&now<inactivityExtensionUntil);
|
|
||||||
|
|
||||||
if(timeOnSite>=siteDuration*1000&&!hasActiveExtension){
|
|
||||||
rotateToNextSite();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 7. INACTIVITY CHECK (works on ALL pages where user has interacted!)
|
|
||||||
// v0.9.8 FIX: Show prompt even without Home URL configured
|
|
||||||
// The prompt allows user to continue or return to rotation
|
// The prompt allows user to continue or return to rotation
|
||||||
if(!showingHidden){
|
// Don't show inactivity prompt if session is locked
|
||||||
|
if(!showingHidden&&!sessionLocked){
|
||||||
const homeViewIdx=getHomeViewIndex();
|
const homeViewIdx=getHomeViewIndex();
|
||||||
const currentTabIdx=viewIndexToTabIndex(currentIndex);
|
const currentTabIdx=viewIndexToTabIndex(currentIndex);
|
||||||
const isOnHomePage=(homeViewIdx>=0&¤tIndex===homeViewIdx);
|
const isOnHomePage=(homeViewIdx>=0&¤tIndex===homeViewIdx);
|
||||||
|
|
||||||
// v0.9.8: Show inactivity prompt on ANY site where user has interacted
|
// v0.9.9: Show inactivity prompt on ANY site where user has interacted
|
||||||
// - Auto-rotates to recipe → user taps → prompt appears after timeout
|
// - Auto-rotates to recipe → user taps → prompt appears after timeout
|
||||||
// - User keeps swiping through photos → keeps resetting, no prompt
|
// - User keeps swiping through photos → keeps resetting, no prompt
|
||||||
// - No user interaction → no prompt, just keeps rotating
|
// - No user interaction → no prompt, just keeps rotating
|
||||||
@@ -3894,6 +3882,29 @@ function startMasterTimer(){
|
|||||||
const location=isOnHomePage?'home page':'other page';
|
const location=isOnHomePage?'home page':'other page';
|
||||||
console.log('[INACTIVITY] 🔔 *** SHOWING PROMPT (on '+location+') ***');
|
console.log('[INACTIVITY] 🔔 *** SHOWING PROMPT (on '+location+') ***');
|
||||||
showInactivityPrompt();
|
showInactivityPrompt();
|
||||||
|
return; // Don't rotate while showing prompt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. SITE ROTATION
|
||||||
|
// v0.9.9: Don't rotate if inactivity prompt is showing or session is locked
|
||||||
|
if(!showingHidden&&views.length>1&&(!promptWindow||promptWindow.isDestroyed())&&!sessionLocked){
|
||||||
|
const currentTabIdx=viewIndexToTabIndex(currentIndex);
|
||||||
|
|
||||||
|
if(currentTabIdx>=0&&tabs[currentTabIdx]){
|
||||||
|
const siteDuration=parseInt(tabs[currentTabIdx].duration)||0;
|
||||||
|
|
||||||
|
if(siteDuration>0){
|
||||||
|
const timeOnSite=now-siteStartTime;
|
||||||
|
|
||||||
|
// CRITICAL FIX: Don't auto-rotate if time extension is active
|
||||||
|
const hasActiveExtension=(inactivityExtensionUntil>0&&now<inactivityExtensionUntil);
|
||||||
|
|
||||||
|
if(timeOnSite>=siteDuration*1000&&!hasActiveExtension){
|
||||||
|
rotateToNextSite();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8761,6 +8772,7 @@ core_menu() {
|
|||||||
add_option "Sites"
|
add_option "Sites"
|
||||||
add_option "WiFi"
|
add_option "WiFi"
|
||||||
add_option "Power/Display/Quiet Hours"
|
add_option "Power/Display/Quiet Hours"
|
||||||
|
add_option "Session Lockout"
|
||||||
add_option "Full reinstall"
|
add_option "Full reinstall"
|
||||||
add_option "Complete uninstall"
|
add_option "Complete uninstall"
|
||||||
show_menu_prompt
|
show_menu_prompt
|
||||||
@@ -8772,8 +8784,9 @@ core_menu() {
|
|||||||
4) configure_sites ;;
|
4) configure_sites ;;
|
||||||
5) configure_wifi ;;
|
5) configure_wifi ;;
|
||||||
6) configure_power_display_quiet ;;
|
6) configure_power_display_quiet ;;
|
||||||
7) full_reinstall; return ;;
|
7) configure_lockout; save_config ;;
|
||||||
8) complete_uninstall; return ;;
|
8) full_reinstall; return ;;
|
||||||
|
9) complete_uninstall; return ;;
|
||||||
0) return ;;
|
0) return ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
Reference in New Issue
Block a user