[geeklog-cvs] Geeklog-1.x/system lib-webservices.php,1.32,1.33

Dirk Haun dhaun at qs1489.pair.com
Wed Feb 20 15:38:02 EST 2008


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

Modified Files:
	lib-webservices.php 
Log Message:
Use the somewhat sanitized site_name for the realm


Index: lib-webservices.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-webservices.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** lib-webservices.php	6 Jan 2008 20:44:10 -0000	1.32
--- lib-webservices.php	20 Feb 2008 20:38:00 -0000	1.33
***************
*** 59,63 ****
  function WS_error($error_code, $error_desc = '')
  {
!     global $WS_VERBOSE;
  
      header('Content-type: text/plain');
--- 59,63 ----
  function WS_error($error_code, $error_desc = '')
  {
!     global $_CONF, $WS_VERBOSE;
  
      header('Content-type: text/plain');
***************
*** 76,81 ****
          break;
      case PLG_RET_AUTH_FAILED:
          header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
!         header('WWW-Authenticate: Basic realm="www.geeklog.net"');
          if (empty($error_desc)) {
              $error_desc = 'Unauthorized';
--- 76,82 ----
          break;
      case PLG_RET_AUTH_FAILED:
+         $realm = preg_replace('/[^a-zA-Z0-9\-_\. ]/', '', $_CONF['site_name']);
          header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
!         header('WWW-Authenticate: Basic realm="' . $realm . '"');
          if (empty($error_desc)) {
              $error_desc = 'Unauthorized';




More information about the geeklog-cvs mailing list