本文整理汇总了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'));
}
示例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;
}
示例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;
}
示例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'));
}
示例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.');
}
示例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);
}
示例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
}
}
示例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
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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
}
}
示例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
}
示例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
}
}
示例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
}
}