Admin Custom Login - Version 2.5.0

Version Description

  • New: Redirect user after successfull login to custom URL other than admin
Download this release

Release Info

Developer weblizar
Plugin Icon 128x128 Admin Custom Login
Version 2.5.0
Comparing to
See all releases

Code changes from version 2.4.9.1 to 2.5.0

admin-custom-login.php CHANGED
@@ -1,18 +1,53 @@
1
  <?php
2
  /**
3
  * Plugin Name: Admin Custom Login
4
- * Version: 2.4.9.1
5
  * Description: Customize Your WordPress Login Screen Amazingly
6
  * Author: Weblizar
7
  * Author URI: http://weblizar.com/plugins/
8
  * Plugin URI: http://weblizar.com/plugins/
9
  */
 
10
  // Exit if accessed directly
11
  if ( ! defined( 'ABSPATH' ) ) exit;
12
-
13
  define("WEBLIZAR_NALF_PLUGIN_URL", plugin_dir_url(__FILE__));
14
  define("WEBLIZAR_ACL", "WEBLIZAR_ACL" );
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  add_action('plugins_loaded', 'ACL_GetReadyTranslation');
17
  function ACL_GetReadyTranslation() {
18
  load_plugin_textdomain(WEBLIZAR_ACL, FALSE, dirname( plugin_basename(__FILE__)).'/languages/' );
1
  <?php
2
  /**
3
  * Plugin Name: Admin Custom Login
4
+ * Version: 2.5.0
5
  * Description: Customize Your WordPress Login Screen Amazingly
6
  * Author: Weblizar
7
  * Author URI: http://weblizar.com/plugins/
8
  * Plugin URI: http://weblizar.com/plugins/
9
  */
10
+
11
  // Exit if accessed directly
12
  if ( ! defined( 'ABSPATH' ) ) exit;
 
13
  define("WEBLIZAR_NALF_PLUGIN_URL", plugin_dir_url(__FILE__));
14
  define("WEBLIZAR_ACL", "WEBLIZAR_ACL" );
15
 
16
+ /**
17
+ * Redirect user after successful login.
18
+ *
19
+ * @param string $redirect_to URL to redirect to.
20
+ * @param string $request URL the user is coming from.
21
+ * @param object $user Logged user's data.
22
+ * @return string
23
+ */
24
+ function ACL_login_redirect( $redirect_to, $request, $user ) {
25
+ //is there a user to check?
26
+ if ( isset( $user->roles ) && is_array( $user->roles ) ) {
27
+
28
+ // get and load custom rerdirect option after user login
29
+ $login_page = unserialize(get_option('Admin_custome_login_login'));
30
+ $login_redirect_user = $login_page['login_redirect_user'];
31
+
32
+ //check for admins
33
+ if ( in_array( 'administrator', $user->roles ) ) {
34
+ // redirect admin to the default place
35
+ return $redirect_to;
36
+ } else {
37
+ // redirect users to another place
38
+ if($login_redirect_user != "") {
39
+ return $login_redirect_user;
40
+ } else {
41
+ return $redirect_to;
42
+ }
43
+ }
44
+ } else {
45
+ return $redirect_to;
46
+ }
47
+ }
48
+ add_filter( 'login_redirect', 'ACL_login_redirect', 10, 3 );
49
+
50
+ // load plugin translation
51
  add_action('plugins_loaded', 'ACL_GetReadyTranslation');
52
  function ACL_GetReadyTranslation() {
53
  load_plugin_textdomain(WEBLIZAR_ACL, FALSE, dirname( plugin_basename(__FILE__)).'/languages/' );
includes/Login-form-setting/Login-form-background.php CHANGED
@@ -162,9 +162,7 @@ function loginbgchange() {
162
  }
163
  }
164
  </script>
165
- <style>
166
-
167
- </style>
168
  <div class="row">
169
  <div class="post-social-wrapper clearfix">
170
  <div class="col-md-12 post-social-item">
@@ -545,6 +543,22 @@ function loginbgchange() {
545
  </table>
546
  </div>
547
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
  <div class="panel panel-primary panel-default content-panel">
549
  <div class="panel-body">
550
  <table class="form-table">
@@ -653,6 +667,7 @@ function loginbgchange() {
653
  var login_bg_repeat = jQuery( "#login_bg_repeat option:selected" ).val();
654
  var login_bg_position = jQuery( "#login_bg_position option:selected" ).val();
655
  var login_custom_css = jQuery( "#login_custom_css").val();
 
656
  if (document.getElementById('login_enable_shadow1').checked) {
657
  var login_enable_shadow = document.getElementById('login_enable_shadow1').value;
658
  }
@@ -662,7 +677,7 @@ function loginbgchange() {
662
  var login_shadow_color = jQuery("#login_shadow_color").val();
663
 
664
 
665
- var PostData = "Action=" + Action + "&login_form_position=" + login_form_position + "&Login_bg_value=" + Login_bg_value + "&login_background_color=" + login_background_color + "&login_bg_color_overlay=" + login_bg_color_overlay + "&login_bg_image=" + login_bg_image + "&login_form_opacity=" + login_form_opacity + "&login_form_width=" + login_form_width + "&login_form_radius=" + login_form_radius + "&login_border_style=" + login_border_style + "&login_border_thikness=" + login_border_thikness + "&login_border_color=" + login_border_color + "&login_bg_repeat=" + login_bg_repeat + "&login_bg_position=" + login_bg_position + "&login_enable_shadow=" + login_enable_shadow + "&login_shadow_color=" + login_shadow_color + "&login_custom_css=" + login_custom_css + "&login_form_left=" + login_form_left + "&login_form_top=" + login_form_top + "&login_form_float=" + login_form_float;
666
  jQuery.ajax({
667
  dataType : 'html',
668
  type: 'POST',
@@ -756,9 +771,11 @@ function loginbgchange() {
756
  jQuery(document).ready( function() {
757
  jQuery('input[name=enable_form_shadow]').val(['yes']);
758
  //login Custom Css
759
-
760
  jQuery("#login_custom_css").val('');
761
- });
 
 
 
762
  //Login Image
763
  document.getElementById("login_bg_image").value ="<?php echo WEBLIZAR_NALF_PLUGIN_URL?>/images/3d-background.jpg";
764
  // Login From Background Color
@@ -814,6 +831,7 @@ function loginbgchange() {
814
  $login_enable_shadow = sanitize_option('login_enable_shadow', $_POST['login_enable_shadow']);
815
  $login_shadow_color = sanitize_option('login_shadow_color', $_POST['login_shadow_color']);
816
  $login_custom_css = sanitize_option('login_custom_css', $_POST['login_custom_css']);
 
817
 
818
 
819
  // Save Values in Option Table
@@ -837,6 +855,7 @@ function loginbgchange() {
837
  'login_enable_shadow' => $login_enable_shadow,
838
  'login_shadow_color' => $login_shadow_color,
839
  'login_custom_css' => $login_custom_css,
 
840
 
841
  ));
842
  update_option('Admin_custome_login_login', $login_page);
@@ -863,6 +882,7 @@ function loginbgchange() {
863
  'login_enable_shadow' => 'yes',
864
  'login_shadow_color' => '#C8C8C8',
865
  'login_custom_css' => '',
 
866
  ));
867
  update_option('Admin_custome_login_login', $login_page);
868
  }
162
  }
163
  }
164
  </script>
165
+
 
 
166
  <div class="row">
167
  <div class="post-social-wrapper clearfix">
168
  <div class="col-md-12 post-social-item">
543
  </table>
544
  </div>
545
  </div>
546
+ <div class="panel panel-primary panel-default content-panel">
547
+ <div class="panel-body">
548
+ <table class="form-table">
549
+ <tr>
550
+ <th scope="row" ><?php _e('Redirect Users other than Admin','WEBLIZAR_ACL')?></th>
551
+ <td></td>
552
+ </tr>
553
+ <tr class="radio-span" style="border-bottom:none;">
554
+ <td>
555
+ <input type="text" class="login_redirect_user" id="login_redirect_user" name="login_redirect_user" placeholder="Redirect URL" size="56" value="<?php echo $login_redirect_user; ?>"><br>
556
+ <span style="color:#ef4238"> Enter the URL to redirect users after login other than Admin</span>
557
+ </td>
558
+ </tr>
559
+ </table>
560
+ </div>
561
+ </div>
562
  <div class="panel panel-primary panel-default content-panel">
563
  <div class="panel-body">
564
  <table class="form-table">
667
  var login_bg_repeat = jQuery( "#login_bg_repeat option:selected" ).val();
668
  var login_bg_position = jQuery( "#login_bg_position option:selected" ).val();
669
  var login_custom_css = jQuery( "#login_custom_css").val();
670
+ var login_redirect_user = jQuery( "#login_redirect_user").val();
671
  if (document.getElementById('login_enable_shadow1').checked) {
672
  var login_enable_shadow = document.getElementById('login_enable_shadow1').value;
673
  }
677
  var login_shadow_color = jQuery("#login_shadow_color").val();
678
 
679
 
680
+ var PostData = "Action=" + Action + "&login_form_position=" + login_form_position + "&Login_bg_value=" + Login_bg_value + "&login_background_color=" + login_background_color + "&login_bg_color_overlay=" + login_bg_color_overlay + "&login_bg_image=" + login_bg_image + "&login_form_opacity=" + login_form_opacity + "&login_form_width=" + login_form_width + "&login_form_radius=" + login_form_radius + "&login_border_style=" + login_border_style + "&login_border_thikness=" + login_border_thikness + "&login_border_color=" + login_border_color + "&login_bg_repeat=" + login_bg_repeat + "&login_bg_position=" + login_bg_position + "&login_enable_shadow=" + login_enable_shadow + "&login_shadow_color=" + login_shadow_color + "&login_custom_css=" + login_custom_css + "&login_redirect_user=" + login_redirect_user +"&login_form_left=" + login_form_left + "&login_form_top=" + login_form_top + "&login_form_float=" + login_form_float;
681
  jQuery.ajax({
682
  dataType : 'html',
683
  type: 'POST',
771
  jQuery(document).ready( function() {
772
  jQuery('input[name=enable_form_shadow]').val(['yes']);
773
  //login Custom Css
 
774
  jQuery("#login_custom_css").val('');
775
+
776
+ //login Redirect User
777
+ jQuery("#login_redirect_user").val('');
778
+ });
779
  //Login Image
780
  document.getElementById("login_bg_image").value ="<?php echo WEBLIZAR_NALF_PLUGIN_URL?>/images/3d-background.jpg";
781
  // Login From Background Color
831
  $login_enable_shadow = sanitize_option('login_enable_shadow', $_POST['login_enable_shadow']);
832
  $login_shadow_color = sanitize_option('login_shadow_color', $_POST['login_shadow_color']);
833
  $login_custom_css = sanitize_option('login_custom_css', $_POST['login_custom_css']);
834
+ $login_redirect_user = sanitize_option('login_redirect_user', $_POST['login_redirect_user']);
835
 
836
 
837
  // Save Values in Option Table
855
  'login_enable_shadow' => $login_enable_shadow,
856
  'login_shadow_color' => $login_shadow_color,
857
  'login_custom_css' => $login_custom_css,
858
+ 'login_redirect_user' => $login_redirect_user,
859
 
860
  ));
861
  update_option('Admin_custome_login_login', $login_page);
882
  'login_enable_shadow' => 'yes',
883
  'login_shadow_color' => '#C8C8C8',
884
  'login_custom_css' => '',
885
+ 'login_redirect_user' => '',
886
  ));
887
  update_option('Admin_custome_login_login', $login_page);
888
  }
includes/get_value.php CHANGED
@@ -41,6 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
41
  $login_enable_shadow=$login_page['login_enable_shadow'];
42
  $login_shadow_color=$login_page['login_shadow_color'];
43
  $login_custom_css=$login_page['login_custom_css'];
 
44
 
45
  // Get value of Text and Color page
46
  $text_and_color_page = unserialize(get_option('Admin_custome_login_text'));
41
  $login_enable_shadow=$login_page['login_enable_shadow'];
42
  $login_shadow_color=$login_page['login_shadow_color'];
43
  $login_custom_css=$login_page['login_custom_css'];
44
+ $login_redirect_user=$login_page['login_redirect_user'];
45
 
46
  // Get value of Text and Color page
47
  $text_and_color_page = unserialize(get_option('Admin_custome_login_text'));
installation.php CHANGED
@@ -35,6 +35,7 @@ if(!isset($Version)){
35
  'login_form_left'=>'700',
36
  'login_form_top'=>'300',
37
  'login_custom_css'=>'',
 
38
  'login_bg_type'=>'static-background-image',
39
  'login_bg_color' => '#1e73be',
40
  'login_bg_effect' => 'pattern-1',
@@ -121,4 +122,4 @@ if(!isset($Version)){
121
  ));
122
  add_option("Admin_custome_login_Slidshow", $Slidshow_image);
123
  }
124
- ?>
35
  'login_form_left'=>'700',
36
  'login_form_top'=>'300',
37
  'login_custom_css'=>'',
38
+ 'login_redirect_user'=>'',
39
  'login_bg_type'=>'static-background-image',
40
  'login_bg_color' => '#1e73be',
41
  'login_bg_effect' => 'pattern-1',
122
  ));
123
  add_option("Admin_custome_login_Slidshow", $Slidshow_image);
124
  }
125
+ ?>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Customize WordPress Login Page ===
2
  Contributors: weblizar
3
  Donate link: http://www.weblizar.com/
4
- Tags: admin, admin login, admin login page, customize, admin custom login, custom login, branding, custom login, custom login pro, customization, error, login, login error, logo, customization, themes, wordpress login, login form, admin login form, wordpress login, plugin, jquery form, jquery, customization, customizer, custom login plugin, background , sideshow, social form, social connect, social share, facebook, twitter, google plug, linkedin, background slideshow, image, logo, custom logo, wordpress admin login, wp login, wp-login, log in, admin, role, subscriber, captcha, security login, customize wordpress login form, wp login form, login form plugin, ogin page, logo, style log in, style login, themes, custom login page, css , html, form style,
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
- Stable tag: 2.4.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -34,6 +34,7 @@ Guys please send us your login screenshots at `lizarweb[at]gmail[dot]com`.
34
  > * Login Form Button Colour
35
  > * Login Form Button Size
36
  > * Login Form Background
 
37
  > * Add Social Media Icon On Login Form
38
  > * Social Media Icon Colour
39
  > * Social Media Icon Size
@@ -111,14 +112,15 @@ If you have any question contact us at here: [Plugin Support Forum ](http://word
111
  3. Custom Login Page Preview 3
112
  4. Custom Login Page Preview 4
113
  5. Custom Login Page Preview 5
114
- 6. http://texasbutter.com Contributed by Shawn McNair
115
- 7. http://texasbutter.com Contributed by Shawn McNair
116
- 8. Admin Setting Dashboard
 
117
 
118
  == Changelog ==
119
 
120
  For more information, see [Weblizar](http://wwww.weblizar.com/)
121
-
122
  = 2.4.9.1 - Social icons position bug fixed, Logo fade in bug fixed with background slide show
123
  = 2.4.9 - More secure code structure added
124
  = 2.4.8 - All setting fields are sanitizied, Plugin setting are now more seciure from malicious script
@@ -236,4 +238,4 @@ Please contribute to translate our plugin. Contact at `lizarweb (at) gmail (dot
236
 
237
  == Frequently Asked Questions ==
238
 
239
- Please use WordPress [support forum](http://wordpress.org/support/plugin/admin-custom-login) to ask any query regarding any issue.
1
  === Customize WordPress Login Page ===
2
  Contributors: weblizar
3
  Donate link: http://www.weblizar.com/
4
+ Tags: custom login page, custom admin login, custom login, customize wordpress login page, wordpress login
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
+ Stable tag: 2.5.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
34
  > * Login Form Button Colour
35
  > * Login Form Button Size
36
  > * Login Form Background
37
+ > * Redirect Users like (All Subscribers, Editors, Authors and Contributors) on Custom URL
38
  > * Add Social Media Icon On Login Form
39
  > * Social Media Icon Colour
40
  > * Social Media Icon Size
112
  3. Custom Login Page Preview 3
113
  4. Custom Login Page Preview 4
114
  5. Custom Login Page Preview 5
115
+ 6. http://texasbutter.com Made by Shawn McNair
116
+ 7. http://texasbutter.com Made by Shawn McNair
117
+ 8. http://www.naturesfolio.com Made by Sheila
118
+ 9. Admin Setting Dashboard
119
 
120
  == Changelog ==
121
 
122
  For more information, see [Weblizar](http://wwww.weblizar.com/)
123
+ = 2.5.0 - New: Redirect user after successfull login to custom URL other than admin
124
  = 2.4.9.1 - Social icons position bug fixed, Logo fade in bug fixed with background slide show
125
  = 2.4.9 - More secure code structure added
126
  = 2.4.8 - All setting fields are sanitizied, Plugin setting are now more seciure from malicious script
238
 
239
  == Frequently Asked Questions ==
240
 
241
+ Please use WordPress [support forum](http://wordpress.org/support/plugin/admin-custom-login) to ask any query regarding any issue.