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


PHP kuserPeer::getKuserByEmail方法代码示例

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


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

示例1: registerAction

 /**
  * Create a new Partner object
  * 
  * @action register
  * @param KalturaPartner $partner
  * @param string $cmsPassword
  * @param int $templatePartnerId
  * @param bool $silent
  * @return KalturaPartner
  *
  * @throws APIErrors::PARTNER_REGISTRATION_ERROR
  */
 public function registerAction(KalturaPartner $partner, $cmsPassword = "", $templatePartnerId = null, $silent = false)
 {
     KalturaResponseCacher::disableCache();
     $dbPartner = $partner->toPartner();
     $c = new Criteria();
     $c->addAnd(UserLoginDataPeer::LOGIN_EMAIL, $partner->adminEmail, Criteria::EQUAL);
     $existingUser = UserLoginDataPeer::doSelectOne($c);
     /*@var $exisitingUser UserLoginData */
     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/group, allow setting it as parent for the new created partner
                 $parentPartner = PartnerPeer::retrieveByPK($parentPartnerId);
                 if (!($parentPartner->getPartnerGroupType() == PartnerGroupType::VAR_GROUP || $parentPartner->getPartnerGroupType() == PartnerGroupType::GROUP)) {
                     throw new KalturaAPIException(KalturaErrors::NON_GROUP_PARTNER_ATTEMPTING_TO_ASSIGN_CHILD, $parentPartnerId);
                 }
                 if ($templatePartnerId) {
                     $templatePartner = PartnerPeer::retrieveByPK($templatePartnerId);
                     if (!$templatePartner || $templatePartner->getPartnerParentId() != $parentPartnerId) {
                         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 || $this->getKs()->partner_id == $parentPartnerId)) {
             kuserPeer::setUseCriteriaFilter(false);
             $kuserOfLoginData = kuserPeer::getKuserByEmail($partner->adminEmail, $existingUser->getConfigPartnerId());
             kuserPeer::setUseCriteriaFilter(true);
             if ($kuserOfLoginData) {
                 $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, $templatePartnerId);
         $dbPartner = PartnerPeer::retrieveByPK($pid);
         // send a confirmation email as well as the result of the service
         $partner_registration->sendRegistrationInformationForPartner($dbPartner, false, $existingUser, $silent);
     } 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);
     }
     $partner = new KalturaPartner();
     // start from blank
     $partner->fromPartner($dbPartner);
     $partner->secret = $dbPartner->getSecret();
     $partner->adminSecret = $dbPartner->getAdminSecret();
     $partner->cmsPassword = $pass;
     return $partner;
 }
开发者ID:DBezemer,项目名称:server,代码行数:70,代码来源:PartnerService.php

示例2: 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

示例3: postSave

 /**
  * Code to be run after persisting the object
  * @param PropelPDO $con
  */
 public function postSave(PropelPDO $con = null)
 {
     // update plugin permissions in the database
     if (is_array($this->setEnabledPlugins)) {
         foreach ($this->setEnabledPlugins as $pluginName => $enabled) {
             if ($enabled) {
                 PermissionPeer::enablePlugin($pluginName, $this->getId());
             } else {
                 PermissionPeer::disablePlugin($pluginName, $this->getId());
             }
         }
     }
     // update special services permissions in the database
     if (is_array($this->setEnabledServices)) {
         foreach ($this->setEnabledServices as $permissionName => $enabled) {
             if ($enabled) {
                 PermissionPeer::enableForPartner($permissionName, PermissionType::SPECIAL_FEATURE, $this->getId());
             } else {
                 PermissionPeer::disableForPartner($permissionName, $this->getId());
             }
         }
     }
     $this->setEnabledPlugins = array();
     $this->setEnabledServices = array();
     $ksObj = kSessionUtils::crackKs(kCurrentContext::$ks);
     $currentKuser = null;
     if (is_object($ksObj)) {
         $currentKuser = kuserPeer::getKuserByEmail($ksObj->user, -2);
     }
     if ($currentKuser) {
         $allowedPartners = $currentKuser->getAllowedPartners();
         if (isset($allowedPartners) && !empty($allowedPartners)) {
             $partnersArray = array_map('trim', explode(',', $allowedPartners));
             if (!in_array($this->getId(), $partnersArray)) {
                 $currentKuser->setAllowedPartners($allowedPartners . ',' . $this->getId());
             }
         } else {
             $currentKuser->setAllowedPartners($this->getId());
         }
         $currentKuser->save();
     }
 }
开发者ID:panigh,项目名称:server,代码行数:46,代码来源:Partner.php


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