From 04d6577482b11a620cbec909923ef42191102def Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sun, 25 Apr 2021 18:53:43 -0400 Subject: [PATCH] fix --- www/application/controllers/Registration.php | 4 +- www/application/controllers/Signup.php | 90 ++++++++++++++++++++ www/application/views/home/view_index1.php | 10 +-- 3 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 www/application/controllers/Signup.php diff --git a/www/application/controllers/Registration.php b/www/application/controllers/Registration.php index 24473578..f3995720 100644 --- a/www/application/controllers/Registration.php +++ b/www/application/controllers/Registration.php @@ -83,8 +83,8 @@ class Registration extends CI_Controller { $data['terms'] = $terms_checked; - $this->load->view('users/view_registration', $data); - $this->load->view('users/view_external_footer', $data); + // $this->load->view('users/view_registration', $data); + // $this->load->view('users/view_external_footer', $data); } } diff --git a/www/application/controllers/Signup.php b/www/application/controllers/Signup.php new file mode 100644 index 00000000..7bd57fd5 --- /dev/null +++ b/www/application/controllers/Signup.php @@ -0,0 +1,90 @@ +input->ip_address(); + $data['loc'] = $ip; //"38.101.241.200"; + + $this->load->model('combo_model'); + $this->combo_model->defaultComboMessage = 'Select your Country'; + $data['country_combo'] = $this->combo_model->getCountryCombo('country', $country); + $terms_checked = ''; + // is anybody using this email already + $this->load->model('account_model'); + $data['signup_error'] = ''; + + if ($_POST) { // post + if ($data['terms'] == 'on') { + $terms_checked = 'checked'; + } + + // $data['terms'] = 1; // note terms is turned to 1 + // + // print_r($_POST); + if ($this->account_model->verifySignupInputs($data) == true) { + $email_in_use = false; + $data['terms'] = 1; // $terms is interger in backend; + if ($this->account_model->checkUsernameDuplicate($data) > 0) { + $email_in_use = true; + } + if ($email_in_use == false) { + $data['action'] = WRENCHBOARD_ACCOUNT_PENDING; + if ($_POST) { + if ($firstname !== '' && $lastname !== '') { + $this->load->model('backend_model'); + $out = array(); + $res = $this->backend_model->wrenchboard_api($data, $out); + if ($res > 0) { + $data['account_email'] = strtolower($email); + redirect('outmessage', $data); + } else { + $data['signup_error'] = "Unable to create account"; + } + } + } + } else { + $data['signup_error'] = "Please use another username"; + } + } else { + $data['signup_error'] = "Enter all required fields"; + } + } // if post + $data['signup_error_style'] = ''; + if (strlen($data['signup_error']) > 0) { + $data['signup_error_style'] = "
" . $data["signup_error"] . "
"; + } + + + $data['terms'] = $terms_checked; + + + $this->load->view('users/view_registration', $data); + $this->load->view('users/view_external_footer', $data); + } + +} diff --git a/www/application/views/home/view_index1.php b/www/application/views/home/view_index1.php index 7e895ecc..e979b604 100644 --- a/www/application/views/home/view_index1.php +++ b/www/application/views/home/view_index1.php @@ -70,7 +70,7 @@
  • How it works
  • Create Project
  • -
  • Sign up
  • +
  • Sign up
  • @@ -82,7 +82,7 @@
  • How it works
  • Create Project
  • Login
  • -
  • Sign up
  • +
  • Sign up
  • @@ -153,7 +153,7 @@
    @@ -219,7 +219,7 @@
    - You can do more with WrenchBoard . Create and manage your preferred workgroup. Organize and manage your teams efficiently. Get started Sign up or Login in with Facebook + You can do more with WrenchBoard . Create and manage your preferred workgroup. Organize and manage your teams efficiently. Get started Sign up or Login in with Facebook
    @@ -451,7 +451,7 @@