Skip to content
Snippets Groups Projects
Commit c326dea5 authored by Bob Mottram's avatar Bob Mottram
Browse files

Only show apps whose passwords can be changed

parent 11ce88a8
No related branches found
No related tags found
No related merge requests found
......@@ -146,16 +146,20 @@ function passwords_show_apps {
SELECTED_APP=
i=0
W=()
name=()
for a in "${APPS_AVAILABLE[@]}"
do
i=$((i+1))
W+=($i "$a")
if [[ $(function_exists change_password_${a}) == "1" ]]; then
i=$((i+1))
W+=($i "$a")
name+=("$u")
fi
done
selected_app_index=$(dialog --backtitle $"Freedombone Control Panel" --title $"Select App" --menu $"Select one of the following:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3)
if [ $? -eq 0 ]; then
SELECTED_APP="${APPS_INSTALLED_NAMES[$((selected_app_index-1))]}"
SELECTED_APP="${name[$((selected_app_index-1))]}"
fi
}
......@@ -182,12 +186,10 @@ function view_or_change_passwords {
0)
CURR_PASSWORD=$(<$data)
if [ ${#CURR_PASSWORD} -gt 8 ]; then
if [[ $(function_exists change_password_${SELECTED_APP}) == "1" ]]; then
${PROJECT_NAME}-pass -u ${SELECTED_USERNAME} -a ${SELECTED_APP} -p ${CURR_PASSWORD}
change_password_${SELECTED_APP} ${SELECTED_USERNAME} "${CURR_PASSWORD}"
dialog --title $"Change password" \
--msgbox $"The password was changed" 6 40
fi
${PROJECT_NAME}-pass -u ${SELECTED_USERNAME} -a ${SELECTED_APP} -p ${CURR_PASSWORD}
change_password_${SELECTED_APP} ${SELECTED_USERNAME} "${CURR_PASSWORD}"
dialog --title $"Change password" \
--msgbox $"The password was changed" 6 40
fi
;;
esac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment