get_options_name()); if (!$old_options) { $new_options = $this->get_option_galogin(); $new_option['ga_poweredby'] = true; $this->save_option_galogin($new_option); } } protected function add_actions() { parent::add_actions(); add_action('wp_ajax_gal_drip_submitted', array($this, 'gal_drip_submitted')); } protected function ga_section_text_end() { ?>

http://wp-glogin.com/

' .'' .'' .'' .'Buy our premium Login plugin to revolutionize user management' .''; $adverts[] = '
' .'' .'' .'' .'Try our Google Drive Embedder plugin' .'
'; $adverts[] = '
' .'' .'' .'' .'Bring your site to life with Google Profile Avatars' .'
'; $adverts[] = '
' .'' .'' .'' .'Instantly turn WordPress into a corporate intranet with All-In-One Intranet' .'
'; $startnum = (int)date('j'); echo '
'; $this->output_drip_form(); for ($i=0 ; $i<2 ; $i++) { echo $adverts[($startnum+$i) % 4]; } echo '
'; } protected function output_drip_form() { $userdata = wp_get_current_user(); if (!$userdata) { return; } $signedup = get_user_meta($userdata->ID, 'gal_user_signedup_to_drip', true); if (!$signedup) { $useremail = $userdata->user_email; ?>

Get the most out of Google Apps and WordPress

Register your email address to receive information on building a WordPress site that truly integrates G Suite and WordPress.



You can unsubscribe at any time, and we will never share your email address.

ID, 'gal_user_signedup_to_drip', true); } protected function ga_domainsection_text() { echo '
'; echo '

'.__('The Domain Control section is only applicable to the premium and enterprise versions of this plugin.', 'google-apps-login').'

'; echo '

'; _e( 'In this basic version of the plugin, any existing WordPress account corresponding to a Google email address can authenticate via Google.', 'google-apps-login'); echo '

'; ?>

Premium Upgrade

In our professional plugins, you can specify your G Suite (Google Apps) domain name to obtain more powerful features.

Find out more about purchase options on our website: http://wp-glogin.com/

'; } protected function set_other_admin_notices() { global $pagenow; if (in_array($pagenow, array('users.php', 'user-new.php')) ) { $no_thanks = get_user_meta(get_current_user_id(), $this->get_options_name().'_no_thanks', true); if (!$no_thanks) { if (isset($_REQUEST['google_apps_login_action']) && $_REQUEST['google_apps_login_action']=='no_thanks') { $this->ga_said_no_thanks(null); } add_action('admin_notices', Array($this, 'ga_user_screen_upgrade_message')); if (is_multisite()) { add_action('network_admin_notices', Array($this, 'ga_user_screen_upgrade_message')); } } } } public function ga_said_no_thanks( $data ) { update_user_meta(get_current_user_id(), $this->get_options_name().'_no_thanks', true); wp_redirect( remove_query_arg( 'google_apps_login_action' ) ); exit; } public function ga_user_screen_upgrade_message() { $purchase_url = 'http://wp-glogin.com/glogin/?utm_source=User%20Pages&utm_medium=freemium&utm_campaign=Freemium'; $nothanks_url = add_query_arg( 'google_apps_login_action', 'no_thanks' ); echo '

'; echo sprintf( __('Completely forget about WordPress user management - upgrade to Google Apps Login Premium or Enterprise to automatically sync users from your Google Apps domain', 'google-apps-login'), $purchase_url ); echo '   ' . __( 'Find out more', 'google-apps-login' ) . ''; echo ' ' . __( 'No Thanks', 'google-apps-login' ) . ''; echo '

'; } public function my_plugin_basename() { $basename = plugin_basename(__FILE__); if ('/'.$basename == __FILE__) { // Maybe due to symlink $basename = basename(dirname(__FILE__)).'/'.basename(__FILE__); } return $basename; } protected function my_plugin_url() { $basename = plugin_basename(__FILE__); if ('/'.$basename == __FILE__) { // Maybe due to symlink return plugins_url().'/'.basename(dirname(__FILE__)).'/'; } // Normal case (non symlink) return plugin_dir_url( __FILE__ ); } } // Global accessor function to singleton function galbasicGoogleAppsLogin() { return basic_google_apps_login::get_instance(); } // Initialise at least once galbasicGoogleAppsLogin(); if (!function_exists('GoogleAppsLogin')) { function GoogleAppsLogin() { return galbasicGoogleAppsLogin(); } } ?>