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


PHP API::updateUser方法代码示例

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


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

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $login = $input->getArgument('login');
     $user = $this->usersManagerApi->getUser($login);
     if (!UserMapper::isUserLdapUser($user)) {
         throw new Exception("User '{$login}' is not an LDAP user. To regenerate this user's token_auth, change the user's password.");
     }
     if (!$this->userMapper->isRandomTokenAuthGenerationEnabled()) {
         throw new Exception("Random token_auth generation is disabled in [LoginLdap] config. This means any changes made by this " . "command will be overwritten when the user logs in. Aborting.");
     }
     $newPassword = $this->userMapper->generateRandomPassword();
     $this->usersManagerApi->updateUser($login, $newPassword, $email = false, $alias = false, $isPasswordHash = true);
     $user = $this->usersManagerApi->getUser($login);
     $this->writeSuccessMessage($output, array("token_auth for '{$login}' regenerated successfully, new token_auth = '{$user['token_auth']}'"));
 }
开发者ID:heiglandreas,项目名称:plugin-LoginLdap,代码行数:15,代码来源:RegenerateTokenAuth.php

示例2: testUpdateUser

 /**
  * normal case, reused in other tests
  */
 public function testUpdateUser()
 {
     $login = "login";
     $user = array('login' => $login, 'password' => "geqgeagae", 'email' => "test@test.com", 'alias' => "alias");
     $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
     $this->api->updateUser($login, "passowordOK", "email@geaga.com", "NEW ALIAS");
     $this->_checkUserHasNotChanged($user, "passowordOK", "email@geaga.com", "NEW ALIAS");
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:11,代码来源:UsersManagerTest.php

示例3: test_updateUser

 public function test_updateUser()
 {
     $this->api->updateUser($this->login, 'newPassword', 'email@example.com', 'newAlias', false);
     $user = $this->api->getUser($this->login);
     $this->assertSame('14a88b9d2f52c55b5fbcf9c5d9c11875', $user['password']);
     $this->assertSame('email@example.com', $user['email']);
     $this->assertSame('newAlias', $user['alias']);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:8,代码来源:APITest.php

示例4: updateUser

 /**
  * Decrypts the password (if encrypted) and calls the original function on
  * the decrypted value.
  *
  * @see the parent class function for parameters and return value
  */
 public function updateUser($userLogin, $password = false, $email = false, $alias = false, $_isPasswordHashed = false, $directCall = false)
 {
     // check if this function is called directly
     // Reason: updateUser() is called in following situations:
     //         1. With an already decrypted password by:
     //            * Piwik\Plugins\Login\PasswordResetter::confirmNewPassword()
     //              on password change via the form before login
     //            * Controller::processPasswordChange() when any user changes
     //              their own password in their account settings
     //         2. With an encrypted password when called directly by (so,
     //            decryption is needed in this case):
     //            * /plugins/UsersManagerEncrypted/javascripts/usersManager.js::sendUpdateUserAJAX()
     //              when a super user changes someone's password in Piwik user administration.
     if ($directCall == 'true') {
         $password = Crypto::decrypt($password);
     }
     return parent::updateUser($userLogin, $password, $email, $alias, $_isPasswordHashed);
 }
开发者ID:Joey3000,项目名称:piwik-UsersManagerEncrypted,代码行数:24,代码来源:API.php


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