[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: fax/inc class.manager.inc.php,1.2,1.3
From: |
Marco Andriolo-Stagno (MAS!) <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: fax/inc class.manager.inc.php,1.2,1.3 |
Date: |
Mon, 02 Dec 2002 11:48:39 -0500 |
Update of /cvsroot/phpgroupware/fax/inc
In directory subversions:/tmp/cvs-serv26128/inc
Modified Files:
class.manager.inc.php
Log Message:
removed some debug code; added check to avoid to send empty files
Index: class.manager.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/fax/inc/class.manager.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.manager.inc.php 27 Nov 2002 15:50:40 -0000 1.2
--- class.manager.inc.php 2 Dec 2002 16:48:36 -0000 1.3
***************
*** 33,41 ****
{
srand(date('s'));
! $possible_charactors =
'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$string = '';
while (strlen($string) < $length)
{
! $string .= substr($possible_charactors,
rand()%(strlen($possible_charactors)), 1);
}
return($string);
--- 33,41 ----
{
srand(date('s'));
! $possible_characters =
'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$string = '';
while (strlen($string) < $length)
{
! $string .= substr($possible_characters,
rand()%(strlen($possible_characters)), 1);
}
return($string);
***************
*** 71,80 ****
# uploaded file
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
! { #TODO: check for fakes entries!!
$filename = $_FILES['userfile']['name'];
$filename_real =
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.'phpgw_fax_'.$GLOBALS['phpgw']->accounts->data['account_lid'].'_'.$this->randomname(8).'_'.$filename;
! copy($_FILES['userfile']['tmp_name'], $filename_real);
! $_POST['filename'] = $filename;
! $_POST['filename_real'] = $filename_real;
}
--- 71,92 ----
# uploaded file
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
! {
$filename = $_FILES['userfile']['name'];
$filename_real =
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.'phpgw_fax_'.$GLOBALS['phpgw']->accounts->data['account_lid'].'_'.$this->randomname(8).'_'.$filename;
!
! # avoid to add wrong files
! if (filesize($_FILES['userfile']['tmp_name'])
!= 0)
! {
! copy($_FILES['userfile']['tmp_name'],
$filename_real);
! $_POST['filename'] = $filename;
! $_POST['filename_real'] =
$filename_real;
! $upld_err = '' ;
! }
! else
! {
! $upld_err = lang('upld_err');
! }
!
!
}
***************
*** 87,106 ****
# debug code:
! print "<pre>";
! #print_r ($_FILES);
! # print_r ($GLOBALS['phpgw_info']);
! # print_r ($GLOBALS['phpgw']);
! # print_r ($_POST);
! #print_r ($_GET);
! #print_r ($GLOBALS['phpgw_info']['theme']);
! #$prefs_obj = CreateObject('phpgwapi.preferences');
! #$prefs = $prefs_obj->read_repository();
! #$prefs['pollo']='ciao';
! #print_r ($GLOBALS['phpgw']->preferences) ;
! #print_r
($GLOBALS['phpgw_info']['user']['preferences']) ;
!
! #$GLOBALS['phpgw']->preferences->$this->test();
! #print_r ($GLOBALS['phpgw']->preferences) ;
! print "</pre>";
if (isset($_POST['action']))
--- 99,105 ----
# debug code:
! # print "<pre>";
! #
! # print "</pre>";
if (isset($_POST['action']))
***************
*** 146,150 ****
$cat_id = 'none';
$no_data = True;
- #$newquery = False;
}
--- 145,148 ----
***************
*** 159,197 ****
$filename_real = $_POST['filename_real'];
- #
- # newquery e' stato rimosso. come funziona tutto questo?
- #
- #
- # if (isset($_POST['newquery']) or $cat_id != 'none' or
!$_POST['query'])
-
if ($_POST['query'] != '')
! { $cat_id = 'none' ;
$none = 'selected';
$all = '';
! $query = $_POST['query'];
}
else
{
$query = '';
-
}
- # if ($cat_id != 'none' or !$_POST['query'])
- # { $query = ''; }
- # else
- # { $query = $_POST['query']; }
- /*
- if ($_POST['query'] == '')
- {
- $cat_id = 'none';
- $none = 'selected';
- $all = '';
- # $newquery = True;
- # $query = '';
- }
- */
!
! # per mantenere traccia di quello che ho selezionato da
un repost all'altrp
if (!($cat_id != $_POST['old_cat'] or $query !=
$_POST['old_query'] or $filter != $_POST['old_filter']))
{
--- 157,174 ----
$filename_real = $_POST['filename_real'];
if ($_POST['query'] != '')
! {
! $cat_id = 'none' ;
$none = 'selected';
$all = '';
! $query = $_POST['query'];
}
else
{
$query = '';
}
! # keep selected data
if (!($cat_id != $_POST['old_cat'] or $query !=
$_POST['old_query'] or $filter != $_POST['old_filter']))
{
***************
*** 212,217 ****
# WARNING! phpgwebhosting vs filemanager
! # Warning if it's not available the fc patch
! # se non c'e' esco!
$file_chooser =
$GLOBALS['phpgw']->link('/index.php','menuaction=phpwebhosting.file_chooser.navigate&targetaction=fax.manager.compose&fc_type=L');
--- 189,193 ----
# WARNING! phpgwebhosting vs filemanager
! # WARNING! if it's not available the file_chooser patch
$file_chooser =
$GLOBALS['phpgw']->link('/index.php','menuaction=phpwebhosting.file_chooser.navigate&targetaction=fax.manager.compose&fc_type=L');
***************
*** 253,257 ****
if (!$_POST)
{$tpl->set_var('filename_data',rawurlencode(serialize(array())));}
!
$data = array
(
--- 229,233 ----
if (!$_POST)
{$tpl->set_var('filename_data',rawurlencode(serialize(array())));}
!
$data = array
(
***************
*** 271,275 ****
'regarding' => $regarding,
'comments' => $comments,
- #'query' => $query,
'old_query' => $query,
'old_cat' => $cat_id,
--- 247,250 ----
***************
*** 319,324 ****
'l_fake' => lang('fake'),
'l_att_descr' => lang('att_descr'),
! # toglierlo dalle lingue
! #'att_txt' => lang('att_txt'),
'bg_color' =>
$GLOBALS['phpgw_info']['theme']['bg_color'],
'bg_text' =>
$GLOBALS['phpgw_info']['theme']['bg_text'],
--- 294,298 ----
'l_fake' => lang('fake'),
'l_att_descr' => lang('att_descr'),
! 'l_upld_err' => $upld_err ,
'bg_color' =>
$GLOBALS['phpgw_info']['theme']['bg_color'],
'bg_text' =>
$GLOBALS['phpgw_info']['theme']['bg_text'],
***************
*** 495,500 ****
$tpl->pparse('write_faxdata_cover_header',
'faxdata_cover_header', TRUE);
! # cover list
!
$query = 'SELECT global_settings FROM phpgw_fax_admin';
$this->db->query($query, __LINE__, __FILE__);
--- 469,473 ----
$tpl->pparse('write_faxdata_cover_header',
'faxdata_cover_header', TRUE);
! # cover list
$query = 'SELECT global_settings FROM phpgw_fax_admin';
$this->db->query($query, __LINE__, __FILE__);
***************
*** 503,509 ****
$cp = $gs['cover_path'];
- # FARE MEGLIO!!!!!
- # SE NON E' settato avvisare di settarlo!
#ToDO: add smart filter; in prefs section too.
exec('ls '.$gs['cover_path'], $ls);
$i = 0;
--- 476,481 ----
$cp = $gs['cover_path'];
#ToDO: add smart filter; in prefs section too.
+ #ToDO: add warning message if not set
exec('ls '.$gs['cover_path'], $ls);
$i = 0;
***************
*** 537,553 ****
#ToDO!!!!
-
- # ricordati che si chiama filemanager
# Storage present?
#if
($GLOBALS['phpgw_info']['apps']['phpwebhosting']['enabled'] or
$GLOBALS['phpgw_info']['apps']['filemanager']['enabled'])
# { $tpl->pparse('write_faxdata_file_chooser',
'faxdata_file_chooser', TRUE); }
-
$attach_array =
unserialize(urldecode(stripslashes($_POST['filename_data'])));
$update_attach_data = False ;
!
! # funziona se dallo storage!
! if ($_POST['filename'] and $_POST['filename_real'])
{
if ($filename and $filename_real)
--- 509,520 ----
#ToDO!!!!
# Storage present?
#if
($GLOBALS['phpgw_info']['apps']['phpwebhosting']['enabled'] or
$GLOBALS['phpgw_info']['apps']['filemanager']['enabled'])
# { $tpl->pparse('write_faxdata_file_chooser',
'faxdata_file_chooser', TRUE); }
$attach_array =
unserialize(urldecode(stripslashes($_POST['filename_data'])));
$update_attach_data = False ;
! if ($_POST['filename'] and $_POST['filename_real'])
{
if ($filename and $filename_real)
***************
*** 587,591 ****
{ $fake = false;}
! /* da fare meglio */
if ($to_move and !$fake)
{
--- 554,558 ----
{ $fake = false;}
! # ToDO: do it better
if ($to_move and !$fake)
{
***************
*** 656,675 ****
$tpl->set_var('show_win_name','PROVA NOME FINESTRA');
$tpl->pparse('write_show_preview','show_preview');
- #evitare pdf -> pdf!
-
- /*
- if
(substr(strtolower($to_show),-3,3)=='txt' or
-
substr(strtolower($to_show),-4,4)=='text')
- { print "testo non faccio
niente";}
- else
- {
- exec('file -bik
'.$to_show,$ou);
- print "substr
".substr($ou[0],0,10);
- print "<br>non ha estensione
txt";
- if
(substr($ou[0],0,10)=='text/plain')
- { print "comunque del testo
senza estensione";}
- *
- }
- */
#update_attach_data = True ;
break ;
--- 623,626 ----
***************
*** 751,756 ****
$gs = unserialize($this->db->f('global_settings'));
! # Se non c'e' prendo quello di default? c'e' da qualche
parte?!
! #ToDo: warning if domain not set
$domain = $gs['domain'];
if ($domain{0}!='@')
--- 702,706 ----
$gs = unserialize($this->db->f('global_settings'));
! #ToDo: warning message if domain not set
$domain = $gs['domain'];
if ($domain{0}!='@')
***************
*** 813,818 ****
}
!
! print 'destinatari:<br>'; #DEGUG CODE
/*
--- 763,768 ----
}
!
! #DEGUG CODE
/*
***************
*** 837,840 ****
--- 787,791 ----
{$fax_filename .= $attach_file[1].' ';}
+ print "<h3><center>please: see note in
fax/inc/class.manager.inc.php!</center></h3>";
foreach ($final_data as $dest)
{
***************
*** 843,847 ****
$faxcmd = "sendfax -c '".$comments."' ".$cover.$notify." -f
'".$user_login.$domain."' -i 'phpgroupware' -r '".$regarding."' -x '".
$dest['org_name']."' -y '".$dest['adr_one_locality']."' -d
'".$dest['tel_fax']."' ".$fax_filename;
! # ToDo: execute and not print it!!
print $faxcmd;
}
--- 794,803 ----
$faxcmd = "sendfax -c '".$comments."' ".$cover.$notify." -f
'".$user_login.$domain."' -i 'phpgroupware' -r '".$regarding."' -x '".
$dest['org_name']."' -y '".$dest['adr_one_locality']."' -d
'".$dest['tel_fax']."' ".$fax_filename;
! # IF YOU WANT TO SEND THE FAXES FOR REAL UNCOMMENT THE
! # FOLLOWING LINE!
! #exec($faxcmd, $out);
!
! # IF YOU WANT TO REMOVE THE DEBUG OUTPUT
COMMENT THE
! # FOLLOWING LINE!
print $faxcmd;
}
***************
*** 1147,1155 ****
# false 0 startjob pop
- #
- # salvare gia' i file temporanei con estensione se possibile?!
- # file -bik ...
-
-
# ing `when '' (e.g. `when done''). Note that `when
# requeued'' implies `when done''. (Equivalent to the
--- 1103,1106 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: fax/inc class.manager.inc.php,1.2,1.3,
Marco Andriolo-Stagno (MAS!) <address@hidden> <=