kernel/user/ezuseroperationcollection.php
static public function setSettings( $userID, $isEnabled, $maxLogin )
    {
        $userSetting = eZUserSetting::fetch( $userID );

        if ( $userSetting )
        {
            $userSetting->setAttribute( 'max_login', $maxLogin );
            $isUserEnabled = $isEnabled != 0;

            if ( $userSetting->attribute( 'is_enabled' ) != $isUserEnabled )
            {
                eZContentCacheManager::clearContentCacheIfNeeded( $userID );
                eZContentCacheManager::generateObjectViewCache( $userID );
            }

            $userSetting->setAttribute( "is_enabled", $isUserEnabled );
            $userSetting->store();

            if ( !$isUserEnabled )
            {
                eZUser::removeSessionData( $userID );
            }
            else
            {
                eZUserAccountKey::removeByUserID( $userID );
            }
            return array( 'status' => true );
        }
        else
        {
            eZDebug::writeError( "Failed to change settings of user $userID ", __METHOD__ );
            return array( 'status' => false );
        }
    }
static public function setSettings( $userID, $isEnabled, $maxLogin )
    {
        $userSetting = eZUserSetting::fetch( $userID );

        if ( $userSetting )
        {
            $userSetting->setAttribute( 'max_login', $maxLogin );
            $isUserEnabled = $isEnabled != 0;

            if ( $userSetting->attribute( 'is_enabled' ) != $isUserEnabled )
            {
                eZContentCacheManager::clearContentCacheIfNeeded( $userID );
                eZContentCacheManager::generateObjectViewCache( $userID );
            }

            $userSetting->setAttribute( "is_enabled", $isUserEnabled );
            $userSetting->store();

            if ( !$isUserEnabled )
            {
                eZUser::removeSessionData( $userID );
            }
            else
            {
                eZUserAccountKey::removeByUserID( $userID );
            }
            return array( 'status' => true );
        }
        else
        {
            eZDebug::writeError( "Failed to change settings of user $userID ", __METHOD__ );
            return array( 'status' => false );
        }
    }
static public function setSettings ( $ userID , $ isEnabled , $ maxLogin ) { $ userSetting = eZUserSetting :: fetch ( $ userID ) ; if ( $ userSetting ) { $ userSetting -> setAttribute ( 'max_login' , $ maxLogin ) ; $ isUserEnabled = $ isEnabled != 0 ; if ( $ userSetting -> attribute ( 'is_enabled' ) != $ isUserEnabled ) { eZContentCacheManager :: clearContentCacheIfNeeded ( $ userID ) ; eZContentCacheManager :: generateObjectViewCache ( $ userID ) ; } $ userSetting -> setAttribute ( "is_enabled" , $ isUserEnabled ) ; $ userSetting -> store ( ) ; if ( ! $ isUserEnabled ) { eZUser :: removeSessionData ( $ userID ) ; } else { eZUserAccountKey :: removeByUserID ( $ userID ) ; } return array ( 'status' => true ) ; } else { eZDebug :: writeError ( "Failed to change settings of user $userID " , __METHOD__ ) ; return array ( 'status' => false ) ; } }
Changes user settings

@param int $userID
@param int $isEnabled
@param int $maxLogin

@return array An array with operation status, always true if userID is ok
Changes user settings