.. versionadded:: 2016.3.0

    Gets the current setting for Auto Login

    :return: If enabled, returns the user name, otherwise returns False
    :rtype: str, bool

    CLI Example:

    .. code-block:: bash

        salt '*' user.get_auto_login
494576
def get_auto_login():
    '''
    
    '''
    cmd = ['defaults',
           'read',
           '/Library/Preferences/com.apple.loginwindow.plist',
           'autoLoginUser']
    ret = __salt__['cmd.run_all'](cmd, ignore_retcode=True)
    return False if ret['retcode'] else ret['stdout']
1235309
def get_user(self, username):
        
        User = get_user_model()
        try:
            user = User.objects.get(**{
                User.USERNAME_FIELD: username,
            })
            if user.is_active:
                raise ActivationError(
                    self.ALREADY_ACTIVATED_MESSAGE,
                    code='already_activated'
                )
            return user
        except User.DoesNotExist:
            raise ActivationError(
                self.BAD_USERNAME_MESSAGE,
                code='bad_username'
            )
629905
def get_local_user():
    
    # TODO: I don't understand why these lines were added outside the
    # try/except, since presumably it means the attempt at catching ImportError
    # wouldn't work. However, that's how the contributing user committed it.
    # Need an older Windows box to test it out, most likely.
    import getpass

    username = None
    # All Unix and most Windows systems support the getpass module.
    try:
        username = getpass.getuser()
    # Some SaaS platforms raise KeyError, implying there is no real user
    # involved. They get the default value of None.
    except KeyError:
        pass
    # Older (?) Windows systems don't support getpass well; they should
    # have the `win32` module instead.
    except ImportError:  # pragma: nocover
        if win32:
            import win32api
            import win32security  # noqa
            import win32profile  # noqa

            username = win32api.GetUserName()
    return username
674927
def get_password(self):
        
        if self.password is None:
            if os.environ.get(self.username+'password'):
                self.password = os.environ.get(self.username+'password')
            else:
                raise PasswordError(self.username)
601932
def get(self, user_name: str) -> User:
        
        user = current_user()
        if user.is_admin or user.name == user_name:
            return self._get_or_abort(user_name)
        else:
            abort(403)
1150093
def get_auth_user():
    
    from uliweb import request
    from uliweb import settings

    user_fieldname = settings.get_var('AUTH/GET_AUTH_USER_FIELDNAME', 'id')

    session_key = _get_auth_key()
    user_id = request.session.get(session_key)
    if user_id:
        if isinstance(user_id, dict):
            return user_id
        else:
            User = get_model('user')
            user = User.get(User.c[user_fieldname]==user_id)
            return user
1363012
def authenticate_user(username, password):
    
    user_model = Query()
    user = db.get(user_model.username == username)

    if not user:
        logger.warning("User %s not found", username)
        return False

    if user['password'] == hash_password(password, user.get('salt')):
        return user['username']

    return False
1198012
def get_user(self, username="~"):
        
        url = self._build_url("users/%s/" % username, _prepend_namespace=False)
        response = self._get(url)
        check_response(response)
        return response
104123
def _search_for_user_dn(self):
        
        search = self.settings.USER_SEARCH
        if search is None:
            raise ImproperlyConfigured(
                "AUTH_LDAP_USER_SEARCH must be an LDAPSearch instance."
            )

        results = search.execute(self.connection, {"user": self._username})
        if results is not None and len(results) == 1:
            (user_dn, self._user_attrs) = next(iter(results))
        else:
            user_dn = None

        return user_dn
750777
def chloginclass(name, loginclass, root=None):
    '''
    
    '''
    if loginclass == get_loginclass(name):
        return True

    cmd = ['pw', 'usermod', '-L', '{0}'.format(loginclass),
           '-n', '{0}'.format(name)]

    __salt__['cmd.run'](cmd, python_shell=False)

    return get_loginclass(name) == loginclass
273853
def autoconf(self):
        
        apcinfo = APCinfo(self._host, self._port, self._user, self._password, 
                          self._monpath, self._ssl)
        return apcinfo is not None
427785
def auth(self):
        
        if self.oauth:
            return self.oauth
        return (self.username, self.password)
1110091
def check_auth(username, password):
    

    with open(os.path.expanduser("~/config/.note.conf")) as fd:
        config = json.loads(fd.read())

    try:
        u = config['server']['login']['username']
        p = config['server']['login']['password']
    except KeyError:
        print "cannot start server"
        sys.exit(1)

    return username == u and password == p
121539
def get_working_login(self, database, username=None, password=None):
        
        login_user = None


        #  this will authenticate and update login user
        self.get_db(database, username=username, password=password,
                    never_auth_with_admin=True)

        login_user = self.get_login_user(database)

        if login_user:
            username = login_user["username"]
            password = (login_user["password"] if "password" in login_user
                        else None)
        return username, password
809325
def telnet_login(
        self, username_pattern=r"(?:user>)", alt_prompt_term=r"#\s*$", **kwargs
    ):
        
        self.TELNET_RETURN = self.RETURN
        return super(RadETXTelnet, self).telnet_login(
            username_pattern=username_pattern,
            alt_prompt_terminator=alt_prompt_term,
            **kwargs
        )
597287
def autoconf(self):
        
        nginxInfo = NginxInfo(self._host, self._port,
                                self._user, self._password, 
                                self._statuspath, self._ssl)
        return nginxInfo is not None
298146
def autoconf(self):
        
        lighttpdInfo = LighttpdInfo(self._host, self._port,
                                self._user, self._password, 
                                self._statuspath, self._ssl)
        return lighttpdInfo is not None