} $app->response()->header("Content-Type", "application/json"); $resultArray = array(); $resultArray['total'] = $resTotalRowCount['resultSet'][0]['count']; $resultArray['rows'] = $flows; /* $app->contentType('application/json'); $app->halt(302, '{"error":"Something went wrong"}'); $app->stop(); */ $app->response()->body(json_encode($resultArray)); }); /** * * Okan CIRAN * @since 23-02-2016 */ $app->get("/pkFillUsersFirmMachines_infoFirmMachineTool/", function () use($app) { $stripper = $app->getServiceManager()->get('filterChainerCustom'); $stripChainerFactory = new \Services\Filter\Helper\FilterChainerFactory(); $BLL = $app->getBLLManager()->get('infoFirmMachineToolBLL'); $headerParams = $app->request()->headers(); if (!isset($headerParams['X-Public'])) { throw new Exception('rest api "pkGetConsConfirmationProcessDetails_sysOsbConsultants" end point, X-Public variable not found'); } $pk = $headerParams['X-Public']; $vLanguageCode = 'tr'; if (isset($_GET['language_code'])) { $stripper->offsetSet('language_code', $stripChainerFactory->get(stripChainers::FILTER_ONLY_LANGUAGE_CODE, $app, $_GET['language_code'])); } $vMachineId = 0; if (isset($_GET['machine_id'])) { $stripper->offsetSet('machine_id', $stripChainerFactory->get(stripChainers::FILTER_ONLY_NUMBER_ALLOWED, $app, $_GET['machine_id'])); }
* @since 13-01-2016 */ $app->get("/pkInsert_sysAclResources/", function () use($app) { ///////////////////**** validator /** * validat chain test * @author Mustafa Zeynel Dağlı * @since 15/01/2016 */ $vName = $_GET['name']; $vUrl = $_GET['url']; $vParent = $_GET['parent']; $vIconClass = $_GET['icon_class']; $vDescription = $_GET['description']; $vUserId = $_GET['user_ID']; $validater = $app->getServiceManager()->get('validationChainerServiceForZendChainer'); $validatorChainUrl = new Zend\Validator\ValidatorChain(); $validater->offsetSet(array_search($_GET['url'], $_GET), new \Utill\Validation\Chain\ZendValidationChainer($app, $_GET['url'], $validatorChainUrl->attach(new Zend\Validator\StringLength(array('min' => 6, 'max' => 50))))); $validatorChainName = new Zend\Validator\ValidatorChain(); $validater->offsetSet('name', new \Utill\Validation\Chain\ZendValidationChainer($app, $vName, $validatorChainName->attach(new Zend\Validator\StringLength(array('min' => 3, 'max' => 10)))->attach(new Zend\I18n\Validator\Alnum()))); $validater->offsetSet('parent', new \Utill\Validation\Chain\ZendValidationChainer($app, $vParent, $validatorChainName->attach(new Zend\Validator\StringLength(array('min' => 3, 'max' => 10)))->attach(new Zend\I18n\Validator\Alnum()))); $validater->validate(); $messager = $app->getServiceManager()->get('validatorMessager'); print_r($messager->getValidationMessage()); /***validator ***/ $stripper = $app->getServiceManager()->get('filterChainerCustom'); //print_r('---'.array_search($_GET['url'], $_GET).'???'); $stripper->offsetSet(array_search($_GET['url'], $_GET), new \Utill\Strip\Chain\StripChainer($app, $_GET['url'], array(\Services\Filter\FilterServiceNames::FILTER_SQL_RESERVEDWORDS, \Services\Filter\FilterServiceNames::FILTER_HTML_TAGS_CUSTOM_ADVANCED, \Services\Filter\FilterServiceNames::FILTER_JAVASCRIPT_FUNCTIONS, \Services\Filter\FilterServiceNames::FILTER_HEXADECIMAL_ADVANCED, \Services\Filter\FilterServiceNames::FILTER_ONLY_ALPHABETIC_ALLOWED))); $stripper->offsetSet('name', new \Utill\Strip\Chain\StripChainer($app, $_GET['name'], array(\Services\Filter\FilterServiceNames::FILTER_DEFAULT, \Services\Filter\FilterServiceNames::FILTER_HEXADECIMAL_ADVANCED, \Services\Filter\FilterServiceNames::FILTER_HTML_TAGS_CUSTOM_ADVANCED, \Services\Filter\FilterServiceNames::FILTER_JAVASCRIPT_FUNCTIONS, \Services\Filter\FilterServiceNames::FILTER_LOWER_CASE, \Services\Filter\FilterServiceNames::FILTER_SQL_RESERVEDWORDS))); /*$stripper->offsetSet(array_search($_GET['icon_class'], $_GET), new \Utill\Strip\Chain\StripChainer($app, $_GET['icon_class'], array( \Services\Filter\FilterServiceNames::FILTER_DEFAULT,
if (isset($_GET['act_parent_id'])) { $vActParentId = $_GET['act_parent_id']; } $vConsultantId = 0; if (isset($_GET['consultant_id'])) { $vConsultantId = $_GET['consultant_id']; } $vConsultantConfirmTypeId = 0; if (isset($_GET['consultant_confirm_type_id'])) { $vConsultantConfirmTypeId = $_GET['consultant_confirm_type_id']; } $vConfirmId = 0; if (isset($_GET['confirm_id'])) { $vConsultantConfirmTypeId = $_GET['confirm_id']; } $validater = $app->getServiceManager()->get('validationChainerServiceForZendChainer'); $validatorChainUrl = new Zend\Validator\ValidatorChain(); $validater->offsetSet(array_search($_GET['url'], $_GET), new \Utill\Validation\Chain\ZendValidationChainer($app, $_GET['url'], $validatorChainUrl->attach(new Zend\Validator\StringLength(array('min' => 6, 'max' => 50))))); $validatorChainLanguageCode = new Zend\Validator\ValidatorChain(); $validater->offsetSet('language_code', new \Utill\Validation\Chain\ZendValidationChainer($app, $vLanguageCode, $validatorChainLanguageCode->attach(new Zend\Validator\StringLength(array('min' => 2, 'max' => 2)))->attach(new Zend\I18n\Validator\Alpha()))); $validatorChainId = new Zend\Validator\ValidatorChain(); $validater->offsetSet('id', new \Utill\Validation\Chain\ZendValidationChainer($app, $vID, $validatorChainId->attach(new Zend\Validator\StringLength(array('min' => 1)))->attach(new Zend\Validator\Digits()))); $validatorChainOperationTypeId = new Zend\Validator\ValidatorChain(); $validater->offsetSet('operation_type_id', new \Utill\Validation\Chain\ZendValidationChainer($app, $vOperationTypeId, $validatorChainOperationTypeId->attach(new Zend\Validator\StringLength(array('min' => 1)))->attach(new Zend\Validator\Digits()))); $validatorChainActive = new Zend\Validator\ValidatorChain(); $validater->offsetSet('active', new \Utill\Validation\Chain\ZendValidationChainer($app, $vActive, $validatorChainActive->attach(new Zend\Validator\StringLength(array('min' => 1, 'max' => 1)))->attach(new Zend\Validator\Digits()))); $validatorChainProfilePublic = new Zend\Validator\ValidatorChain(); $validater->offsetSet('profile_public', new \Utill\Validation\Chain\ZendValidationChainer($app, $vProfilePublic, $validatorChainProfilePublic->attach(new Zend\Validator\StringLength(array('min' => 1, 'max' => 1)))->attach(new Zend\Validator\Digits()))); $validatorChainConsAllowId = new Zend\Validator\ValidatorChain(); $validater->offsetSet('cons_allow_id', new \Utill\Validation\Chain\ZendValidationChainer($app, $vConsAllowId, $validatorChainConsAllowId->attach(new Zend\Validator\StringLength(array('min' => 1, 'max' => 1)))->attach(new Zend\Validator\Digits()))); $validatorChainActParentId = new Zend\Validator\ValidatorChain();
$app->response()->body(json_encode($resultArray)); }); /** * * Okan CIRAN * @since 13-01-2016 */ $app->get("/pkInsert_sysAclPrivilege/", function () use($app) { $BLL = $app->getBLLManager()->get('sysAclPrivilegeBLL'); $errorcode = 0; $hatasayisi = 0; $hatasayisi1 = 0; $hatasayisi2 = 0; $hatasayisi3 = 0; ////******************Filters ******************////////// // Filters are called from service manager $filterDefault = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_DEFAULT); $filterHexadecimalAdvanced = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HEXADECIMAL_ADVANCED); $filterHTMLTagsAdvanced = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_HTML_TAGS_ADVANCED); $filterLowerCase = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_LOWER_CASE); $filterPregReplace = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_PREG_REPLACE); $filterSQLReservedWords = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_SQL_RESERVEDWORDS); $filterRemoveText = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_REMOVE_TEXT); $filterRemoveNumber = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_REMOVE_NUMBER); $filterToNull = $app->getServiceManager()->get(\Services\Filter\FilterServiceNames::FILTER_TONULL); $filterAlpha = new \Zend\I18n\Filter\Alnum(array('allowWhiteSpace' => true)); ////******************Filters ******************////////// ////******************Validators ******************////////// $validatorAlpha = new Zend\I18n\Validator\Alnum(array('allowWhiteSpace' => true)); $validatorStringLength = new Zend\Validator\StringLength(array('min' => 3, 'max' => 20)); $validatorNotEmptyString = new Zend\Validator\NotEmpty(); $vName = $_GET['name'];