[solved] Image in AgentPreferences

English! place to talk about development, programming and coding
Post Reply
steste123
Znuny wizard
Posts: 554
Joined: 25 Sep 2012, 19:04
Znuny Version: OTRS Help Desk
Real Name: Stefan

[solved] Image in AgentPreferences

Post by steste123 »

Hi @all,
I tested the beta 1 of OTRS - and it's great that OTRS launched a 2FA-feature :) To make it easier for the agents I want to generate a QR-Code to add the OTP-Token to the Google Authenticator.

Code: Select all

<img src="https://chart.googleapis.com/chart?cht=qr&chl=unsafe%3Aotpauth%3A%2F%2Ftotp%2FUSERNAME%3Fsecret%3DSHAREDKEY%26counter%3D0&chs=180x180&choe=UTF-8&chld=L|2" />
I added this HTML-URL to the following excerpt of the AgentPreferences.tt

Code: Select all

<label for="[% Data.Name | html %]">[% Translate(Data.Key) | html %]:</label>
                                    <div class="Field">
                                        <input type="text" name="[% Data.Name | html %]" id="[% Data.Name | html %]" value="[% Data.SelectedID | html %]" />
                                    </div>
                           
                           <div class="Field">
                                        <img src="https://chart.googleapis.com/chart?cht=qr&chl=unsafe%3Aotpauth%3A%2F%2Ftotp%2FTicketsystem%3Fsecret%3D[% Data.SelectedID | html %]%26counter%3D0&chs=180x180&choe=UTF-8&chld=L|2" />
                                    </div>
                           
                           
                                    <div class="Clear"></div>
[% RenderBlockStart("InputKeySingleBlock") %]
                                    <div class="Field ButtonOnly">
                                        <button type="submit" id="[% Data.Name | html %]Update" value="[% Translate("Update") | html %]" class="CallForAction"><span>[% Translate("Update") | html %]</span></button>
                                    </div>
But it won't work :( Maybe anybody have an idea - how I can implement a Image?
Last edited by steste123 on 14 Oct 2015, 11:29, edited 2 times in total.
OTRS 5.x - Debian 8 - apache 2.4 - MySQL 5.x
steste123
Znuny wizard
Posts: 554
Joined: 25 Sep 2012, 19:04
Znuny Version: OTRS Help Desk
Real Name: Stefan

Re: [solved] Image in AgentPreferences

Post by steste123 »

Solved by myself :)
OTRS 5.x - Debian 8 - apache 2.4 - MySQL 5.x
steste123
Znuny wizard
Posts: 554
Joined: 25 Sep 2012, 19:04
Znuny Version: OTRS Help Desk
Real Name: Stefan

Re: [solved] Image in AgentPreferences

Post by steste123 »

I'm an idiot :((((( I deleted my beta VM without saving the template-files.

Has anybody an idea where I need to add this part so that I'm able to configure the 2FA-Secretkey-Box for the AgentPreferences?
OTRS 5.x - Debian 8 - apache 2.4 - MySQL 5.x
steste123
Znuny wizard
Posts: 554
Joined: 25 Sep 2012, 19:04
Znuny Version: OTRS Help Desk
Real Name: Stefan

Re: Image in AgentPreferences

Post by steste123 »

solved :D
Just for my and your information

AgentPreferences.tt

Change this:

Code: Select all

[% RenderBlockEnd("InputKeySingleBlock") %]
[% RenderBlockEnd("InputKey") %]
[% RenderBlockStart("Input") %]
                                    <label for="[% Data.Name | html %]">[% Translate(Data.Key) | html %]:</label>
                                    <div class="Field">
                                        <input type="text" name="[% Data.Name | html %]" id="[% Data.Name | html %]" value="[% Data.SelectedID | html %]" />
                                    </div>
                                    <div class="Clear"></div>
[% RenderBlockStart("InputSingleBlock") %]
                                    <div class="Field ButtonOnly">
                                        <button type="submit" class="CallForAction" id="[% Data.Name | html %]Update" value="[% Translate("Update") | html %]">[% Translate("Update") | html %]</button>
                                    </div>
to this:

Code: Select all

[% RenderBlockEnd("InputKeySingleBlock") %]
[% RenderBlockEnd("InputKey") %]
[% RenderBlockStart("Input") %]
                               <label for="[% Data.Name | html %]">[% Translate(Data.Key) | html %]:</label>
                                    <div class="Field">
                                        <input type="text" name="[% Data.Name | html %]" id="[% Data.Name | html %]" value="[% Data.SelectedID | html %]" />
                                    </div>
                           
                           <div class="Field">
                                        <img src="https://chart.googleapis.com/chart?cht=qr&chl=unsafe%3Aotpauth%3A%2F%2Ftotp%2FTicketsystem%3Fsecret%3D[% Data.SelectedID | html %]%26counter%3D0&chs=180x180&choe=UTF-8&chld=L|2" />
                                    </div>
                           
                           
                                    <div class="Clear"></div>
[% RenderBlockStart("InputKeySingleBlock") %]
                                    <div class="Field ButtonOnly">
                                        <button type="submit" id="[% Data.Name | html %]Update" value="[% Translate("Update") | html %]" class="CallForAction"><span>[% Translate("Update") | html %]</span></button>
                                    </div>
OTRS 5.x - Debian 8 - apache 2.4 - MySQL 5.x
Post Reply