Пример #1
0
 protected function field_values($user)
 {
     $prompt_user = new Prompt_User($user);
     $origin = $prompt_user->get_subscriber_origin();
     if (!$origin) {
         $origin = new Prompt_Subscriber_Origin(array('timestamp' => strtotime($user->user_registered)));
     }
     $fields = array($user->user_email, $user->first_name, $user->last_name, $origin->get_date('c'), $origin->get_source_label(), $origin->get_source_url());
     return $this->quote($fields);
 }
Пример #2
0
 /**
  * Prevent subscribers who were not sent credentials from resetting their password.
  *
  * Hooks allow_password_reset
  *
  * @since 1.3.2
  *
  * @param int $user_id
  * @return boolean
  */
 public static function filter_allow_password_reset($allow, $user_id)
 {
     $prompt_user = new Prompt_User($user_id);
     if (!$prompt_user->get_wp_user()->has_cap('subscriber')) {
         return $allow;
     }
     if (!$prompt_user->get_subscriber_origin()) {
         return $allow;
     }
     if (Prompt_Core::$options->get('send_login_info')) {
         return $allow;
     }
     return false;
 }