2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "GUIPassword.h"
12 #include "GUIUserMessages.h"
13 #include "ServiceBroker.h"
16 #include "dialogs/GUIDialogGamepad.h"
17 #include "dialogs/GUIDialogNumeric.h"
18 #include "favourites/FavouritesService.h"
19 #include "guilib/GUIComponent.h"
20 #include "guilib/GUIKeyboardFactory.h"
21 #include "guilib/GUIWindowManager.h"
22 #include "guilib/LocalizeStrings.h"
23 #include "media/MediaLockState.h"
24 #include "messaging/ApplicationMessenger.h"
25 #include "messaging/helpers/DialogOKHelper.h"
26 #include "profiles/ProfileManager.h"
27 #include "profiles/dialogs/GUIDialogLockSettings.h"
28 #include "profiles/dialogs/GUIDialogProfileSettings.h"
29 #include "settings/MediaSourceSettings.h"
30 #include "settings/Settings.h"
31 #include "settings/SettingsComponent.h"
32 #include "utils/StringUtils.h"
33 #include "utils/URIUtils.h"
34 #include "utils/Variant.h"
35 #include "utils/log.h"
36 #include "view/ViewStateSettings.h"
40 using namespace KODI::MESSAGING
;
42 CGUIPassword::CGUIPassword(void)
44 iMasterLockRetriesLeft
= -1;
47 CGUIPassword::~CGUIPassword(void) = default;
50 bool CGUIPassword::IsItemUnlocked(T pItem
,
51 const std::string
& strType
,
52 const std::string
& strLabel
,
53 const std::string
& strHeading
)
55 const std::shared_ptr
<CProfileManager
> profileManager
=
56 CServiceBroker::GetSettingsComponent()->GetProfileManager();
57 if (profileManager
->GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE
)
60 while (pItem
->m_iHasLock
> LOCK_STATE_LOCK_BUT_UNLOCKED
)
62 const std::string strLockCode
= pItem
->m_strLockCode
;
63 int iResult
= 0; // init to user succeeded state, doing this to optimize switch statement below
64 if (!g_passwordManager
.bMasterUser
) // Check if we are the MasterUser!
66 if (0 != CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(
67 CSettings::SETTING_MASTERLOCK_MAXRETRIES
) &&
68 pItem
->m_iBadPwdCount
>= CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(
69 CSettings::SETTING_MASTERLOCK_MAXRETRIES
))
71 // user previously exhausted all retries, show access denied error
72 HELPERS::ShowOKDialogText(CVariant
{12345}, CVariant
{12346});
75 // show the appropriate lock dialog
76 iResult
= VerifyPassword(pItem
->m_iLockMode
, strLockCode
, strHeading
);
81 { // user canceled out
87 // password entry succeeded
88 pItem
->m_iBadPwdCount
= 0;
89 pItem
->m_iHasLock
= LOCK_STATE_LOCK_BUT_UNLOCKED
;
90 g_passwordManager
.LockSource(strType
, strLabel
, false);
91 CMediaSourceSettings::GetInstance().UpdateSource(strType
, strLabel
, "badpwdcount",
92 std::to_string(pItem
->m_iBadPwdCount
));
93 CMediaSourceSettings::GetInstance().Save();
95 // a mediasource has been unlocked successfully
96 // => refresh favourites due to possible visibility changes
97 CServiceBroker::GetFavouritesService().RefreshFavourites();
102 // password entry failed
103 if (0 != CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(
104 CSettings::SETTING_MASTERLOCK_MAXRETRIES
))
105 pItem
->m_iBadPwdCount
++;
106 CMediaSourceSettings::GetInstance().UpdateSource(strType
, strLabel
, "badpwdcount",
107 std::to_string(pItem
->m_iBadPwdCount
));
108 CMediaSourceSettings::GetInstance().Save();
113 // this should never happen, but if it does, do nothing
122 bool CGUIPassword::IsItemUnlocked(CFileItem
* pItem
, const std::string
& strType
)
124 const std::string strLabel
= pItem
->GetLabel();
125 std::string strHeading
;
126 if (pItem
->m_bIsFolder
)
127 strHeading
= g_localizeStrings
.Get(12325); // "Locked! Enter code..."
129 strHeading
= g_localizeStrings
.Get(12348); // "Item locked"
131 return IsItemUnlocked
<CFileItem
*>(pItem
, strType
, strLabel
, strHeading
);
134 bool CGUIPassword::IsItemUnlocked(CMediaSource
* pItem
, const std::string
& strType
)
136 const std::string strLabel
= pItem
->strName
;
137 const std::string
& strHeading
= g_localizeStrings
.Get(12325); // "Locked! Enter code..."
139 return IsItemUnlocked
<CMediaSource
*>(pItem
, strType
, strLabel
, strHeading
);
142 bool CGUIPassword::CheckStartUpLock()
144 // prompt user for mastercode if the mastercode was set b4 or by xml
145 int iVerifyPasswordResult
= -1;
147 const std::string
& strHeader
= g_localizeStrings
.Get(20075); // "Enter master lock code"
149 if (iMasterLockRetriesLeft
== -1)
150 iMasterLockRetriesLeft
= CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES
);
152 if (g_passwordManager
.iMasterLockRetriesLeft
== 0)
153 g_passwordManager
.iMasterLockRetriesLeft
= 1;
155 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
157 std::string strPassword
= profileManager
->GetMasterProfile().getLockCode();
159 if (profileManager
->GetMasterProfile().getLockMode() == 0)
160 iVerifyPasswordResult
= 0;
163 for (int i
=1; i
<= g_passwordManager
.iMasterLockRetriesLeft
; i
++)
165 iVerifyPasswordResult
= VerifyPassword(profileManager
->GetMasterProfile().getLockMode(), strPassword
, strHeader
);
166 if (iVerifyPasswordResult
!= 0 )
168 std::string strLabel1
;
169 strLabel1
= g_localizeStrings
.Get(12343); // "retries left"
170 int iLeft
= g_passwordManager
.iMasterLockRetriesLeft
-i
;
171 std::string strLabel
= StringUtils::Format("{} {}", iLeft
, strLabel1
);
173 // PopUp OK and Display: MasterLock mode has changed but no new Mastercode has been set!
174 HELPERS::ShowOKDialogLines(CVariant
{12360}, CVariant
{12367}, CVariant
{strLabel
}, CVariant
{""});
177 i
=g_passwordManager
.iMasterLockRetriesLeft
;
181 if (iVerifyPasswordResult
== 0)
183 g_passwordManager
.iMasterLockRetriesLeft
= CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES
);
184 return true; // OK The MasterCode Accepted! XBMC Can Run!
188 CServiceBroker::GetAppMessenger()->PostMsg(TMSG_SHUTDOWN
); // Turn off the box
193 bool CGUIPassword::SetMasterLockMode(bool bDetails
)
195 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
197 CProfile
* profile
= profileManager
->GetProfile(0);
200 CProfile::CLock locks
= profile
->GetLocks();
201 // prompt user for master lock
202 if (CGUIDialogLockSettings::ShowAndGetLock(locks
, 12360, true, bDetails
))
204 profile
->SetLocks(locks
);
211 bool CGUIPassword::IsProfileLockUnlocked(int iProfile
)
214 return IsProfileLockUnlocked(iProfile
,bDummy
,true);
217 bool CGUIPassword::IsProfileLockUnlocked(int iProfile
, bool& bCanceled
, bool prompt
)
219 if (g_passwordManager
.bMasterUser
)
222 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
224 int iProfileToCheck
= iProfile
;
226 iProfileToCheck
= profileManager
->GetCurrentProfileIndex();
228 if (iProfileToCheck
== 0)
229 return IsMasterLockUnlocked(prompt
,bCanceled
);
232 const CProfile
*profile
= profileManager
->GetProfile(iProfileToCheck
);
237 return (profile
->getLockMode() == LOCK_MODE_EVERYONE
);
239 if (profile
->getDate().empty() &&
240 (profileManager
->GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE
||
241 profile
->getLockMode() == LOCK_MODE_EVERYONE
))
243 // user hasn't set a password and this is the first time they've used this account
244 // so prompt for password/settings
245 if (CGUIDialogProfileSettings::ShowForProfile(iProfileToCheck
, true))
250 if (profileManager
->GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE
)
251 // prompt user for profile lock code
252 return CheckLock(profile
->getLockMode(),profile
->getLockCode(),20095,bCanceled
);
259 bool CGUIPassword::IsMasterLockUnlocked(bool bPromptUser
)
262 return IsMasterLockUnlocked(bPromptUser
,bDummy
);
265 bool CGUIPassword::IsMasterLockUnlocked(bool bPromptUser
, bool& bCanceled
)
269 if (iMasterLockRetriesLeft
== -1)
270 iMasterLockRetriesLeft
= CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES
);
272 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
274 if ((LOCK_MODE_EVERYONE
< profileManager
->GetMasterProfile().getLockMode() && !bMasterUser
) && !bPromptUser
)
276 // not unlocked, but calling code doesn't want to prompt user
280 if (g_passwordManager
.bMasterUser
|| profileManager
->GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE
)
283 if (iMasterLockRetriesLeft
== 0)
285 UpdateMasterLockRetryCount(false);
289 // no, unlock since we are allowed to prompt
290 const std::string
& strHeading
= g_localizeStrings
.Get(20075);
291 std::string strPassword
= profileManager
->GetMasterProfile().getLockCode();
293 int iVerifyPasswordResult
= VerifyPassword(profileManager
->GetMasterProfile().getLockMode(), strPassword
, strHeading
);
294 if (1 == iVerifyPasswordResult
)
295 UpdateMasterLockRetryCount(false);
297 if (0 != iVerifyPasswordResult
)
303 // user successfully entered mastercode
304 UpdateMasterLockRetryCount(true);
308 void CGUIPassword::UpdateMasterLockRetryCount(bool bResetCount
)
310 // \brief Updates Master Lock status.
311 // \param bResetCount masterlock retry counter is zeroed if true, or incremented and displays an Access Denied dialog if false.
314 // Bad mastercode entered
315 if (0 < CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES
))
317 // We're keeping track of how many bad passwords are entered
318 if (1 < g_passwordManager
.iMasterLockRetriesLeft
)
320 // user still has at least one retry after decrementing
321 g_passwordManager
.iMasterLockRetriesLeft
--;
325 // user has run out of retry attempts
326 g_passwordManager
.iMasterLockRetriesLeft
= 0;
327 // Tell the user they ran out of retry attempts
328 HELPERS::ShowOKDialogText(CVariant
{12345}, CVariant
{12346});
332 std::string dlgLine1
= "";
333 if (0 < g_passwordManager
.iMasterLockRetriesLeft
)
334 dlgLine1
= StringUtils::Format("{} {}", g_passwordManager
.iMasterLockRetriesLeft
,
335 g_localizeStrings
.Get(12343)); // "retries left"
336 // prompt user for master lock code
337 HELPERS::ShowOKDialogLines(CVariant
{20075}, CVariant
{12345}, CVariant
{std::move(dlgLine1
)}, CVariant
{0});
340 g_passwordManager
.iMasterLockRetriesLeft
= CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(CSettings::SETTING_MASTERLOCK_MAXRETRIES
); // user entered correct mastercode, reset retries to max allowed
343 bool CGUIPassword::CheckLock(LockType btnType
, const std::string
& strPassword
, int iHeading
)
346 return CheckLock(btnType
,strPassword
,iHeading
,bDummy
);
349 bool CGUIPassword::CheckLock(LockType btnType
, const std::string
& strPassword
, int iHeading
, bool& bCanceled
)
353 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
355 if (btnType
== LOCK_MODE_EVERYONE
||
356 strPassword
== "-" ||
357 profileManager
->GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE
||
358 g_passwordManager
.bMasterUser
)
363 const std::string
& strHeading
= g_localizeStrings
.Get(iHeading
);
364 int iVerifyPasswordResult
= VerifyPassword(btnType
, strPassword
, strHeading
);
366 if (iVerifyPasswordResult
== -1)
369 return (iVerifyPasswordResult
==0);
372 bool CGUIPassword::CheckSettingLevelLock(const SettingLevel
& level
, bool enforce
/*=false*/)
374 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
376 LOCK_LEVEL::SETTINGS_LOCK lockLevel
= profileManager
->GetCurrentProfile().settingsLockLevel();
378 if (lockLevel
== LOCK_LEVEL::NONE
)
381 //check if we are already in settings and in an level that needs unlocking
382 int windowID
= CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow();
383 if ((int)lockLevel
-1 <= (short)CViewStateSettings::GetInstance().GetSettingLevel() &&
384 (windowID
== WINDOW_SETTINGS_MENU
||
385 (windowID
>= WINDOW_SCREEN_CALIBRATION
&&
386 windowID
<= WINDOW_SETTINGS_MYPVR
)))
387 return true; //Already unlocked
389 else if (lockLevel
== LOCK_LEVEL::ALL
)
390 return IsMasterLockUnlocked(true);
391 else if ((int)lockLevel
-1 <= (short)level
)
394 return IsMasterLockUnlocked(true);
395 else if (!IsMasterLockUnlocked(false))
397 //Current Setting level is higher than our permission... so lower the viewing level
398 SettingLevel newLevel
= (SettingLevel
)(short)(lockLevel
-2);
399 CViewStateSettings::GetInstance().SetSettingLevel(newLevel
);
406 bool IsSettingsWindow(int iWindowID
)
408 return (iWindowID
>= WINDOW_SCREEN_CALIBRATION
&& iWindowID
<= WINDOW_SETTINGS_MYPVR
)
409 || iWindowID
== WINDOW_SKIN_SETTINGS
;
412 bool CGUIPassword::CheckMenuLock(int iWindowID
)
414 bool bCheckPW
= false;
415 int iSwitch
= iWindowID
;
417 // check if a settings subcategory was called from other than settings window
418 if (IsSettingsWindow(iWindowID
))
420 int iCWindowID
= CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow();
421 if (iCWindowID
!= WINDOW_SETTINGS_MENU
&& !IsSettingsWindow(iCWindowID
))
422 iSwitch
= WINDOW_SETTINGS_MENU
;
425 if (iWindowID
== WINDOW_MUSIC_NAV
)
427 if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_HOME
)
428 iSwitch
= WINDOW_MUSIC_NAV
;
431 if (iWindowID
== WINDOW_VIDEO_NAV
)
433 if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() == WINDOW_HOME
)
434 iSwitch
= WINDOW_VIDEO_NAV
;
437 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
441 case WINDOW_SETTINGS_MENU
: // Settings
442 return CheckSettingLevelLock(CViewStateSettings::GetInstance().GetSettingLevel());
444 case WINDOW_ADDON_BROWSER
: // Addons
445 bCheckPW
= profileManager
->GetCurrentProfile().addonmanagerLocked();
447 case WINDOW_FILES
: // Files
448 bCheckPW
= profileManager
->GetCurrentProfile().filesLocked();
450 case WINDOW_PROGRAMS
: // Programs
451 bCheckPW
= profileManager
->GetCurrentProfile().programsLocked();
453 case WINDOW_MUSIC_NAV
: // Music
454 bCheckPW
= profileManager
->GetCurrentProfile().musicLocked();
455 if (!bCheckPW
&& !m_strMediaSourcePath
.empty()) // check mediasource by path
456 return g_passwordManager
.IsMediaPathUnlocked(profileManager
, "music");
458 case WINDOW_VIDEO_NAV
: // Video
459 bCheckPW
= profileManager
->GetCurrentProfile().videoLocked();
460 if (!bCheckPW
&& !m_strMediaSourcePath
.empty()) // check mediasource by path
461 return g_passwordManager
.IsMediaPathUnlocked(profileManager
, "video");
463 case WINDOW_PICTURES
: // Pictures
464 bCheckPW
= profileManager
->GetCurrentProfile().picturesLocked();
466 case WINDOW_GAMES
: // Games
467 bCheckPW
= profileManager
->GetCurrentProfile().gamesLocked();
469 case WINDOW_SETTINGS_PROFILES
:
477 return IsMasterLockUnlocked(true); //Now let's check the PW if we need!
482 bool CGUIPassword::LockSource(const std::string
& strType
, const std::string
& strName
, bool bState
)
484 VECSOURCES
* pShares
= CMediaSourceSettings::GetInstance().GetSources(strType
);
485 bool bResult
= false;
486 for (IVECSOURCES it
=pShares
->begin();it
!= pShares
->end();++it
)
488 if (it
->strName
== strName
)
490 if (it
->m_iHasLock
> LOCK_STATE_NO_LOCK
)
492 it
->m_iHasLock
= bState
? LOCK_STATE_LOCKED
: LOCK_STATE_LOCK_BUT_UNLOCKED
;
498 CGUIMessage
msg(GUI_MSG_NOTIFY_ALL
,0,0,GUI_MSG_UPDATE_SOURCES
);
499 CServiceBroker::GetGUI()->GetWindowManager().SendThreadMessage(msg
);
504 void CGUIPassword::LockSources(bool lock
)
506 // lock or unlock all sources (those with locks)
507 const char* strTypes
[] = {"programs", "music", "video", "pictures", "files", "games"};
508 for (const char* const strType
: strTypes
)
510 VECSOURCES
*shares
= CMediaSourceSettings::GetInstance().GetSources(strType
);
511 for (IVECSOURCES it
=shares
->begin();it
!= shares
->end();++it
)
512 if (it
->m_iLockMode
!= LOCK_MODE_EVERYONE
)
513 it
->m_iHasLock
= lock
? LOCK_STATE_LOCKED
: LOCK_STATE_LOCK_BUT_UNLOCKED
;
515 CGUIMessage
msg(GUI_MSG_NOTIFY_ALL
,0,0,GUI_MSG_UPDATE_SOURCES
);
516 CServiceBroker::GetGUI()->GetWindowManager().SendThreadMessage(msg
);
519 void CGUIPassword::RemoveSourceLocks()
521 // remove lock from all sources
522 const char* strTypes
[] = {"programs", "music", "video", "pictures", "files", "games"};
523 for (const char* const strType
: strTypes
)
525 VECSOURCES
*shares
= CMediaSourceSettings::GetInstance().GetSources(strType
);
526 for (IVECSOURCES it
=shares
->begin();it
!= shares
->end();++it
)
527 if (it
->m_iLockMode
!= LOCK_MODE_EVERYONE
) // remove old info
529 it
->m_iHasLock
= LOCK_STATE_NO_LOCK
;
530 it
->m_iLockMode
= LOCK_MODE_EVERYONE
;
532 // remove locks from xml
533 CMediaSourceSettings::GetInstance().UpdateSource(strType
, it
->strName
, "lockmode", "0");
536 CMediaSourceSettings::GetInstance().Save();
537 CGUIMessage
msg(GUI_MSG_NOTIFY_ALL
,0,0, GUI_MSG_UPDATE_SOURCES
);
538 CServiceBroker::GetGUI()->GetWindowManager().SendThreadMessage(msg
);
541 bool CGUIPassword::IsDatabasePathUnlocked(const std::string
& strPath
, VECSOURCES
& vecSources
)
543 const std::shared_ptr
<CProfileManager
> profileManager
= CServiceBroker::GetSettingsComponent()->GetProfileManager();
545 if (g_passwordManager
.bMasterUser
|| profileManager
->GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE
)
548 // Don't check plugin paths as they don't have an entry in sources.xml
549 // Base locked status on videos being locked and being in the video
550 // navigation screen (must have passed lock by then)
552 if (url
.IsProtocol("plugin"))
553 return !(profileManager
->GetCurrentProfile().videoLocked() &&
554 CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_VIDEO_NAV
);
556 // try to find the best matching source
558 int iIndex
= CUtil::GetMatchingSource(strPath
, vecSources
, bName
);
560 if (iIndex
> -1 && iIndex
< static_cast<int>(vecSources
.size()))
561 if (vecSources
[iIndex
].m_iHasLock
< LOCK_STATE_LOCKED
)
567 bool CGUIPassword::IsMediaPathUnlocked(const std::shared_ptr
<CProfileManager
>& profileManager
,
568 const std::string
& strType
) const
570 if (!StringUtils::StartsWithNoCase(m_strMediaSourcePath
, "root") &&
571 !StringUtils::StartsWithNoCase(m_strMediaSourcePath
, "library://"))
573 if (!g_passwordManager
.bMasterUser
&&
574 profileManager
->GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE
)
576 VECSOURCES
& vecSources
= *CMediaSourceSettings::GetInstance().GetSources(strType
);
578 int iIndex
= CUtil::GetMatchingSource(m_strMediaSourcePath
, vecSources
, bName
);
579 if (iIndex
> -1 && iIndex
< static_cast<int>(vecSources
.size()))
581 return g_passwordManager
.IsItemUnlocked(&vecSources
[iIndex
], strType
);
589 bool CGUIPassword::IsMediaFileUnlocked(const std::string
& type
, const std::string
& file
) const
591 std::vector
<CMediaSource
>* vecSources
= CMediaSourceSettings::GetInstance().GetSources(type
);
596 "{}: CMediaSourceSettings::GetInstance().GetSources(\"{}\") returned nullptr.",
601 // try to find the best matching source for this file
603 bool isSourceName
{false};
604 const std::string fileBasePath
= URIUtils::GetBasePath(file
);
606 int iIndex
= CUtil::GetMatchingSource(fileBasePath
, *vecSources
, isSourceName
);
608 if (iIndex
> -1 && iIndex
< static_cast<int>(vecSources
->size()))
609 return (*vecSources
)[iIndex
].m_iHasLock
< LOCK_STATE_LOCKED
;
614 void CGUIPassword::OnSettingAction(const std::shared_ptr
<const CSetting
>& setting
)
619 const std::string
&settingId
= setting
->GetId();
620 if (settingId
== CSettings::SETTING_MASTERLOCK_LOCKCODE
)
624 int CGUIPassword::VerifyPassword(LockType btnType
, const std::string
& strPassword
, const std::string
& strHeading
)
626 int iVerifyPasswordResult
;
629 case LOCK_MODE_NUMERIC
:
630 iVerifyPasswordResult
= CGUIDialogNumeric::ShowAndVerifyPassword(const_cast<std::string
&>(strPassword
), strHeading
, 0);
632 case LOCK_MODE_GAMEPAD
:
633 iVerifyPasswordResult
= CGUIDialogGamepad::ShowAndVerifyPassword(const_cast<std::string
&>(strPassword
), strHeading
, 0);
635 case LOCK_MODE_QWERTY
:
636 iVerifyPasswordResult
= CGUIKeyboardFactory::ShowAndVerifyPassword(const_cast<std::string
&>(strPassword
), strHeading
, 0);
638 default: // must not be supported, treat as unlocked
639 iVerifyPasswordResult
= 0;
643 return iVerifyPasswordResult
;