<commit_before>###########################################################
#
# Copyright (c) 2005, Southpaw Technology
#                     All Rights Reserved
#
# PROPRIETARY INFORMATION.  This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permission.
#
#
#

__all__ = ["SignOutCmd", "PasswordEditCmd"]


from pyasm.common import Environment, UserException
from command import *
from pyasm.search import SearchKey

import hashlib
class SignOutCmd(Command):
    '''Sign out command'''

    def __init__(self, **kwargs):
        self.login_name = ''
        super(SignOutCmd, self).__init__(**kwargs)

    def is_undoable(cls):
        return False
    is_undoable = classmethod(is_undoable)

    def get_title(self):
        return "Sign Out Command"


    def set_login_name(self, login_name):
        self.login_name = login_name

    def check(self):
        return True

    def execute(self):

        if not self.login_name:
            self.login_name = self.kwargs.get('login');

        # invalidate the ticket
        security = Environment.get_security()
        ticket = security.get_ticket()

        if ticket == None:
            return


        login_name = ticket.get_value("login")
        print("Signing out: ", login_name)

        # expire the ticket

        from pyasm.security import Site
        site = Site.get()<commit_msg>signout<commit_after>###########################################################
#
# Copyright (c) 2005, Southpaw Technology
#                     All Rights Reserved
#
# PROPRIETARY INFORMATION.  This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permission.
#
#
#

__all__ = ["SignOutCmd", "PasswordEditCmd"]


from pyasm.common import Environment, UserException
from command import *
from pyasm.search import SearchKey, Search

import hashlib
class SignOutCmd(Command):
    '''Sign out command'''

    def __init__(self, **kwargs):
        self.login_name = ''
        super(SignOutCmd, self).__init__(**kwargs)

    def is_undoable(cls):
        return False
    is_undoable = classmethod(is_undoable)

    def get_title(self):
        return "Sign Out Command"


    def set_login_name(self, login_name):
        self.login_name = login_name

    def check(self):
        return True

    def execute(self):

        if not self.login_name:
            self.login_name = self.kwargs.get('login');

        # invalidate the ticket
        security = Environment.get_security()

        target = self.kwargs.get('target')
        target_ticket = self.kwargs.get('target_ticket')
        if target:
           search = Search('sthpw/ticket')
           search.add_filter('ticket', target_ticket)
           ticket = search.get_sobject()
        else:
           ticket = security.get_ticket()

	if ticket == None:
            return

        login_name = ticket.get_value("login")
        print("Signing out: ", login_name)

        # expire the ticket

        from pyasm.security import Site
        site = Site.get()
{'fraction_non_alphanumeric': 0.12670689107653224, 'fraction_numerical': 0.0025404890441409972, 'mean_word_length': 2.7455410225921524, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7639237', 'n_tokens_mistral': 905, 'n_tokens_neox': 843, 'n_words': 241}