function template()
    {
        do_action('activate_header');
        add_action('wp_head', array($this, 'do_activate_header'));
        add_action('wp_head', array($this, 'wpmu_activate_stylesheet'));
        get_header();
        ?>

        <div id="content" class="widecolumn">

            <?php 
        if (!$this->has_activation_key()) {
            get_template_part($this->template_folder . '/activate', 'no-key');
        } else {
            $key = $this->get_activation_key();
            $this->result = GFUserSignups::activate_signup($key);
            if (is_wp_error($this->result)) {
                get_template_part($this->template_folder . '/activate', 'error');
            } else {
                get_template_part($this->template_folder . '/activate', 'success');
            }
        }
        ?>

        </div>

        <script type="text/javascript">
            var key_input = document.getElementById('key');
            key_input && key_input.focus();
        </script>

        <?php 
        get_footer();
    }
    function template()
    {
        do_action('activate_header');
        add_action('wp_head', array($this, 'do_activate_header'));
        add_action('wp_head', array($this, 'wpmu_activate_stylesheet'));
        get_header();
        ?>
<div class="container">
	<div class="section">
		<div class="col two-thirds">
        <div id="content" class="widecolumn">

            <?php 
        if (!$this->has_activation_key()) {
            include 'activate-no-key.php';
        } else {
            $key = $this->get_activation_key();
            $this->result = GFUserSignups::activate_signup($key);
            if (is_wp_error($this->result)) {
                include 'activate-error.php';
            } else {
                include 'activate-success.php';
            }
        }
        ?>

        </div>
		</div>
	</div>
</div>

        <script type="text/javascript">
            var key_input = document.getElementById('key');
            key_input && key_input.focus();
        </script>

        <?php 
        get_footer();
    }
예제 #3
0
 public static function activate_user()
 {
     require_once self::get_base_path() . '/includes/signups.php';
     GFUserSignups::prep_signups_functionality();
     $key = rgpost('key');
     $userdata = GFUserSignups::activate_signup($key);
     $error_message = '';
     if (is_wp_error($userdata)) {
         $error_message = $userdata->get_error_message();
     }
     echo $error_message;
     exit;
 }
예제 #4
0
    ?>
</label>
                <br /><input type="text" name="key" id="key" value="" size="50" />
            </p>
            <p class="submit">
                <input id="submit" type="submit" name="Submit" class="submit" value="<?php 
    esc_attr_e('Activate');
    ?>
" />
            </p>
        </form>

    <?php 
} else {
    $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
    $result = GFUserSignups::activate_signup($key);
    if (is_wp_error($result)) {
        if ('already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code()) {
            $signup = $result->get_error_data();
            ?>
                <h2><?php 
            _e('Your account is now active!');
            ?>
</h2>
                <?php 
            echo '<p class="lead-in">';
            if ($signup->domain . $signup->path == '') {
                printf(__('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url('wp-login.php', 'login'), $signup->user_login, $signup->user_email, network_site_url('wp-login.php?action=lostpassword', 'login'));
            } else {
                printf(__('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url('wp-login.php?action=lostpassword'));
            }
 public static function handle_submission()
 {
     if (!wp_verify_nonce(rgpost('action_nonce'), 'action') && !check_admin_referer('action_nonce', 'action_nonce')) {
         die('You have failed...');
     }
     require_once GFUser::get_base_path() . '/includes/signups.php';
     GFUserSignups::prep_signups_functionality();
     self::$errors = '';
     self::$message = '';
     $action = rgpost('single_action');
     $action = !$action ? rgpost('action') != -1 ? rgpost('action') : rgpost('action2') : $action;
     $items = rgpost('item') ? array(rgpost('item')) : rgpost('items');
     foreach ($items as $key) {
         switch ($action) {
             case 'delete':
                 $success = GFUserSignups::delete_signup($key);
                 if ($success) {
                     self::$message = _n('Item deleted.', 'Items deleted.', count($items), 'graivtyformsuserregistration');
                 } else {
                     self::$errors = _n('There was an issue deleting this item.', 'There was an issue deleting one or more selected items.', count($items), 'graivtyformsuserregistration');
                 }
                 break;
             case 'activate':
                 $userdata = GFUserSignups::activate_signup($key);
                 if (!is_wp_error($userdata) && rgar($userdata, 'user_id')) {
                     self::$message = _n('Item activated.', 'Items activated.', count($items), 'graivtyformsuserregistration');
                 } else {
                     self::$errors = _n('There was an issue activating this item', 'There was an issue activating one or more selected items', count($items), 'graivtyformsuserregistration');
                     if (is_wp_error($userdata)) {
                         $errors = reset($userdata->errors);
                         self::$errors .= ": " . $errors[0];
                     }
                 }
                 break;
         }
     }
 }
예제 #6
0
 public function authenticate_user()
 {
     if (!empty($_REQUEST['key'])) {
         // include GF User Registration functionality
         require_once gf_user_registration()->get_base_path() . '/includes/signups.php';
         $result = GFUserSignups::activate_signup($_REQUEST['key']);
         if (is_wp_error($result)) {
             if ('already_active' == $result->get_error_code()) {
                 $signup = $result->get_error_data();
                 $message = sprintf(__('Your account is already active with the email address %5$s'), $signup->user_login);
             } else {
                 $message = $result->get_error_message();
             }
         } else {
             $message = __('Your account is now activated. Please login below.');
         }
         get_component('elements', 'alert', compact('message'));
     }
 }
예제 #7
0
    function template()
    {
        do_action('activate_header');
        add_action('wp_head', array($this, 'do_activate_header'));
        add_action('wp_head', array($this, 'wpmu_activate_stylesheet'));
        get_header();
        ?>

        <div class="main_content" role="main">

            <article>

                <div class="container">
                    <div class="sub-heading">
                        <h1 class="text-center primary-heading">Активация</h1>
                        <div class="text-center">
                            <span class="divider" aria-hidden="true"><i class="glyphicon glyphicon-user"></i></span>
                        </div>
                    </div>
                    <div class="text-justify">



            <?php 
        if (!$this->has_activation_key()) {
            get_template_part('inc/' . $this->template_folder . '/activate', 'no-key');
        } else {
            $key = $this->get_activation_key();
            $this->result = GFUserSignups::activate_signup($key);
            if (is_wp_error($this->result)) {
                get_template_part('inc/' . $this->template_folder . '/activate', 'error');
            } else {
                get_template_part('inc/' . $this->template_folder . '/activate', 'success');
            }
        }
        ?>

                    </div>
            </article>

        </div>

        <script type="text/javascript">
            var key_input = document.getElementById('key');
            key_input && key_input.focus();
        </script>

        <?php 
        get_footer();
    }