Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl_setopt($ch, CURLOPT_URL, Configure::read('TMSWebServices.Url').'getSystemSetting.json');
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
- $result_json = curl_exec($ch);
- curl_close($ch);
- $result = json_decode($result_json, true);
- debug($result); exit;
- App::uses('AuthComponent', 'Controller/Component');
- App::uses('UsersController', 'Controller');
- App::uses('Security','Utility');
- class WebServicesController extends AppController {
- public $name = 'WebServices';
- public $uses = array('Tenant', 'TbNextId', 'ReportMaster' );
- public $components = array('RequestHandler');
- public function getSystemSetting(){
- $this->loadModel('SystemSetting');
- $results = $this->SystemSetting->find($type, $params);
- $return_value = array();
- $return_value[] = $results['SystemSetting'];
- foreach($return_value['Config'] as $key=>$value){
- if ($value['ENCRYPT_IND'] == 'Y'){
- $encryptedValue = $return_value['Config'][$key]['SYSTEM_SETTING_VALUE'];
- //decrypt the value
- $decryptedValue = Security::cipher($encryptedValue,
- Configure::read('Security.salt')); // the problem starts here
- $return_value['Config'][$key]['SYSTEM_SETTING_VALUE'] = $decryptedValue;
- }
- }
- }
- }
- $this->set(array(
- 'return_value' => $return_value,
- '_serialize' => array('return_value')
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement