├── .gitmodules ├── login-redirect-files ├── languages │ ├── login_redirect.mo │ ├── login_redirect.po │ └── login_redirect.pot └── wpmudev-dash-notification.php ├── changelog.txt ├── README.md └── login-redirect.php /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dash-notice"] 2 | path = dash-notice 3 | url = git@bitbucket.org:incsub/wpmudev-dashboard-notification.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /login-redirect-files/languages/login_redirect.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wpmudev/login-redirect/master/login-redirect-files/languages/login_redirect.mo -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | Plugin Name: Login Redirect 2 | Author: WPMUDEV 3 | Lead developer: Maniu 4 | Contributors: Andrew Billits, Ulrich Sossou 5 | 6 | Change Log: 7 | ---------------------------------------------------------------------- 8 | ---------------------------------------------------------------------- 9 | 10 | 1.0.8 - 02/07/2015 11 | ---------------------------------------------------------------------- 12 | - Fixed issues when plugin is network activated 13 | 14 | 1.0.7 - 02/07/2015 15 | ---------------------------------------------------------------------- 16 | - Fixed strict notices 17 | 18 | 1.0.6 - 26/06/2013 19 | ---------------------------------------------------------------------- 20 | - Disabled redirect URL if it does not point to admin URL 21 | 22 | 1.0.5 - 26/06/2013 23 | ---------------------------------------------------------------------- 24 | - Fixed disabling redirect if already specified 25 | 26 | 1.0.4 - 25/06/2013 27 | ---------------------------------------------------------------------- 28 | - Disabled redirect if already specified 29 | 30 | 1.0.3 - 02/02/2011 31 | ---------------------------------------------------------------------- 32 | - New feature: Singlesite support. 33 | - New feature: ability to configure plugin on a per site basis on 34 | Multisite installs. 35 | 36 | 1.0.2 - 01/05/2011 37 | ---------------------------------------------------------------------- 38 | - WP 3.1+ compatibility. 39 | - Add option to network settings. 40 | - Use PHP redirect instead of JavaScript. 41 | - Internationalization. 42 | 43 | 1.0.1 - 09/21/2009 44 | ---------------------------------------------------------------------- 45 | - No longer redirects on password reset pages. 46 | 47 | 1.0.0 - 11/17/2008 48 | ---------------------------------------------------------------------- 49 | - Initial Release. 50 | -------------------------------------------------------------------------------- /login-redirect-files/languages/login_redirect.po: -------------------------------------------------------------------------------- 1 | # Translation of the WordPress plugin Login Redirect 1.0.3 by Andrew Billits, Ulrich Sossou. 2 | # Copyright (C) 2011 Andrew Billits, Ulrich Sossou 3 | # This file is distributed under the same license as the Login Redirect package. 4 | # FIRST AUTHOR , 2011. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: Login Redirect 1.0.3\n" 9 | "Report-Msgid-Bugs-To: http://wordpress.org/tag/login-redirect\n" 10 | "POT-Creation-Date: 2011-02-02 11:21+0100\n" 11 | "PO-Revision-Date: 2013-10-11 14:01+0100\n" 12 | "Last-Translator: FULL NAME \n" 13 | "Language-Team: LANGUAGE \n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=utf-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "X-Generator: Poedit 1.5.5\n" 18 | 19 | #. #-#-#-#-# login-redirect.pot (Login Redirect 1.0.3) #-#-#-#-# 20 | #. Plugin Name of the plugin/theme 21 | #: login-redirect.php:86 login-redirect.php:114 22 | msgid "Login Redirect" 23 | msgstr "" 24 | 25 | #: login-redirect.php:89 login-redirect.php:116 26 | msgid "Redirect to" 27 | msgstr "" 28 | 29 | #: login-redirect.php:93 30 | msgid "The URL users will be redirected to after login." 31 | msgstr "" 32 | 33 | #: login-redirect.php:156 34 | msgid "" 35 | "Please install the latest version of our free " 37 | "Update Notifications plugin which helps you stay up-to-date with the " 38 | "most stable, secure versions of WPMU DEV themes and plugins. More information »" 41 | msgstr "" 42 | 43 | #. Plugin URI of the plugin/theme 44 | msgid "http://premium.wpmudev.org/project/login-redirect" 45 | msgstr "" 46 | 47 | #. Description of the plugin/theme 48 | msgid "" 49 | "Redirects users to specified url after they've logged in, replacing the " 50 | "default 'go to dashboard' behavior." 51 | msgstr "" 52 | 53 | #. Author of the plugin/theme 54 | msgid "Andrew Billits, Ulrich Sossou" 55 | msgstr "" 56 | 57 | #. Author URI of the plugin/theme 58 | msgid "http://premium.wpmudev.org/" 59 | msgstr "" 60 | -------------------------------------------------------------------------------- /login-redirect-files/languages/login_redirect.pot: -------------------------------------------------------------------------------- 1 | # Translation of the WordPress plugin Login Redirect 1.0.3 by Andrew Billits, Ulrich Sossou. 2 | # Copyright (C) 2011 Andrew Billits, Ulrich Sossou 3 | # This file is distributed under the same license as the Login Redirect package. 4 | # FIRST AUTHOR , 2011. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: Login Redirect 1.0.3\n" 10 | "Report-Msgid-Bugs-To: http://wordpress.org/tag/login-redirect\n" 11 | "POT-Creation-Date: 2011-02-02 11:21+0100\n" 12 | "PO-Revision-Date: 2011-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=utf-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #. #-#-#-#-# login-redirect.pot (Login Redirect 1.0.3) #-#-#-#-# 21 | #. Plugin Name of the plugin/theme 22 | #: login-redirect.php:86 login-redirect.php:114 23 | msgid "Login Redirect" 24 | msgstr "" 25 | 26 | #: login-redirect.php:89 login-redirect.php:116 27 | msgid "Redirect to" 28 | msgstr "" 29 | 30 | #: login-redirect.php:93 31 | msgid "The URL users will be redirected to after login." 32 | msgstr "" 33 | 34 | #: login-redirect.php:156 35 | msgid "" 36 | "Please install the latest version of our free " 38 | "Update Notifications plugin which helps you stay up-to-date with the " 39 | "most stable, secure versions of WPMU DEV themes and plugins. More information »" 42 | msgstr "" 43 | 44 | #. Plugin URI of the plugin/theme 45 | msgid "http://premium.wpmudev.org/project/login-redirect" 46 | msgstr "" 47 | 48 | #. Description of the plugin/theme 49 | msgid "" 50 | "Redirects users to specified url after they've logged in, replacing the " 51 | "default 'go to dashboard' behavior." 52 | msgstr "" 53 | 54 | #. Author of the plugin/theme 55 | msgid "Andrew Billits, Ulrich Sossou" 56 | msgstr "" 57 | 58 | #. Author URI of the plugin/theme 59 | msgid "http://premium.wpmudev.org/" 60 | msgstr "" 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Login Redirect 2 | 3 | **INACTIVE NOTICE: This plugin is unsupported by WPMUDEV, we've published it here for those technical types who might want to fork and maintain it for their needs.** 4 | 5 | ## Translations 6 | 7 | Translation files can be found at https://github.com/wpmudev/translations 8 | 9 | ## Login Redirect points users to any url you choose when logging in to your site. 10 | 11 | ### A More Efficient Workflow 12 | 13 | By default WordPress sends users to the dashboard. Create a more efficient user experience by sending users exactly where you need them to land when logging in. 14 | 15 | ![Add New Post ](http://premium.wpmudev.org/wp-content/uploads/2008/11/Add-New-Post-‹-CowPat.Net-—-WordPress.jpg) 16 | 17 | Choose send users to create a new post 18 | 19 | ### Set It and Forget It 20 | 21 | Use Login Redirect to direct new logins to a page of your choosing. 22 | 23 | ![login-redirect](http://premium.wpmudev.org/wp-content/uploads/2008/11/login-redirect.jpg) 24 | 25 | Simply paste a url of your choosing 26 | 27 | It's simple, fast and convenient. With Login Redirect you can point users anywhere you like on login – in seconds. 28 | 29 | ## Usage 30 | 31 | For help with installing plugins please refer to our [Plugin installation guide](https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/). Once installed login to your admin panel for WordPress or Multisite and activate the plugin: 32 | 33 | * On regular WordPress installs – visit **Plugins** and **Activate** the plugin. 34 | * For WordPress Multisite installs – Activate it blog-by-blog (say if you wanted to make it a Pro Sites plugin), or visit **Network Admin -> Plugins** and **Network Activate** the plugin. 35 | 36 | _Please Note:_ 37 | 38 | * _Not compatible with BuddyPress_ 39 | 40 | ### To Use: 41 | 42 | When activated on regular WordPress or on a site-by-site basis on WordPress Multisite, simply head to **Settings --> General** and add the URL in the text field labeled "Login Redirect" When network activated on Multisite, simply head to **Network Admin --> Settings --> Network Settings** and add the URL in the text field labeled "Login Redirect" 43 | 44 | ![Login Redirect Setting](https://premium.wpmudev.org/wp-content/uploads/2008/11/General-Settings-‹-CowPat.Net-—-WordPress.jpg "Login Redirect Setting") 45 | 46 | Thats it, all done! 47 | -------------------------------------------------------------------------------- /login-redirect-files/wpmudev-dash-notification.php: -------------------------------------------------------------------------------- 1 | slug, 'install_wpmudev_dash') !== false ) { 31 | $res = new stdClass; 32 | $res->name = 'WPMU DEV Dashboard'; 33 | $res->slug = 'wpmu-dev-dashboard'; 34 | $res->version = ''; 35 | $res->rating = 100; 36 | $res->homepage = 'http://premium.wpmudev.org/project/wpmu-dev-dashboard/'; 37 | $res->download_link = "http://premium.wpmudev.org/wdp-un.php?action=install_wpmudev_dash"; 38 | $res->tested = $cur_wp_version; 39 | 40 | return $res; 41 | } 42 | 43 | return false; 44 | } 45 | 46 | function auto_install_url() { 47 | $function = is_multisite() ? 'network_admin_url' : 'admin_url'; 48 | return wp_nonce_url($function("update.php?action=install-plugin&plugin=install_wpmudev_dash"), "install-plugin_install_wpmudev_dash"); 49 | } 50 | 51 | function activate_url() { 52 | $function = is_multisite() ? 'network_admin_url' : 'admin_url'; 53 | return wp_nonce_url($function('plugins.php?action=activate&plugin=wpmudev-updates%2Fupdate-notifications.php'), 'activate-plugin_wpmudev-updates/update-notifications.php'); 54 | } 55 | 56 | function install_notice() { 57 | echo '

' . sprintf(__('Easily get updates, support, and one-click WPMU DEV plugin/theme installations right from in your dashboard - install the free WPMU DEV Dashboard plugin.    (find out more)', 'wpmudev'), $this->auto_install_url()) . '

'; 58 | } 59 | 60 | function activate_notice() { 61 | echo '

' . sprintf(__('Updates, Support, Premium Plugins, Community - activate the WPMU DEV Dashboard plugin now.', 'wpmudev'), $this->activate_url()) . '

'; 62 | } 63 | 64 | } 65 | new WPMUDEV_Dashboard_Notice(); 66 | } 67 | ?> -------------------------------------------------------------------------------- /login-redirect.php: -------------------------------------------------------------------------------- 1 | is_plugin_active_for_network( plugin_basename( __FILE__ ) )) { 42 | add_action( 'wpmu_options', array( &$this, 'network_option' ) ); 43 | add_action( 'update_wpmu_options', array( &$this, 'update_network_option' ) ); 44 | } 45 | add_action( 'admin_init', array( &$this, 'add_settings_field' ) ); 46 | 47 | add_action( 'plugins_loaded', array( &$this, 'load_translation' ) ); 48 | } 49 | 50 | function load_translation() { 51 | // load text domain 52 | if ( defined( 'WPMU_PLUGIN_DIR' ) && file_exists( WPMU_PLUGIN_DIR . '/login-redirect.php' ) ) { 53 | load_muplugin_textdomain( 'login_redirect', 'login-redirect-files/languages' ); 54 | } else { 55 | load_plugin_textdomain( 'login_redirect', false, dirname( plugin_basename( __FILE__ ) ) . '/login-redirect-files/languages' ); 56 | } 57 | } 58 | 59 | /** 60 | * Redirect user on login 61 | **/ 62 | function redirect( $redirect_to, $requested_redirect_to, $user ) { 63 | $interim_login = isset( $_REQUEST['interim-login'] ); 64 | $reauth = empty( $_REQUEST['reauth'] ) ? false : true; 65 | 66 | if( $this->is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) 67 | $login_redirect_url = get_site_option( 'login_redirect_url' ); 68 | else 69 | $login_redirect_url = get_option( 'login_redirect_url' ); 70 | 71 | if ( !is_wp_error( $user ) && !$reauth && !$interim_login && !empty( $login_redirect_url ) ) { 72 | wp_redirect( $login_redirect_url ); 73 | exit(); 74 | } 75 | 76 | return $redirect_to; 77 | } 78 | 79 | /** 80 | * Network option 81 | **/ 82 | function network_option() { 83 | ?> 84 |

85 | 86 | 87 | 88 | 93 | 94 |
89 | 90 |
91 | 92 |
95 | is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) 110 | return; 111 | 112 | add_settings_section( 'login_redirect_setting_section', __( 'Login Redirect', 'login_redirect' ), '__return_false', 'general' ); 113 | 114 | add_settings_field( 'login_redirect_url', __( 'Redirect to', 'login_redirect' ), array( &$this, 'site_option' ), 'general', 'login_redirect_setting_section' ); 115 | 116 | register_setting( 'general', 'login_redirect_url' ); 117 | } 118 | 119 | /** 120 | * Setting field for singlesite 121 | **/ 122 | function site_option() { 123 | echo ''; 124 | } 125 | 126 | /** 127 | * Verify if plugin is network activated 128 | **/ 129 | function is_plugin_active_for_network( $plugin ) { 130 | if ( !is_multisite() ) 131 | return false; 132 | 133 | $plugins = get_site_option( 'active_sitewide_plugins'); 134 | if ( isset($plugins[$plugin]) ) 135 | return true; 136 | 137 | return false; 138 | } 139 | 140 | } 141 | 142 | $login_redirect = new Login_Redirect(); 143 | --------------------------------------------------------------------------------