Files
luos/workflow/engine/methods/users/usersEdit.php

60 lines
2.4 KiB
PHP
Raw Normal View History

<?php
2017-09-28 16:50:35 -04:00
//Check guest user
if (isset($_GET['USR_UID']) && RBAC::isGuestUserUid($_GET['USR_UID'])) {
throw new Exception(G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($_GET['USR_UID'])));
return;
}
//calculating the max upload file size;
2017-08-14 16:13:46 -04:00
use ProcessMaker\Core\System;
2017-12-04 13:25:35 +00:00
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, - 1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$postMaxSize = (int) $POST_MAX_SIZE * $mul;
2017-12-04 13:25:35 +00:00
$UPLOAD_MAX_SIZE = ini_get('upload_max_filesize');
$mul = substr($UPLOAD_MAX_SIZE, - 1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
$uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ($postMaxSize < $uploadMaxSize) {
$uploadMaxSize = $postMaxSize;
}
2016-06-02 10:23:09 -04:00
//Add year by expiration date
$expirationDate = 1;
$envFile = PATH_CONFIG . 'env.ini';
2017-12-04 13:25:35 +00:00
if (file_exists($envFile)) {
2017-08-14 16:13:46 -04:00
$sysConf = System::getSystemConfiguration($envFile);
2017-12-04 13:25:35 +00:00
if (isset($sysConf['expiration_year']) && $sysConf['expiration_year']>0) {
$expirationDate = abs($sysConf['expiration_year']);
2016-06-02 10:23:09 -04:00
}
}
2015-12-03 15:01:58 -04:00
$languageManagement = 0;
/*----------------------------------********---------------------------------*/
2017-12-04 13:25:35 +00:00
$licensedFeatures = PMLicensedFeatures::getSingleton();
2015-12-03 15:01:58 -04:00
if ($licensedFeatures->verifyfeature('w2LL3o4NFNiaDRXcFFCYVpJS3Jsall5dmh0ZWtBTkdKR3ROS0VzWGdoLzNQYz0=')) {
$languageManagement = 1;
}
/*----------------------------------********---------------------------------*/
2017-10-10 12:33:25 -04:00
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
2017-12-04 13:25:35 +00:00
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('users/users', true); //adding a javascript file .js
$oHeadPublisher->assign('USR_UID', $_GET['USR_UID']);
$oHeadPublisher->assign('MODE', $_GET['MODE']);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
$oHeadPublisher->assign('SYSTEM_TIME_ZONE', $arraySystemConfiguration['time_zone']);
2017-12-04 13:25:35 +00:00
$oHeadPublisher->assign('TIME_ZONE_DATA', array_map(function ($value) {
return [$value, $value];
}, DateTimeZone::listIdentifiers()));
$oHeadPublisher->assign('__SYSTEM_UTC_TIME_ZONE__', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__'])? 1 : 0);
$oHeadPublisher->assign('EXPIRATION_DATE', $expirationDate);
2015-12-03 15:01:58 -04:00
$oHeadPublisher->assign('LANGUAGE_MANAGEMENT', $languageManagement);
$oHeadPublisher->assign('__ACTION__', 'saveUser');
2017-12-04 13:25:35 +00:00
G::RenderPage('publish', 'extJs');