src/snac/server/database/DBUser.php
/**
     * Update a user record.
     *
     * Write the User fields to the database where appuser.id=$user->getUserID(). By checking the returned id
     * inside updateUser() we at least know a record was updated in the database.
     *
     * Users do not have a groupList. They did, and it was removed, so you won't find any reference to it,
     * except this comment.
     *
     * @param \snac\data\User $user A user object.
     * @param boolean $saveRole optionsl If true, save the roles of this user
     * @return boolean True on success, else false.
     */
Update a user record.
Write the User fields to the database where appuser.id=$user->getUserID(). By checking the returned id
inside updateUser() we at least know a record was updated in the database.

Users do not have a groupList. They did, and it was removed, so you won't find any reference to it,
except this comment.

@param \snac\data\User $user A user object.
@param boolean $saveRole optionsl If true, save the roles of this user
@return boolean True on success, else false.
Update a user record . Write the User fields to the database where appuser . id = $user - > getUserID () . By checking the returned id inside updateUser () we at least know a record was updated in the database . Users do not have a groupList . They did and it was removed so you won ' t find any reference to it except this comment . @param \ snac \ data \ User $user A user object . @param boolean $saveRole optionsl If true save the roles of this user @return boolean True on success else false .
public function saveUser($user, $saveRole=false)
    {
        $retVal = $this->sql->updateUser($user->getUserID(),
                                         $user->getFirstName(),
                                         $user->getLastName(),
                                         $user->getFullName(),
                                         $user->getAvatar(),
                                         $user->getAvatarSmall(),
                                         $user->getAvatarLarge(),
                                         $user->getEmail(),
                                         $user->getUserName(),
                                         $user->getWorkEmail(),
                                         $user->getWorkPhone(),
                                         $user->getAffiliation()==null?null:$user->getAffiliation()->getID(),
                                         $user->getPreferredRules(),
                                         $user->getUserActive());
        if ($saveRole) {
            $rolesToDelete = $this->listUserRoles($user);
            $rolesToAdd = $user->getRoleList();
            foreach($rolesToDelete as $role) {
                $this->removeUserRole($user, $role);
            }
            foreach($rolesToAdd as $role) {
                $this->addRoleToUser($user, $role);
            }
        }
        return $retVal;
    }
public function saveUser ( $ user , $ saveRole = false ) { $ retVal = $ this -> sql -> updateUser ( $ user -> getUserID ( ) , $ user -> getFirstName ( ) , $ user -> getLastName ( ) , $ user -> getFullName ( ) , $ user -> getAvatar ( ) , $ user -> getAvatarSmall ( ) , $ user -> getAvatarLarge ( ) , $ user -> getEmail ( ) , $ user -> getUserName ( ) , $ user -> getWorkEmail ( ) , $ user -> getWorkPhone ( ) , $ user -> getAffiliation ( ) == null ? null : $ user -> getAffiliation ( ) -> getID ( ) , $ user -> getPreferredRules ( ) , $ user -> getUserActive ( ) ) ; if ( $ saveRole ) { $ rolesToDelete = $ this -> listUserRoles ( $ user ) ; $ rolesToAdd = $ user -> getRoleList ( ) ; foreach ( $ rolesToDelete as $ role ) { $ this -> removeUserRole ( $ user , $ role ) ; } foreach ( $ rolesToAdd as $ role ) { $ this -> addRoleToUser ( $ user , $ role ) ; } } return $ retVal ; }
Update a user record.
Update a user record .
/*
         * Admins can run this on behalf of another user. It requires authorization to save roles and save
         * groups.
         */ /*
             * - remove all old roles, removeUserRole()?
             * - add back all current roles
             */ // This method will munge the list of roles attached to the user (Side-effect-full) // This method will munge the list of roles attached to the user (Side-effect-full)