Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function action_index(){
- $html = new Template();
- if(Session::get("logged_in")){
- Response::redirect('/test-newsletter');
- exit(0);
- }
- // die("in ifss");
- if(Input::post()){
- $username = Input::post('username','');
- $password = Input::post('password','');
- if($username === "username" && $password === "password") {
- Session::set('logged_in', true);
- Response::redirect('/test-newsletter');
- }else{
- $html->assign('message','Wrong username or password');
- }
- }
- return $html->fetch('login.tpl');
- }
- <?php
- return array(
- "_root_" => "default/index",
- "logout" => "default/logout",
- "_404_" => "default/404",
- "time" => "default/time",
- "test" => "default/test",
- "birthdays" => "backstage/birthdays",
- "earned-status" => "backstage/earned_status",
- "nearly-new-status" => "backstage/nearly_new_status",
- "placed-order" => "backstage/placed_order",
- "user-history" => "backstage/user_history",
- "test-newsletter" => "backstage/test_newsletter",
- "preview-email" => "backstage/preview_email",
- "view-email/:id" => "backstage/view_email",
- "api/set-date" => "backstage/api_set_date"
- );
- public function action_test_newsletter(){
- die("here");
- $submitted = Input::post("submit", false);
- $points = Input::post("points", "");
- $email = Input::post("email", "");
- $type = Input::post("type", "");
- $html = new Template();
- $html->assign("points", $points);
- $html->assign("email", $email);
- $html->assign("type", $type);
- $html->assign("message", "");
- if($submitted){
- $testService = new TestService(trim($type), trim($email), trim($points));
- if($testService->isValid()){
- $testService->processEmail();
- $html->assign("message", "Email Sent!");
- }else{
- $html->assign("message", $testService->getErrorMesssage());
- }
- }
- return $html->fetch("test_newsletter.tpl");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement