Comparison

plugins/mod_console.lua @ 1483:efd19cdda6ca

mod_console: Allow customisation/suppression of the banner
author Matthew Wild <mwild1@gmail.com>
date Sun, 05 Jul 2009 17:36:27 +0100
parent 1433:e7bd00e70973
child 1491:694a0a00e1a5
comparison
equal deleted inserted replaced
1482:9734231a569f 1483:efd19cdda6ca
435 end 435 end
436 436
437 ------------- 437 -------------
438 438
439 function printbanner(session) 439 function printbanner(session)
440 local option = config.get("*", "core", "console_banner");
441 if option == nil or option == "full" or option == "graphic" then
440 session.print [[ 442 session.print [[
441 ____ \ / _ 443 ____ \ / _
442 | _ \ _ __ ___ ___ _-_ __| |_ _ 444 | _ \ _ __ ___ ___ _-_ __| |_ _
443 | |_) | '__/ _ \/ __|/ _ \ / _` | | | | 445 | |_) | '__/ _ \/ __|/ _ \ / _` | | | |
444 | __/| | | (_) \__ \ |_| | (_| | |_| | 446 | __/| | | (_) \__ \ |_| | (_| | |_| |
445 |_| |_| \___/|___/\___/ \__,_|\__, | 447 |_| |_| \___/|___/\___/ \__,_|\__, |
446 A study in simplicity |___/ 448 A study in simplicity |___/
447 449
448 ]] 450 ]]
451 end
452 if option == nil or option == "short" or option == "full" then
449 session.print("Welcome to the Prosody administration console. For a list of commands, type: help"); 453 session.print("Welcome to the Prosody administration console. For a list of commands, type: help");
450 session.print("You may find more help on using this console in our online documentation at "); 454 session.print("You may find more help on using this console in our online documentation at ");
451 session.print("http://prosody.im/doc/console\n"); 455 session.print("http://prosody.im/doc/console\n");
452 end 456 end
457 if option and option ~= "short" and option ~= "full" and option ~= "graphic" then
458 if type(option) == "string" then
459 session.print(option)
460 elseif type(option) == "function" then
461 setfenv(option, redirect_output(_G, session));
462 pcall(option, session);
463 end
464 end
465 end