Beispiel #1
0
if (isset($_REQUEST['Update'])) {
    //update
    $args = array('type' => 'edit', 'tos' => false, 'captcha' => false, 'action' => $url . '&tab=users', 'is_public' => false, 'user_id' => $_REQUEST['user_id']);
    $obj->setVariable($args);
    //setting the object variables
    $obj->save_update_user();
} else {
    if (isset($_REQUEST['Submit'])) {
        //create
        $args = array('user_id' => false, 'type' => 'create', 'tos' => false, 'captcha' => false, 'action' => $url . '&tab=users', 'is_public' => false);
        $obj->setVariable($args);
        //setting the object variables
        $obj->save_update_user();
    }
}
$obj_form = new UserAddEdit();
if (isset($_REQUEST['ihc-edit-user'])) {
    ///EDIT USER FORM
    $args = array('user_id' => $_REQUEST['ihc-edit-user'], 'type' => 'edit', 'tos' => false, 'captcha' => false, 'action' => $url . '&tab=users', 'is_public' => false);
    $obj_form->setVariable($args);
    //setting the object variables
    $form = $obj_form->form();
} else {
    /// CREATE USER FORM
    $args = array('user_id' => false, 'type' => 'create', 'tos' => false, 'captcha' => false, 'action' => $url . '&tab=users', 'is_public' => false);
    $obj_form->setVariable($args);
    //setting the object variables
    $form = $obj_form->form();
}
global $ihc_error_register;
echo $ihc_error_register;
Beispiel #2
0
function ihc_register_preview_ajax()
{
    include_once IHC_PATH . 'classes/UserAddEdit.class.php';
    $args = array('user_id' => false, 'type' => 'create', 'tos' => true, 'captcha' => true, 'action' => '', 'is_public' => true, 'disabled_submit_form' => 'disabled', 'register_template' => $_REQUEST['template']);
    $obj_form = new UserAddEdit();
    $obj_form->setVariable($args);
    //setting the object variables
    $str = '';
    $str .= '<style>' . $_REQUEST['custom_css'] . '</style>';
    $str .= '<div class="iump-register-form  ' . $_REQUEST['template'] . '">' . $obj_form->form() . '</div>';
    echo $str;
    die;
}
function ihc_register_form($attr = false)
{
    $str = '';
    $user_type = ihc_get_user_type();
    if ($user_type == 'unreg') {
        ///////ONLY UNREGISTERED CAN SEE THE REGISTER FORM
        if (isset($_GET['ihc_register'])) {
            return;
        }
        $template = get_option('ihc_register_template');
        $str .= '<style>' . get_option('ihc_register_custom_css') . '</style>';
        include_once IHC_PATH . 'classes/UserAddEdit.class.php';
        $args = array('user_id' => false, 'type' => 'create', 'tos' => true, 'captcha' => true, 'action' => '', 'is_public' => true, 'register_template' => $template);
        $obj_form = new UserAddEdit();
        $obj_form->setVariable($args);
        //setting the object variables
        $str .= '<div class="iump-register-form ' . $template . '">' . $obj_form->form() . '</div>';
        //print the Errors
        global $ihc_error_register;
        if (!empty($ihc_error_register)) {
            $str .= '<div class="ihc-wrapp-the-errors">' . $ihc_error_register . '</div>';
        }
    }
    return $str;
}
                    //PREVENT INFINITE REDIRECT LOOP
                    wp_redirect($redirect_link);
                    exit;
                }
            }
        } else {
            ////////////////////// REPLACE CONTENT, adding filter to block, show only the content
            add_filter('the_content', 'ihc_filter_content');
        }
    }
}
function ihc_init_form_action($url)
{
    /*  
	 * used on init action
	 * form actions : 
	 * REGISTER
	 * LOGIN 
	 * UPDATE
	 * LOGOUT
	 * RESET PASS
	 *  
	 */
    switch ($_REQUEST['ihcaction']) {
        case 'login':
            //login
            include_once IHC_PATH . 'public/functions/login.php';
            ihc_login($url);
            break;
        case 'logout':
            //logout
            include_once IHC_PATH . 'public/functions/logout.php';
            ihc_do_logout($url);
            break;
        case 'register':
            ///////////////////////////////register
            include_once IHC_PATH . 'classes/UserAddEdit.class.php';
            $args = array('user_id' => false, 'type' => 'create', 'tos' => true, 'captcha' => true, 'action' => '', 'is_public' => true, 'url' => $url);
            $obj = new UserAddEdit();
            $obj->setVariable($args);
            //setting the object variables