Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

3 changes: 2 additions & 1 deletion config-sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

UA_CODE = 'UA-23362538-7'

COSIGN_PROXY_DIR = '/opt/cosign/proxy'
MY_ENTITY_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
ANDRVOTR_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

SUBMISSIONS_OPEN = True
UPLOADS_ENABLED = True
Expand Down
23 changes: 14 additions & 9 deletions eprihlaska/ais_utils.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import os
import sys
import re
import flask.json
from flask import url_for
DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, DIR + '/votr/')

from aisikl.context import Context # noqa
from aisikl.app import Application # noqa
import aisikl.portal # noqa
from fladgejt.login import create_client # noqa


def create_context(cookies, origin='ais2-beta.uniba.sk'):
ctx = Context(cookies, ais_url='https://'+origin+'/')
return ctx
def create_context(*, my_entity_id, andrvotr_api_key, andrvotr_authority_token, beta):
server = dict(
login_types=('saml_andrvotr',),
ais_url=('https://ais2-beta.uniba.sk/' if beta else 'https://ais2.uniba.sk/'),
)
params = dict(
type='saml_andrvotr',
my_entity_id=my_entity_id,
andrvotr_api_key=andrvotr_api_key,
andrvotr_authority_token=andrvotr_authority_token,
)
return create_client(server, params).context


def test_ais(ctx):
Expand Down Expand Up @@ -135,7 +140,7 @@ def save_application_form(ctx,

# If the priezviskoTextField is not empty, it most probably means the
# person is already registered in
if app.d.priezviskoTextField.value != '' and process_type is None:
if app.d.priezviskoTextField.value != '' and process_type == 'none':
notes['person_exists'] = {
'name': app.d.menoTextField.value,
'surname': app.d.priezviskoTextField.value,
Expand Down
6 changes: 0 additions & 6 deletions eprihlaska/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,5 @@ class SignupForm(FlaskForm):
submit = SubmitField(label=c.SIGNUP)


class AIS2CookieForm(FlaskForm):
jsessionid = StringField(label='JSESSIONID',
validators=[validators.DataRequired()])
submit = SubmitField(label=c.SUBMIT)


class AIS2SubmitForm(FlaskForm):
submit = SubmitField(label=c.CONTINUE)
2 changes: 1 addition & 1 deletion eprihlaska/templates/admin_impersonate_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1 class="section-title">
<div class="container">
<div class="row">
<div class="col-lg-12 text-right">
<a href="https://login.uniba.sk/logout.cgi"><strong>Odhlásiť sa</strong></a>
<a href="{{ url_for('logout') }}"><strong>Odhlásiť sa</strong></a>
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions eprihlaska/templates/admin_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
{% endif %}

{% if app.state.value == 2 %}
<a class="btn btn-xs btn-default" href="{{ url_for('admin_process', id=app.id) }}">Preklopiť na BETU</a>
<a class="btn btn-xs btn-default" href="{{ url_for('admin_ais2_process', id=app.id) }}">Preklopiť</a>
<a class="btn btn-xs btn-default" href="{{ url_for('admin_ais2_process', ais_instance='beta', process_type='none', id=app.id) }}">Preklopiť na BETU</a>
<a class="btn btn-xs btn-default" href="{{ url_for('admin_ais2_process', ais_instance='prod', process_type='none', id=app.id) }}">Preklopiť</a>
{% endif %}
</div>
<br />
Expand Down Expand Up @@ -106,7 +106,7 @@ <h1 class="section-title">
<div class="container">
<div class="row">
<div class="col-lg-12 text-right">
<a href="https://login.uniba.sk/logout.cgi"><strong>Odhlásiť sa</strong></a>
<a href="{{ url_for('logout') }}"><strong>Odhlásiť sa</strong></a>
</div>
</div>
<div class="row">
Expand Down
14 changes: 3 additions & 11 deletions eprihlaska/templates/admin_process.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="container">
<h1 class="section-title">
{% block title %}
{% if beta %}
{% if ais_instance == 'beta' %}
Preklopenie prihlášky #{{ id }} do AIS2 (beta)
{% else %}
Preklopenie prihlášky #{{ id }} do AIS2
Expand Down Expand Up @@ -128,21 +128,13 @@ <h3>Vyplniť prihlášku bez párovania s osobou</h3>
</a>
</div>
<div class="col-md-4">
{% if beta %}
<a class="btn" href="{{ url_for('admin_process_special', id=id, process_type='no_fill') }}">
{% else %}
<a class="btn" href="{{ url_for('admin_ais2_process_special', id=id, process_type='no_fill') }}">
{% endif %}
<a class="btn" href="{{ url_for('admin_ais2_process', ais_instance=ais_instance, process_type='no_fill', id=id) }}">
Pokračovať s údajmi z AIS2
</a>
</div>

<div class="col-md-4">
{% if beta %}
<a class="btn" href="{{ url_for('admin_process_special', id=id, process_type='fill') }}">
{% else %}
<a class="btn" href="{{ url_for('admin_ais2_process_special', id=id, process_type='fill') }}">
{% endif %}
<a class="btn" href="{{ url_for('admin_ais2_process', ais_instance=ais_instance, process_type='fill', id=id) }}">
Pokračovať s údajmi z prihlášky
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion eprihlaska/templates/admin_tokens_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1 class="section-title">
<div class="container">
<div class="row">
<div class="col-lg-12 text-right">
<a href="https://login.uniba.sk/logout.cgi"><strong>Odhlásiť sa</strong></a>
<a href="{{ url_for('logout') }}"><strong>Odhlásiť sa</strong></a>
</div>
</div>

Expand Down
Loading