Decrypt Session id

English! place to talk about development, programming and coding
Post Reply
rapidboy
Znuny newbie
Posts: 25
Joined: 23 Apr 2013, 13:47
Znuny Version: 3.2.1
Real Name: John Almound
Company: Student

Decrypt Session id

Post by rapidboy »

how i can Decrypt Session id & value, i want to know which session id is associated with which agent_id :shock:
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Decrypt Session id

Post by crythias »

the sessions table will hold that information until the session is cleared.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
rapidboy
Znuny newbie
Posts: 25
Joined: 23 Apr 2013, 13:47
Znuny Version: 3.2.1
Real Name: John Almound
Company: Student

Re: Decrypt Session id

Post by rapidboy »

No i want to get no. of online Users in some perl Module file .... OTRS mysql is giving me an Encrypted data like below :
Can u please tell me how can i get that data without encription , because i want no. of online users ....thanks

Code: Select all

session_id                                       |   session_value

07efefrereefe43433                          outofoffice:#MA : #DashboardOverview : ddjedf03e3: UserFirstname:edfnejf3e33
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Decrypt Session id

Post by jojo »

for getting the number of online users you don't need to decrypt the data
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
rapidboy
Znuny newbie
Posts: 25
Joined: 23 Apr 2013, 13:47
Znuny Version: 3.2.1
Real Name: John Almound
Company: Student

Re: Decrypt Session id

Post by rapidboy »

ok thanks for your reply but how i can get user_id from online Agents... !!

Any Code or NameSpace is required to import please share it here ... !!
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Decrypt Session id

Post by reneeb »

Check the code of the dashboard widget "Online User" (Kernel/Output/HTML/DashboardUserOnline.pm)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
rapidboy
Znuny newbie
Posts: 25
Joined: 23 Apr 2013, 13:47
Znuny Version: 3.2.1
Real Name: John Almound
Company: Student

Re: Decrypt Session id

Post by rapidboy »

I write this Code in Run method & import use Kernel::System::AuthSession; in start of my perl module..

Code: Select all

# get session ids
    my @Sessions = $Self->{SessionObject}->GetAllSessionIDs();

        SESSIONID:
        for my $SessionID (@Sessions) {

            next SESSIONID if !$SessionID;

            # get session data
            my %Data = $Self->{SessionObject}->GetSessionIDData( SessionID => $SessionID );
            my %AgentData;
            if ( $Data{UserType} eq 'User' ) {
                $Data{UserType} = 'Agent'; 
            }
       
            # get user data
                %AgentData = $Self->{UserObject}->GetUserData(
                    UserID => $Data{UserID},
                    NoOutOfOffice => 1,
                );

           }

Now i want to put Online UserID in the owner & Responsible section in randomize method ? any Solution !!


Code: Select all

# create new ticket, do db insert
        my $TicketID = $Self->{TicketObject}->TicketCreate(
            QueueID      => $NewQueueID,
            TypeID       => $GetParam{TypeID},
            ServiceID    => $GetParam{ServiceID},
            SLAID        => $GetParam{SLAID},
            Title        => $GetParam{Subject},
            PriorityID   => $GetParam{PriorityID},
            Priority     => $GetParam{Priority},
            Lock         => 'unlock',
            State        => $Self->{Config}->{StateDefault},
            CustomerID   => $Self->{UserCustomerID},
            CustomerUser => $Self->{UserLogin},
            UserID       => $Self->{ConfigObject}->Get('CustomerPanelUserID'),
            OwnerID      =>                                ,
            ResponsibleID =>                             ,
        );


crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Decrypt Session id

Post by crythias »

Don't!! need!! to!! shout!! at!! us!!

What you're doing is!! really!! annoying!! and!! useless!! if!! only!! one!! agent!! is!! logged!! in!!

And broken when nobody is logged in.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
rapidboy
Znuny newbie
Posts: 25
Joined: 23 Apr 2013, 13:47
Znuny Version: 3.2.1
Real Name: John Almound
Company: Student

Re: Decrypt Session id

Post by rapidboy »

crythias : if u don't know the ans don't give me an answer please, i read too many posts of you, and you just give suggestions to others not an answer.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Decrypt Session id

Post by crythias »

Okay. I do know the answer. That's why I'm telling you what's broken about your request. And I could tell you how to choose and automatically assign ownership from the list of people currently logged into the system, but I'd never do it because if nobody's logged on, I'd have to do the same kind of manual work I'm trying to avoid by assigning randomly.

Also, I know that there's no load balancing in randomly assigning ticket ownership, and in true random fashion, it's likely that someone is going to be inundated with tickets where others are not going to have as many. Plus, this assigning ownership has no concept of time to complete, so I'd expect a backlog and more manual labor to address.

With this said, I'll refrain from posting on this topic unless you specifically address me or this post.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
alexus
Znuny wizard
Posts: 382
Joined: 20 Sep 2010, 16:54
Znuny Version: OTRS 6 CE
Real Name: Alexey Yusov
Company: Radiant System Group s.r.o
Location: Prague
Contact:

Re: Decrypt Session id

Post by alexus »

"I need to decrypt Sessions" -> "I need to know the number of online users" -> "I need randomize Owner" -> What is the next step (or steps) ??? What do you want to actually? What are your true business or process requiremetns?
Alexey Yusov

Production: OTRS CE ITSM 6.0.28 on CentOS 7 + Apache 2.4 + MariaDB 10.4.13 + Radiant Customer Portal

Radiant System OTRS Intergrator
RS4OTRS marketplace
Stay tuned on our Facebook
((OTRS)) Community Edition - what next?
rapidboy
Znuny newbie
Posts: 25
Joined: 23 Apr 2013, 13:47
Znuny Version: 3.2.1
Real Name: John Almound
Company: Student

Re: Decrypt Session id

Post by rapidboy »

I need UserID's in CustomerTicketMessage.pm from session (No. of online Agents ).
basically i need to set Owner & Responsible for Ticket there.... i tried to much but it didn't make any success..
Please share some wisdom here...
Post Reply