public function executeShow()
 {
     $this->users = UsersPeer::retrieveByPk($this->getRequestParameter('id'));
     $c = new Criteria();
     $c->add(RolePeer::ID, $this->users->getRoleId());
     $this->roles = RolePeer::doSelect($c);
     $this->forward404Unless($this->users);
 }
 public function removeUserFromDepartment($DepUid, $UsrUid)
 {
     $aFields = array('USR_UID' => $UsrUid, 'DEP_UID' => '', 'USR_REPORTS_TO' => '');
     try {
         $oUser = UsersPeer::retrieveByPk($UsrUid);
         $user = $oUser->loadDetailed($UsrUid);
         $dptoTitle = $this->Load($DepUid);
         if (is_object($oUser) && get_class($oUser) == 'Users') {
             //$oDepto = new Users();
             $oUser->setDepUid('');
             $oUser->setUsrReportsTo('');
             $oUser->save();
             G::auditLog("RemoveUsersFromDepartament", "Remove user " . $user['USR_USERNAME'] . "( " . $UsrUid . ") from departament " . $dptoTitle['DEPO_TITLE'] . " (" . $DepUid . ") ");
         }
     } catch (exception $oError) {
         throw $oError;
     }
 }
Exemple #3
0
         $userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
         $aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
         try {
             $depFields = $oDepInfo->load($userFields['DEP_UID']);
             $aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
         } catch (Exception $e) {
         }
     } else {
         $aFields['USR_REPORTS_TO'] = ' ';
     }
 }
 try {
     $depFields = $oDepInfo->load($aFields['DEP_UID']);
     $aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
 } catch (Exception $e) {
     $oUser = UsersPeer::retrieveByPk($_GET['USR_UID']);
     $oUser->setDepUid('');
     $oUser->save();
 }
 //Load Calendar options and falue for this user
 G::LoadClass('calendar');
 $calendar = new Calendar();
 $calendarObj = $calendar->getCalendarList(true, true);
 global $_DBArray;
 $_DBArray['availableCalendars'] = $calendarObj['array'];
 $_SESSION['_DBArray'] = $_DBArray;
 $calendarInfo = $calendar->getCalendarFor($_GET['USR_UID'], $_GET['USR_UID'], $_GET['USR_UID']);
 //If the function returns a DEFAULT calendar it means that this object doesn't have assigned any calendar
 $aFields['USR_CALENDAR'] = $calendarInfo['CALENDAR_APPLIED'] != 'DEFAULT' ? $calendarInfo['CALENDAR_UID'] : "";
 $aFields['RANDOM'] = rand();
 /////////////////////////
Exemple #4
0
 public function removeUserFromDepartment($DepUid, $UsrUid)
 {
     $aFields = array('USR_UID' => $UsrUid, 'DEP_UID' => '', 'USR_REPORTS_TO' => '');
     try {
         $oUser = UsersPeer::retrieveByPk($UsrUid);
         if (is_object($oUser) && get_class($oUser) == 'Users') {
             //$oDepto = new Users();
             $oUser->setDepUid('');
             $oUser->setUsrReportsTo('');
             $oUser->save();
         }
     } catch (exception $oError) {
         throw $oError;
     }
 }
Exemple #5
0
 if (is_object($oUser) && get_class($oUser) == 'Users') {
     $userFields = $oUser->toArray(BasePeer::TYPE_FIELDNAME);
     $aFields['USR_REPORTS_TO'] = $userFields['USR_FIRSTNAME'] . ' ' . $userFields['USR_LASTNAME'];
     try {
         $depFields = $oDepInfo->load($userFields['DEP_UID'] . 'xy<');
         $aFields['USR_REPORTS_TO'] .= " (" . $depFields['DEPO_TITLE'] . ")";
     } catch (Exception $e) {
     }
 } else {
     $aFields['USR_REPORTS_TO'] = ' ';
 }
 try {
     $depFields = $oDepInfo->load($aFields['DEP_UID']);
     $aFields['USR_DEPARTMENT'] = $depFields['DEPO_TITLE'];
 } catch (Exception $e) {
     $oUser = UsersPeer::retrieveByPk($_SESSION['USER_LOGGED']);
     $oUser->setDepUid('');
     $oUser->save();
     $aFields['USR_DEPARTMENT'] = ' ';
 }
 $G_MAIN_MENU = 'processmaker';
 $G_ID_MENU_SELECTED = 'MY_ACCOUNT';
 $G_PUBLISH = new Publisher();
 //$RBAC->systemObj->loadByCode('PROCESSMAKER');//('PROCESSMAKER', $_SESSION['USER_LOGGED']);
 #verifying if it has any preferences on the configurations table
 G::loadClass('configuration');
 $oConf = new Configurations();
 $oConf->loadConfig($x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '');
 //echo $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
 //G::pr($RBAC->userObj->load($_SESSION['USER_LOGGED']));
 if (sizeof($oConf->Fields) > 0) {