41 lines
906 B
Plaintext
41 lines
906 B
Plaintext
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* -------------------------------------------------------------------------
|
||
|
|
* UrBackup plugin for GLPI
|
||
|
|
* -------------------------------------------------------------------------
|
||
|
|
*/
|
||
|
|
|
||
|
|
use GlpiPlugin\Urbackup\Profile;
|
||
|
|
|
||
|
|
include('../../../inc/includes.php');
|
||
|
|
|
||
|
|
Session::checkLoginUser();
|
||
|
|
Session::checkRight('profile', UPDATE);
|
||
|
|
Session::checkCSRF($_POST);
|
||
|
|
|
||
|
|
$profiles_id = (int) ($_POST['profiles_id'] ?? 0);
|
||
|
|
|
||
|
|
if ($profiles_id <= 0) {
|
||
|
|
Session::addMessageAfterRedirect(
|
||
|
|
__('Invalid profile.', 'urbackup'),
|
||
|
|
true,
|
||
|
|
ERROR
|
||
|
|
);
|
||
|
|
|
||
|
|
Html::back();
|
||
|
|
}
|
||
|
|
|
||
|
|
if (isset($_POST['update_urbackup_rights'])) {
|
||
|
|
Profile::saveRights($_POST);
|
||
|
|
|
||
|
|
Session::addMessageAfterRedirect(
|
||
|
|
__('UrBackup rights saved successfully.', 'urbackup'),
|
||
|
|
true,
|
||
|
|
INFO
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
global $CFG_GLPI;
|
||
|
|
|
||
|
|
Html::redirect($CFG_GLPI['root_doc'] . '/front/profile.form.php?id=' . $profiles_id);
|