phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] ftp index.php inc/functions.inc.php templates/b...


From: Dave Hall
Subject: [Phpgroupware-cvs] ftp index.php inc/functions.inc.php templates/b...
Date: Thu, 28 Dec 2006 14:05:28 +0000

CVSROOT:        /sources/phpgroupware
Module name:    ftp
Changes by:     Dave Hall <skwashd>     06/12/28 14:05:28

Modified files:
        .              : index.php 
        inc            : functions.inc.php 
        templates/base : login.tpl 

Log message:
        this should now be working properly

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ftp/index.php?cvsroot=phpgroupware&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/ftp/inc/functions.inc.php?cvsroot=phpgroupware&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/ftp/templates/base/login.tpl?cvsroot=phpgroupware&r1=1.1&r2=1.2

Patches:
Index: index.php
===================================================================
RCS file: /sources/phpgroupware/ftp/index.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- index.php   15 May 2005 13:34:11 -0000      1.19
+++ index.php   28 Dec 2006 14:05:28 -0000      1.20
@@ -10,7 +10,7 @@
 *  option) any later version.                                              *
 \**************************************************************************/
 
-       /* $Id: index.php,v 1.19 2005/05/15 13:34:11 skwashd Exp $ */
+       /* $Id: index.php,v 1.20 2006/12/28 14:05:28 skwashd Exp $ */
 
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp'              => 'ftp',
@@ -19,8 +19,8 @@
 
        if ($_GET['action'] == 'get' || $_GET['action'] == 'view')
        {
-               $GLOBALS['phpgw_info']['flags']['nonavbar'] = True;
-               $GLOBALS['phpgw_info']['flags']['noheader'] = True;
+               $GLOBALS['phpgw_info']['flags']['nonavbar'] = true;
+               $GLOBALS['phpgw_info']['flags']['noheader'] = true;
        }
        include('../header.inc.php');
 
@@ -31,14 +31,10 @@
 
        $default_login  = $GLOBALS['phpgw_info']['user']['account_lid'];
        $default_pass   = 
$GLOBALS['phpgw']->session->appsession('password','phpgwapi');
-       $default_server = 
$GLOBALS['phpgw_info']['server']['default_ftp_server'];
+       $default_server = 
isset($GLOBALS['phpgw_info']['server']['default_ftp_server']) ? 
$GLOBALS['phpgw_info']['server']['default_ftp_server'] : '';
 
        $sessionUpdated=false;
 
-       $em_bg      = $GLOBALS['phpgw_info']['theme']['table_bg'];
-       $em_bg_text = $GLOBALS['phpgw_info']['theme']['table_text'];
-       $bgcolor[0] = $GLOBALS['phpgw_info']['theme']['row_on'];
-       $bgcolor[1] = $GLOBALS['phpgw_info']['theme']['row_off'];
        $bgclass = array('row_on', 'row_off');
        $tempdir    = $GLOBALS['phpgw_info']['server']['temp_dir'];
 
@@ -52,26 +48,21 @@
                'bad_connect' => 'bad_connection.tpl'
        ));
        $GLOBALS['phpgw']->template->set_var(array(
-               'em_bgcolor' => $em_bg,
-               'em_text_color' => $em_bg_text,
                'bgclass' => $bgclass[0]
        ));
 
        $GLOBALS['phpgw']->template->set_block('main_','main');
        $GLOBALS['phpgw']->template->set_block('main_','row');
-       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
-       
$GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
-       
$GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
 
        $GLOBALS['phpgw']->template->set_var('module_name',lang('Ftp Client'));
 
+       $tried_default = false;
        if (!$action || $action=='login')
        {
                // if theres no action, try to login to default host with user 
and pass
                if ($action=='login') 
                {
-                       // username, ftpserver and password should have been 
passed in
-                       // via POST
+                       // username, ftpserver and password should have been 
passed in via POST
                        $connInfo['username']  = $_POST['username'];
                        $connInfo['password']  = $_POST['password'];
                        $connInfo['ftpserver'] = $_POST['ftpserver'];
@@ -94,7 +85,7 @@
 
        if ($action != 'newlogin') 
        {
-               if (empty($connInfo)) 
+               if ( !count($connInfo) )
                {
                        $connInfo=getConnectionInfo();
                }
@@ -356,10 +347,10 @@
                        $sessionUpdated=true;
                        if (!$tried_default) 
                        {
-                               // don't put out an error on the default login
-                               for($i=0;$i<strlen($connInfo['password']);$i++)
+                               $pass = '&lt;&lt;EMPTY&gt;&gt;';
+                               if ( !empty($connInfo['password']) )
                                {
-                                        $pass.="*"; 
+                                       $pass = '***PASSWORD***';
                                }
                                
$GLOBALS['phpgw']->template->set_var('error_message', lang('Failed to connect 
to %1 with user %2 and password %3', 
                                        $connInfo['ftpserver'], 
$connInfo['username'], $pass), true);

Index: inc/functions.inc.php
===================================================================
RCS file: /sources/phpgroupware/ftp/inc/functions.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- inc/functions.inc.php       15 May 2005 13:34:12 -0000      1.16
+++ inc/functions.inc.php       28 Dec 2006 14:05:28 -0000      1.17
@@ -10,7 +10,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id: functions.inc.php,v 1.16 2005/05/15 13:34:12 skwashd Exp $ */
+       /* $Id: functions.inc.php,v 1.17 2006/12/28 14:05:28 skwashd Exp $ */
 
        //NOTE: This is a hack to fix the register_globals problems with this 
app in 16
        //TODO: Fix it properly
@@ -33,7 +33,7 @@
 
        function getConnectionInfo() 
        {
-               return $GLOBALS['phpgw']->session->appsession();
+               return $GLOBALS['phpgw']->session->appsession('default', '');
        }
 
        function phpftp_connect($host,$user,$pass) 
@@ -231,12 +231,12 @@
 
        function updateSession($string='')
        {
-               $GLOBALS['phpgw']->common->appsession($string);
-               return;
+               return $GLOBALS['phpgw']->session->appsession('default', '', 
$string);
        }
 
        function analysedir($dirline)
        {
+               $dirinfo = array();
                if (ereg("([-dl])[rwxst-]{9}",substr($dirline,0,10)))
                {
                        $GLOBALS['systyp'] = 'UNIX';
@@ -246,7 +246,7 @@
                {
                        $dirinfo[0] = -1;
                }
-               elseif($GLBALS['systyp'] == 'Windows_NT')
+               elseif($GLOBALS['systyp'] == 'Windows_NT')
                {
                        if (ereg("[-0-9]+ *[0-9:]+[PA]?M? +<DIR> 
{10}(.*)",$dirline,$regs))
                        {
@@ -289,7 +289,7 @@
                        //echo '<pre>'; print_r($fileinfo); echo '</pre>';
                }
     
-               if (($dirinfo[2]=='.') || ($dirinfo[2]=='..'))
+               if ( isset($dirinfo[2]) && ($dirinfo[2] == '.' || $dirinfo[2] 
== '..') )
                {
                        $dirinfo[0] = 0;
                }

Index: templates/base/login.tpl
===================================================================
RCS file: /sources/phpgroupware/ftp/templates/base/login.tpl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- templates/base/login.tpl    28 Dec 2006 13:38:35 -0000      1.1
+++ templates/base/login.tpl    28 Dec 2006 14:05:28 -0000      1.2
@@ -1,20 +1,17 @@
 {login_form_begin}
+<h2>{lang_login}</h2>
 <table align="center" width="40%" cellspacing="0" cellpadding="0">
- <tr bgcolor="{th_bg}">
-  <td colspan="2">{lang_login}</td>
- </tr>
-
- <tr bgcolor="{row_on}">
+       <tr class="row_on">
   <td>{lang_username}</td>
   <td>{login_form_username}</td>
  </tr>
 
- <tr bgcolor="{row_off}">
+       <tr class="row_off">
   <td>{lang_password}</td>
   <td>{login_form_password}</td>
  </tr>
 
- <tr bgcolor="{row_on}">
+       <tr class="row_on">
   <td>{lang_ftpserver}</td>
   <td>{login_form_ftpserver}</td>
  </tr>
@@ -24,4 +21,3 @@
  </tr>
 </table>
 {login_form_end}
-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]