public function index() { // echo "hii";die; $this->layout = ""; $data = $this->RestData(); $this->autoRender = false; $myObj = CJSON::decode($data, $useArray = false); $requested_service = $myObj->{"request_type_sent"}; $this->log("REQUEST:===>" . $data); // $this->log("Data Sent by User===>".$data); // echo $requested_service;die; switch ($requested_service) { case 'SMS_VERIFICATION': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->smsVerification($this->make_safe($myObj->{"mobile_no"}))); unset($userObj); break; case 'POST_INSTALLATION': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->postInstallation($this->make_safe($myObj->{"device_id"}), $this->make_safe($myObj->{"email_id"}), $this->make_safe($myObj->{"android_id"}), $this->make_safe($myObj->{"google_ad_id"}))); unset($userObj); break; case 'LOGIN_SERVICE': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->registerCustomer($this->make_safe($myObj->{"customer_id"}), $this->make_safe($myObj->{"mobile_no"}), $this->make_safe($myObj->{"device_id"}), $this->make_safe($myObj->{"referrer"}))); unset($userObj); break; case 'GET_CAMPAIGNS': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->getCampaignList($this->make_safe($myObj->{"customer_id"}))); unset($userObj); break; case 'GET_CUSTOMER_DETAILS': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->getCustomerDetails($this->make_safe($myObj->{"customer_id"}))); unset($userObj); break; case 'TEST_SERVICE': App::uses('CustomerController', 'Controller'); $userObj = new CustomerController(); echo $this->SetLog($userObj->test()); unset($userObj); break; default: $data = "405"; $this->SetLog($data); break; } }
case 'Next': $_SESSION['username'] = $_POST['username']; //prüft ob der User erfolgreich in die Text Datei gespeichert wurde if ($user_controller->registerUser()) { header("Location:./view/CustomerView.php"); } else { /*wenn die Passwörter nicht identisch sind wird der User zurück an die RegisterView geschickt und eine Error Meldung wird ausgegeben*/ header("Location:./view/RegisterView.php?err=12"); } break; //Send //Send case 'Send': //prüft ob die Customer Daten erfolgreich gespeichert wurden if ($cust_controller->registerCustomer()) { header("Location:./view/LoginView.php"); } else { header("Location:./view/RegisterView.php?err=13"); } break; //logout //logout case 'logout': $user_controller->logout(); header("Location:view/LoginView.php"); break; // admin operations // admin operations case 'show-Userlist': header("Location:view/UserListView.php");