Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 7067:4c0ec9bd5168
mod_admin_telnet: Remove compat warning about 'console_banner' as a function
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 10 Jan 2016 00:01:28 +0100 |
parent | 7031:89221daefae9 |
child | 7068:0c494bca43cb |
comparison
equal
deleted
inserted
replaced
7066:7d5a1fb9bf9e | 7067:4c0ec9bd5168 |
---|---|
1123 end | 1123 end |
1124 | 1124 |
1125 ------------- | 1125 ------------- |
1126 | 1126 |
1127 function printbanner(session) | 1127 function printbanner(session) |
1128 local option = module:get_option("console_banner"); | 1128 local option = module:get_option_string("console_banner", "full"); |
1129 if option == nil or option == "full" or option == "graphic" then | 1129 if option == "full" or option == "graphic" then |
1130 session.print [[ | 1130 session.print [[ |
1131 ____ \ / _ | 1131 ____ \ / _ |
1132 | _ \ _ __ ___ ___ _-_ __| |_ _ | 1132 | _ \ _ __ ___ ___ _-_ __| |_ _ |
1133 | |_) | '__/ _ \/ __|/ _ \ / _` | | | | | 1133 | |_) | '__/ _ \/ __|/ _ \ / _` | | | | |
1134 | __/| | | (_) \__ \ |_| | (_| | |_| | | 1134 | __/| | | (_) \__ \ |_| | (_| | |_| | |
1135 |_| |_| \___/|___/\___/ \__,_|\__, | | 1135 |_| |_| \___/|___/\___/ \__,_|\__, | |
1136 A study in simplicity |___/ | 1136 A study in simplicity |___/ |
1137 | 1137 |
1138 ]] | 1138 ]] |
1139 end | 1139 end |
1140 if option == nil or option == "short" or option == "full" then | 1140 if option == "short" or option == "full" then |
1141 session.print("Welcome to the Prosody administration console. For a list of commands, type: help"); | 1141 session.print("Welcome to the Prosody administration console. For a list of commands, type: help"); |
1142 session.print("You may find more help on using this console in our online documentation at "); | 1142 session.print("You may find more help on using this console in our online documentation at "); |
1143 session.print("http://prosody.im/doc/console\n"); | 1143 session.print("http://prosody.im/doc/console\n"); |
1144 end | 1144 end |
1145 if option and option ~= "short" and option ~= "full" and option ~= "graphic" then | 1145 if option ~= "short" and option ~= "full" and option ~= "graphic" then |
1146 if type(option) == "string" then | 1146 session.print(option); |
1147 session.print(option) | |
1148 elseif type(option) == "function" then | |
1149 module:log("warn", "Using functions as value for the console_banner option is no longer supported"); | |
1150 end | |
1151 end | 1147 end |
1152 end | 1148 end |
1153 | 1149 |
1154 module:provides("net", { | 1150 module:provides("net", { |
1155 name = "console"; | 1151 name = "console"; |