Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/06/2008, 02:44
blanko
 
Fecha de Ingreso: agosto-2007
Mensajes: 42
Antigüedad: 16 años, 8 meses
Puntos: 0
Respuesta: Interacion con impresora en equipo que tiene el servidor apache/php

Que problema de permisos es el que tengo.

Porque usando el código de uno de los comentarios de esa función que me pasaste, obtengo el listado de las impresoras locales, pero no las de red.

este es el código:

Código PHP:
if (function_exists("printer_list"))
  {
  
$PrintCurr 0;

  
// Get the local printers.
  
$PrintDests printer_list(PRINTER_ENUM_LOCAL);

  if (isset(
$PrintDests))
    foreach (
$PrintDests as $PrintDest)
      
$PrinterList[$PrintCurr++] = $PrintDest["NAME"];

  
// We should be able to enumerate the remote printers too.  Let's have a
  // shot at it.
  //
  // Start by looking for the remote printers tree.
  
$PrintDoms printer_list(PRINTER_ENUM_NAME); $PrintTree "";

  if (isset(
$PrintDoms))
    foreach (
$PrintDoms as $PrintDomain)
      {
      if (
preg_match("/Remote/i"$PrintDomain["NAME"]))
        { 
$PrintTree $PrintDomain["NAME"]; break; }
      }

  
// If we found a remote printers tree, we need to enumerate all of the
  // domains/workgroups/nodes within the tree and all the printers attached
  // to those nodes.
  
if ($PrintTree != "")
    {
    
// Enumerate all of the domains.
    
$PrintDoms printer_list(PRINTER_ENUM_NAME$PrintTree);

    if (isset(
$PrintDoms))
      foreach (
$PrintDoms as $PrintDomain)
        {
        
// Enumerate all of the nodes within the domain.
        
$PrintNodes printer_list(PRINTER_ENUM_NAME$PrintDomain["NAME"]);

        if (isset(
$PrintNodes))
          foreach (
$PrintNodes as $PrintNode)
            {
            
// Enumerate all of the printers within the node.
            
$PrintDests printer_list(PRINTER_ENUM_NAME,
              
$PrintNode["NAME"]);

            if (isset(
$PrintDests))
              foreach (
$PrintDests as $PrintDest)
                
$PrinterList[$PrintCurr++] = $PrintDest["NAME"];
            }
        }
    }
  }

  
print_r($PrinterList); 

Y obtengo este resultado:

Código PHP:
Array ( [0] => WinFax (Photo Quality) [1] => WinFax [2] => Microsoft Office Document Image Writer [3] => HP Photosmart D5100 series 
Pero aquí falta una, la impresora de red, que permisos debo modificar en windows para que php pueda verla¿? y gracias por tu ayuda


Los dos PC tienen Windows XP SP2

Última edición por blanko; 18/06/2008 a las 02:49 Razón: Para añadir el sistema operativo