public function getPlanList() { if (SessionHelper::getRoleID() != Constants::$RoleAdmin) { return Redirect::to('unauthorize'); } return View::make('admin.planlist'); }
public function getAddFundamental($encryptedFundamentalID = 0) { $isEditMode = false; if ($encryptedFundamentalID) { $isEditMode = true; } if (SessionHelper::getRoleID() != Constants::$RoleAdmin) { return Redirect::to('unauthorize'); } if ($isEditMode) { $decryptFundamentalID = Common::getEncryptDecryptValue('decrypt', $encryptedFundamentalID); $fundamentalID = Common::getExplodeValue($decryptFundamentalID, Constants::$QueryStringFundamentalID); } else { $fundamentalID = 0; } $serviceResponse = $this->DataProvider->getFundamentalDetails($fundamentalID); return View::make('admin.addfundamental', (array) $serviceResponse->Data); }
public function postAuthenticate() { $serviceRequest = $this->GetObjectFromJsonRequest(Input::json()->all()); /*$serviceResponse = $this->securityDataProvider->postAuthenticate($serviceRequest->Data);*/ $serviceResponse = $this->securityDataProvider->AuthenticateUser($serviceRequest->Data); if (!empty($serviceResponse->Data)) { SessionHelper::setRoleID($serviceResponse->Data->userdeatil->RoleID); SessionHelper::setRoleName($serviceResponse->Data->userdeatil->RoleName); SessionHelper::setUserName($serviceResponse->Data->userdeatil->FirstName); } if ($serviceResponse->IsSuccess) { $userLoginChecked = Auth::User(); if (!empty($userLoginChecked)) { $sessionCheckURL = SessionHelper::getRedirectURL(); if (!empty($sessionCheckURL)) { $serviceResponse->Data->redirectURL = $sessionCheckURL; } else { $logInRoleData = Common::GetLoginRoleText($userLoginChecked->RoleID); $serviceResponse->Data->redirectURL = URL::to('/' . $logInRoleData->redirectURL); } } } return $this->GetJsonResponse($serviceResponse); }
public function IsAuthorized($requestSegment) { if (SessionHelper::getRoleID() != Constants::$RoleDCC) { $requestURLSegment = Request::segment($requestSegment); if (!empty($requestURLSegment)) { $decodeRequestURL = urldecode($requestURLSegment); $decryptProjectID = Common::getEncryptDecryptValue('decrypt', $decodeRequestURL); $projectID = Common::getExplodeValue($decryptProjectID, Constants::$QueryStringProjectID); $propertyName = 'ProjectID'; $userProjectIdArray = Common::GetPropertyArrayFromArray(SessionHelper::getUserProjectList(), $propertyName); if (!in_array($projectID, $userProjectIdArray)) { return true; } else { return false; } } else { return false; } } }
public function getUserGroup() { if (SessionHelper::getRoleID() != Constants::$RoleAdmin) { return Redirect::to('unauthorize'); } $serviceResponse = $this->GroupDataProvider->getGroupListForSearch(); if (!empty($serviceResponse->Data)) { foreach ($serviceResponse->Data->UserGroupModel->UserListArray as $users) { $userID = Constants::$QueryStringUSerID . "=" . $users->UserID; $users->EncryptUserID = Common::getEncryptDecryptID('encrypt', $userID); $users->UserName = $users->FirstName . " " . $users->LastName . " - " . $users->Mobile; } //print_r($serviceResponse->Data->UserGroupModel->UserListArray);exit; foreach ($serviceResponse->Data->UserGroupModel->GroupListArray as $groups) { $groupID = Constants::$QueryStringGroupID . "=" . $groups->GroupID; $groups->EncryptGroupID = Common::getEncryptDecryptID('encrypt', $groupID); } } return View::make('admin.usergrouplist', (array) $serviceResponse->Data); }
public function WebLogout($model) { $response = new ServiceResponse(); $dateTime = date(Constants::$DefaultDateTimeFormat); $userHistoryEntity = UserHistoryEntity::where('UserID', $model->UserID)->orderBy('UserHistoryID', Constants::$SortIndexDESC)->first(); $userHistoryEntity->LogoutTime = $dateTime; $userHistoryEntity->save(); Auth::logout(); SessionHelper::SessionFlush(); $response->IsSuccess = true; return $response; }
public static function CheckUserLogin() { $response = new ServiceResponse(); if (SessionHelper::getRoleID() || Auth::check()) { $roleDetails = Common::GetLoginRoleText(SessionHelper::getRoleID()); $response->IsSuccess = true; $response->Data = $roleDetails; } return $response; }