Change blog avatar from control panel

This commit is contained in:
Bob Mottram 2016-03-23 16:23:39 +00:00
parent a758f2ff03
commit 280e9c604e
1 changed files with 39 additions and 15 deletions

View File

@ -631,6 +631,28 @@ function irc_set_global_password {
esac
}
function change_blog_avatar {
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --title $"Change blog avatar" \
--backtitle $"Freedombone Control Panel" \
--inputbox $"Enter a URL for an image. It should be approximately a square image." 8 75 2>$data
sel=$?
case $sel in
0)
IMAGE_URL=$(<$data)
if [ ${#IMAGE_URL} -gt 5 ]; then
clear
${PROJECT_NAME}-blog -a $IMAGE_URL
if [ "$?" = "0" ]; then
dialog --title $"Change blog avatar" \
--msgbox $"Your blog avatar has been changed" 6 40
fi
fi
;;
esac
}
function change_ssh_public_key {
select_user
if [ ! $SELECTED_USERNAME ]; then
@ -1808,7 +1830,7 @@ function menu_top_level {
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \
--title $"Control Panel" \
--radiolist $"Choose an operation:" 27 70 20 \
--radiolist $"Choose an operation:" 28 70 21 \
1 $"About this system" off \
2 $"Backup and Restore" off \
3 $"Reset Tripwire" off \
@ -1822,13 +1844,14 @@ function menu_top_level {
11 $"Hubzilla" off \
12 $"Media menu" off \
13 $"IRC menu" off \
14 $"Change the name of this system" off \
15 $"Set the TLS date/time source" off \
16 $"Set a static local IP address" off \
17 $"Check for updates" off \
18 $"Power off the system" off \
19 $"Restart the system" off \
20 $"Exit" on 2> $data
14 $"Change your blog avatar" off \
15 $"Change the name of this system" off \
16 $"Set the TLS date/time source" off \
17 $"Set a static local IP address" off \
18 $"Check for updates" off \
19 $"Power off the system" off \
20 $"Restart the system" off \
21 $"Exit" on 2> $data
sel=$?
case $sel in
1) exit 1;;
@ -1848,13 +1871,14 @@ function menu_top_level {
11) menu_hubzilla;;
12) menu_media;;
13) menu_irc;;
14) change_system_name;;
15) set_tls_time_source;;
16) set_static_IP;;
17) check_for_updates;;
18) shut_down_system;;
19) restart_system;;
20) break;;
14) change_blog_avatar;;
15) change_system_name;;
16) set_tls_time_source;;
17) set_static_IP;;
18) check_for_updates;;
19) shut_down_system;;
20) restart_system;;
21) break;;
esac
done
}