[geeklog-cvs] Geeklog-1.x/public_html lib-common.php, 1.685, 1.686 users.php, 1.165, 1.166

Dirk Haun dhaun at qs1489.pair.com
Sun Mar 9 06:23:15 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv99049/public_html

Modified Files:
	lib-common.php users.php 
Log Message:
Moved collection of remote auth modules to a separate function; only display the "Service" dropdown if necessary


Index: users.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/users.php,v
retrieving revision 1.165
retrieving revision 1.166
diff -C2 -d -r1.165 -r1.166
*** users.php	9 Mar 2008 09:39:16 -0000	1.165
--- users.php	9 Mar 2008 10:23:13 -0000	1.166
***************
*** 625,651 ****
      // 3rd party remote authentification.
      if ($_CONF['user_login_method']['3rdparty'] && !$_CONF['usersubmission']) {
!         /* Build select */
!         $select = '<select name="service">';
!         if ($_CONF['user_login_method']['standard']) {
!             $select .= '<option value="">' .  $_CONF['site_name'] . '</option>';
!         }
!         if (is_dir($_CONF['path_system'].'classes/authentication/')) {
! 
!             $folder = opendir( $_CONF['path_system'].'classes/authentication/' );
!             while (($filename = @readdir( $folder )) !== false) {
!                 $strpos = strpos($filename, '.auth.class.php');
!                 if ($strpos) {
!                     $service = substr($filename, 0, $strpos);
!                     $select .= '<option value="'.$service.'">'.$service.'</option>';
                  }
              }
          }
-         $select .= '</select>';
-         $user_templates->set_file('services', 'services.thtml');
-         $user_templates->set_var('lang_service', $LANG04[121]);
-         $user_templates->set_var('select_service', $select);
-         $user_templates->parse('output', 'services');
-         $user_templates->set_var('services',
-                $user_templates->finish($user_templates->get_var('output')));
      } else {
          $user_templates->set_var('services', '');
--- 625,656 ----
      // 3rd party remote authentification.
      if ($_CONF['user_login_method']['3rdparty'] && !$_CONF['usersubmission']) {
!         $modules = SEC_collectRemoteAuthenticationModules();
!         if (count($modules) == 0) {
!             $user_templates->set_var('services', '');
!         } else {
!             if (!$_CONF['user_login_method']['standard'] &&
!                     (count($modules) == 1)) {
!                 $select = $modules[0];
!             } else {
!                 // Build select
!                 $select = '<select name="service">';
!                 if ($_CONF['user_login_method']['standard']) {
!                     $select .= '<option value="">' .  $_CONF['site_name']
!                             . '</option>';
                  }
+                 foreach ($modules as $service) {
+                     $select .= '<option value="' . $service . '">' . $service
+                             . '</option>';
+                 }
+                 $select .= '</select>';
              }
+ 
+             $user_templates->set_file('services', 'services.thtml');
+             $user_templates->set_var('lang_service', $LANG04[121]);
+             $user_templates->set_var('select_service', $select);
+             $user_templates->parse('output', 'services');
+             $user_templates->set_var('services',
+                    $user_templates->finish($user_templates->get_var('output')));
          }
      } else {
          $user_templates->set_var('services', '');

Index: lib-common.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/lib-common.php,v
retrieving revision 1.685
retrieving revision 1.686
diff -C2 -d -r1.685 -r1.686
*** lib-common.php	9 Mar 2008 09:39:16 -0000	1.685
--- lib-common.php	9 Mar 2008 10:23:13 -0000	1.686
***************
*** 2355,2388 ****
  
          // 3rd party remote authentification.
!         if( $_CONF['user_login_method']['3rdparty'] && !$_CONF['usersubmission'] )
!         {
!             // Build select
!             $select = '<select name="service" id="service">';
!             if ($_CONF['user_login_method']['standard']) {
!                 $select .= '<option value="">' . $_CONF['site_name']
!                         . '</option>';
!             }
!             if( is_dir( $_CONF['path_system'] . 'classes/authentication/' ))
!             {
!                 $folder = opendir( $_CONF['path_system']
!                                    . 'classes/authentication/' );
!                 while(( $filename = @readdir( $folder )) !== false )
!                 {
!                     $strpos = strpos( $filename, '.auth.class.php' );
!                     if( $strpos && (substr( $filename, strlen( $filename ) - 4) == '.php') )
!                     {
!                         $service = substr( $filename, 0, $strpos );
                          $select .= '<option value="' . $service . '">'
                                  . $service . '</option>';
                      }
                  }
              }
-             $select .= '</select>';
-             $login->set_file( 'services', 'blockservices.thtml' );
-             $login->set_var( 'lang_service', $LANG04[121] );
-             $login->set_var( 'select_service', $select );
-             $login->parse( 'output', 'services' );
-             $login->set_var( 'services',
-                              $login->finish( $login->get_var( 'output' )));
          } else {
             $login->set_var('services', '');
--- 2355,2387 ----
  
          // 3rd party remote authentification.
!         if ($_CONF['user_login_method']['3rdparty'] && !$_CONF['usersubmission']) {
!             $modules = SEC_collectRemoteAuthenticationModules();
!             if (count($modules) == 0) {
!                 $user_templates->set_var('services', '');
!             } else {
!                 if (!$_CONF['user_login_method']['standard'] &&
!                         (count($modules) == 1)) {
!                     $select = $modules[0];
!                 } else {
!                     // Build select
!                     $select = '<select name="service" id="service">';
!                     if ($_CONF['user_login_method']['standard']) {
!                         $select .= '<option value="">' . $_CONF['site_name']
!                                 . '</option>';
!                     }
!                     foreach ($modules as $service) {
                          $select .= '<option value="' . $service . '">'
                                  . $service . '</option>';
                      }
+                     $select .= '</select>';
                  }
+ 
+                 $login->set_file('services', 'blockservices.thtml');
+                 $login->set_var('lang_service', $LANG04[121]);
+                 $login->set_var('select_service', $select);
+                 $login->parse('output', 'services');
+                 $login->set_var('services',
+                                 $login->finish($login->get_var('output')));
              }
          } else {
             $login->set_var('services', '');




More information about the geeklog-cvs mailing list