bool CGUIPassword::IsProfileLockUnlocked(int iProfile)
{
bool bDummy;
- return IsProfileLockUnlocked(iProfile,bDummy);
+ return IsProfileLockUnlocked(iProfile,bDummy,true);
}
-bool CGUIPassword::IsProfileLockUnlocked(int iProfile, bool& bCanceled)
+bool CGUIPassword::IsProfileLockUnlocked(int iProfile, bool& bCanceled, bool prompt)
{
if (g_passwordManager.bMasterUser)
return true;
if (iProfile == -1)
iProfileToCheck = g_settings.GetCurrentProfileIndex();
if (iProfileToCheck == 0)
- return IsMasterLockUnlocked(true,bCanceled);
+ return IsMasterLockUnlocked(prompt,bCanceled);
else
{
CProfile *profile = g_settings.GetProfile(iProfileToCheck);
if (!profile)
return false;
+
+ if (!prompt)
+ return (profile->getLockMode() == LOCK_MODE_EVERYONE);
+
if (profile->getDate().IsEmpty() &&
(g_settings.GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE ||
profile->getLockMode() == LOCK_MODE_EVERYONE))
bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading);
bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading, bool& bCanceled);
bool IsProfileLockUnlocked(int iProfile=-1);
- bool IsProfileLockUnlocked(int iProfile, bool& bCanceled);
+ bool IsProfileLockUnlocked(int iProfile, bool& bCanceled, bool prompt = true);
bool IsMasterLockUnlocked(bool bPromptUser);
bool IsMasterLockUnlocked(bool bPromptUser, bool& bCanceled);
{
g_application.getApplicationMessenger().Minimize();
}
- else if (execute.Equals("loadprofile") && g_settings.GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE)
+ else if (execute.Equals("loadprofile"))
{
int index = g_settings.GetProfileIndex(parameter);
- if (index >= 0)
+ bool prompt = (params.size() == 2 && params[1].Equals("prompt"));
+ bool bCanceled;
+ if (index >= 0
+ && (g_settings.GetMasterProfile().getLockMode() == LOCK_MODE_EVERYONE
+ || g_passwordManager.IsProfileLockUnlocked(index,bCanceled,prompt)))
+ {
+
CGUIWindowLoginScreen::LoadProfile(index);
+ }
}
else if (execute.Equals("mastermode"))
{