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


PHP object::addUser方法代码示例

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


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

示例1: addUser

 /**
  * 增加新的用户
  *
  * @param object $data
  * @access public
  * @return boolean true|false
  */
 public function addUser(UserSave $data)
 {
     if (!$this->userValidate->add($data)) {
         return $this->setErrorMsg($this->userValidate->getErrorMessage());
     }
     if (!$this->acl->checkGroupLevelPermission($data->group_id, Acl::GROUP_LEVEL_TYPE_GROUP)) {
         return $this->setErrorMsg(Lang::get('common.account_level_deny'));
     }
     if ($this->userModel->getOneUserByName($data->name)) {
         return $this->setErrorMsg(Lang::get('user.account_exists'));
     }
     $data->setPassword(md5($data->password));
     if ($this->userModel->addUser($data->toArray()) !== false) {
         return true;
     }
     return $this->setErrorMsg(Lang::get('common.action_error'));
 }
开发者ID:pfdtk,项目名称:bmsys,代码行数:24,代码来源:Process.php

示例2: addUser

 /**
  * Add a new user to the storage container
  *
  * @param string Username
  * @param string Password
  * @param array  Additional information
  *
  * @return boolean
  */
 function addUser($username, $password, $additional = '')
 {
     $res = $this->pwfile->addUser($user, $additional['userid'], $pass);
     if ($res === true) {
         return $this->pwfile->save();
     }
     return $res;
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:17,代码来源:SMBPasswd.php

示例3: addUser

 /**
  * Add a new user to the storage container
  *
  * @param string Username
  * @param string Password
  * @param array  Additional information
  *
  * @return boolean
  */
 function addUser($username, $password, $additional = '')
 {
     $this->log('Auth_Container_SMBPasswd::addUser() called.', AUTH_LOG_DEBUG);
     $res = $this->pwfile->addUser($user, $additional['userid'], $pass);
     if ($res === true) {
         return $this->pwfile->save();
     }
     return $res;
 }
开发者ID:vinnivinsachi,项目名称:Vincent-DR,代码行数:18,代码来源:SMBPasswd.php

示例4: addUser

 /**
  * 增加新的用户
  *
  * @param object $data
  * @access public
  * @return boolean true|false
  */
 public function addUser(\App\Services\Admin\User\Param\UserSave $data)
 {
     if (!$this->userValidate->add($data)) {
         return $this->setErrorMsg($this->userValidate->getErrorMessage());
     }
     //检查当前用户的权限是否能增加这个用户
     if (!$this->acl->checkGroupLevelPermission($data->group_id, Acl::GROUP_LEVEL_TYPE_GROUP)) {
         return $this->setErrorMsg(Lang::get('common.account_level_deny'));
     }
     //检测当前用户名是否已经存在
     if ($this->userModel->getOneUserByName($data->name)) {
         return $this->setErrorMsg(Lang::get('user.account_exists'));
     }
     $data->setPassword(md5($data->password));
     //开始保存到数据库
     if ($this->userModel->addUser($data->toArray()) !== false) {
         return true;
     }
     return $this->setErrorMsg(Lang::get('common.action_error'));
 }
开发者ID:jjzhai,项目名称:mylaravel,代码行数:27,代码来源:Process.php

示例5: addUser

 /**
  * Tries to add a user to both containers.
  *
  * If the optional $id parameter is passed it will be used
  * for both containers.
  *
  * In any case the auth and perm id will be equal when using this method.
  *
  * If this behaviour doesn't suit your needs please consider
  * using directly the concerned method. This method is just
  * implement to simplify things a bit and should satisfy most
  * user needs.
  *
  *  Note type is optional for DB, thus it's needed for MDB and MDB2,
  *  we recommend that you use type even though you use DB, so if you change to MDB[2],
  *  it will be no problem for you.
  *  usage example for addUser:
  * <code>
  *       $user_id = $admin->addUser('johndoe', 'dummypass', true, null, null, null);
  *  </code>
  *
  * Untested: it most likely doesn't work.
  *
  * @access public
  * @param  string  user handle (username)
  * @param  string  user password
  * @param  integer permission user type
  * @param  boolean is account active ?
  * @param  int          ID
  * @param  integer ID of the owning user.
  * @param  integer ID of the owning group.
  * @param  array   values for the custom fields
  * @return mixed   userid or false
  */
 function addUser($handle, $password, $type = null, $active = true, $id = null, $owner_user_id = null, $owner_group_id = null, $customFields = array())
 {
     if (is_object($this->auth) && is_object($this->perm)) {
         $authId = $this->auth->addUser($handle, $password, $active, $owner_user_id, $owner_group_id, $id, $customFields);
         if (LiveUser::isError($authId)) {
             return $authId;
         }
         return $this->perm->addUser($authId, $this->authContainerName, $type);
     }
     return LiveUser::raiseError(LIVEUSER_ERROR, null, null, 'Perm or Auth container couldn\\t be started.');
 }
开发者ID:BackupTheBerlios,项目名称:hem,代码行数:45,代码来源:Admin.php

示例6: process

 /**
  * Process message from consumed queue. process() involves applying methods to existing objects as
  * a part of consuming a message in a queue.
  */
 protected function process()
 {
     $this->mbcDEUser->processUserCampaigns($this->campaigns);
     // Skip user objects that end up with no campaigns
     if (count($this->mbcDEUser->campaigns) > 0) {
         $this->mbcDEUser->getSubsciptionsURL();
         $this->mbcDEMessenger->addUser($this->mbcDEUser);
         $this->users[] = $this->mbcDEUser;
     } else {
         echo '- No valid campaigns to compose digest message for user.', PHP_EOL;
     }
     // Cleanup for processing of next user digest settings
     unset($this->mbcDEUser);
 }
开发者ID:sergii-tkachenko,项目名称:mbc-digest-email,代码行数:18,代码来源:MBC_DigestEmail_Consumer.php

示例7: copyInto

 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param object $copyObj An object of Account (or compatible) type.
  * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
  * @throws PropelException
  */
 public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
 {
     $copyObj->setAddressId($this->getAddressId());
     $copyObj->setIdentifier($this->getIdentifier());
     $copyObj->setName($this->getName());
     if ($deepCopy && !$this->startCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         // store object hash to prevent cycle
         $this->startCopy = true;
         foreach ($this->getBookingTypes() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addBookingType($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getClockingTypes() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addClockingType($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getDomains() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addDomain($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getHolidays() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addHoliday($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getPlugins() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addPlugin($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getPropertys() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addProperty($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
         //unflag object copy
         $this->startCopy = false;
     }
     // if ($deepCopy)
     if ($makeNew) {
         $copyObj->setNew(true);
         $copyObj->setId(NULL);
         // this is a auto-increment column, so set to default value
     }
 }
开发者ID:dapepe,项目名称:tymio,代码行数:74,代码来源:BaseAccount.php

示例8: copyInto

 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of \Models\Image (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @param      boolean $makeNew Whether to reset autoincrement PKs and make the object new.
  * @throws PropelException
  */
 public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
 {
     $copyObj->setTitle($this->getTitle());
     $copyObj->setDescription($this->getDescription());
     $copyObj->setPath($this->getPath());
     $copyObj->setThumbnailPath($this->getThumbnailPath());
     $copyObj->setType($this->getType());
     $copyObj->setCreatedAt($this->getCreatedAt());
     $copyObj->setUpdatedAt($this->getUpdatedAt());
     if ($deepCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getArticles() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addArticle($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getImageGalleryMaps() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addImageGalleryMap($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     if ($makeNew) {
         $copyObj->setNew(true);
         $copyObj->setId(NULL);
         // this is a auto-increment column, so set to default value
     }
 }
开发者ID:OneTimeCZ,项目名称:DofE,代码行数:50,代码来源:Image.php

示例9: addUser

 /**
  * Add user to the storage container
  *
  * @access public
  * @param  string Username
  * @param  string Password
  * @param  mixed  Additional parameters
  * @return mixed  True on success, PEAR error object on error
  *                and AUTH_METHOD_NOT_SUPPORTED otherwise.
  */
 function addUser($username, $password, $additional = '')
 {
     $this->_loadStorage();
     return $this->storage->addUser($username, $password, $additional);
 }
开发者ID:laiello,项目名称:coopcrucial,代码行数:15,代码来源:Auth.php

示例10: addUser

 /**
  * Add user to the storage container
  *
  * @access public
  * @param  string Username
  * @param  string Password
  * @param  mixed  Additional parameters
  * @return mixed  True on success, PEAR error object on error
  *                and AUTH_METHOD_NOT_SUPPORTED otherwise.
  */
 function addUser($username, $password, $additional = '')
 {
     $this->log('Auth::addUser() called.', AUTH_LOG_DEBUG);
     $this->_loadStorage();
     return $this->storage->addUser($username, $password, $additional);
 }
开发者ID:railfuture,项目名称:tiki-website,代码行数:16,代码来源:Auth.php

示例11: copyInto

 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of \Jalle19\StatusManager\Database\Instance (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @param      boolean $makeNew Whether to reset autoincrement PKs and make the object new.
  * @throws PropelException
  */
 public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
 {
     $copyObj->setName($this->getName());
     if ($deepCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getConnections() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addConnection($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getInputs() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addInput($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getChannels() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addChannel($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getSubscriptions() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addSubscription($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     if ($makeNew) {
         $copyObj->setNew(true);
     }
 }
开发者ID:Jalle19,项目名称:tvheadend-status-manager,代码行数:54,代码来源:Instance.php

示例12: copyInto

 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of \App\Propel\File (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @param      boolean $makeNew Whether to reset autoincrement PKs and make the object new.
  * @throws PropelException
  */
 public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
 {
     $copyObj->setFileTypeId($this->getFileTypeId());
     $copyObj->setFilePath($this->getFilePath());
     $copyObj->setCreatedAt($this->getCreatedAt());
     $copyObj->setUpdatedAt($this->getUpdatedAt());
     if ($deepCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         foreach ($this->getCategories() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addCategory($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getNews() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addNews($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getPeriodicPlans() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addPeriodicPlan($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getProducts() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addProduct($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getProviders() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addProvider($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getResourceFiles() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addResourceFile($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     if ($makeNew) {
         $copyObj->setNew(true);
         $copyObj->setFileId(NULL);
         // this is a auto-increment column, so set to default value
     }
 }
开发者ID:mtornero,项目名称:slowshop,代码行数:71,代码来源:File.php

示例13: copyInto

 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of Game (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @throws     PropelException
  */
 public function copyInto($copyObj, $deepCopy = false)
 {
     $copyObj->setStartTime($this->start_time);
     $copyObj->setEndTime($this->end_time);
     $copyObj->setActivePlayers($this->active_players);
     $copyObj->setLatitude($this->latitude);
     $copyObj->setLongitude($this->longitude);
     $copyObj->setIsActive($this->is_active);
     $copyObj->setIsPublic($this->is_public);
     if ($deepCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getGameMembers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addGameMember($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     $copyObj->setNew(true);
     $copyObj->setId(NULL);
     // this is a auto-increment column, so set to default value
 }
开发者ID:adatta02,项目名称:comp194ma,代码行数:41,代码来源:BaseGame.php

示例14: copyInto

 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of Contact (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @param      boolean $makeNew Whether to reset autoincrement PKs and make the object new.
  * @throws PropelException
  */
 public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
 {
     $copyObj->setFirstName($this->getFirstName());
     $copyObj->setLastName($this->getLastName());
     $copyObj->setCompanyName($this->getCompanyName());
     $copyObj->setEmailAddress($this->getEmailAddress());
     $copyObj->setPhoneMainNumber($this->getPhoneMainNumber());
     $copyObj->setPhoneOtherNumber($this->getPhoneOtherNumber());
     $copyObj->setMailingAddress($this->getMailingAddress());
     $copyObj->setMailingAddressLatitude($this->getMailingAddressLatitude());
     $copyObj->setMailingAddressLongitude($this->getMailingAddressLongitude());
     $copyObj->setCity($this->getCity());
     $copyObj->setStateId($this->getStateId());
     $copyObj->setZipCode($this->getZipCode());
     $copyObj->setCreatedAt($this->getCreatedAt());
     $copyObj->setUpdatedAt($this->getUpdatedAt());
     if ($deepCopy && !$this->startCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         // store object hash to prevent cycle
         $this->startCopy = true;
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
         //unflag object copy
         $this->startCopy = false;
     }
     // if ($deepCopy)
     if ($makeNew) {
         $copyObj->setNew(true);
         $copyObj->setId(NULL);
         // this is a auto-increment column, so set to default value
     }
 }
开发者ID:homer6,项目名称:blank_altumo,代码行数:49,代码来源:BaseContact.php

示例15: copyInto

 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of sfGuardUser (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @param      boolean $makeNew Whether to reset autoincrement PKs and make the object new.
  * @throws PropelException
  */
 public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
 {
     $copyObj->setUsername($this->getUsername());
     $copyObj->setAlgorithm($this->getAlgorithm());
     $copyObj->setSalt($this->getSalt());
     $copyObj->setPassword($this->getPassword());
     $copyObj->setCreatedAt($this->getCreatedAt());
     $copyObj->setLastLogin($this->getLastLogin());
     $copyObj->setIsActive($this->getIsActive());
     $copyObj->setIsSuperAdmin($this->getIsSuperAdmin());
     if ($deepCopy && !$this->startCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         // store object hash to prevent cycle
         $this->startCopy = true;
         foreach ($this->getsfGuardUserPermissions() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addsfGuardUserPermission($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getsfGuardUserGroups() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addsfGuardUserGroup($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getsfGuardRememberKeys() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addsfGuardRememberKey($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
         //unflag object copy
         $this->startCopy = false;
     }
     // if ($deepCopy)
     if ($makeNew) {
         $copyObj->setNew(true);
         $copyObj->setId(NULL);
         // this is a auto-increment column, so set to default value
     }
 }
开发者ID:homer6,项目名称:blank_altumo,代码行数:61,代码来源:BasesfGuardUser.php


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