Remove profile field editor from manage and add return links.

This commit is contained in:
flash 2018-09-25 23:21:11 +02:00
parent 0998e5d69c
commit 238d454464
6 changed files with 23 additions and 20 deletions

View file

@ -194,10 +194,6 @@ switch ($_GET['v'] ?? null) {
$updatePassword->execute();
}
if (!empty($_POST['profile']) && is_array($_POST['profile'])) {
user_profile_fields_set($userId, $_POST['profile']);
}
if (isset($_POST['add_role'])) {
user_role_add($manageUser['user_id'], $_POST['add_role']['role']);
}

View file

@ -1,9 +1,11 @@
{% set in_manage = manage_menu is defined %}
<nav class="header">
<div class="header__wrapper">
<div class="header__icons">
<label class="header__icon header__icon--menu" for="toggle-mobile-header-menu"></label>
<a class="header__logo{% if manage_menu is defined %} header__logo--manage{% endif %}" href="/">
<a class="header__logo{% if in_manage %} header__logo--manage{% endif %}" href="/">
{{ globals.site_name }}
</a>
@ -70,8 +72,12 @@
</li>
{% if has_manage_access %}
<li class="header__user__action">
<a class="header__user__link" href="{{ manage_link|default('/manage/index.php') }}">Manage</a>
</li>
{% if in_manage %}
<a class="header__user__link" href="{{ site_link|default('/') }}">Return</a>
{% else %}
<a class="header__user__link" href="{{ manage_link|default('/manage/index.php') }}">Manage</a>
{% endif %}
</li>
{% endif %}
<li class="header__user__action">
<a class="header__user__link" href="/auth.php?m=logout&amp;s={{ csrf_token() }}">Log out</a>

View file

@ -1,5 +1,9 @@
{% extends 'manage/changelog/master.twig' %}
{% if edit_change is defined %}
{% set site_link = '/changelog.php?c=' ~ edit_change.change_id %}
{% endif %}
{% block manage_content %}
<div class="container">
<form action="?v=change{{ edit_change is defined ? '&c=' ~ edit_change.change_id : '' }}" method="post">

View file

@ -1 +1,5 @@
{% extends 'manage/master.twig' %}
{% if site_link is not defined %}
{% set site_link = '/changelog.php' %}
{% endif %}

View file

@ -1 +1,5 @@
{% extends 'manage/master.twig' %}
{% if site_link is not defined %}
{% set site_link = '/members.php' %}
{% endif %}

View file

@ -1,6 +1,8 @@
{% extends 'manage/users/master.twig' %}
{% from 'manage/macros.twig' import permissions_table %}
{% set site_link = '/profile.php?u=' ~ view_user.user_id %}
{% block manage_content %}
{% if can_manage_users %}
<form method="post" enctype="multipart/form-data" action="">
@ -102,19 +104,6 @@
</label>
</div>
<div class="container">
<div class="container__title">Profile fields</div>
{% for name, props in profile_fields %}
<label class="form__label">
<div class="form__label__text">{{ props.name }}</div>
<div class="form__label__input">
<input class="input__text" type="{{ props.type|default('text') }}" value="{{ view_user['user_' ~ name] }}" name="profile[{{ name }}]">
</div>
</label>
{% endfor %}
</div>
<div class="container">
<div class="container__title">Colour</div>