/** * Create Trusted Devices Widget container for WP Dashboard * * @return string */ public function getTDMWidget() { $result = ''; if (RublonHelper::isSiteRegistered()) { if (RublonHelper::canShowTDMWidget()) { $current_user = wp_get_current_user(); $protection_type = RublonHelper::YES; RublonHelper::isUserProtected($current_user, $protection_type); switch ($protection_type) { case RublonHelper::PROTECTION_TYPE_MOBILE: $result .= '<p>' . sprintf(__('Your account is protected by <a href="%s" target="_blank">Rublon</a>.', 'rublon'), RublonHelper::rubloncomUrl()) . '</p>'; break; case RublonHelper::PROTECTION_TYPE_EMAIL: $result .= '<p>' . sprintf(__('Your account is protected by <a href="%s" target="_blank">Rublon</a>.', 'rublon'), RublonHelper::rubloncomUrl()) . ' ' . sprintf(__('Get the <a href="%s/get" target="_blank">Rublon mobile app</a> for more security.', 'rublon'), RublonHelper::rubloncomUrl()) . '</p>'; break; case RublonHelper::PROTECTION_TYPE_NONE: $lang = RublonHelper::getBlogLanguage(); $result .= '<p>' . sprintf('<span style="color: red; font-weight: bold;">' . __('Warning!', 'rublon') . '</span>' . ' ' . __('Your account is not protected. Go to <a href="%s">your profile page</a> to enable account protection.', 'rublon'), admin_url(RublonHelper::WP_PROFILE_PAGE . RublonHelper::WP_PROFILE_EMAIL2FA_SECTION)) . '</p>'; break; } $result .= $this->getDeviceWidget(); } else { $result = '<p>' . __('Your account isn\'t protected by Rublon and thus vulnerable to password theft and brute force attacks. Please contact your administrator. ') . '</p>'; } } return $result; }
protected function getProjectData() { $projectData = parent::getProjectData(); $projectData['project-description'] = get_bloginfo('description'); $projectData['plugin-version'] = RublonHelper::getCurrentPluginVersion(); $projectData['lang'] = RublonHelper::getBlogLanguage(); $current_user = wp_get_current_user(); $email = RublonHelper::getUserEmail($current_user); $projectData['project-owner-email'] = $email; $projectData['project-owner-email-hash'] = self::hash($email); $projectData[RublonConsumerRegistrationCommon::FIELD_PARTNER_KEY] = RublonHelper::getPartnerKey(); return $projectData; }
public function getLang() { return RublonHelper::getBlogLanguage(); }
/** * Get project's additional data. * * The data returned will be used upon consumer's registration * and are required. If any additional data is needed, * this method may be overwritten. * * @return string */ protected function getProjectData() { $project_data = parent::getProjectData(); $project_data[self::FIELD_PROJECT_DESCRIPTION] = get_bloginfo('description'); $project_data[self::FIELD_PROJECT_LANG] = RublonHelper::getBlogLanguage(); return $project_data; }
/** * Handle the additional Rublon columns for a given user * * @param mixed $value Current column value * @param string $column_name Column name * @param int $user_id User's ID * @return string */ function rublon2factor_manage_rublon_columns($value, $column_name, $user_id) { if (RublonHelper::isSiteRegistered()) { // Retrieve Rublon users from prerender data. $rublon_mobile_users = RublonHelper::getPrerenderData(RublonHelper::PRERENDER_KEY_MOBILE_USERS); if ($column_name == 'rublon2factor_status') { $user = get_user_by('id', $user_id); $protectionType = array(RublonHelper::roleProtectionType($user), RublonHelper::userProtectionType($user)); if (RublonHelper::isPersonalEdition() && RublonHelper::isProjectOwner($user_id) || RublonFeature::isBusinessEdition() && RublonRolesProtection::isGrater(RublonHelper::getUserProtectionType($user), RublonHelper::PROTECTION_TYPE_NONE)) { $lang = RublonHelper::getBlogLanguage(); $value = sprintf('<a href="%s"', RublonHelper::rubloncomUrl()) . ' target="_blank"><img class="rublon-protected rublon-image" src="' . RUBLON2FACTOR_PLUGIN_URL . '/assets/images/rublon_logo_32x32.png' . '" title="' . __('Account protected by Rublon', 'rublon') . '" /></a>'; } } return $value; } }