This commit is contained in:
qronald
2017-05-22 13:27:38 -04:00
parent 0242efa6b0
commit 66dcf0432c
3 changed files with 13 additions and 6 deletions

View File

@@ -29,6 +29,14 @@ class Designer extends Controller
$client = $this->getClientCredentials(); $client = $this->getClientCredentials();
if (isset($httpData->tracker_designer) && $httpData->tracker_designer == 1) { if (isset($httpData->tracker_designer) && $httpData->tracker_designer == 1) {
try {
$response = \ProcessMaker\BusinessModel\Light\Tracker::authentication($_SESSION['CASE'], $_SESSION['PIN']);
} catch (\Exception $e) {
G::header('Location: /errors/error403.php');
die();
}
$httpData->prj_uid = $response['process'];
$httpData->app_uid = $response['app_uid'];
$client["tracker_designer"] = 1; $client["tracker_designer"] = 1;
} }

View File

@@ -13,14 +13,14 @@ class Tracker
} }
/** /**
* authenticaction for case tracker * Authentication for case tracker
* *
* @param $case numbre case * @param int $case number case
* @param $pin code pin access for case tracek * @param int $pin code pin access for case track
* @return array * @return array
* @throws \Exception * @throws \Exception
*/ */
public function authentication($case, $pin) public static function authentication($case, $pin)
{ {
$cases = new \Cases(); $cases = new \Cases();
$response = array(); $response = array();

View File

@@ -21,8 +21,7 @@ class Tracker extends Api
public function Authentication($case, $pin) public function Authentication($case, $pin)
{ {
try { try {
$oMobile = new \ProcessMaker\BusinessModel\Light\Tracker(); $response = \ProcessMaker\BusinessModel\Light\Tracker::authentication($case, $pin);
$response = $oMobile->authentication($case, $pin);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
} }