';
if ($title) {
echo wp_kses($before_title, array('h3'=>array(),'h4'=>array()));
echo wp_kses($title, mfn_allowed_html());
echo wp_kses($after_title, array('h3'=>array(),'h4'=>array()));
}
// validation
if (isset($_GET['login']) && $_GET['login'] == 'failed') {
$errcode = $_GET['errcode'];
if ($errcode == "empty_username" || $errcode == "empty_password") {
$error = __('Please enter Username and Password', 'mfn-opts');
} elseif ($errcode == 'invalid_username') {
$error = __('Invalid Username', 'mfn-opts');
} elseif ($errcode == 'incorrect_password') {
$error = __('Incorrect Password', 'mfn-opts');
}
echo '
'. esc_html($error) .'
';
}
if (is_user_logged_in()) {
echo '
'. get_avatar($user->ID, 64) .'
';
echo '
';
} else {
wp_login_form(array( 'value_remember' => 0,
'redirect' => site_url(),
'remember'=> false
));
echo '
';
}
echo '
'."\n";
echo wp_kses_post($after_widget);
}
/**
* Deals with the settings when they are saved by the admin.
*/
public function update($new_instance, $old_instance)
{
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['show_register'] = (int) $new_instance['show_register'];
$instance['show_forgotten_password'] = (int) $new_instance['show_forgotten_password'];
return $instance;
}
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
*/
public function form($instance)
{
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
$show_register = isset($instance['show_register']) ? absint($instance['show_register']) : 0;
$show_forgotten_password = isset($instance['show_forgotten_password']) ? absint($instance['show_forgotten_password']) : 0;
?>