framework/RedKiteCms/Rendering/Controller/Security/SaveUserController.php
public function save(array $options)
    {
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $this->options = $resolver->resolve($options);

        $request = $this->options["request"];
        $password = $request->get('password');
        $user = $this->fetchUser($this->options['security'], $this->options['configuration_handler']);

        $factory = $this->options['encoder_factory'];
        $encoder = $factory->getEncoder($user);
        $salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
        $password = $encoder->encodePassword($password, $salt);

        $userName = "admin";
        $usersFile = $this->options['configuration_handler']->usersDir() . '/users.json';
        $users = json_decode(FilesystemTools::readFile($usersFile), true);
        $user = $users[$userName];
        $user["password"] = $password;
        $user["salt"] = $salt;
        $users[$userName] = $user;
        FilesystemTools::writeFile($usersFile, json_encode($users));
    }
public function save(array $options)
    {
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $this->options = $resolver->resolve($options);

        $request = $this->options["request"];
        $password = $request->get('password');
        $user = $this->fetchUser($this->options['security'], $this->options['configuration_handler']);

        $factory = $this->options['encoder_factory'];
        $encoder = $factory->getEncoder($user);
        $salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
        $password = $encoder->encodePassword($password, $salt);

        $userName = "admin";
        $usersFile = $this->options['configuration_handler']->usersDir() . '/users.json';
        $users = json_decode(FilesystemTools::readFile($usersFile), true);
        $user = $users[$userName];
        $user["password"] = $password;
        $user["salt"] = $salt;
        $users[$userName] = $user;
        FilesystemTools::writeFile($usersFile, json_encode($users));
    }
public function save ( array $ options ) { $ resolver = new OptionsResolver ( ) ; $ this -> configureOptions ( $ resolver ) ; $ this -> options = $ resolver -> resolve ( $ options ) ; $ request = $ this -> options [ "request" ] ; $ password = $ request -> get ( 'password' ) ; $ user = $ this -> fetchUser ( $ this -> options [ 'security' ] , $ this -> options [ 'configuration_handler' ] ) ; $ factory = $ this -> options [ 'encoder_factory' ] ; $ encoder = $ factory -> getEncoder ( $ user ) ; $ salt = base_convert ( sha1 ( uniqid ( mt_rand ( ) , true ) ) , 16 , 36 ) ; $ password = $ encoder -> encodePassword ( $ password , $ salt ) ; $ userName = "admin" ; $ usersFile = $ this -> options [ 'configuration_handler' ] -> usersDir ( ) . '/users.json' ; $ users = json_decode ( FilesystemTools :: readFile ( $ usersFile ) , true ) ; $ user = $ users [ $ userName ] ; $ user [ "password" ] = $ password ; $ user [ "salt" ] = $ salt ; $ users [ $ userName ] = $ user ; FilesystemTools :: writeFile ( $ usersFile , json_encode ( $ users ) ) ; }
Implements the action to update the user information
@param array $options

@return \Symfony\Component\HttpFoundation\Response
Implements the action to update the user information @param array $options