Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Activity новая запись "неправильно ввегден пароль"


Recommended Posts

Не могу полулить id покупателя при неправленом ввогде пароля Activity новая запись "неправильно ввегден пароль" при верном логине и ввода

OCstore 2.3

login.php

protected function validate() {
		// Check how many login attempts have been made.
		$login_info = $this->model_account_customer->getLoginAttempts($this->request->post['email']);

		 $this->load->model('account/customer');

         // Add to activity log  VARIANT-1
			if ($this->config->get('config_customer_activity')) {
				$this->load->model('account/activity');                

				$activity_data = array(
						'customer_id' => $login_info['customer_id'],
						'name'        => $login_info['firstname'] . ' ' . $login_info['lastname']					);

				$this->model_account_activity->addActivity('passwrong', $activity_data);
			}
			// Add to activity log VARIANT-2
			if ($this->config->get('config_customer_activity')) {
				$customer_info = $this->model_account_customer->getCustomerByEmail($this->request->post['email']);

				if ($customer_info) {
					$this->load->model('account/activity');

					$activity_data = array(
						'customer_id' => $customer_info['customer_id'],
						'name'        => $customer_info['firstname'] . ' ' . $customer_info['lastname']
					);

					$this->model_account_activity->addActivity('passwrong', $activity_data);
				}
			}
		if ($login_info && ($login_info['total'] >= $this->config->get('config_login_attempts')) && strtotime('-1 hour') < strtotime($login_info['date_modified'])) {
			$this->error['warning'] = $this->language->get('error_attempts');

		}

		// Check if customer has been approved.
		$customer_info = $this->model_account_customer->getCustomerByEmail($this->request->post['email']);


		if ($customer_info && !$customer_info['approved']) {
			$this->error['warning'] = $this->language->get('error_approved');
		}

		if (!$this->error) {
			if (!$this->customer->login($this->request->post['email'], $this->request->post['password'])) {
				$this->error['warning'] = $this->language->get('error_login');

				$this->model_account_customer->addLoginAttempt($this->request->post['email']);
			} else {
				$this->model_account_customer->deleteLoginAttempts($this->request->post['email']);

			}
		}

		return !$this->error;

	}

эти два вариани не дают резульии.

 

Прошу помощи, как полулить customer_id при ввогде правильной почты и неправильном пароле для Activity

Link to comment
Share on other sites


после этот строки

if (!$this->customer->login($this->request->post['email'], $this->request->post['password'])) {

добавить проверку
 

if ($customer_info) {
  /* wrong password */
}

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.