本文整理汇总了PHP中kuserPeer::setDefaultCriteriaFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP kuserPeer::setDefaultCriteriaFilter方法的具体用法?PHP kuserPeer::setDefaultCriteriaFilter怎么用?PHP kuserPeer::setDefaultCriteriaFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kuserPeer
的用法示例。
在下文中一共展示了kuserPeer::setDefaultCriteriaFilter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* Cleans up the environment after running a test.
*/
protected function tearDown()
{
kuserPeer::clearInstancePool();
UserLoginDataPeer::clearInstancePool();
kuserPeer::setDefaultCriteriaFilter(false);
UserLoginDataPeer::setUseCriteriaFilter(false);
$this->clientConfig = null;
$this->client = null;
$this->nextUserId = null;
foreach ($this->createdDbObjects as $obj) {
try {
if (get_class($obj) == 'kuser') {
$updated = kuserPeer::retrieveByPK($obj->getId());
if ($updated) {
$loginData = UserLoginDataPeer::retrieveByPK($updated->getLoginDataId());
if ($loginData) {
$loginData->delete();
}
}
}
$obj->delete();
} catch (PropelException $e) {
}
}
parent::tearDown();
}
示例2:
/**
* Returns the default criteria filter
*
* @return criteriaFilter The default criteria filter.
*/
public static function &getCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
kuserPeer::setDefaultCriteriaFilter();
}
return self::$s_criteria_filter;
}
示例3:
/**
* Returns the default criteria filter
*
* @return criteriaFilter The default criteria filter.
*/
public static function &getCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
kuserPeer::setDefaultCriteriaFilter();
}
$partnerCriteria = myPartnerUtils::getPartnerCriteriaParams('kuser');
if ($partnerCriteria) {
call_user_func_array(array('kuserPeer', 'addPartnerToCriteria'), $partnerCriteria);
}
return self::$s_criteria_filter;
}
示例4: loginImpl
/**
* Get a session using user email and password
*
* @param string $puserId
* @param string $loginEmail
* @param string $password
* @param int $partnerId
* @param int $expiry
* @param string $privileges
*
* @return string KS
*
* @throws KalturaErrors::USER_NOT_FOUND
* @thrown KalturaErrors::LOGIN_RETRIES_EXCEEDED
* @thrown KalturaErrors::LOGIN_BLOCKED
* @thrown KalturaErrors::PASSWORD_EXPIRED
* @thrown KalturaErrors::INVALID_PARTNER_ID
* @thrown KalturaErrors::INTERNAL_SERVERL_ERROR
* @throws KalturaErrors::USER_IS_BLOCKED
*/
protected function loginImpl($puserId, $loginEmail, $password, $partnerId = null, $expiry = 86400, $privileges = '*')
{
KalturaResponseCacher::disableCache();
kuserPeer::setDefaultCriteriaFilter();
kuserPeer::setUseCriteriaFilter(true);
// if a KS of a specific partner is used, don't allow logging in to a different partner
if ($this->getPartnerId() && $partnerId && $this->getPartnerId() != $partnerId) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $partnerId);
}
try {
if ($loginEmail) {
$user = UserLoginDataPeer::userLoginByEmail($loginEmail, $password, $partnerId);
} else {
$user = kuserPeer::userLogin($puserId, $password, $partnerId);
}
} catch (kUserException $e) {
$code = $e->getCode();
if ($code == kUserException::LOGIN_DATA_NOT_FOUND) {
throw new KalturaAPIException(KalturaErrors::USER_NOT_FOUND);
}
if ($code == kUserException::USER_NOT_FOUND) {
throw new KalturaAPIException(KalturaErrors::USER_NOT_FOUND);
} else {
if ($code == kUserException::LOGIN_RETRIES_EXCEEDED) {
throw new KalturaAPIException(KalturaErrors::LOGIN_RETRIES_EXCEEDED);
} else {
if ($code == kUserException::LOGIN_BLOCKED) {
throw new KalturaAPIException(KalturaErrors::LOGIN_BLOCKED);
} else {
if ($code == kUserException::PASSWORD_EXPIRED) {
throw new KalturaAPIException(KalturaErrors::PASSWORD_EXPIRED);
} else {
if ($code == kUserException::WRONG_PASSWORD) {
throw new KalturaAPIException(KalturaErrors::USER_WRONG_PASSWORD);
} else {
if ($code == kUserException::USER_IS_BLOCKED) {
throw new KalturaAPIException(KalturaErrors::USER_IS_BLOCKED);
}
}
}
}
}
}
throw new $e();
}
if (!$user) {
throw new KalturaAPIException(KalturaErrors::LOGIN_DATA_NOT_FOUND);
}
if ($partnerId && $user->getPartnerId() != $partnerId || $this->getPartnerId() && !$partnerId && $user->getPartnerId() != $this->getPartnerId()) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $partnerId);
}
$partner = PartnerPeer::retrieveByPK($user->getPartnerId());
if (!$partner || $partner->getStatus() == Partner::PARTNER_STATUS_FULL_BLOCK) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $user->getPartnerId());
}
$ks = null;
$admin = $user->getIsAdmin() ? KalturaSessionType::ADMIN : KalturaSessionType::USER;
// create a ks for this admin_kuser as if entered the admin_secret using the API
kSessionUtils::createKSessionNoValidations($partner->getId(), $user->getPuserId(), $ks, $expiry, $admin, "", $privileges);
return $ks;
}