vendor/piwik/piwik/plugins/UsersManager/API.php
/**
     * Updates a user in the database.
     * Only login and password are required (case when we update the password).
     * When the password changes, the key token for this user will change, which could break
     * its API calls.
     *
     * @see addUser() for all the parameters
     */
Updates a user in the database.
Only login and password are required (case when we update the password).
When the password changes, the key token for this user will change, which could break
its API calls.

@see addUser() for all the parameters
Updates a user in the database . Only login and password are required ( case when we update the password ) . When the password changes the key token for this user will change which could break its API calls . @see addUser () for all the parameters
public function updateUser($userLogin, $password = false, $email = false, $alias = false,
                               $_isPasswordHashed = false)
    {
        Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
        $this->checkUserIsNotAnonymous($userLogin);
        $userInfo = $this->getUser($userLogin);
        $passwordHasBeenUpdated = false;
        if (empty($password)) {
            $password = $userInfo['password'];
        } else {
            $password = Common::unsanitizeInputValue($password);
            if (!$_isPasswordHashed) {
                UsersManager::checkPassword($password);
                $password = UsersManager::getPasswordHash($password);
            }
            $passwordHasBeenUpdated = true;
        }
        if (empty($alias)) {
            $alias = $userInfo['alias'];
        }
        if (empty($email)) {
            $email = $userInfo['email'];
        }
        if ($email != $userInfo['email']) {
            $this->checkEmail($email);
        }
        $alias      = $this->getCleanAlias($alias, $userLogin);
        $token_auth = $this->getTokenAuth($userLogin, $password);
        $this->model->updateUser($userLogin, $password, $email, $alias, $token_auth);
        Cache::deleteTrackerCache();
        Piwik::postEvent('UsersManager.updateUser.end', array($userLogin, $passwordHasBeenUpdated, $email, $password, $alias));
    }
public function updateUser ( $ userLogin , $ password = false , $ email = false , $ alias = false , $ _isPasswordHashed = false ) { Piwik :: checkUserHasSuperUserAccessOrIsTheUser ( $ userLogin ) ; $ this -> checkUserIsNotAnonymous ( $ userLogin ) ; $ userInfo = $ this -> getUser ( $ userLogin ) ; $ passwordHasBeenUpdated = false ; if ( empty ( $ password ) ) { $ password = $ userInfo [ 'password' ] ; } else { $ password = Common :: unsanitizeInputValue ( $ password ) ; if ( ! $ _isPasswordHashed ) { UsersManager :: checkPassword ( $ password ) ; $ password = UsersManager :: getPasswordHash ( $ password ) ; } $ passwordHasBeenUpdated = true ; } if ( empty ( $ alias ) ) { $ alias = $ userInfo [ 'alias' ] ; } if ( empty ( $ email ) ) { $ email = $ userInfo [ 'email' ] ; } if ( $ email != $ userInfo [ 'email' ] ) { $ this -> checkEmail ( $ email ) ; } $ alias = $ this -> getCleanAlias ( $ alias , $ userLogin ) ; $ token_auth = $ this -> getTokenAuth ( $ userLogin , $ password ) ; $ this -> model -> updateUser ( $ userLogin , $ password , $ email , $ alias , $ token_auth ) ; Cache :: deleteTrackerCache ( ) ; Piwik :: postEvent ( 'UsersManager.updateUser.end' , array ( $ userLogin , $ passwordHasBeenUpdated , $ email , $ password , $ alias ) ) ; }
Updates a user in the database.
Updates a user in the database .
/**
         * Triggered after an existing user has been updated.
         * Event notify about password change.
         *
         * @param string $userLogin The user's login handle.
         * @param boolean $passwordHasBeenUpdated Flag containing information about password change.
         */