Se agregan validaciones en PROJECT USER. Se agrega el metodo PUT para PM USER
This commit is contained in:
@@ -177,6 +177,7 @@ class ProjectUser
|
||||
\G::LoadClass( 'case' );
|
||||
$oCase = new \Cases();
|
||||
$startTasks = $oCase->getStartCases($sUserUID);
|
||||
if (sizeof($startTasks) > 1){
|
||||
foreach ($startTasks as $task) {
|
||||
if ((isset( $task['pro_uid'] )) && ($task['pro_uid'] == $sProcessUID)) {
|
||||
$taskValue = explode( '(', $task['value'] );
|
||||
@@ -186,6 +187,9 @@ class ProjectUser
|
||||
'act_name' => $taskValue[0]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw (new \Exception( 'This user `usr_uid`: '. $sUserUID .' has no initial activities assigned in this project.'));
|
||||
}
|
||||
return $aUsers;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace BusinessModel;
|
||||
use \G;
|
||||
|
||||
class User
|
||||
{
|
||||
/**
|
||||
@@ -57,6 +58,55 @@ class User
|
||||
$this->usersRolesObj->create( $sUserUID, $aRol['ROL_UID'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* to test Password
|
||||
*
|
||||
* @access public
|
||||
* @param string $sPassword
|
||||
* @return array
|
||||
*/
|
||||
public function testPassword ($sPassword = '')
|
||||
{
|
||||
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "UsersProperties.php");
|
||||
$oUserProperty = new \UsersProperties();
|
||||
$aFields = array();
|
||||
$dateNow = date('Y-m-d H:i:s');
|
||||
$aErrors = $oUserProperty->validatePassword($sPassword, $dateNow, $dateNow);
|
||||
if (!empty($aErrors)) {
|
||||
if (!defined('NO_DISPLAY_USERNAME')) {
|
||||
define('NO_DISPLAY_USERNAME', 1);
|
||||
}
|
||||
$aFields = array();
|
||||
$aFields['DESCRIPTION'] = \G::LoadTranslation('ID_POLICY_ALERT');
|
||||
foreach ($aErrors as $sError) {
|
||||
switch ($sError) {
|
||||
case 'ID_PPP_MINIMUM_LENGTH':
|
||||
$aFields['DESCRIPTION'] .= ' - ' . \G::LoadTranslation($sError) . ': ' . PPP_MINIMUM_LENGTH .'. ';
|
||||
$aFields[substr($sError, 3)] = PPP_MINIMUM_LENGTH;
|
||||
break;
|
||||
case 'ID_PPP_MAXIMUM_LENGTH':
|
||||
$aFields['DESCRIPTION'] .= ' - ' . \G::LoadTranslation($sError) . ': ' . PPP_MAXIMUM_LENGTH .'. ';
|
||||
$aFields[substr($sError, 3)] = PPP_MAXIMUM_LENGTH;
|
||||
break;
|
||||
case 'ID_PPP_EXPIRATION_IN':
|
||||
$aFields['DESCRIPTION'] .= ' - ' . \G::LoadTranslation($sError) . ' ' . PPP_EXPIRATION_IN . ' ' . \G::LoadTranslation('ID_DAYS') .'. ';
|
||||
$aFields[substr($sError, 3)] = PPP_EXPIRATION_IN;
|
||||
break;
|
||||
default:
|
||||
$aFields['DESCRIPTION'] .= ' - ' . \G::LoadTranslation($sError);
|
||||
$aFields[substr($sError, 3)] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$aFields['DESCRIPTION'] .= \G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY');
|
||||
$aFields['STATUS'] = false;
|
||||
} else {
|
||||
$aFields['DESCRIPTION'] = \G::LoadTranslation('ID_PASSWORD_COMPLIES_POLICIES');
|
||||
$aFields['STATUS'] = true;
|
||||
}
|
||||
return $aFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* change status of an user
|
||||
*
|
||||
@@ -67,17 +117,29 @@ class User
|
||||
public function changeUserStatus ($sUserUID = '', $sStatus = 'ACTIVE')
|
||||
{
|
||||
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "RbacUsers.php");
|
||||
//require_once ("classes/model/RbacUsers.php");
|
||||
$this->userObj = new \RbacUsers();
|
||||
if ($sStatus === 'ACTIVE') {
|
||||
$sStatus = 1;
|
||||
}
|
||||
|
||||
$aFields = $this->userObj->load( $sUserUID );
|
||||
$aFields['USR_STATUS'] = $sStatus;
|
||||
$this->userObj->update( $aFields );
|
||||
}
|
||||
|
||||
/**
|
||||
* remove a role from an user
|
||||
*
|
||||
* @access public
|
||||
* @param array $sUserUID
|
||||
* @return void
|
||||
*/
|
||||
public function removeRolesFromUser ($sUserUID = '')
|
||||
{
|
||||
$oCriteria = new \Criteria( 'rbac' );
|
||||
$oCriteria->add( \UsersRolesPeer::USR_UID, $sUserUID );
|
||||
\UsersRolesPeer::doDelete( $oCriteria );
|
||||
}
|
||||
|
||||
/**
|
||||
* updated an user
|
||||
*
|
||||
@@ -89,9 +151,7 @@ class User
|
||||
public function updateUser ($aData = array(), $sRolCode = '')
|
||||
{
|
||||
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "RbacUsers.php");
|
||||
//require_once ("classes/model/RbacUsers.php");
|
||||
$this->userObj = new \RbacUsers();
|
||||
|
||||
if (isset( $aData['USR_STATUS'] )) {
|
||||
if ($aData['USR_STATUS'] == 'ACTIVE') {
|
||||
$aData['USR_STATUS'] = 1;
|
||||
@@ -99,12 +159,43 @@ class User
|
||||
}
|
||||
$this->userObj->update( $aData );
|
||||
if ($sRolCode != '') {
|
||||
echo 'entra rol';
|
||||
$this->removeRolesFromUser( $aData['USR_UID'] );
|
||||
$this->assignRoleToUser( $aData['USR_UID'], $sRolCode );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the roles and permission for one RBAC_user
|
||||
*
|
||||
* gets the Role and their permissions for one User
|
||||
*
|
||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||
* @access public
|
||||
*
|
||||
* @param string $sSystem the system
|
||||
* @param string $sUser the user
|
||||
* @return $this->aUserInfo[ $sSystem ]
|
||||
*/
|
||||
public function loadUserRolePermission ($sSystem, $sUser)
|
||||
{
|
||||
//in previous versions we provided a path data and session we will cache the session Info for this user
|
||||
//now this is deprecated, and all the aUserInfo is in the memcache
|
||||
$this->sSystem = $sSystem;
|
||||
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "UsersRoles.php");
|
||||
$this->usersRolesObj = new \UsersRoles();
|
||||
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Systems.php");
|
||||
$this->systemObj = new \Systems();
|
||||
$fieldsSystem = $this->systemObj->loadByCode( $sSystem );
|
||||
$fieldsRoles = $this->usersRolesObj->getRolesBySystem( $fieldsSystem['SYS_UID'], $sUser );
|
||||
$fieldsPermissions = $this->usersRolesObj->getAllPermissions( $fieldsRoles['ROL_UID'], $sUser );
|
||||
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "RbacUsers.php");
|
||||
$this->userObj = new \RbacUsers();
|
||||
$this->aUserInfo['USER_INFO'] = $this->userObj->load( $sUser );
|
||||
$this->aUserInfo[$sSystem]['SYS_UID'] = $fieldsSystem['SYS_UID'];
|
||||
$this->aUserInfo[$sSystem]['ROLE'] = $fieldsRoles;
|
||||
$this->aUserInfo[$sSystem]['PERMISSIONS'] = $fieldsPermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create User
|
||||
*
|
||||
@@ -116,6 +207,7 @@ class User
|
||||
{
|
||||
try {
|
||||
global $RBAC;
|
||||
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
|
||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||
$form = $arrayData;
|
||||
if (isset($arrayData['USR_UID'])) {
|
||||
@@ -123,12 +215,15 @@ class User
|
||||
} else {
|
||||
$form['USR_UID'] = '';
|
||||
}
|
||||
if (!isset($form['USR_NEW_PASS'])) {
|
||||
$form['USR_NEW_PASS'] = '';
|
||||
$sConfirm = $this->testPassword($form['USR_NEW_PASS']);
|
||||
if ($sConfirm['STATUS'] != 1) {
|
||||
throw new \Exception('`usr_new_pass`. '.$sConfirm['DESCRIPTION']);
|
||||
}
|
||||
if ($form['USR_NEW_PASS'] != '') {
|
||||
if ($form['USR_NEW_PASS'] != $form['USR_CNF_PASS']) {
|
||||
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
|
||||
}
|
||||
|
||||
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
|
||||
}
|
||||
if (!isset($form['USR_CITY'])) {
|
||||
$form['USR_CITY'] = '';
|
||||
}
|
||||
@@ -138,15 +233,14 @@ class User
|
||||
if (!isset($form['USR_AUTH_USER_DN'])) {
|
||||
$form['USR_AUTH_USER_DN'] = '';
|
||||
}
|
||||
if ($form['USR_UID'] == '') {
|
||||
$criteria = new \Criteria();
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
$criteria->add(\UsersPeer::USR_USERNAME, utf8_encode($arrayData['USR_USERNAME']));
|
||||
if (\UsersPeer::doCount($criteria) > 0) {
|
||||
throw new \Exception(\G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $arrayData['USR_USERNAME'])));
|
||||
throw new \Exception('`usr_username`. '.\G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $arrayData['USR_USERNAME'])));
|
||||
}
|
||||
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
|
||||
$aData['USR_PASSWORD'] = md5($form['USR_PASSWORD']);
|
||||
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
|
||||
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
|
||||
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
|
||||
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
|
||||
@@ -173,8 +267,6 @@ class User
|
||||
}
|
||||
$aData['USR_STATUS'] = $statusWF;
|
||||
$aData['USR_UID'] = $sUserUID;
|
||||
$aData['USR_PASSWORD'] = md5($sUserUID);
|
||||
$aData['USR_PASSWORD'] = $sUserUID;
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
$aData['USR_LOCATION'] = $form['USR_LOCATION'];
|
||||
@@ -184,17 +276,24 @@ class User
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
|
||||
$oUser = new \Users();
|
||||
$oUser -> create( $aData );
|
||||
//Save Calendar assigment
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
//print (PATH_IMAGES_ENVIRONMENT_USERS);
|
||||
if ($_FILES['USR_PHOTO']['tmp_name'] != '') {
|
||||
\G::uploadFile($_FILES['USR_PHOTO']['tmp_name'], PATH_IMAGES_ENVIRONMENT_USERS, $sUserUID . '.gif');
|
||||
}
|
||||
} else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
throw new \Exception($oError->$result);
|
||||
}
|
||||
if ((isset($form['USR_CALENDAR']))) {
|
||||
//Save Calendar ID for this user
|
||||
\G::LoadClass("calendar");
|
||||
$calendarObj = new \Calendar();
|
||||
$calendarObj->assignCalendarTo($sUserUID, $form['USR_CALENDAR'], 'USER');
|
||||
}
|
||||
}
|
||||
$oCriteria = $this->getUser($sUserUID);
|
||||
return $oCriteria;
|
||||
} catch (\Exception $e) {
|
||||
@@ -203,31 +302,67 @@ class User
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Group
|
||||
* Update User
|
||||
*
|
||||
* @param string $groupUid Unique id of Group
|
||||
* @param string $usrUid Unique id of User
|
||||
* @param array $arrayData Data
|
||||
* @param string $usrLoggedUid Unique id of User logged
|
||||
*
|
||||
* return array Return data of the Group updated
|
||||
* return array Return data of the User updated
|
||||
*/
|
||||
public function update($groupUid, $arrayData)
|
||||
public function update($usrUid, $arrayData, $usrLoggedUid)
|
||||
{
|
||||
try {
|
||||
global $RBAC;
|
||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||
$form = $arrayData;
|
||||
/*if ($form['USR_NEW_PASS'] != '') {
|
||||
$sConfirm = $this->testPassword($form['USR_NEW_PASS']);
|
||||
if ($sConfirm['STATUS'] != 1) {
|
||||
throw new \Exception('`usr_new_pass`. '.$sConfirm['DESCRIPTION']);
|
||||
}
|
||||
if ($form['USR_NEW_PASS'] != $form['USR_CNF_PASS']) {
|
||||
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
|
||||
}
|
||||
if ($form['USR_NEW_PASS'] != $form['USR_CNF_PASS']) {
|
||||
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
|
||||
}
|
||||
}*/
|
||||
if (isset($usrUid)) {
|
||||
$form['USR_UID'] = $usrUid;
|
||||
} else {
|
||||
$form['USR_UID'] = '';
|
||||
}
|
||||
if (!isset($form['USR_NEW_PASS'])) {
|
||||
$form['USR_NEW_PASS'] = '';
|
||||
}
|
||||
if ($form['USR_NEW_PASS'] != '') {
|
||||
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
|
||||
}
|
||||
if (!isset($form['USR_CITY'])) {
|
||||
$form['USR_CITY'] = '';
|
||||
}
|
||||
if (!isset($form['USR_LOCATION'])) {
|
||||
$form['USR_LOCATION'] = '';
|
||||
}
|
||||
if (!isset($form['USR_AUTH_USER_DN'])) {
|
||||
$form['USR_AUTH_USER_DN'] = '';
|
||||
}
|
||||
$aData['USR_UID'] = $form['USR_UID'];
|
||||
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
|
||||
if (isset($form['USR_PASSWORD'])) {
|
||||
if ($form['USR_PASSWORD'] != '') {
|
||||
if ($form['USR_NEW_PASS'] != $form['USR_CNF_PASS']) {
|
||||
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
|
||||
}
|
||||
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
|
||||
require_once 'classes/model/UsersProperties.php';
|
||||
$oUserProperty = new \UsersProperties();
|
||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD'])))));
|
||||
|
||||
$memKey = 'rbacSession' . session_id();
|
||||
$memcache = & PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '' );
|
||||
$memcache = & \PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '' );
|
||||
if (($RBAC->aUserInfo = $memcache->get($memKey)) === false) {
|
||||
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
|
||||
$this->loadUserRolePermission($RBAC->sSystem, $usrLoggedUid);
|
||||
$memcache->set($memKey, $RBAC->aUserInfo, \PMmemcached::EIGHT_HOURS);
|
||||
}
|
||||
if ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] == 'PROCESSMAKER_ADMIN') {
|
||||
@@ -235,9 +370,7 @@ class User
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$oUserProperty->update($aUserProperty);
|
||||
}
|
||||
|
||||
$aErrors = $oUserProperty->validatePassword($form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0);
|
||||
|
||||
if (count($aErrors) > 0) {
|
||||
$sDescription = \G::LoadTranslation('ID_POLICY_ALERT') . ':,';
|
||||
foreach ($aErrors as $sError) {
|
||||
@@ -257,10 +390,7 @@ class User
|
||||
}
|
||||
}
|
||||
$sDescription .= '' . \G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY');
|
||||
$result->success = false;
|
||||
$result->msg = $sDescription;
|
||||
print (\G::json_encode($result));
|
||||
die();
|
||||
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.$sDescription);
|
||||
}
|
||||
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
||||
if (!is_array($aHistory)) {
|
||||
@@ -283,10 +413,7 @@ class User
|
||||
$sDescription = \G::LoadTranslation('ID_POLICY_ALERT') . ':<br /><br />';
|
||||
$sDescription .= ' - ' . \G::LoadTranslation('PASSWORD_HISTORY') . ': ' . PPP_PASSWORD_HISTORY . '<br />';
|
||||
$sDescription .= '<br />' . \G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY') . '';
|
||||
$result->success = false;
|
||||
$result->msg = $sDescription;
|
||||
print (G::json_encode($result));
|
||||
die();
|
||||
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.$sDescription);
|
||||
}
|
||||
|
||||
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
||||
@@ -309,9 +436,9 @@ class User
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'];
|
||||
}
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
$RBAC->updateUser($aData, $form['USR_ROLE']);
|
||||
$this->updateUser($aData, $form['USR_ROLE']);
|
||||
} else {
|
||||
$RBAC->updateUser($aData);
|
||||
$this->updateUser($aData);
|
||||
}
|
||||
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
|
||||
$aData['USR_CITY'] = $form['USR_CITY'];
|
||||
@@ -320,11 +447,6 @@ class User
|
||||
$aData['USR_PHONE'] = $form['USR_PHONE'];
|
||||
$aData['USR_ZIP_CODE'] = $form['USR_ZIP_CODE'];
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
/*
|
||||
if ($form['USR_RESUME'] != '') {
|
||||
$aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
}
|
||||
*/
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
}
|
||||
@@ -334,7 +456,7 @@ class User
|
||||
if (isset($form['USR_AUTH_USER_DN'])) {
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
}
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
|
||||
$oUser = new \Users();
|
||||
$oUser->update($aData);
|
||||
if ($_FILES['USR_PHOTO']['error'] != 1) {
|
||||
@@ -346,37 +468,19 @@ class User
|
||||
} else {
|
||||
$result->success = false;
|
||||
$result->fileError = true;
|
||||
print (G::json_encode($result));
|
||||
die();
|
||||
throw new \Exception($result);
|
||||
}
|
||||
/* Saving preferences */
|
||||
$def_lang = $form['PREF_DEFAULT_LANG'];
|
||||
$def_menu = $form['PREF_DEFAULT_MENUSELECTED'];
|
||||
$def_cases_menu = isset($form['PREF_DEFAULT_CASES_MENUSELECTED']) ? $form['PREF_DEFAULT_CASES_MENUSELECTED'] : '';
|
||||
|
||||
\G::loadClass('configuration');
|
||||
|
||||
$oConf = new \Configurations();
|
||||
$aConf = Array('DEFAULT_LANG' => $def_lang, 'DEFAULT_MENU' => $def_menu, 'DEFAULT_CASES_MENU' => $def_cases_menu);
|
||||
|
||||
/* UPDATING SESSION VARIABLES */
|
||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||
//$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
|
||||
|
||||
$oConf->aConfig = $aConf;
|
||||
$oConf->saveConfig('USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED']);
|
||||
|
||||
|
||||
//Save Calendar assigment
|
||||
if ((isset($form['USR_CALENDAR']))) {
|
||||
//Save Calendar ID for this user
|
||||
\G::LoadClass("calendar");
|
||||
$calendarObj = new \Calendar();
|
||||
$calendarObj->assignCalendarTo($aData['USR_UID'], $form['USR_CALENDAR'], 'USER');
|
||||
}
|
||||
$result->success = true;
|
||||
print (\G::json_encode($result));
|
||||
|
||||
$oConf->saveConfig('USER_PREFERENCES', '', '', $usrLoggedUid);
|
||||
$oCriteria = $this->getUser($usrUid);
|
||||
return $oCriteria;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -67,8 +67,11 @@ class User extends Api
|
||||
*/
|
||||
public function doPut($usr_uid, $request_data) {
|
||||
try {
|
||||
$userLoggedUid = $this->getUserId();
|
||||
$user = new \BusinessModel\User();
|
||||
$arrayData = $user->update($usr_uid, $request_data);
|
||||
$arrayData = $user->update($usr_uid, $request_data, $userLoggedUid);
|
||||
$response = $arrayData;
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user