diff --git a/mythtv/programs/mythwelcome/welcomedialog.cpp b/mythtv/programs/mythwelcome/welcomedialog.cpp
index 743519e..bb107ae 100644
--- a/mythtv/programs/mythwelcome/welcomedialog.cpp
+++ b/mythtv/programs/mythwelcome/welcomedialog.cpp
@@ -1,5 +1,6 @@
 // ANSI C
 #include <cstdlib>
+#include <fstream>
 
 // POSIX
 #include <unistd.h>
@@ -23,9 +24,13 @@
 #include "welcomedialog.h"
 #include "welcomesettings.h"
 
-#define UPDATE_STATUS_INTERVAL   30000
-#define UPDATE_SCREEN_INTERVAL   15000
+#define UPDATE_STATUS_INTERVAL          30000
+#define UPDATE_SCREEN_INTERVAL          15000
 
+#define ACTION_CLOSE                    1
+#define ACTION_SHOW_WELCOME_SETTINGS    2
+#define ACTION_SHOW_SHUTDOWN_SETTINGS   3
+            
 
 WelcomeDialog::WelcomeDialog(MythScreenStack *parent, const char *name)
               :MythScreenType(parent, name),
@@ -49,6 +54,7 @@ WelcomeDialog::WelcomeDialog(MythScreenStack *parent, const char *name)
     m_timeFormat = gCoreContext->GetSetting("TimeFormat", "h:mm AP");
     m_dateFormat = gCoreContext->GetSetting("MythWelcomeDateFormat", "dddd\\ndd MMM yyyy");
     m_dateFormat.replace("\\n", "\n");
+    m_closePasswordSetting = "MythWelcomeExitPIN";
 
     // if idleTimeoutSecs is 0, the user disabled the auto-shutdown feature
     m_bWillShutdown = (gCoreContext->GetNumSetting("idleTimeoutSecs", 0) != 0);
@@ -212,6 +218,27 @@ void WelcomeDialog::customEvent(QEvent *e)
     }
 }
 
+void WelcomeDialog::showWelcomeSettings(void)
+{
+    MythWelcomeSettings settings;
+    if (kDialogCodeAccepted == settings.exec())
+    {
+        RemoteSendMessage("CLEAR_SETTINGS_CACHE");
+        updateStatus();
+        updateScreen();
+
+        m_dateFormat = gCoreContext->GetSetting("MythWelcomeDateFormat", "dddd\\ndd MMM yyyy");
+        m_dateFormat.replace("\\n", "\n");
+    }
+}
+
+void WelcomeDialog::showShutdownSettings(void)
+{
+    MythShutdownSettings settings;
+    if (kDialogCodeAccepted == settings.exec())
+        RemoteSendMessage("CLEAR_SETTINGS_CACHE");
+}
+
 bool WelcomeDialog::keyPressEvent(QKeyEvent *event)
 {
     if (GetFocusWidget()->keyPressEvent(event))
@@ -238,24 +265,13 @@ bool WelcomeDialog::keyPressEvent(QKeyEvent *event)
         {
             Close();
         }
-        else if (action == "INFO")
+        else if ( (action == "INFO") && checkPinCode("MythWelcome settings", ACTION_SHOW_WELCOME_SETTINGS) )
         {
-            MythWelcomeSettings settings;
-            if (kDialogCodeAccepted == settings.exec())
-            {
-                RemoteSendMessage("CLEAR_SETTINGS_CACHE");
-                updateStatus();
-                updateScreen();
-
-                m_dateFormat = gCoreContext->GetSetting("MythWelcomeDateFormat", "dddd\\ndd MMM yyyy");
-                m_dateFormat.replace("\\n", "\n");
-            }
+            showWelcomeSettings();
         }
-        else if (action == "SHOWSETTINGS")
+        else if ( (action == "SHOWSETTINGS") && checkPinCode("MythShutdown settings", ACTION_SHOW_SHUTDOWN_SETTINGS) )
         {
-            MythShutdownSettings settings;
-            if (kDialogCodeAccepted == settings.exec())
-                RemoteSendMessage("CLEAR_SETTINGS_CACHE");
+            showShutdownSettings();
         }
         else if (action == "0")
         {
@@ -307,6 +323,15 @@ bool WelcomeDialog::keyPressEvent(QKeyEvent *event)
 
 void WelcomeDialog::closeDialog()
 {
+    if ( !checkPinCode("Exit PIN", ACTION_CLOSE) )
+    {
+        // password dialog is created, checking will be done in closePasswordCheck function
+        // return without closing now
+        updateStatusMessage();
+        updateScreen();
+        return;
+    }
+
     Close();
 }
 
@@ -614,6 +639,7 @@ void WelcomeDialog::showMenu(void)
 
     m_menuPopup->AddButton(tr("Run mythfilldatabase"), SLOT(runEPGGrabber()));
     m_menuPopup->AddButton(tr("Shutdown Now"), SLOT(shutdownNow()));
+    m_menuPopup->AddButton(tr("Reboot Now"), SLOT(rebootNow()));
     m_menuPopup->AddButton(tr("Exit"), SLOT(closeDialog()));
     m_menuPopup->AddButton(tr("Cancel"));
 }
@@ -642,39 +668,44 @@ void WelcomeDialog::runEPGGrabber(void)
     updateScreen();
 }
 
-void WelcomeDialog::shutdownNow(void)
+void WelcomeDialog::shutdownNow(bool is_poweroff)
 {
+    // is_poweroff is true by default, so calling from shutdown menu it perform a real shutdown
+    // rebootNow function will call this function with false as parameter
+    QString poweroff_cmd = gCoreContext->GetSetting(is_poweroff ? "MythShutdownPowerOff" : "MythShutdownReboot", "");
+    if ( poweroff_cmd.isEmpty() ) return;
+    
     // if this is a frontend only machine just shut down now
     if (gCoreContext->IsFrontendOnly())
     {
-        VERBOSE(VB_GENERAL, "MythWelcome is shutting this computer down now");
-        QString poweroff_cmd = gCoreContext->GetSetting("MythShutdownPowerOff", "");
-        if (!poweroff_cmd.isEmpty())
-            myth_system(poweroff_cmd);
+        VERBOSE(VB_GENERAL, QString("MythWelcome is %1 this computer %2now")
+                .arg(is_poweroff ? "shutting" : "rebooting")
+                .arg(is_poweroff ? "down" : ""));
+        myth_system(poweroff_cmd);
         return;
     }
 
     // don't shutdown if we are recording
     if (m_isRecording)
     {
-        MythPopupBox::showOkPopup(GetMythMainWindow(), "Cannot shutdown",
-                tr("Cannot shutdown because MythTV is currently recording"));
+        MythPopupBox::showOkPopup(GetMythMainWindow(), QString("Cannot %1").arg(is_poweroff ? "shutdown" : "reboot"),
+                QString("Cannot %1 because MythTV is currently recording").arg(is_poweroff ? "shutdown" : "reboot"));
         return;
     }
 
     QDateTime curtime = QDateTime::currentDateTime();
 
-    // don't shutdown if we are about to start recording
+    // don't shutdown/reboot if we are about to start recording
     if (!m_nextRecordingStart.isNull() &&
         curtime.secsTo(m_nextRecordingStart) - m_preRollSeconds <
         (m_idleWaitForRecordingTime * 60) + m_idleTimeoutSecs)
     {
-        MythPopupBox::showOkPopup(GetMythMainWindow(), "Cannot shutdown",
-                tr("Cannot shutdown because MythTV is about to start recording"));
+        MythPopupBox::showOkPopup(GetMythMainWindow(), QString("Cannot %1").arg(is_poweroff ? "shutdown" : "reboot"),
+                QString("Cannot %1 because MythTV is about to start recording").arg(is_poweroff ? "shutdown" : "reboot"));
         return;
     }
 
-    // don't shutdown if we are about to start a wakeup/shutdown period
+    // don't shutdown/reboot if we are about to start a wakeup/shutdown period
     QString mythshutdown_exe_status =
         m_installDir + "/bin/mythshutdown --status 0";
     int statusCode = system(mythshutdown_exe_status.toLocal8Bit().constData());
@@ -683,9 +714,8 @@ void WelcomeDialog::shutdownNow(void)
 
     if (statusCode & 128)
     {
-        MythPopupBox::showOkPopup(GetMythMainWindow(), "Cannot shutdown",
-                tr("Cannot shutdown because MythTV is about to start "
-                "a wakeup/shutdown period."));
+        MythPopupBox::showOkPopup(GetMythMainWindow(), QString("Cannot %1").arg(is_poweroff ? "shutdown" : "reboot"),
+                QString("Cannot %1 because MythTV is about to start a wakeup/shutdown period.").arg(is_poweroff ? "shutdown" : "reboot"));
         return;
     }
 
@@ -721,9 +751,77 @@ void WelcomeDialog::shutdownNow(void)
         }
     }
 
-    // run command to set wakeuptime in bios and shutdown the system
-    QString mythshutdown_exe =
-        "sudo " + m_installDir + "/bin/mythshutdown --shutdown";
-    myth_system(mythshutdown_exe);
+    // run command to set wakeuptime in bios and shutdown/reboot the system
+    myth_system(poweroff_cmd);
+}
+
+void WelcomeDialog::rebootNow(void)
+{
+    // run shutdown function with parameter false, so a reboot will be performed
+    shutdownNow(false);
+}
+
+bool WelcomeDialog::checkPinCode(const QString &title, uint action)
+{
+    if ( gCoreContext->GetNumSetting(m_closePasswordSetting, 0) )
+    {
+        QString password = gCoreContext->GetSetting(m_closePasswordSetting);
+
+        if (!password.isEmpty())
+        {
+            // exit password is set, delay action until valid password is entered
+            VERBOSE(VB_GENERAL, QString("Using Password: %1").arg(m_closePasswordSetting));
+
+            MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+            MythTextInputDialog *pwd =
+                    new MythTextInputDialog(mainStack, title, FilterNone, true);
+            switch(action)
+            {
+                default:
+                case ACTION_CLOSE:
+                    connect(pwd, SIGNAL(haveResult(QString)),SLOT(closePasswordCheck(QString)));
+                    break;
+                case ACTION_SHOW_WELCOME_SETTINGS:
+                    connect(pwd, SIGNAL(haveResult(QString)),SLOT(showWelcomeSettingsPasswordCheck(QString)));
+                    break;
+                case ACTION_SHOW_SHUTDOWN_SETTINGS:
+                    connect(pwd, SIGNAL(haveResult(QString)),SLOT(showShutdownSettingsPasswordCheck(QString)));
+                    break;
+            }
+            if (pwd->Create())
+            {
+                mainStack->AddScreen(pwd, false);
+            }
+            // password dialog is created, checking will be done in specified action function
+            updateStatusMessage();
+            updateScreen();
+            // return false, so no action will be done
+            return false;
+        }
+    }
+    return true;
+}
+
+void WelcomeDialog::closePasswordCheck(const QString &password)
+{
+    QString exit_password = gCoreContext->GetSetting(m_closePasswordSetting);
+    VERBOSE(VB_GENERAL, QString("closePasswordCheck"));
+
+    if (exit_password == password) Close();
+}
+
+void WelcomeDialog::showWelcomeSettingsPasswordCheck(const QString &password)
+{
+    QString exit_password = gCoreContext->GetSetting(m_closePasswordSetting);
+    VERBOSE(VB_GENERAL, QString("showWelcomeSettingsPasswordCheck"));
+
+    if (exit_password == password) showWelcomeSettings();
 }
 
+void WelcomeDialog::showShutdownSettingsPasswordCheck(const QString &password)
+{
+    QString exit_password = gCoreContext->GetSetting(m_closePasswordSetting);
+    VERBOSE(VB_GENERAL, QString("showShutdownSettingsPasswordCheck"));
+
+    if (exit_password == password) showShutdownSettings();
+}
diff --git a/mythtv/programs/mythwelcome/welcomedialog.h b/mythtv/programs/mythwelcome/welcomedialog.h
index 1f16c59..c6a6b7a 100644
--- a/mythtv/programs/mythwelcome/welcomedialog.h
+++ b/mythtv/programs/mythwelcome/welcomedialog.h
@@ -34,13 +34,20 @@ class WelcomeDialog : public MythScreenType
     void updateScreen(void);
     void closeDialog(void);
     void showMenu(void);
-    void shutdownNow(void);
+    void shutdownNow(bool is_poweroff=true);
+    void rebootNow(void);
     void runEPGGrabber(void);
     void lockShutdown(void);
     void unlockShutdown(void);
     bool updateRecordingList(void);
     bool updateScheduledList(void);
-
+    void showWelcomeSettings(void);
+    void showShutdownSettings(void);
+    bool checkPinCode(const QString &title, uint action);
+    void closePasswordCheck(const QString &password);
+    void showWelcomeSettingsPasswordCheck(const QString &password);
+    void showShutdownSettingsPasswordCheck(const QString &password);
+    
   private:
     void updateStatusMessage(void);
     bool checkConnectionToServer(void);
@@ -78,6 +85,7 @@ class WelcomeDialog : public MythScreenType
     uint           m_statusListNo;
     QStringList    m_statusList;
     bool           m_frontendIsRunning;
+    QString        m_closePasswordSetting;
 
     vector<TunerStatus> m_tunerList;
     ProgramDetailList   m_scheduledList;
diff --git a/mythtv/programs/mythwelcome/welcomesettings.cpp b/mythtv/programs/mythwelcome/welcomesettings.cpp
index 39c85d2..7970018 100644
--- a/mythtv/programs/mythwelcome/welcomesettings.cpp
+++ b/mythtv/programs/mythwelcome/welcomesettings.cpp
@@ -85,6 +85,7 @@ static HostLineEdit *MythWelcomeDateFormat()
     return gc;
 };
 
+
 MythWelcomeSettings::MythWelcomeSettings()
 {
     HorizontalConfigurationGroup* hcg1 =
@@ -196,6 +197,17 @@ static HostLineEdit *MythShutdownXTermCmd()
     return gc;
 };
 
+static HostLineEdit *MythWelcomeExitPIN()
+{
+    HostLineEdit *gc = new HostLineEdit("MythWelcomeExitPIN");
+    gc->setLabel(QObject::tr("Exit PIN"));
+    gc->setValue("");
+    gc->setHelpText(QObject::tr("Enter a PIN to protect MythWelcome from exit. "
+                                "It also protect from accessing to setting screen. "
+                                "Leave it blank to disable it. "));
+    return gc;
+};
+
 
 MythShutdownSettings::MythShutdownSettings()
 {
@@ -210,6 +222,7 @@ MythShutdownSettings::MythShutdownSettings()
     vcg->addChild(MythShutdownPowerOff());
     vcg->addChild(MythShutdownXTermCmd());
     vcg->addChild(MythShutdownStartFECmd());
+    vcg->addChild(MythWelcomeExitPIN());
 
     addChild(vcg);
 }
