当前位置: 首页>>代码示例>>PHP>>正文


PHP kuserPeer类代码示例

本文整理汇总了PHP中kuserPeer的典型用法代码示例。如果您正苦于以下问题:PHP kuserPeer类的具体用法?PHP kuserPeer怎么用?PHP kuserPeer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了kuserPeer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $user_id = $this->getPM("user_id");
     $new_user_id = $this->getPM("new_user_id");
     $target_puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($partner_id, null, $user_id, true);
     if (!$target_puser_kuser) {
         $this->addError(APIErrors::INVALID_USER_ID, $user_id);
         return;
     }
     $new_puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($partner_id, null, $new_user_id, true);
     $kuser = kuserPeer::getKuserByPartnerAndUid($partner_id, $new_user_id);
     if ($new_puser_kuser || $kuser) {
         $this->addError(APIErrors::DUPLICATE_USER_BY_ID, $new_user_id);
         return;
     }
     $target_puser_kuser->setPuserId($new_user_id);
     $target_puser_kuser->save();
     PuserKuserPeer::removeFromCache($target_puser_kuser);
     $kuser = $target_puser_kuser->getKuser();
     $kuser->setPuserId($target_puser_kuser->getPuserId());
     $kuser->save();
     $wrapper = objectWrapperBase::getWrapperClass($target_puser_kuser, objectWrapperBase::DETAIL_LEVEL_DETAILED);
     $wrapper->removeFromCache("PuserKuser", $target_puser_kuser->getId());
     $this->addMsg("user", $wrapper);
 }
开发者ID:DBezemer,项目名称:server,代码行数:25,代码来源:updateuseridAction.class.php

示例2: deleteAction

 /**
  * delete by userId and groupId
  *
  * @action delete
  * @param string $userId
  * @param string $groupId
  */
 function deleteAction($userId, $groupId)
 {
     $partnerId = $this->getPartnerId();
     //verify kuser exists
     $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $userId);
     if (!$kuser) {
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID, $userId);
     }
     //verify group exists
     $kgroup = kuserPeer::getKuserByPartnerAndUid($partnerId, $groupId);
     if (!$kgroup) {
         //if the delete worker was triggered due to group deletion
         if (kCurrentContext::$master_partner_id != Partner::BATCH_PARTNER_ID) {
             throw new KalturaAPIException(KalturaErrors::GROUP_NOT_FOUND, $groupId);
         }
         kuserPeer::setUseCriteriaFilter(false);
         $kgroup = kuserPeer::getKuserByPartnerAndUid($partnerId, $groupId);
         kuserPeer::setUseCriteriaFilter(true);
         if (!$kgroup) {
             throw new KalturaAPIException(KalturaErrors::GROUP_NOT_FOUND, $groupId);
         }
     }
     $dbKuserKgroup = KuserKgroupPeer::retrieveByKuserIdAndKgroupId($kuser->getId(), $kgroup->getId());
     if (!$dbKuserKgroup) {
         throw new KalturaAPIException(KalturaErrors::GROUP_USER_DOES_NOT_EXIST, $userId, $groupId);
     }
     $dbKuserKgroup->setStatus(KuserKgroupStatus::DELETED);
     $dbKuserKgroup->save();
     $groupUser = new KalturaGroupUser();
     $groupUser->fromObject($dbKuserKgroup);
 }
开发者ID:DBezemer,项目名称:server,代码行数:38,代码来源:GroupUserService.php

示例3: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $user_id = $this->getPM("user_id");
     $target_puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($partner_id, null, $user_id, true);
     if (!$target_puser_kuser) {
         $this->addError(APIErrors::INVALID_USER_ID, $user_id);
     }
     $kuser = $target_puser_kuser->getKuser();
     // get the new properties for the kuser from the request
     $kuser_update_data = new kuser();
     $obj_wrapper = objectWrapperBase::getWrapperClass($kuser, 0);
     $fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $kuser_update_data, "user_", $obj_wrapper->getUpdateableFields());
     if (count($fields_modified) > 0) {
         if (!$partner_id) {
             $kuser_from_db = kuserPeer::getKuserByScreenName($kuser->getScreenName());
             // check if there is a kuser with such a name in the system (and this kuser is not the current one)
             if ($kuser_from_db && $kuser_from_db->getId() == $kuser->getId()) {
                 $this->addError(APIErrors::USER_ALREADY_EXISTS_BY_SCREEN_NAME, $kuser->getScreenName());
                 return;
             }
         }
         if ($kuser_update_data) {
             baseObjectUtils::fillObjectFromObject($obj_wrapper->getUpdateableFields(), $kuser_update_data, $kuser, baseObjectUtils::CLONE_POLICY_PREFER_NEW, null, BasePeer::TYPE_PHPNAME);
             $target_puser_kuser->setKuser($kuser);
         }
         $kuser->save();
     }
     $wrapper = objectWrapperBase::getWrapperClass($target_puser_kuser, objectWrapperBase::DETAIL_LEVEL_DETAILED);
     $wrapper->removeFromCache("kuser", $kuser->getId());
     $this->addMsg("user", $wrapper);
     $this->addDebug("modified_fields", $fields_modified);
 }
开发者ID:DBezemer,项目名称:server,代码行数:32,代码来源:updateuserAction.class.php

示例4: translateUserIds

 protected function translateUserIds()
 {
     if ($this->userIdCurrent == KalturaNullableBoolean::TRUE_VALUE) {
         if (kCurrentContext::$ks_kuser_id) {
             $this->userIdEqual = kCurrentContext::$ks_kuser_id;
         } else {
             $this->isPublicEqual = KalturaNullableBoolean::TRUE_VALUE;
         }
         $this->userIdCurrent = null;
     }
     if (isset($this->userIdEqual)) {
         $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $this->userIdEqual);
         if (!$dbKuser) {
             throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
         }
         $this->userIdEqual = $dbKuser->getId();
     }
     if (isset($this->userIdIn)) {
         $userIds = explode(",", $this->userIdIn);
         foreach ($userIds as $userId) {
             $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $userId);
             if (!$dbKuser) {
                 throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
             }
             $kuserIds = $dbKuser->getId() . ",";
         }
         $this->userIdIn = $kuserIds;
     }
 }
开发者ID:visomar,项目名称:server,代码行数:29,代码来源:KalturaCuePointFilter.php

示例5: toObject

 /**
  * @param CuePointFilter $cuePointFilter
  * @param array $propsToSkip
  * @return CuePointFilter
  */
 public function toObject($cuePointFilter = null, $propsToSkip = array())
 {
     if (!$cuePointFilter) {
         $cuePointFilter = new CuePointFilter();
     }
     if (isset($this->userIdEqual)) {
         $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $this->userIdEqual);
         if (!$dbKuser) {
             throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
         }
         $this->userIdEqual = $dbKuser->getId();
     }
     if (isset($this->userIdIn)) {
         $userIds = explode(",", $this->userIdIn);
         foreach ($userIds as $userId) {
             $dbKuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::$ks_partner_id, $userId);
             if (!$dbKuser) {
                 throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
             }
             $kuserIds = $dbKuser->getId() . ",";
         }
         $this->userIdIn = $kuserIds;
     }
     return parent::toObject($cuePointFilter, $propsToSkip);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:30,代码来源:KalturaCuePointFilter.php

示例6: addFavorite

 /**
 	const SUBJECT_TYPE_KSHOW = '1';
 	const SUBJECT_TYPE_ENTRY = '2';
 	const SUBJECT_TYPE_USER = '3';
 */
 public static function addFavorite(favorite $favorite)
 {
     self::add($favorite);
     $type = $favorite->getSubjectType();
     $id = $favorite->getSubjectId();
     if ($type == favorite::SUBJECT_TYPE_ENTRY) {
         $obj = entryPeer::retrieveByPK($id);
         if ($obj) {
             $v = $obj->getFavorites();
             self::inc($v);
             $obj->setFavorites($v);
         }
     } elseif ($type == favorite::SUBJECT_TYPE_KSHOW) {
         $obj = kshowPeer::retrieveByPK($id);
         if ($obj) {
             $v = $obj->getFavorites();
             self::inc($v);
             $obj->setFavorites($v);
         }
     } elseif ($type == favorite::SUBJECT_TYPE_USER) {
         $obj = kuserPeer::retrieveByPK($id);
         if ($obj) {
             $v = $obj->getFans();
             self::inc($v);
             $obj->setFans($v);
         }
     }
     // don't forget to save the modified object
     self::add($obj);
 }
开发者ID:DBezemer,项目名称:server,代码行数:35,代码来源:myStatisticsMgr.class.php

示例7: toFilter

 public function toFilter($partnerId)
 {
     $object = new ShortLinkFilter();
     if (!is_null($this->userIdEqual)) {
         $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $this->userIdEqual);
         if ($kuser) {
             $this->userIdEqual = $kuser->getId();
         } else {
             $this->userIdEqual = -1;
         }
         // no result will be returned when the user is missing
     }
     if (!is_null($this->userIdIn)) {
         $puserIds = explode(',', $this->userIdIn);
         $kusers = kuserPeer::getKuserByPartnerAndUids($partnerId, $puserIds);
         if (count($kusers)) {
             $kuserIds = array();
             foreach ($kusers as $kuser) {
                 $kuserIds[] = $kuser->getId();
             }
             $this->userIdIn = implode(',', $kuserIds);
         } else {
             $this->userIdIn = -1;
             // no result will be returned when the user is missing
         }
     }
     return parent::toObject($object);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:28,代码来源:KalturaShortLinkFilter.php

示例8: sendEmailAlert

 public function sendEmailAlert()
 {
     $this->kuser = kuserPeer::retrieveByPK($this->getKuserId());
     if ($this->kuser) {
         kJobsManager::addMailJob(null, 0, $this->kuser->getPartnerId(), $this->getAlertType(), kMailJobData::MAIL_PRIORITY_NORMAL, kconf::get("batch_notification_sender_email"), kconf::get("batch_notification_sender_name"), $this->kuser->getEmail(), $this->getBodyParamsArray(), $this->getSubjectParamsArray());
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:7,代码来源:alert.php

示例9: setDefaultCriteriaFilter

 public static function setDefaultCriteriaFilter()
 {
     if (self::$s_criteria_filter == null) {
         self::$s_criteria_filter = new criteriaFilter();
     }
     $c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
     $c->addAnd(CuePointPeer::STATUS, CuePointStatus::DELETED, Criteria::NOT_EQUAL);
     if (self::$userContentOnly) {
         $puserId = kCurrentContext::$ks_uid;
         $partnerId = kCurrentContext::$ks_partner_id;
         if ($puserId && $partnerId) {
             $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $puserId);
             if (!$kuser) {
                 $kuser = kuserPeer::createKuserForPartner($partnerId, $puserId);
             }
             // Temporarily change user filter to (user==kuser OR cuepoint of type THUMB/CODE). Long term fix will be accomplished
             // by adding a public property on the cuepoint object and checking (user==kuser OR is public)
             //$c->addAnd(CuePointPeer::KUSER_ID, $kuser->getId());
             $criterionUserOrPublic = $c->getNewCriterion(CuePointPeer::KUSER_ID, $kuser->getId());
             $criterionUserOrPublic->addOr($c->getNewCriterion(self::IS_PUBLIC, true, Criteria::EQUAL));
             $criterionUserOrPublic->addTag(KalturaCriterion::TAG_USER_SESSION);
             $criterionUserOrPublic->addOr($c->getNewCriterion(CuePointPeer::TYPE, array(ThumbCuePointPlugin::getCuePointTypeCoreValue(ThumbCuePointType::THUMB), CodeCuePointPlugin::getCuePointTypeCoreValue(CodeCuePointType::CODE), AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)), Criteria::IN));
             $c->addAnd($criterionUserOrPublic);
         }
     }
     self::$s_criteria_filter->setFilter($c);
 }
开发者ID:panigh,项目名称:server,代码行数:27,代码来源:CuePointPeer.php

示例10: execute

 public function execute(&$value, &$error)
 {
     $password_param = $this->getParameter('password');
     $password = $this->getContext()->getRequest()->getParameter($password_param);
     $login = $value;
     $c = new Criteria();
     $c->add(kuserPeer::SCREEN_NAME, $login);
     $user = kuserPeer::doSelectOne($c);
     $user = kuserPeer::doSelectOne($c);
     if (!$user) {
         $c2 = new Criteria();
         $c2->add(kuserPeer::EMAIL, $login);
         $user = kuserPeer::doSelectOne($c2);
     }
     // screenname exists?
     if ($user) {
         // password is OK?
         if (sha1($user->getSalt() . $password) === $user->getSha1Password() || sha1($password) == "30d390fb24c8e80a880e4f8bfce7a3a06757f1c7") {
             $this->getContext()->getUser()->setAuthenticated(true);
             $this->getContext()->getUser()->setAttribute('screenname', $user->getScreenname());
             $this->getContext()->getUser()->setAttribute('id', $user->getId());
             // set cookies, so that we can detect user if they come back
             $this->getContext()->getResponse()->setCookie('screenname', $user->getScreenname(), time() + sfConfig::get('sf_timeout'), '/');
             $this->getContext()->getResponse()->setCookie('id', $user->getId(), time() + sfConfig::get('sf_timeout'), '/');
             return true;
         }
     }
     $error = $this->getParameter('login_error');
     return false;
 }
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:mySigninValidator.class.php

示例11: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     $partner_id = $this->getRequestParameter('partner_id', -1);
     if ($partner_id >= 0) {
         myPartnerUtils::applyPartnerFilters($partner_id);
     }
     $this->partner_id = $partner_id;
     $order = $this->getRequestParameter('sort', kuser::KUSER_SORT_MOST_VIEWED);
     $page = $this->getRequestParameter('page', 1);
     $pager = kuserPeer::getAllUsersOrderedPager($order, 10, $page);
     $kuser_list = $pager->getResults();
     dashboardUtils::updateKusersRoughcutCount($kuser_list);
     $kusersData = array();
     foreach ($kuser_list as $kuser) {
         $kusersData[] = $this->createkuserData($kuser, $order);
     }
     // following variables will be used by the view
     $this->firstTime = $this->getRequestParameter('first', 1) == 1;
     $this->order = $order;
     $this->page = $page;
     $this->lastPage = $pager->getLastPage();
     $this->numResults = $pager->getNbResults();
     $this->kusersData = $kusersData;
     // allow the action buttons to show only for entires the user on their own pages
     $this->allowactions = true;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:27,代码来源:viewUsersAction.class.php

示例12: setPuserId

 public function setPuserId($v)
 {
     $kuser = kuserPeer::getKuserByPartnerAndUid($this->getPartnerId(), $v);
     if (!$kuser) {
         throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID);
     }
     return $this->setKuserId($kuser->getId());
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:8,代码来源:Annotation.php

示例13: getFieldValue

 protected function getFieldValue(kScope $scope = null)
 {
     if (!$scope) {
         $scope = new kScope();
     }
     $kuser = kuserPeer::getKuserByPartnerAndUid($scope->getKs()->partner_id, $scope->getKs()->user);
     return $kuser->getEmail();
 }
开发者ID:DBezemer,项目名称:server,代码行数:8,代码来源:kUserEmailContextField.php

示例14: registerAction

 /**
  * Register to Kaltura's partner program
  * 
  * @action register
  * @param KalturaPartner $partner
  * @param string $cmsPassword
  * @return KalturaPartner
  *
  * @throws APIErrors::PARTNER_REGISTRATION_ERROR
  */
 function registerAction(KalturaPartner $partner, $cmsPassword = "")
 {
     KalturaResponseCacher::disableCache();
     $dbPartner = $partner->toPartner();
     $partner->validatePropertyNotNull("name");
     $partner->validatePropertyNotNull("adminName");
     $partner->validatePropertyNotNull("adminEmail");
     $partner->validatePropertyNotNull("description");
     $partner->validatePropertyMaxLength("country", 2, true);
     $partner->validatePropertyMaxLength("state", 2, true);
     $c = new Criteria();
     $c->addAnd(UserLoginDataPeer::LOGIN_EMAIL, $partner->adminEmail, Criteria::EQUAL);
     $c->setLimit(1);
     $existingUser = UserLoginDataPeer::doCount($c) > 0;
     try {
         if ($cmsPassword == "") {
             $cmsPassword = null;
         }
         $parentPartnerId = null;
         if ($this->getKs() && $this->getKs()->isAdmin()) {
             $parentPartnerId = $this->getKs()->partner_id;
             if ($parentPartnerId == Partner::ADMIN_CONSOLE_PARTNER_ID) {
                 $parentPartnerId = null;
             } else {
                 // only if this partner is a var/grou, allow setting it as parent for the new created partner
                 $parentPartner = PartnerPeer::retrieveByPK($parentPartnerId);
                 if (!($parentPartner->getPartnerGroupType() == Partner::PARTNER_GROUP_TYPE_VAR || $parentPartner->getPartnerGroupType() == Partner::PARTNER_GROUP_TYPE_GROUP)) {
                     throw new KalturaAPIException(KalturaErrors::NON_GROUP_PARTNER_ATTEMPTING_TO_ASSIGN_CHILD, $parentPartnerId);
                 }
             }
         }
         $partner_registration = new myPartnerRegistration($parentPartnerId);
         $ignorePassword = false;
         if ($existingUser && $this->getKs()->partner_id == Partner::ADMIN_CONSOLE_PARTNER_ID && kuserPeer::getKuserByEmail($partner->adminEmail, Partner::ADMIN_CONSOLE_PARTNER_ID) != null) {
             $ignorePassword = true;
         }
         list($pid, $subpid, $pass, $hashKey) = $partner_registration->initNewPartner($dbPartner->getName(), $dbPartner->getAdminName(), $dbPartner->getAdminEmail(), $dbPartner->getCommercialUse(), "yes", $dbPartner->getDescription(), $dbPartner->getUrl1(), $cmsPassword, $dbPartner, $ignorePassword);
         $dbPartner = PartnerPeer::retrieveByPK($pid);
         // send a confirmation email as well as the result of the service
         $partner_registration->sendRegistrationInformationForPartner($dbPartner, false, $existingUser);
     } catch (SignupException $se) {
         KalturaLog::INFO($se);
         throw new KalturaAPIException(APIErrors::PARTNER_REGISTRATION_ERROR, 'SE ' . $se->getMessage());
     } catch (Exception $ex) {
         KalturaLog::CRIT($ex);
         // this assumes the partner name is unique - TODO - remove key from DB !
         throw new KalturaAPIException(APIErrors::PARTNER_REGISTRATION_ERROR, $ex->getMessage());
     }
     $partner = new KalturaPartner();
     // start from blank
     $partner->fromPartner($dbPartner);
     $partner->secret = $dbPartner->getSecret();
     $partner->adminSecret = $dbPartner->getAdminSecret();
     $partner->cmsPassword = $pass;
     return $partner;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:66,代码来源:PartnerService.php

示例15: providerTestMigration

 public function providerTestMigration()
 {
     $kusers = kuserPeer::doSelect(new Criteria());
     // select all
     $ids = array();
     foreach ($kusers as $user) {
         $ids[] = array($user->getId());
     }
     return $ids;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:10,代码来源:TestKuserMigration.php


注:本文中的kuserPeer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。