public function testAuthHelperUnsuccessfullWithUnkownError()
 {
     $userRcEntries = array(array());
     OC_RoundCube_App::$RC_USER_ENTRIES = $userRcEntries;
     OC_RoundCube_App::$LOGIN_RESULT = false;
     $params = array("uid" => 'user', "password" => 'password');
     $loggedIn = OC_RoundCube_AuthHelper::login($params);
     $this->assertFalse($loggedIn, 'Should not be logged in');
 }
Ejemplo n.º 2
0
                }
            }
        } else {
            if ($param === 'removeHeaderNav') {
                OCP\Config::setAppValue('roundcube', 'removeHeaderNav', false);
            }
            if ($param === 'removeControlNav') {
                OCP\Config::setAppValue('roundcube', 'removeControlNav', false);
            }
            if ($param === 'autoLogin') {
                OCP\Config::setAppValue('roundcube', 'autoLogin', false);
            }
            if ($param === 'enableDebug') {
                OCP\Config::setAppValue('roundcube', 'enableDebug', false);
            }
            if ($param === 'rcNoCronRefresh') {
                OCP\Config::setAppValue('roundcube', 'rcNoCronRefresh', false);
            }
        }
    }
    // update login status
    $username = OCP\User::getUser();
    $params = array("uid" => $username);
    $loginHelper = new OC_RoundCube_AuthHelper();
    $loginHelper->login($params);
} else {
    OC_JSON::error(array("data" => array("message" => $l->t("Not submitted for us."))));
    return false;
}
OCP\JSON::success(array('data' => array('message' => $l->t('Application settings successfully stored.'))));
return true;
Ejemplo n.º 3
0
	$result = OC_RoundCube_App::cryptEmailIdentity($ocUser, $_POST['rc_mail_username'], $_POST['rc_mail_password'], true);

	if ($result) {
		// update login credentials
		$maildir = OCP\Config::getAppValue('roundcube', 'maildir', '');
		$rc_host = OCP\Config::getAppValue('roundcube', 'rcHost', '');
		if ($rc_host == '') {
			$rc_host = OC_Request::serverHost();
		}
		$params= array(
				"uid" => $_POST['rc_mail_username'],
				"password" => $_POST['rc_mail_password'],
		);
		// first logout
		// then login again
		OC_RoundCube_AuthHelper::logout($params);
		// then login again
		OC_RoundCube_AuthHelper::login($params);
	} else {
		OC_JSON::error(array("data" => array( "message" => $l->t("Unable to store email credentials in the data-base.") )));
		return false;
	}
} else {
	OC_JSON::error(array("data" => array( "message" => $l->t("Not submitted for us.") )));
	return false;
}

OCP\JSON::success(array('data' => array( 'message' => $l->t('Email-user credentials successfully stored. Please login again to OwnCloud for applying the new settings.') )));
return true;