Ejemplo n.º 1
0
 /**
  * @param  string $current_password
  * @param  string $new_password
  * @return array
  */
 public function processPasswordChange($current_password, $new_password)
 {
     $rows = $this->db->select('users', array("`password` = '" . $current_password . "'", "`id` = '" . $this->id . "'"));
     $return_array = array();
     if (!$rows) {
         $return_array['status'] = 0;
         $return_array['message'] = 'Incorrect current password.';
     } else {
         $this->db->update('users', array('password' => $new_password), array("`id` = '" . $this->id . "'"));
         $return_array['status'] = 1;
         $return_array['message'] = 'New account password saved.';
     }
     return $return_array;
 }
Ejemplo n.º 2
0
 /**
  * @param  array $data Form submission $_POST
  * @return void
  */
 public function saveHours($data)
 {
     $timezone = $data['timezone'];
     unset($data['timezone']);
     $data = array('hours' => serialize($data), 'timezone' => $timezone);
     $this->db->update('locations', $data, array("`id` = '" . $this->business_id . "'"));
 }
Ejemplo n.º 3
0
 /**
  * Reset password based on email.
  *
  * @param string $password
  * @param string $email
  * @return void
  */
 public function processResetPassword($password, $email)
 {
     $this->db->update('users', array('password' => $password), array("`email` = '" . $email . "'"));
 }