Ejemplo n.º 1
0
 function loginForm()
 {
     do_action('loginx_before_login_form');
     if (parent::useWoo() && !$_GET['password'] && !$_POST['reset'] && !$_GET['reset'] && !$_GET['resend'] && !$_GET['act']) {
         print '<script>window.location.href = "' . get_permalink(woocommerce_get_page_id('myaccount')) . '";</script>';
         exit;
     }
     require_once PHPX_DIR . '/phpx_form.php';
     $form = new phpx_form();
     if (parent::loginx_successMessage()) {
         $text = '<div class="loginx_success">' . parent::loginx_successMessage('get') . '</div>';
     } else {
         if ($_GET['password'] || $_POST['reset']) {
             $form->startForm(parent::loginx_getURL() . '?password=1');
             if (parent::loginx_errorMessage()) {
                 $form->freeText(parent::loginx_errorMessage('get'), 'loginx_error');
             }
             $form->freeText($this->options['password_text']);
             $form->textField('Email/Username', 'email', '', true);
             $form->hidden('nonce', wp_create_nonce('loginx'));
             $text = '<div id="loginx_password">' . $form->endForm() . '</div>';
         } else {
             if ($_GET['reset']) {
                 $user_id = $this->wpdb->get_var($this->wpdb->prepare('select user_id from ' . $this->wpdb->prefix . 'loginx_key where loginx_key = %s and loginx_expire > %d limit 1', $_GET['reset'], time()));
                 if (!$user_id) {
                     $text = '<div class="loginx_error">' . $this->options['bad_key'] . '</div>';
                 } else {
                     $form->startForm(parent::loginx_getURL());
                     if (parent::loginx_errorMessage()) {
                         $form->freeText(parent::loginx_errorMessage('get'), 'loginx_error');
                     }
                     $form->freeText($this->options['password_reset_text']);
                     $form->password('Password', 'pass', true, 6);
                     $form->password('Confirm Password', 'pass_confirm', true, 6, true);
                     $form->hidden('nonce', wp_create_nonce('loginx'));
                     $form->hidden('reset', $_GET['reset']);
                     $text = '<div id="loginx_password">' . $form->endForm() . '</div>';
                 }
             } else {
                 $form->startForm($this->loginx_getURL());
                 if (parent::loginx_errorMessage()) {
                     $form->freeText(parent::loginx_errorMessage('get'), 'loginx_error');
                 }
                 $form->textField('Username', 'username', '', true);
                 $form->password('Password', 'password', true, 4);
                 //$form->checkBox('Remember Me?', 'remember', 0);
                 $form->hidden('remember', 'forever');
                 $form->hidden('nonce', wp_create_nonce('loginx'));
                 $form->freeText('<div id="loginx_password_link"><a href="' . get_permalink() . '?password=1">Forgot Login/Password?</a></div>');
                 $form->freeText('<div id="loginx_register_link"><a href="' . get_permalink($this->options['register_page']) . '">Register</a></div>');
                 if (function_exists('rpx_init')) {
                     $form->freeText(do_shortcode('[rpxlogin]'));
                 }
                 $text = '<div id="loginx_form">' . $form->endForm() . '</div>';
             }
         }
     }
     do_action('loginx_after_login_form');
     return $text;
 }
Ejemplo n.º 2
0
 function adbarx_admin()
 {
     if ($_POST['nonce']) {
         if (!wp_verify_nonce($_POST['nonce'], 'adbarx_admin')) {
             die('Invalid Security Token');
         }
         $this->options['remember'] = $_POST['showOnce'] == 'on' ? 1 : 0;
         $this->options['content'] = $_POST['content'];
         $this->options['title'] = $_POST['title'];
         if ($_POST['resetViews'] == 'on') {
             $this->options['cookie'] = 'adx_' . substr(md5(microtime()), 5, 20);
         }
         update_option('adbarx_options', $this->options);
     }
     add_filter('admin_head', array($this, 'adbarx_showEditor'));
     require_once PHPX_DIR . 'phpx_form.php';
     $form = new phpx_form();
     $form->instantReturn = true;
     $text = '<div class="wrap"><h2>Ad Bar X</h2>';
     $text .= $form->startForm('themes.php?page=adbarx/includes/adbarx_functions.php', 'adbarxForm');
     $text .= $form->hidden('nonce', wp_create_nonce('adbarx_admin'));
     print $text;
     the_editor(stripslashes($this->options['content']), 'content');
     $text = '<br /><br />';
     $text .= $form->textField('Bar Title', 'title', $this->options['title']);
     $text .= $form->checkBox('Show Adbar Once', 'showOnce', 1);
     $text .= $form->checkBox('Reset All Views', 'resetViews', 0);
     $text .= $form->endForm();
     $text .= '</div>';
     print $text;
 }
Ejemplo n.º 3
0
 function showPasswordForm()
 {
     if ($_GET['c'] == 1) {
         $this->text = '<div id="loginx_form"><p class="loginx_success">' . parent::loginx_emailTrans($this->options['password_change_success_message'], array('::LINK::' => get_permalink($this->options['profile_page']))) . '</p></div>';
         return true;
     }
     require_once PHPX_DIR . 'phpx_form.php';
     $form = new phpx_form();
     $form->startForm(get_permalink(), 'loginxPasswordForm');
     $form->hidden('nonce', wp_create_nonce('loginx_password'));
     $form->hidden('loginx_form', 1);
     $form->hidden('loginx_password', 1);
     if (parent::loginx_errorMessage()) {
         $form->freeText(parent::loginx_errorMessage('get'), 'loginx_error');
     }
     $form->password('Password', 'user_pass', true, 6);
     $form->password('Confirm Password', 'user_pass_confirm', true, 6, true);
     $this->text .= '<div id="loginx_form">' . $form->endForm() . '</div>';
 }
Ejemplo n.º 4
0
 function crowdx_run()
 {
     if ($_POST['submit']) {
         if (!wp_verify_nonce($_POST["_wpnonce"])) {
             die('Security check');
         }
         $omit = array('_wpnonce', 'submit');
         foreach (array_keys($_POST) as $p) {
             if (!in_array($p, $omit)) {
                 $this->options[$p] = $_POST[$p];
             }
         }
         update_option('crowdx_options', $this->options);
         $status = 'Options Updated';
     }
     $userRoleArray = array();
     $wp_roles = new WP_Roles();
     foreach ($wp_roles->role_names as $role => $name) {
         $userRoleArray[$role] = $name;
     }
     require_once PHPX_DIR . 'phpx_page.php';
     require_once PHPX_DIR . 'phpx_form.php';
     $page = new phpx_page();
     $form = new phpx_form();
     $form->startForm($this->baseURL, "crowdxForm");
     $form->hidden("_wpnonce", wp_create_nonce());
     $form->dropDown('Enabled', 'enable', $this->options['enable'], array('Off', 'On'));
     $form->dropDown('All Users (Internal and Crowd)', 'all_users', $this->options['all_users'], array('Off', 'On'));
     $form->dropDown('Auto Add New Users from Crowd', 'add_users', $this->options['add_users'], array('Off', 'On'));
     $form->dropDown('User Role for Added Users', 'default_user_role', $this->options['default_user_role'], $userRoleArray);
     $form->dropDown('Fallback to Internal Database', 'fallback', $this->options['fallback'], array('Off', 'On'));
     $form->textField('URL to Crowd Server', 'server', $this->options['server']);
     $form->textField('Application Name', 'app_name', $this->options['app_name'], true);
     $form->textField('Application Password', 'app_pass', $this->options['app_pass'], true);
     $form->endForm('Submit');
     $text = $page->startPage('CrowdX Configuration', $status) . $form->text . $page->endPage();
     print $text;
 }
Ejemplo n.º 5
0
 function adminPage()
 {
     if (current_user_can('publish_pages')) {
         if ($_POST['submit']) {
             $omit = array('submit', 'wp_nonce');
             if (!wp_verify_nonce($_POST['wp_nonce'], 'tabx')) {
                 die('Invalid Token');
             }
             foreach ($_POST as $k => $v) {
                 if (!in_array($k, $omit)) {
                     $this->options[$k] = $v;
                 }
             }
             if ($_FILES['image']['name'] != '') {
                 $file = wp_handle_upload($_FILES['image'], array('test_form' => false));
                 $this->options['image'] = $file['url'];
             }
             update_option('tabx_options', $this->options);
             $message = '<p>Options Saved</p>';
         }
         $envArray = array('Development', 'Production');
         require_once PHPX_DIR . 'phpx_form.php';
         $form = new phpx_form();
         $text = '<div class="wrap" id="phpxContainer"><h2>Slide Out Tab</h2>';
         if ($message || $_GET['message']) {
             $text .= $message;
         }
         $text .= $form->startForm('tools.php?page=tabx/tabx.php', 'tabxForm', 'post', true);
         $text .= $form->hidden('wp_nonce', wp_create_nonce('tabx'));
         $text .= $form->textField('Link Text', 'link_text', $this->options['link_text']);
         ob_start();
         wp_editor(stripslashes($this->options['content']), 'tabxcontent', array('textarea_name' => 'content'));
         $text .= $form->freeText(ob_get_contents());
         ob_end_clean();
         $locationArray = array('top' => 'top', 'bottom' => 'bottom', 'left' => 'left', 'right' => 'right');
         $actionArray = array('click' => 'click', 'hover' => 'hover');
         $fixedArray = array('true' => 'True', 'false' => 'False');
         $text .= $form->fileField('Image', 'image');
         $text .= $form->freeText('<strong>Current Image: </strong><br /><img src="' . $this->options['image'] . '" />');
         $text .= $form->textField('Image Height', 'height', $this->options['height']);
         $text .= $form->textField('Image Width', 'width', $this->options['width']);
         $text .= $form->dropDown('Location', 'location', $this->options['location'], $locationArray);
         $text .= $form->textField('Speed', 'speed', $this->options['speed']);
         $text .= $form->dropDown('Action', 'action', $this->options['action'], $actionArray);
         $text .= $form->textField('Top Position', 'top', $this->options['top']);
         $text .= $form->textField('Left Position', 'left', $this->options['left']);
         $text .= $form->dropDown('Fixed Position', 'fixed', $this->options['fixed'], $fixedArray);
         $text .= $form->endForm();
         $text .= '</div>';
         print $text;
     }
 }
Ejemplo n.º 6
0
 function fieldform()
 {
     require_once PHPX_DIR . 'phpx_form.php';
     $form1 = new phpx_form();
     $form1->labels = false;
     $form1->instantReturn = true;
     $text .= $form1->startForm($adminURL, 'loginxFieldForm', 'post', false, 'false');
     $id = 0;
     $reg = 0;
     $req = 0;
     if ($_GET['action'] == 'edit') {
         $row = $this->wpdb->get_row($this->wpdb->prepare('select * from ' . $this->wpdb->prefix . 'loginx_field where loginx_field_id = %d limit 1', $_GET['id']));
         $id = $row->loginx_field_id;
         $req = $row->loginx_field_req;
         $reg = $row->loginx_field_reg;
     }
     $addField = '<table class="inline"><tr><th>Name</th><th>Label</th><th>Type</th><th>Options</th></tr><tr>';
     $addField .= '<td>' . $form1->textField('Name', 'loginx_field_name', $row->loginx_field_name, true) . '</td>';
     $addField .= '<td>' . $form1->textField('Label', 'loginx_field_label', $row->loginx_field_label, true) . '</td>';
     $addField .= '<td>' . $form1->dropDown('Type', 'loginx_field_type', $row->loginx_field_type, $this->fieldTypes, false, true) . '</td>';
     $addField .= '<td>' . $form1->textArea('Options', 'loginx_field_options', $row->loginx_field_options) . '</td>';
     $addField .= '</tr></table>';
     $text .= '<a name="customFields"></a><fieldset><legend>Custom Fields</legend>';
     $text .= $form1->startFieldSet('Add Custom User Field');
     $text .= $form1->hidden('nonce', wp_create_nonce('loginx_manage_fields'));
     $text .= $form1->hidden('loginx_field_id', $id);
     $text .= $form1->freeText($addField);
     $text .= $form1->endForm();
     $text .= '</fieldset>';
     $text .= '<div id="customFieldsList">';
     $text .= '</div>';
     $text .= '</fieldset>';
     return $text;
 }