BUG 6680 Change behavior of "On Vacation" status, so that when users return and login, status automatically changes to "active" SOLVED

- The user status never changes when a user on vacation return and login
- Now when a user on vacation return and login its status change to active
This commit is contained in:
Julio Cesar Laura
2012-09-13 14:54:38 -04:00
parent 4586d5153a
commit bc00312e8e
3 changed files with 6 additions and 5 deletions

View File

@@ -228,13 +228,11 @@ public function userExists($UsrUid)
}
function loadByUsernameInArray($sUsername){
echo $sUsername;
$c = $this->loadByUsername($sUsername);
$rs = UsersPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
print_r($row);
return $row;
}

View File

@@ -60,12 +60,15 @@ try {
//The user is inactive
case -3:
require_once 'classes/model/Users.php';
$user = new Users;
$user = new Users();
$aUser = $user->loadByUsernameInArray($usr);
switch ($aUser['USR_STATUS']) {
case 'VACATION':
$errLabel = 'ID_USER_ONVACATION';
$uid = $aUser['USR_UID'];
$RBAC->changeUserStatus($uid, 1);
$aUser['USR_STATUS'] = 'ACTIVE';
$user->update($aUser);
break;
case 'INACTIVE':
$errLabel = 'ID_USER_INACTIVE';

View File

@@ -214,7 +214,7 @@ try {
case 'changeUserStatus':
$response = new stdclass();
if (isset($_REQUEST['USR_UID']) && isset($_REQUEST['NEW_USR_STATUS'])) {
$RBAC->changeUserStatus($_REQUEST['USR_UID'], $_REQUEST['NEW_USR_STATUS']);
$RBAC->changeUserStatus($_REQUEST['USR_UID'], ($_REQUEST['NEW_USR_STATUS'] == 'ACTIVE' ? 1 : 0));
require_once 'classes/model/Users.php';
$userInstance = new Users();
$userData = $userInstance->load($_REQUEST['USR_UID']);