2015-05-05 03:00:01 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
|
|
|
|
2015-05-15 00:07:45 +02:00
|
|
|
// ============================================================================
|
2021-01-16 13:03:16 +01:00
|
|
|
// Authorization
|
2015-05-15 00:07:45 +02:00
|
|
|
// ============================================================================
|
|
|
|
|
2015-08-03 02:49:12 +02:00
|
|
|
// ============================================================================
|
2021-01-16 13:03:16 +01:00
|
|
|
// Functions
|
2015-05-15 00:07:45 +02:00
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
2021-01-16 13:03:16 +01:00
|
|
|
// Main
|
2015-05-15 00:07:45 +02:00
|
|
|
// ============================================================================
|
|
|
|
|
2018-07-25 23:42:00 +02:00
|
|
|
$username = $layout['parameters'];
|
|
|
|
|
2017-06-28 00:31:40 +02:00
|
|
|
// Prevent non-administrators to change other users
|
2018-07-14 15:17:06 +02:00
|
|
|
if ($login->role()!=='admin') {
|
2018-07-25 23:42:00 +02:00
|
|
|
$username = $login->username();
|
2015-05-05 03:00:01 +02:00
|
|
|
}
|
|
|
|
|
2018-07-25 23:42:00 +02:00
|
|
|
try {
|
|
|
|
$user = new User($username);
|
|
|
|
} catch (Exception $e) {
|
2017-06-05 22:36:09 +02:00
|
|
|
Redirect::page('users');
|
2015-05-15 00:07:45 +02:00
|
|
|
}
|
2017-09-09 00:33:14 +02:00
|
|
|
|
2021-01-16 13:03:16 +01:00
|
|
|
// HTML <title>
|
|
|
|
$layout['title'] = $L->g('Edit user') . ' - ' . $layout['title'];
|