things
parent
7c7736c834
commit
03d926dbe4
|
@ -63,6 +63,10 @@ def send_templates(path):
|
||||||
def send_static_js(path):
|
def send_static_js(path):
|
||||||
return send_from_directory(os.path.join(app.root_path, 'static'), path)
|
return send_from_directory(os.path.join(app.root_path, 'static'), path)
|
||||||
|
|
||||||
|
@app.route('/isard-sso-admin/avatars/<path:path>')
|
||||||
|
def send_avatars_img(path):
|
||||||
|
return send_from_directory(os.path.join(app.root_path, '../avatars/master-avatars'), path)
|
||||||
|
|
||||||
# @app.errorhandler(404)
|
# @app.errorhandler(404)
|
||||||
# def not_found_error(error):
|
# def not_found_error(error):
|
||||||
# return render_template('page_404.html'), 404
|
# return render_template('page_404.html'), 404
|
||||||
|
|
|
@ -147,7 +147,7 @@ class Admin():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_moodle_users(self):
|
def get_moodle_users(self):
|
||||||
return self.moodle.get_users_with_groups_and_roles()
|
return [u for u in self.moodle.get_users_with_groups_and_roles() if u['username'] not in ['guest','ddadmin','admin'] and not u['username'].startswith('system')]
|
||||||
|
|
||||||
## TOO SLOW. Not used.
|
## TOO SLOW. Not used.
|
||||||
# def get_moodle_users(self):
|
# def get_moodle_users(self):
|
||||||
|
@ -173,7 +173,7 @@ class Admin():
|
||||||
"email": u.get('email',''),
|
"email": u.get('email',''),
|
||||||
"groups": u['group'],
|
"groups": u['group'],
|
||||||
"roles": filter_roles_list(u['role'])}
|
"roles": filter_roles_list(u['role'])}
|
||||||
for u in users]
|
for u in users if u['username'] not in ['guest','ddadmin','admin'] and not u['username'].startswith('system')]
|
||||||
|
|
||||||
def get_nextcloud_users(self):
|
def get_nextcloud_users(self):
|
||||||
return [{"id":u['username'],
|
return [{"id":u['username'],
|
||||||
|
@ -183,7 +183,7 @@ class Admin():
|
||||||
"email": u.get('email',''),
|
"email": u.get('email',''),
|
||||||
"groups": u['groups'],
|
"groups": u['groups'],
|
||||||
"roles": False}
|
"roles": False}
|
||||||
for u in self.nextcloud.get_users_list()]
|
for u in self.nextcloud.get_users_list() if u['username'] not in ['guest','ddadmin','admin'] and not u['username'].startswith('system')]
|
||||||
|
|
||||||
## TOO SLOW
|
## TOO SLOW
|
||||||
# def get_nextcloud_users(self):
|
# def get_nextcloud_users(self):
|
||||||
|
|
|
@ -183,6 +183,11 @@ $(document).ready(function() {
|
||||||
],
|
],
|
||||||
"order": [[4, 'asc']],
|
"order": [[4, 'asc']],
|
||||||
"columnDefs": [ {
|
"columnDefs": [ {
|
||||||
|
"targets": 1,
|
||||||
|
"render": function ( data, type, full, meta ) {
|
||||||
|
return '<img src="/isard-sso-admin/avatars/'+full.id+'" alt="X" title="'+full.id+'" width="25" height="25">'
|
||||||
|
}},
|
||||||
|
{
|
||||||
"targets": 2,
|
"targets": 2,
|
||||||
"render": function ( data, type, full, meta ) {
|
"render": function ( data, type, full, meta ) {
|
||||||
if(full.keycloak){
|
if(full.keycloak){
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th>Id</th>
|
<th>Avatar</th>
|
||||||
<th>Keycloak</th>
|
<th>Keycloak</th>
|
||||||
<th>K.Groups</th>
|
<th>K.Groups</th>
|
||||||
<th>K.Roles</th>
|
<th>K.Roles</th>
|
||||||
|
|
|
@ -131,7 +131,7 @@ class MoodleSaml():
|
||||||
def set_moodle_saml_plugin(self):
|
def set_moodle_saml_plugin(self):
|
||||||
config={'idpmetadata': self.parse_idp_metadata(),
|
config={'idpmetadata': self.parse_idp_metadata(),
|
||||||
'certs_locked': '1',
|
'certs_locked': '1',
|
||||||
'duallogin': '0',
|
'duallogin': '1',
|
||||||
'idpattr': 'username',
|
'idpattr': 'username',
|
||||||
'autocreate': '1',
|
'autocreate': '1',
|
||||||
'saml_role_siteadmin_map': 'admin',
|
'saml_role_siteadmin_map': 'admin',
|
||||||
|
|
|
@ -63,3 +63,11 @@ class Menu():
|
||||||
return self.menudict
|
return self.menudict
|
||||||
# with open('menu.yaml', 'w') as yml:
|
# with open('menu.yaml', 'w') as yml:
|
||||||
# print(yaml.dump(header, yml, allow_unicode=True))
|
# print(yaml.dump(header, yml, allow_unicode=True))
|
||||||
|
|
||||||
|
def parse_css_color(self):
|
||||||
|
pass
|
||||||
|
#Replace colors in dd.css based on system.yml:
|
||||||
|
# colours:
|
||||||
|
# background: "#F0F0F0"
|
||||||
|
# primary: "#92AE01"
|
||||||
|
# secondary: "#FFFFFF"
|
Loading…
Reference in New Issue