| version 1.35, 2003/02/03 21:50:51 |
version 1.36, 2003/02/04 21:52:54 |
|
|
| * http://www.platon.sk/projects/phpWebFileManager/ |
* http://www.platon.sk/projects/phpWebFileManager/ |
| */ |
*/ |
| |
|
| /* $Platon: phpWebFileManager/index.php,v 1.34 2003/01/07 16:19:04 nepto Exp $ */ |
/* $Platon: phpWebFileManager/index.php,v 1.35 2003/02/03 21:50:51 nepto Exp $ */ |
| |
|
| /* |
/* |
| * phpWebFileManager initialization |
* phpWebFileManager initialization |
| Line 39 require_once $fm_init_file; |
|
| Line 39 require_once $fm_init_file; |
|
| * Libraries function inclusion |
* Libraries function inclusion |
| */ |
*/ |
| |
|
| require_once $PN_PathPrefix . 'lib/fnc.append_slash.php'; |
require_once $PN_PathPrefix . 'functions.inc.php'; |
| require_once $PN_PathPrefix . 'lib/fnc.get_path_without_scriptname.php'; |
|
| require_once $PN_PathPrefix . 'lib/fnc.glue_url.php'; |
|
| require_once $PN_PathPrefix . 'lib/fnc.write_origvars_html.php'; |
|
| |
|
| /* |
/* |
| * fm_echo_message() |
* fm_echo_message() |
| Line 50 require_once $PN_PathPrefix . 'lib/fnc.w |
|
| Line 47 require_once $PN_PathPrefix . 'lib/fnc.w |
|
| * Writes message on output. |
* Writes message on output. |
| */ |
*/ |
| |
|
| function fm_echo_message($message) |
function fm_echo_message($message) /* {{{ */ |
| { |
{ |
| echo '<small>'.$message.'</small>'; |
echo '<small>'.$message.'</small>'; |
| } |
} /* }}} */ |
| |
|
| function fm_get_cgi_var($name, $default_value = null) |
|
| { |
|
| global $fm_cfg; |
|
| $name = $fm_cfg['cgi'].$name; |
|
| |
|
| global $HTTP_GET_VARS; |
|
| $var = $HTTP_GET_VARS[$name]; |
|
| |
|
| if (! isset($var)) { |
if (! function_exists('fm_header')) { |
| global $HTTP_POST_VARS; |
function fm_header($var_ar) /* {{{ */ |
| $var = $HTTP_POST_VARS[$name]; |
{ |
| } |
extract($var_ar); |
| |
if (defined('LOADED_AS_MODULE')) { |
| if (isset($var)) { |
OpenTable(); |
| $var = stripslashes($var); |
echo '<font class="pn-title">'._FM_FILE_MANAGER |
| } else { |
. (strlen($fm_dir) > 0 ? ": $fm_dir_he" : '') |
| $var = $default_value; |
. '</font>'; |
| } |
CloseTable(); |
| |
OpenTable(); |
| return $var; |
} else { |
| |
if (strlen($fm_dir) > 0) { |
| |
echo '<h3>'.$fm_dir_he2.'</h3>'."\n"; |
| |
} |
| |
} |
| |
} /* }}} */ |
| } |
} |
| |
|
| |
|
| /* |
/* |
| * Main phpWebFileManager function |
* Main phpWebFileManager function |
| */ |
*/ |
| |
|
| function fm_main() |
function fm_main() /* {{{ */ |
| { |
{ |
| global $fm_cfg; |
global $fm_cfg; |
| global $HTTP_SERVER_VARS; |
global $HTTP_SERVER_VARS; |
| |
|
| /* Hidden parameters */ |
/* Hidden parameters */ |
| $fm_origvars = append_slash($fm_cfg['origvars'], '&'); |
$fm_origvars = fm_append_slash($fm_cfg['origvars'], '&'); |
| $fm_cfg['dir']['root'] = append_slash($fm_cfg['dir']['root']); |
$fm_cfg['dir']['root'] = fm_append_slash($fm_cfg['dir']['root']); |
| $fm_cfg['url']['root'] = append_slash($fm_cfg['url']['root']); |
$fm_cfg['url']['root'] = fm_append_slash($fm_cfg['url']['root']); |
| $fm_cfg['url']['icons'] = append_slash($fm_cfg['url']['icons']); |
$fm_cfg['url']['icons'] = fm_append_slash($fm_cfg['url']['icons']); |
| if (strlen($fm_cfg['format']['date']) <= 0) { |
if (strlen($fm_cfg['format']['date']) <= 0) { |
| $fm_cfg['format']['date'] = _FM_DATE_FORMAT; |
$fm_cfg['format']['date'] = _FM_DATE_FORMAT; |
| } |
} |
| |
|
| |
|
| /* |
/* |
| * Getting CGI variables |
* Getting CGI variables |
| */ |
*/ |
| $fm_action = fm_get_cgi_var('action', ''); |
$fm_action = fm_get_cgi_var($fm_cfg['cgi'].'action', ''); |
| $fm_submit = fm_get_cgi_var('submit', ''); |
$fm_submit = fm_get_cgi_var($fm_cfg['cgi'].'submit', ''); |
| $fm_dir = fm_get_cgi_var('dir', ''); |
$fm_dir = fm_get_cgi_var($fm_cfg['cgi'].'dir', ''); |
| $fm_filename = fm_get_cgi_var('filename', ''); |
$fm_filename = fm_get_cgi_var($fm_cfg['cgi'].'filename', ''); |
| $fm_new_filename = fm_get_cgi_var('new_filename', ''); |
$fm_new_filename = fm_get_cgi_var($fm_cfg['cgi'].'new_filename', ''); |
| $fm_file_data = fm_get_cgi_var('file_data', ''); |
$fm_file_data = fm_get_cgi_var($fm_cfg['cgi'].'file_data', ''); |
| $PHP_SELF = @$HTTP_SERVER_VARS['PHP_SELF']; |
$PHP_SELF = @$HTTP_SERVER_VARS['PHP_SELF']; |
| |
|
| /* |
/* |
| Line 179 function fm_main() |
|
| Line 171 function fm_main() |
|
| /* On some *BSD systems with PHP version <= 4.0.6 |
/* On some *BSD systems with PHP version <= 4.0.6 |
| function chdir() is removing last '/' character |
function chdir() is removing last '/' character |
| in $fm_dir variable, so we must improve it. */ |
in $fm_dir variable, so we must improve it. */ |
| $fm_dir = append_slash($fm_dir); |
$fm_dir = fm_append_slash($fm_dir); |
| } else { |
} else { |
| $fm_dir = ''; |
$fm_dir = ''; |
| } |
} |
| Line 200 function fm_main() |
|
| Line 192 function fm_main() |
|
| * Title writting with current working direcotry information. |
* Title writting with current working direcotry information. |
| */ |
*/ |
| |
|
| if (defined('LOADED_AS_MODULE')) { |
fm_header(array( |
| OpenTable(); |
'fm_filename' => $fm_filename_he, |
| echo '<font class="pn-title">'._FM_FILE_MANAGER |
'fm_filename_he' => $fm_filename_he, |
| . (strlen($fm_dir) > 0 ? ": $fm_dir_he" : '') |
'fm_filename_he2' => $fm_filename_he2, |
| . '</font>'; |
'fm_dir' => $fm_dir, |
| CloseTable(); |
'fm_dir_he' => $fm_dir_he, |
| OpenTable(); |
'fm_dir_he2' => $fm_dir_he2, |
| } else { |
'fm_dir_ue' => $fm_dir_ue |
| if (strlen($fm_dir) > 0) { |
)); |
| echo '<h3>'.$fm_dir_he2.'</h3>'."\n"; |
|
| } |
|
| } |
|
| |
|
| /* |
/* |
| * Form |
* Form |
| Line 219 function fm_main() |
|
| Line 208 function fm_main() |
|
| |
|
| echo '<form enctype="multipart/form-data" method=post' |
echo '<form enctype="multipart/form-data" method=post' |
| . ' action="' . htmlentities($PHP_SELF) . '">'."\n"; |
. ' action="' . htmlentities($PHP_SELF) . '">'."\n"; |
| |
|
| write_origvars_html($fm_origvars); |
|
| |
|
| echo '<input type=hidden value="'.$fm_filename_he.'" name="'.$fm_cfg['cgi'].'filename">'."\n"; |
echo '<input type=hidden value="'.$fm_filename_he.'" name="'.$fm_cfg['cgi'].'filename">'."\n"; |
| echo '<input type=hidden value="'.$fm_dir_he.'" name="'.$fm_cfg['cgi'].'dir">'."\n"; |
echo '<input type=hidden value="'.$fm_dir_he.'" name="'.$fm_cfg['cgi'].'dir">'."\n"; |
| |
echo fm_get_origvars_html($fm_origvars); |
| |
|
| /* PN: PostNuke module calls */ |
/* PN: PostNuke module calls */ |
| if (defined('LOADED_AS_MODULE')) { |
if (defined('LOADED_AS_MODULE')) { |
| Line 648 function fm_main() |
|
| Line 635 function fm_main() |
|
| if ($view_column && $fm_cfg['perm']['file']['view']) { |
if ($view_column && $fm_cfg['perm']['file']['view']) { |
| $view_url = parse_url('http://'.$HTTP_SERVER_VARS['HTTP_HOST'] |
$view_url = parse_url('http://'.$HTTP_SERVER_VARS['HTTP_HOST'] |
| .$HTTP_SERVER_VARS['REQUEST_URI']); |
.$HTTP_SERVER_VARS['REQUEST_URI']); |
| $view_url['path'] = get_path_without_scriptname($view_url) |
$view_url['path'] = fm_get_path_without_scriptname($view_url) |
| . (strlen($fm_cfg['url']['root']) > 0 |
. (strlen($fm_cfg['url']['root']) > 0 |
| ? $fm_cfg['url']['root'] : $fm_cfg['dir']['root']) |
? $fm_cfg['url']['root'] : $fm_cfg['dir']['root']) |
| . $fm_dir_ue . $entry_ue; |
. $fm_dir_ue . $entry_ue; |
| unset($view_url['query']); |
unset($view_url['query']); |
| unset($view_url['fragment']); |
unset($view_url['fragment']); |
| $view_url = str_replace('%2F', '/', glue_url($view_url)); |
$view_url = str_replace('%2F', '/', fm_glue_url($view_url)); |
| } |
} |
| if ($fm_cfg['show']['icons']) { |
if ($fm_cfg['show']['icons']) { |
| echo '<td align=center>'; |
echo '<td align=center>'; |
| Line 848 function fm_main() |
|
| Line 835 function fm_main() |
|
| CloseTable(); |
CloseTable(); |
| include 'footer.php'; |
include 'footer.php'; |
| } |
} |
| } |
} /* }}} */ |
| |
|
| /* |
/* |
| * Main function call |
* Main function call |
| Line 856 function fm_main() |
|
| Line 843 function fm_main() |
|
| |
|
| fm_main(); |
fm_main(); |
| |
|
| |
/* vim: set expandtab tabstop=4 shiftwidth=4: |
| |
* vim600: fdm=marker fdl=0 fdc=0 |
| |
*/ |
| |
|
| ?> |
?> |