title = __("Login", "dagsopt"); $this->pluginname = $ns->pluginname; $this->file = $ns->file; $this->ns = $ns; } function start() { add_action('init', array(&$this, 'override_reset_password_form_redirect')); add_filter('login_headerurl', array(&$this, 'login_headerurl')); add_filter('login_headertext', array(&$this, 'login_headertext')); add_filter('login_message', array(&$this, 'login_message')); add_action('register_form', array(&$this, 'plugin_form')); if (defined("WP_SITEURL") && defined('WP_SITEURL_CDN')) { add_filter('stylesheet_directory_uri', array(&$this, 'l_stylesheet_directory_uri')); } add_action('login_head', array(&$this, 'login_head')); add_action('admin_enqueue_scripts', function () { /* if possible try not to queue this all over the admin by adding your settings GET page val into next if( empty( $_GET['page'] ) || "my-settings-page" !== $_GET['page'] ) { return; } */ wp_enqueue_media(); }); add_filter('upload_mimes', function ($mime_types) { $mime_types['m4a'] = 'audio/m4a'; // $mime_types['m4v'] = 'video/mp4'; // $mime_types['svg'] = 'image/svg+xml'; // Adding .svg extension $mime_types['json'] = 'application/json'; // Adding .json extension // unset( $mime_types['xls'] ); // Remove .xls extension // unset( $mime_types['xlsx'] ); // Remove .xlsx extension return $mime_types; }, 1, 1); add_action('admin_footer', function () { /* if possible try not to queue this all over the admin by adding your settings GET page val into next if( empty( $_GET['page'] ) || "my-settings-page" !== $_GET['page'] ) { return; } */ ?> $value) { if (stristr($key, "wp-resetpass")) { $v = explode(":", $value); $login = array_shift($v); } # code... } //print_r($GLOBALS); //wp_redirect(site_url('/wp-login.php') . '?action=welcome&user_login=' . $login); //exit; } } } function get_page_by_name($post_name, $output = OBJECT) { global $wpdb; $post = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type='page'", $post_name)); if ($post) { return get_post($post, $output); } return null; } function l_stylesheet_directory_uri($t) { return str_replace(WP_SITEURL, WP_SITEURL_CDN, $t); } function login_headerurl($t) { return "/"; } function login_headertext($t) { return "Til forsiden"; } function login_message($t) { $login = ""; foreach ($_COOKIE as $key => $value) { if (stristr($key, "wp-resetpass")) { $v = explode(":", $value); $login = array_shift($v); } } $str = '

'; if (isset($_GET['action'])) { $type = isset($_GET['type']) ? $_GET['type'] : 'default'; if ($type !== "default") { //print_r($args); $page = $this->get_page_by_name($type); if ($page) { $str .= apply_filters('the_content', $page->post_content); } else { $str .= get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false); } } else { $str .= get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false); } } else { $str .= get_option($this->pluginname . "_login_support_splash", false); } $str .= '

'; return $str; } function help() { ?> ","".$tt->post_content); //$listen = array_pop($arra); $content = ""; //$arr = explode("\n","".$listen); $arr = explode("\n", get_option($this->pluginname . "_login_groups", false)); /* $sel = ''; */ $sel = ''; $html = '
' . $content . '

' . $sel . '

'; echo $html; } function Option($pre) { update_option($pre . '_support_splash', $_POST[$pre . '_support_splash']); update_option($pre . '_support_splash_rp', $_POST[$pre . '_support_splash_rp']); update_option($pre . '_support_splash_welcome', $_POST[$pre . '_support_splash_welcome']); update_option($pre . '_support_splash_resetpass', $_POST[$pre . '_support_splash_resetpass']); update_option($pre . '_support_splash_register', $_POST[$pre . '_support_splash_register']); update_option($pre . '_background_image', $_POST[$pre . '_background_image']); update_option($pre . '_image', $_POST[$pre . '_image']); update_option($pre . '_groups', $_POST[$pre . '_groups']); } function admin_line($pre) { ?>
">

" />
">

" />












dagsopt['plug_login'] = $plug_login; }