Loads a user object with data for this field ready for the edit profile
form
@param stdClass $user a user object
11771
public function edit_load_user_data($user) {
        if ($this->data !== null) {
            $user->{$this->inputname} = $this->data;
        }
    }
1309821
public function created($user)
    {
        if (! $baseName = $user->baseRole) {
            return;
        }
 
        // Attach base role
        if (method_exists($user, 'attachRole')) {
            $user->attachRole($baseName);
        }
    }
153365
function loadUserFields()
    {
        $user_fields = array();

        $this->container->get('event_dispatcher')->dispatch(SettingsEvents::BEFORE_LOAD_USERFIELDS, new FilterUserFieldsEvent($user_fields, $this->container));

        array_merge($user_fields, $user_fields = $this->container->getParameter("acs_settings.user_fields"));

        $user = $this->container->get('security.context')->getToken()->getUser();

        // If is admins we load the global system settings
        if (true === $this->container->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
            $user_fields = array_merge($user_fields, $system_fields = $this->container->getParameter("acs_settings.system_fields"));
        }

        $object_settings = $this->container->get('acs.setting_manager')->getObjectSettingsPrototype($user);

        $user_fields = array_merge($user_fields, $object_settings);

        $this->container->get('event_dispatcher')->dispatch(SettingsEvents::AFTER_LOAD_USERFIELDS, new FilterUserFieldsEvent($user_fields,$this->container));

        return $user_fields;
    }
914801
public function user($user = null)
    {
        if ($user !== null) {
            $this->user = $user;
        }

        return $this->user;
    }
497932
public function editAction(User $user)
    {
        $this->assignElectronicAddressOptions();

        $this->view->assignMultiple([
            'currentUser' => $this->currentUser,
            'user' => $user,
            'availableRoles' => $this->policyService->getRoles()
        ]);
    }
130949
public static function set_user(\stdClass $user) {
        global $ADMIN;
        $GLOBALS['USER'] = $user;
        unset($GLOBALS['USER']->description); // Conserve memory.
        unset($GLOBALS['USER']->password);    // Improve security.
        if (isset($GLOBALS['USER']->lang)) {
            // Make sure it is a valid lang pack name.
            $GLOBALS['USER']->lang = clean_param($GLOBALS['USER']->lang, PARAM_LANG);
        }

        // Relink session with global $USER just in case it got unlinked somehow.
        $_SESSION['USER'] =& $GLOBALS['USER'];

        // Nullify the $ADMIN tree global. If we're changing users, then this is now stale and must be generated again if needed.
        $ADMIN = null;

        // Init session key.
        sesskey();
    }
888946
public function edit(User $user)
    {
        $roles = Role::all();
        $permissions = Permission::all();
        return view('chuckcms::backend.users.edit', compact('user', 'roles', 'permissions'));
    }
208362
public function showProfileFields($user)
    {
        // Get contents
        $fields = $this->fields;
        $title = $this->title;

        // Check fields
        if (empty($fields)) {
            return;
        }

        $vars = [
            't_user_title' => !empty($title) ? $title : Translate::t('user.title'),
        ];

        // Get all values
        foreach ($fields as $field) {
            if (!$field) {
                continue;
            }

            $vars['fields'][] = $field->render([], [
                'template' => 'user',
                'user' => $user,
            ], false);
        }

        // Render view
        Render::view('user.html.twig', $vars, 'user');
    }
710903
public function activateUser(User $user)
    {
        $user->setIsEnabled(true);
        $user->setIsMailValidated(true);
        $user->setResetPasswordHash(null);
        $user->setInitDate(new \DateTime());

        $this->objectManager->persist($user);
        $this->objectManager->flush();
    }
1336551
public function can_manually_control_post_read_status(stdClass $user) : bool {
        global $CFG;
        return $CFG->forum_usermarksread && isloggedin() && forum_tp_is_tracked($this->get_forum_record(), $user);
    }
24576
public function setUser($user)
    {
        if (!($user instanceof $this->userClassName)) {
            throw new \Parable\Framework\Exception("Invalid object provided, type {$this->userClassName} required.");
        }
        $this->user = $user;
        return $this;
    }
858200
public function loadSitesList($user)
    {
        if (!is_super_admin()) {
            return;
        }

        if (!is_network_admin()) {
            return;
        }

        if (file_exists(MSROLEPROPAGINATION_TEMPLATE_PATH . 'profile.php')) {

            //Get data for view
            $data = array(
                'sites' => array_chunk(get_sites(), 3),
                'savedState' => $this->getUserRoles($user->ID)
            );

            //Require view
            require MSROLEPROPAGINATION_TEMPLATE_PATH.'profile.php';
        } else {
            wp_die("Profile page view does not exists at " . MSROLEPROPAGINATION_TEMPLATE_PATH.'profile.php');
        }
    }
102876
public function userCreate($user)
    {
        $this->dispatchHooks('BeforeUserCreateScope', $user);
        $this->parseEntityFields('user', $user);
        $this->getDriver()->userCreate($user);
        $this->dispatchHooks('AfterUserCreateScope', $user);
        $this->userManager->addUser($user);
        return $user;
    }
90812
public function makeUserLoggedIn($user)
    {
        if (!is_array($user) && !is_object($user)) {
            $user = $this->getUser($user);
        } elseif (!($user instanceof UserDataInterface)) {
            $user = new UserData($user);
        }

        if ($user->isNull()) {
            return false;
        }

        return $this->getHandler()->login($user);
    }
233292
public function setUser(User $user): void
    {
        $this->user = $user;
        $this->user->setAcl($this);

        $userRole = $this->user->getRole();
        if ($userRole != null && !empty($this->rules)) {
            foreach ($this->rules as $role => $rules) {
                if ($userRole == $role) {
                    foreach ($rules as $uri => $rules) {
                        $this->user->setPermissionsOf($uri, (array) explode(',', $rules) /* 'read,write' etc. */);
                    }
                    break;
                }
            }
        }
    }
318648
public function edit(User $user)
    {
        return $this->appShellView('user.edit', [
            'user'  => $user,
            'types' => UserTypeProxy::choices(),
            'roles' => RoleProxy::all()
        ]);
    }
1181406
public function updateAction(User $user)
    {
        $this->userService->updateUser($user);
        $this->addFlashMessage('Your user has been updated.', 'User updated', Message::SEVERITY_OK);
        $this->redirect('edit');
    }