Google Apps Login - Version 3.3

Version Description

Added permission check functionality Added Google Drive Embedder insufficient permission error fixes Added Login With Google buttons branding Updated compatibility with the WordPress 5.3.1 release

Download this release

Release Info

Developer levertechadmin
Plugin Icon 128x128 Google Apps Login
Version 3.3
Comparing to
See all releases

Code changes from version 3.2 to 3.3

core/core_google_apps_login.php CHANGED
@@ -93,7 +93,18 @@ class core_google_apps_login {
93
  }
94
 
95
  protected function get_default_scopes() {
96
- return Array('openid', 'email', 'https://www.googleapis.com/auth/userinfo.profile');
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
 
99
  public function ga_login_styles() {
@@ -111,9 +122,13 @@ class core_google_apps_login {
111
  vertical-align: middle;
112
  border-radius: 3px;
113
  padding: 4px;
114
- height: 27px;
115
  font-size: 14px;
116
- margin-bottom: <?php echo $options['ga_poweredby'] ? '6' : '16' ?>px;
 
 
 
 
 
117
  }
118
 
119
  form#loginform p.galogin a {
@@ -154,10 +169,17 @@ class core_google_apps_login {
154
  div#login form#loginform p.submit,
155
  div#login p#nav {
156
  display: none;
157
- }
158
 
159
  <?php } ?>
160
-
 
 
 
 
 
 
 
161
  </style>
162
  <?php }
163
 
@@ -218,9 +240,16 @@ class core_google_apps_login {
218
  }
219
 
220
  ?>
221
- <p class="galogin">
222
- <a href="<?php echo $authUrl; ?>"><?php echo esc_html($this->get_login_button_text()); ?></a>
 
 
 
 
 
 
223
  </p>
 
224
 
225
  <?php if ($options['ga_poweredby']) { ?>
226
  <p class='galogin-powered'><?php esc_html_e( 'Powered by ' , 'google-apps-login'); ?><a href='http://wp-glogin.com/?utm_source=Login%20Form&utm_medium=freemium&utm_campaign=LoginForm' target="_blank">wp-glogin.com</a></p>
@@ -890,7 +919,6 @@ class core_google_apps_login {
890
  echo '</p>';
891
 
892
  $options = $this->get_option_galogin();
893
-
894
  echo "<input id='input_ga_force_permissions' name='".$this->get_options_name()."[ga_force_permissions]' type='checkbox' ".($options['ga_force_permissions'] ? 'checked' : '')." class='checkbox' />";
895
  echo '<label for="input_ga_force_permissions" class="checkbox plain">';
896
  _e( 'Force user to confirm Google permissions every time' , 'google-apps-login' );
@@ -919,7 +947,46 @@ class core_google_apps_login {
919
  echo '<label for="input_ga_poweredby" class="checkbox plain">';
920
  _e( 'Display \'Powered By wp-glogin.com\' on Login form' , 'google-apps-login' );
921
  echo '</label>';
 
 
 
 
 
 
922
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
923
  $this->ga_advancedsection_extra();
924
 
925
  echo '<br class="clear" />';
@@ -966,12 +1033,14 @@ class core_google_apps_login {
966
  'error'
967
  );
968
  }
 
969
  $newinput['ga_ms_usesubsitecallback'] = isset($input['ga_ms_usesubsitecallback']) ? (boolean)$input['ga_ms_usesubsitecallback'] : false;
970
  $newinput['ga_force_permissions'] = isset($input['ga_force_permissions']) ? (boolean)$input['ga_force_permissions'] : false;
971
  $newinput['ga_auto_login'] = isset($input['ga_auto_login']) ? (boolean)$input['ga_auto_login'] : false;
972
  $newinput['ga_poweredby'] = isset($input['ga_poweredby']) ? (boolean)$input['ga_poweredby'] : false;
973
  $newinput['ga_rememberme'] = isset($input['ga_rememberme']) ? (boolean)$input['ga_rememberme'] : false;
974
-
 
975
  // Service account settings
976
  $newinput['ga_domainadmin'] = isset($input['ga_domainadmin']) ? trim($input['ga_domainadmin']) : '';
977
  if (!preg_match('/^([A-Za-z0-9._%+-]+@([0-9a-z-]+\.)*[0-9a-z-]+\.[a-z]{2,63})?$/', $newinput['ga_domainadmin'])) {
@@ -1052,6 +1121,7 @@ class core_google_apps_login {
1052
  'ga_force_permissions' => false,
1053
  'ga_auto_login' => false,
1054
  'ga_poweredby' => false,
 
1055
  'ga_rememberme' => false,
1056
  'ga_sakey' => '',
1057
  'ga_domainadmin' => '');
93
  }
94
 
95
  protected function get_default_scopes() {
96
+ if (class_exists('core_google_drive_embedder')) {
97
+ return Array(
98
+ 'openid',
99
+ 'email',
100
+ 'https://www.googleapis.com/auth/userinfo.profile',
101
+ 'https://www.googleapis.com/auth/drive',
102
+ 'https://www.googleapis.com/auth/drive.install',
103
+ 'https://www.googleapis.com/auth/calendar.readonly'
104
+ );
105
+ }else{
106
+ return Array('openid', 'email', 'https://www.googleapis.com/auth/userinfo.profile');
107
+ }
108
  }
109
 
110
  public function ga_login_styles() {
122
  vertical-align: middle;
123
  border-radius: 3px;
124
  padding: 4px;
 
125
  font-size: 14px;
126
+ margin-bottom: 0px;
127
+ overflow: hidden;
128
+ display: flex;
129
+ justify-content: center;
130
+ align-items: center;
131
+ height: auto;
132
  }
133
 
134
  form#loginform p.galogin a {
169
  div#login form#loginform p.submit,
170
  div#login p#nav {
171
  display: none;
172
+ }
173
 
174
  <?php } ?>
175
+ p.galogin a {
176
+ width: 100%;
177
+ height: 100%;
178
+ clear: both;
179
+ }
180
+ p.galogin a:focus {
181
+ box-shadow: none;
182
+ }
183
  </style>
184
  <?php }
185
 
240
  }
241
 
242
  ?>
243
+ <?php if(isset($options['btn_google_signin_image']) && !empty($options['btn_google_signin_image'])){
244
+ $loginWithGoogleImage = $options['btn_google_signin_image'];
245
+ }else{
246
+ $loginWithGoogleImage = 'btn_google_signin_dark_normal_web';
247
+ }
248
+ ?>
249
+ <p class="galogin" style="cursor: pointer;background: none;box-shadow: none;">
250
+ <a href="<?php echo $authUrl; ?>"><img src="<?php echo $this->my_plugin_url(); ?>img/<?php echo $loginWithGoogleImage ?>.png" /></a>
251
  </p>
252
+
253
 
254
  <?php if ($options['ga_poweredby']) { ?>
255
  <p class='galogin-powered'><?php esc_html_e( 'Powered by ' , 'google-apps-login'); ?><a href='http://wp-glogin.com/?utm_source=Login%20Form&utm_medium=freemium&utm_campaign=LoginForm' target="_blank">wp-glogin.com</a></p>
919
  echo '</p>';
920
 
921
  $options = $this->get_option_galogin();
 
922
  echo "<input id='input_ga_force_permissions' name='".$this->get_options_name()."[ga_force_permissions]' type='checkbox' ".($options['ga_force_permissions'] ? 'checked' : '')." class='checkbox' />";
923
  echo '<label for="input_ga_force_permissions" class="checkbox plain">';
924
  _e( 'Force user to confirm Google permissions every time' , 'google-apps-login' );
947
  echo '<label for="input_ga_poweredby" class="checkbox plain">';
948
  _e( 'Display \'Powered By wp-glogin.com\' on Login form' , 'google-apps-login' );
949
  echo '</label>';
950
+
951
+ echo '<br class="clear" />';
952
+
953
+ echo '<fieldset class="block">
954
+ <legend class="blocktitle">Login With Google Button Styles</legend>';
955
+ echo "<input id='btn_google_signin_image1' name='".$this->get_options_name()."[btn_google_signin_image]' value='btn_google_signin_dark_focus_web' type='radio' ".($options['btn_google_signin_image'] == 'btn_google_signin_dark_focus_web' ? 'checked' : '')." class='checkbox' />";
956
 
957
+ echo '<img src="'.$this->my_plugin_url().'img/btn_google_signin_dark_focus_web.png" />';
958
+
959
+ echo '<br class="clear" />';
960
+
961
+ echo "<input id='btn_google_signin_image2' name='".$this->get_options_name()."[btn_google_signin_image]' value='btn_google_signin_dark_normal_web' ".($options['btn_google_signin_image'] == 'btn_google_signin_dark_normal_web' ? 'checked' : '')." type='radio' class='checkbox' />";
962
+
963
+ echo '<img src="'.$this->my_plugin_url().'img/btn_google_signin_dark_normal_web.png" />';
964
+
965
+ echo '<br class="clear" />';
966
+
967
+ echo "<input id='btn_google_signin_image3' name='".$this->get_options_name()."[btn_google_signin_image]' value='btn_google_signin_dark_pressed_web' ".($options['btn_google_signin_image'] == 'btn_google_signin_dark_pressed_web' ? 'checked' : '')." type='radio' class='checkbox' />";
968
+
969
+ echo '<img src="'.$this->my_plugin_url().'img/btn_google_signin_dark_pressed_web.png" />';
970
+
971
+ echo '<br class="clear" />';
972
+
973
+ echo "<input id='btn_google_signin_image4' name='".$this->get_options_name()."[btn_google_signin_image]' value='btn_google_signin_light_focus_web' ".($options['btn_google_signin_image'] == 'btn_google_signin_light_focus_web' ? 'checked' : '')." type='radio' class='checkbox' />";
974
+
975
+ echo '<img src="'.$this->my_plugin_url().'img/btn_google_signin_light_focus_web.png" />';
976
+
977
+ echo '<br class="clear" />';
978
+
979
+ echo "<input id='btn_google_signin_image5' name='".$this->get_options_name()."[btn_google_signin_image]' value='btn_google_signin_light_normal_web' ".($options['btn_google_signin_image'] == 'btn_google_signin_light_normal_web' ? 'checked' : '')." type='radio' class='checkbox' />";
980
+
981
+ echo '<img src="'.$this->my_plugin_url().'img/btn_google_signin_light_normal_web.png" />';
982
+
983
+ echo '<br class="clear" />';
984
+
985
+ echo "<input id='btn_google_signin_image6' name='".$this->get_options_name()."[btn_google_signin_image]' value='btn_google_signin_light_pressed_web' ".($options['btn_google_signin_image'] == 'btn_google_signin_light_pressed_web' ? 'checked' : '')." type='radio' class='checkbox' />";
986
+
987
+ echo '<img src="'.$this->my_plugin_url().'img/btn_google_signin_light_pressed_web.png" />';
988
+
989
+ echo '</fieldset>';
990
  $this->ga_advancedsection_extra();
991
 
992
  echo '<br class="clear" />';
1033
  'error'
1034
  );
1035
  }
1036
+
1037
  $newinput['ga_ms_usesubsitecallback'] = isset($input['ga_ms_usesubsitecallback']) ? (boolean)$input['ga_ms_usesubsitecallback'] : false;
1038
  $newinput['ga_force_permissions'] = isset($input['ga_force_permissions']) ? (boolean)$input['ga_force_permissions'] : false;
1039
  $newinput['ga_auto_login'] = isset($input['ga_auto_login']) ? (boolean)$input['ga_auto_login'] : false;
1040
  $newinput['ga_poweredby'] = isset($input['ga_poweredby']) ? (boolean)$input['ga_poweredby'] : false;
1041
  $newinput['ga_rememberme'] = isset($input['ga_rememberme']) ? (boolean)$input['ga_rememberme'] : false;
1042
+ $newinput['btn_google_signin_image'] = isset($input['btn_google_signin_image']) ? $input['btn_google_signin_image'] : 'btn_google_signin_dark_normal_web';
1043
+
1044
  // Service account settings
1045
  $newinput['ga_domainadmin'] = isset($input['ga_domainadmin']) ? trim($input['ga_domainadmin']) : '';
1046
  if (!preg_match('/^([A-Za-z0-9._%+-]+@([0-9a-z-]+\.)*[0-9a-z-]+\.[a-z]{2,63})?$/', $newinput['ga_domainadmin'])) {
1121
  'ga_force_permissions' => false,
1122
  'ga_auto_login' => false,
1123
  'ga_poweredby' => false,
1124
+ 'btn_google_signin_image'=>'btn_google_signin_dark_normal_web',
1125
  'ga_rememberme' => false,
1126
  'ga_sakey' => '',
1127
  'ga_domainadmin' => '');
css/gal-admin.css CHANGED
@@ -182,3 +182,20 @@ a.gal_jsonkeytext {
182
  #gal-drip-signup-form p.gal-drip-unsubscribe {
183
  font-size: 80%;
184
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  #gal-drip-signup-form p.gal-drip-unsubscribe {
183
  font-size: 80%;
184
  }
185
+ fieldset.block {
186
+ font-family: sans-serif!important;
187
+ border: 3px solid #1F497D!important;
188
+ background: #eee!important;
189
+ border-radius: 5px!important;
190
+ padding: 15px!important;
191
+ margin-top: 10px;
192
+ }
193
+ fieldset.block legend.blocktitle {
194
+ background: #1F497D!important;
195
+ color: #fff!important;
196
+ padding: 10px 10px!important;
197
+ font-size: 15px!important;
198
+ border-radius: 5px!important;
199
+ box-shadow: 0 0 0 5px #ddd!important;
200
+ margin-left: 20px!important;
201
+ }
google_apps_login.php CHANGED
@@ -4,8 +4,8 @@
4
  * Plugin Name: Google Apps Login
5
  * Plugin URI: http://wp-glogin.com/
6
  * Description: Simple secure login for Wordpress through users' Google Apps accounts (uses secure OAuth2, and MFA if enabled)
7
- * Version: 3.2
8
- * Author: Lever Technologies
9
  * Author URI: http://wp-glogin.com/
10
  * License: GPL3
11
  * Network: true
@@ -23,7 +23,7 @@ else {
23
 
24
  class basic_google_apps_login extends core_google_apps_login {
25
 
26
- protected $PLUGIN_VERSION = '3.2';
27
 
28
  // Singleton
29
  private static $instance = null;
4
  * Plugin Name: Google Apps Login
5
  * Plugin URI: http://wp-glogin.com/
6
  * Description: Simple secure login for Wordpress through users' Google Apps accounts (uses secure OAuth2, and MFA if enabled)
7
+ * Version: 3.3
8
+ * Author: Lever Technology LLC
9
  * Author URI: http://wp-glogin.com/
10
  * License: GPL3
11
  * Network: true
23
 
24
  class basic_google_apps_login extends core_google_apps_login {
25
 
26
+ protected $PLUGIN_VERSION = '3.3';
27
 
28
  // Singleton
29
  private static $instance = null;
img/btn_google_signin_dark_focus_web.png ADDED
Binary file
img/btn_google_signin_dark_normal_web.png ADDED
Binary file
img/btn_google_signin_dark_pressed_web.png ADDED
Binary file
img/btn_google_signin_light_focus_web.png ADDED
Binary file
img/btn_google_signin_light_normal_web.png ADDED
Binary file
img/btn_google_signin_light_pressed_web.png ADDED
Binary file
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Plugin Name ===
2
- Contributors: levertechadmin, danlester
3
  Tags: login, google, authentication, oauth, google login, google apps, g suite, sso, single-sign-on, auth, intranet
4
  Requires at least: 4.0
5
- Tested up to: 4.9
6
- Stable tag: 3.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -197,6 +197,13 @@ the WordPress admin panel once you have activated the plugin. For a (non-persona
197
 
198
  == Changelog ==
199
 
 
 
 
 
 
 
 
200
  = 3.2 =
201
 
202
  Added workaround for incompatibility with WPMU Defender plugin's new 2FA feature.
1
  === Plugin Name ===
2
+ Contributors: levertechadmin
3
  Tags: login, google, authentication, oauth, google login, google apps, g suite, sso, single-sign-on, auth, intranet
4
  Requires at least: 4.0
5
+ Tested up to: 5.3.1
6
+ Stable tag: 3.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
197
 
198
  == Changelog ==
199
 
200
+ = 3.3 =
201
+
202
+ Added permission check functionality
203
+ Added Google Drive Embedder insufficient permission error fixes
204
+ Added Login With Google buttons branding
205
+ Updated compatibility with the WordPress 5.3.1 release
206
+
207
  = 3.2 =
208
 
209
  Added workaround for incompatibility with WPMU Defender plugin's new 2FA feature.