2015-10-19 00:45:58 +02:00
|
|
|
<?php
|
|
|
|
|
2015-11-07 01:23:50 +01:00
|
|
|
HTML::title(array('title'=>$L->g('Edit user'), 'icon'=>'user'));
|
2015-10-19 00:45:58 +02:00
|
|
|
|
2015-11-15 22:37:34 +01:00
|
|
|
echo '<div class="uk-grid">';
|
2015-11-16 05:20:58 +01:00
|
|
|
echo '<div class="uk-width-7-10">';
|
2015-11-15 22:37:34 +01:00
|
|
|
|
2015-11-07 01:23:50 +01:00
|
|
|
HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal'));
|
2015-10-19 00:45:58 +02:00
|
|
|
|
|
|
|
// Security token
|
|
|
|
HTML::formInputHidden(array(
|
2015-10-20 05:14:28 +02:00
|
|
|
'name'=>'tokenCSRF',
|
2015-11-28 15:47:03 +01:00
|
|
|
'value'=>$Security->getTokenCSRF()
|
2015-10-19 00:45:58 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
// Security token
|
|
|
|
HTML::formInputHidden(array(
|
|
|
|
'name'=>'username',
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->username()
|
2015-10-19 00:45:58 +02:00
|
|
|
));
|
|
|
|
|
2015-11-30 01:45:30 +01:00
|
|
|
HTML::legend(array('value'=>$L->g('Profile'), 'class'=>'first-child'));
|
2015-10-19 00:45:58 +02:00
|
|
|
|
2015-11-07 01:23:50 +01:00
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'usernameDisable',
|
|
|
|
'label'=>$L->g('Username'),
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->username(),
|
2015-11-07 01:23:50 +01:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'disabled'=>true,
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'firstName',
|
|
|
|
'label'=>$L->g('First name'),
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->firstName(),
|
2015-10-19 00:45:58 +02:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'lastName',
|
|
|
|
'label'=>$L->g('Last name'),
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->lastName(),
|
2015-10-19 00:45:58 +02:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2015-11-07 01:23:50 +01:00
|
|
|
echo '<div class="uk-form-row">
|
2016-02-13 10:58:34 +01:00
|
|
|
<label class="uk-form-label">'.$L->g('password').'</label>
|
2015-11-07 01:23:50 +01:00
|
|
|
<div class="uk-form-controls">
|
2017-06-28 00:31:40 +02:00
|
|
|
<a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$User->username().'">'.$L->g('Change password').'</a>
|
2015-11-07 01:23:50 +01:00
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
|
2015-10-25 21:27:24 +01:00
|
|
|
if($Login->role()==='admin') {
|
2015-10-19 00:45:58 +02:00
|
|
|
|
|
|
|
HTML::formSelect(array(
|
|
|
|
'name'=>'role',
|
|
|
|
'label'=>$L->g('Role'),
|
|
|
|
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
|
2017-06-28 00:31:40 +02:00
|
|
|
'selected'=>$User->role(),
|
2015-10-19 00:45:58 +02:00
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
2016-09-07 02:14:57 +02:00
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'email',
|
|
|
|
'label'=>$L->g('Email'),
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->email(),
|
2015-10-19 00:45:58 +02:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
2017-09-08 00:43:53 +02:00
|
|
|
'tip'=>$L->g('Recommended for recovery password and notifications')
|
2015-10-19 00:45:58 +02:00
|
|
|
));
|
|
|
|
|
2016-02-14 01:15:19 +01:00
|
|
|
HTML::legend(array('value'=>$L->g('Social networks links')));
|
2015-12-28 23:28:42 +01:00
|
|
|
|
|
|
|
HTML::formInputText(array(
|
2016-02-14 01:15:19 +01:00
|
|
|
'name'=>'twitter',
|
|
|
|
'label'=>'Twitter',
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->twitter(),
|
2016-01-01 00:31:51 +01:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
HTML::formInputText(array(
|
2016-02-14 01:15:19 +01:00
|
|
|
'name'=>'facebook',
|
|
|
|
'label'=>'Facebook',
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->facebook(),
|
2016-01-01 00:31:51 +01:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2017-09-29 23:02:05 +02:00
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'codepen',
|
|
|
|
'label'=>'Codepen',
|
|
|
|
'value'=>$User->codepen(),
|
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2016-01-01 00:31:51 +01:00
|
|
|
HTML::formInputText(array(
|
2016-02-14 01:15:19 +01:00
|
|
|
'name'=>'googlePlus',
|
|
|
|
'label'=>'Google+',
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->googlePlus(),
|
2016-01-01 00:31:51 +01:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
HTML::formInputText(array(
|
2016-02-14 01:15:19 +01:00
|
|
|
'name'=>'instagram',
|
|
|
|
'label'=>'Instagram',
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->instagram(),
|
2015-12-28 23:28:42 +01:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
echo '<div class="uk-form-row">
|
|
|
|
<div class="uk-form-controls">
|
|
|
|
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
|
|
|
<a href="'.HTML_PATH_ADMIN_ROOT.'users" class="uk-button">'.$L->g('Cancel').'</a>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
|
2017-07-02 22:46:05 +02:00
|
|
|
HTML::legend(array('value'=>$L->g('Authentication Token')));
|
|
|
|
|
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'tokenAuth',
|
|
|
|
'label'=>$L->g('Token'),
|
|
|
|
'value'=>$User->tokenAuth(),
|
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
2017-10-09 20:08:18 +02:00
|
|
|
'tip'=>$L->g('this-token-is-similar-to-a-password-it-should-not-be-shared')
|
2017-07-02 22:46:05 +02:00
|
|
|
));
|
|
|
|
|
2016-09-07 02:14:57 +02:00
|
|
|
HTML::legend(array('value'=>$L->g('Status')));
|
|
|
|
|
|
|
|
HTML::formInputText(array(
|
|
|
|
'name'=>'status',
|
2017-09-08 00:43:53 +02:00
|
|
|
'label'=>$L->g('Current status'),
|
2017-06-28 00:31:40 +02:00
|
|
|
'value'=>$User->enabled()?$L->g('Enabled'):$L->g('Disabled'),
|
2016-09-07 02:14:57 +02:00
|
|
|
'class'=>'uk-width-1-2 uk-form-medium',
|
|
|
|
'disabled'=>true,
|
2017-09-23 15:15:29 +02:00
|
|
|
'tip'=>$User->enabled()?'':$L->g('To enable the user you must set a new password')
|
2016-09-07 02:14:57 +02:00
|
|
|
));
|
|
|
|
|
2017-06-28 00:31:40 +02:00
|
|
|
if( $User->enabled() ) {
|
2016-09-07 02:14:57 +02:00
|
|
|
echo '<div class="uk-form-row">
|
|
|
|
<div class="uk-form-controls">
|
2016-09-19 09:43:06 +02:00
|
|
|
<button type="submit" id="jsdisable-user" class="delete-button" name="disable-user"><i class="uk-icon-ban"></i> '.$L->g('Disable the user').'</button>
|
2016-09-07 02:14:57 +02:00
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
2017-06-28 00:31:40 +02:00
|
|
|
if( ($Login->role()==='admin') && ($User->username()!='admin') ) {
|
2015-10-19 00:45:58 +02:00
|
|
|
|
|
|
|
HTML::legend(array('value'=>$L->g('Delete')));
|
|
|
|
|
|
|
|
echo '<div class="uk-form-row">
|
|
|
|
<div class="uk-form-controls">
|
2017-09-23 15:15:29 +02:00
|
|
|
<button type="submit" id="jsdelete-user-associate" class="delete-button" name="delete-user-associate"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and associate his pages to admin user').'</button>
|
|
|
|
<button type="submit" id="jsdelete-user-all" class="delete-button" name="delete-user-all"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and all his pages').'</button>
|
2015-10-19 00:45:58 +02:00
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
HTML::formClose();
|
|
|
|
|
2015-11-15 22:37:34 +01:00
|
|
|
echo '</div>';
|
2015-12-02 02:32:55 +01:00
|
|
|
|
2016-01-02 23:51:12 +01:00
|
|
|
echo '<div class="uk-width-3-10" style="margin-top: 50px; text-align: center;">';
|
2015-12-02 02:32:55 +01:00
|
|
|
|
2017-06-28 00:31:40 +02:00
|
|
|
HTML::profileUploader($User->username());
|
2015-12-02 02:32:55 +01:00
|
|
|
|
2015-11-15 22:37:34 +01:00
|
|
|
echo '</div>';
|
|
|
|
echo '</div>';
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
$("#jsdelete-user-associate").click(function() {
|
2017-08-12 20:54:35 +02:00
|
|
|
if(confirm("<?php $Language->p('Confirm delete this action cannot be undone') ?>")==false) {
|
2015-10-19 00:45:58 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#jsdelete-user-all").click(function() {
|
2017-08-12 20:54:35 +02:00
|
|
|
if(confirm("<?php $Language->p('Confirm delete this action cannot be undone') ?>")==false) {
|
2015-10-19 00:45:58 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-09-07 02:14:57 +02:00
|
|
|
$("#jsdisable-user").click(function() {
|
2017-08-12 20:54:35 +02:00
|
|
|
if(confirm("<?php $Language->p('Do you want to disable the user') ?>")==false) {
|
2016-09-07 02:14:57 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
});
|
|
|
|
|
2015-12-01 03:57:46 +01:00
|
|
|
</script>
|