Check if user isset in $_REQUEST first

This commit is contained in:
Robin Appelman 2015-12-11 13:52:04 +01:00 committed by Lukas Reschke
parent 74de12c698
commit 9d732e35e1
1 changed files with 5 additions and 3 deletions

View File

@ -951,9 +951,11 @@ class OC_Util {
$parameters['canResetPassword'] = true;
if (!\OC::$server->getSystemConfig()->getValue('lost_password_link')) {
$user = \OC::$server->getUserManager()->get($_REQUEST['user']);
if ($user instanceof IUser) {
$parameters['canResetPassword'] = $user->canChangePassword();
if (isset($_REQUEST['user'])) {
$user = \OC::$server->getUserManager()->get($_REQUEST['user']);
if ($user instanceof IUser) {
$parameters['canResetPassword'] = $user->canChangePassword();
}
}
}