1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pluxml_ynh.git synced 2024-09-03 20:16:02 +02:00
pluxml_ynh/sources/core/admin/profil.php

107 lines
3.1 KiB
PHP
Raw Normal View History

2014-11-12 22:01:48 +01:00
<?php
/**
* Edition du profil utilisateur
*
* @package PLX
* @author Stephane F
**/
include(dirname(__FILE__).'/prepend.php');
# Control du token du formulaire
plxToken::validateFormToken($_POST);
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminProfilPrepend'));
# On édite la configuration
if(!empty($_POST)) {
if(!empty($_POST['profil']))
$plxAdmin->editProfil($_POST);
elseif(!empty($_POST['password']))
$plxAdmin->editPassword($_POST);
header('Location: profil.php');
exit;
}
# On inclut le header
include(dirname(__FILE__).'/top.php');
$_profil = $plxAdmin->aUsers[$_SESSION['user']];
?>
2015-08-17 21:12:54 +02:00
<form action="profil.php" method="post" id="form_profil">
2014-11-12 22:01:48 +01:00
2015-08-17 21:12:54 +02:00
<div class="inline-form action-bar">
<h2><?php echo L_PROFIL_EDIT_TITLE ?></h2>
<p><label><?php echo L_PROFIL_LOGIN ?>&nbsp;:&nbsp;<strong><?php echo plxUtils::strCheck($_profil['login']) ?></strong></label></p>
<input type="submit" name="profil" value="<?php echo L_PROFIL_UPDATE ?>" />
</div>
2014-11-12 22:01:48 +01:00
2015-08-17 21:12:54 +02:00
<?php eval($plxAdmin->plxPlugins->callHook('AdminProfilTop')) # Hook Plugins ?>
<fieldset>
<div class="grid">
<div class="col sml-12">
<label for="id_name"><?php echo L_PROFIL_USER ?>&nbsp;:</label>
<?php plxUtils::printInput('name', plxUtils::strCheck($_profil['name']), 'text', '20-255') ?>
</div>
</div>
<div class="grid">
<div class="col sml-12">
<label for="id_email"><?php echo L_PROFIL_MAIL ?>&nbsp;:</label>
<?php plxUtils::printInput('email', plxUtils::strCheck($_profil['email']), 'text', '30-255') ?>
</div>
</div>
<div class="grid">
<div class="col sml-12">
<label for="id_lang"><?php echo L_PROFIL_ADMIN_LANG ?>&nbsp;:</label>
<?php plxUtils::printSelect('lang', plxUtils::getLangs(), $_profil['lang']) ?>
</div>
</div>
<div class="grid">
<div class="col sml-12">
<label for="id_content"><?php echo L_PROFIL_INFOS ?>&nbsp;:</label>
<?php plxUtils::printArea('content',plxUtils::strCheck($_profil['infos']),140,5,false,'full-width'); ?>
</div>
</div>
2014-11-12 22:01:48 +01:00
</fieldset>
<?php eval($plxAdmin->plxPlugins->callHook('AdminProfil')) # Hook Plugins ?>
2015-08-17 21:12:54 +02:00
<?php echo plxToken::getTokenPostMethod() ?>
2014-11-12 22:01:48 +01:00
</form>
2015-08-17 21:12:54 +02:00
<h3><?php echo L_PROFIL_CHANGE_PASSWORD ?></h3>
2014-11-12 22:01:48 +01:00
<form action="profil.php" method="post" id="form_password">
2015-08-17 21:12:54 +02:00
<fieldset>
<div class="grid">
<div class="col sml-12">
<label for="id_password1"><?php echo L_PROFIL_PASSWORD ?>&nbsp;:</label>
<?php plxUtils::printInput('password1', '', 'password', '20-255') ?>
</div>
</div>
<div class="grid">
<div class="col sml-12">
<label for="id_password2"><?php echo L_PROFIL_CONFIRM_PASSWORD ?>&nbsp;:</label>
<?php plxUtils::printInput('password2', '', 'password', '20-255') ?>
</div>
</div>
<div class="grid">
<div class="col sml-12">
<?php echo plxToken::getTokenPostMethod() ?>
<input type="submit" name="password" value="<?php echo L_PROFIL_UPDATE_PASSWORD ?>" />
</div>
</div>
2014-11-12 22:01:48 +01:00
</fieldset>
</form>
<?php
# Hook Plugins
eval($plxAdmin->plxPlugins->callHook('AdminProfilFoot'));
# On inclut le footer
include(dirname(__FILE__).'/foot.php');
?>