Exemplo n.º 1
0
 public function widget($args, $instance)
 {
     $option = get_option('pie_register_2');
     if (is_user_logged_in() && $option['redirect_user'] == 1) {
         //do nothing here
     } else {
         global $errors;
         $error = "";
         //$form 		= new Registration_form();
         $success = '';
         $title = apply_filters('widget_title', $instance['title']);
         echo $args['before_widget'];
         //$this->pie_frontend_enqueu_scripts();
         include_once "register_form.php";
         $output = '';
         if (isset($_POST['success']) && $_POST['success'] != "") {
             $output .= '<p class="piereg_message">' . apply_filters('piereg_messages', __($_POST['success'], "piereg")) . '</p>';
         }
         if (isset($_POST['error']) && $_POST['error'] != "") {
             $output .= '<p class="piereg_login_error">' . apply_filters('piereg_messages', __($_POST['error'], "piereg")) . '</p>';
         }
         if (isset($errors->errors) && sizeof($errors->errors) > 0) {
             foreach ($errors->errors as $key => $err) {
                 if ($key != "login-error") {
                     $error .= $err[0] . "<br />";
                 }
             }
             if (!empty($error)) {
                 $output .= '<p class="piereg_login_error">' . apply_filters('piereg_messages', __($error, "piereg")) . '</p>';
             }
         }
         $output .= outputRegForm(true);
         echo $output;
         echo $args['after_widget'];
     }
 }
Exemplo n.º 2
0
 function showForm()
 {
     $this->piereg_ssl_template_redirect();
     global $errors;
     $error = "";
     $option = get_option('pie_register_2');
     if (is_user_logged_in() && $option['redirect_user'] == 1) {
         $this->afterLoginPage();
         return "";
     } else {
         add_filter('wp_mail_content_type', array($this, 'set_html_content_type'));
         //ob_start();
         $output = '';
         if (isset($_POST['success']) && $_POST['success'] != "") {
             $output .= '<p class="piereg_message">' . apply_filters('piereg_messages', __($_POST['success'], "piereg")) . '</p>';
         }
         if (isset($_POST['error']) && $_POST['error'] != "") {
             $output .= '<p class="piereg_login_error">' . apply_filters('piereg_messages', __($_POST['error'], "piereg")) . '</p>';
         }
         if (isset($_POST['registration_success']) && $_POST['registration_success'] != "") {
             $output .= '<p class="piereg_message">' . apply_filters('piereg_messages', __($_POST['registration_success'], "piereg")) . '</p>';
         }
         if (isset($_POST['registration_error']) && $_POST['registration_error'] != "") {
             $output .= '<p class="piereg_login_error">' . apply_filters('piereg_messages', __($_POST['registration_error'], "piereg")) . '</p>';
         }
         if (isset($errors->errors) && sizeof($errors->errors) > 0) {
             foreach ($errors->errors as $key => $err) {
                 if ($key != "login-error") {
                     $error .= $err[0] . "<br />";
                 }
             }
             if (!empty($error)) {
                 $output .= '<p class="piereg_login_error">' . apply_filters('piereg_messages', __($error, "piereg")) . '</p>';
             }
         }
         include_once "register_form.php";
         $output .= outputRegForm();
         return $output;
     }
 }