Project

General

Profile

Revision 115

View differences:

trunk/install.extplorer.php
1 1
<?php
2
// ensure this file is being included by a parent file
3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
2 4
/**
3 5
* @version $Id$
4 6
* @package eXtplorer
trunk/include/init.php
97 97
	
98 98
$action = stripslashes(extGetParam( $_REQUEST, "action" ));
99 99
$default_lang = !empty( $GLOBALS['mosConfig_lang'] ) ? $GLOBALS['mosConfig_lang'] : ext_Lang::detect_lang();
100
$GLOBALS["language"] = $mainframe->getUserStateFromRequest( 'language', 'lang', $default_lang );
100
$GLOBALS["language"] = basename($mainframe->getUserStateFromRequest( 'language', 'lang', $default_lang ));
101 101
// Get Item
102 102
if(isset($_REQUEST["item"])) 
103 103
  $GLOBALS["item"]=$item = stripslashes(rawurldecode($_REQUEST["item"]));
trunk/include/functions.php
1307 1307
	}
1308 1308
}
1309 1309

  
1310
?>
1310
?>
trunk/include/extract.php
69 69
					if( $res == 0 ) {
70 70
						ext_Result::sendResult( 'extract', false, ext_Lang::err( 'extract_failure' ).' ('.$zip->errorInfo(true).')');
71 71
					} else
72
						ext_Result::sendResult( 'extract', false, ext_Lang::msg( 'extract_success' ).print_r($res,true));
72
						ext_Result::sendResult( 'extract', false, ext_Lang::msg( 'extract_success' ));
73 73
				
74 74
				break ;
75 75
				
trunk/application.php
110 110
	}
111 111
	function detect_lang() {
112 112
		$default = 'english';
113
		if( empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) return $default;
113 114
		
114 115
		 $_AL=strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);
115 116
		 $_UA=strtolower($_SERVER['HTTP_USER_AGENT']);
trunk/webdav_authenticate.php
1
<?php
2
// ensure this file is being included by a parent file
3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
4
# Author: Vincent JAULIN
5
# Copyright: Keyphrene.com 2008 @ all rights reserved
6

  
7
// function to parse the http auth header
8
function http_digest_parse($txt)
9
{
10
    // protect against missing data
11
    $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1);
12
    $data = array();
13

  
14
    preg_match_all('@(\w+)=([\'"]?)([%a-zA-Z0-9=./\_-]+)\2@', $txt, $matches, PREG_SET_ORDER);
15

  
16
    foreach ($matches as $m) {
17
        $data[$m[1]] = $m[3];
18
        unset($needed_parts[$m[1]]);
19
    }
20

  
21
    return $needed_parts ? false : $data;
22
}
23

  
24
function AuthenticationDigestHTTP($realm, $users, $phpcgi=0) {
25
	if (empty($_SERVER['PHP_AUTH_DIGEST']) && empty($_SERVER['REDIRECT_REMOTE_USER'])){
26
		header('HTTP/1.1 401 Unauthorized');
27
		header('WWW-Authenticate: Digest realm="'.$realm.'" qop="auth" nonce="'.uniqid(rand(), true).'" opaque="'.md5($realm).'"');
28
		die('401 Unauthorized');
29
	}
30
	// analyze the PHP_AUTH_DIGEST variable
31
	$auth = $_SERVER['PHP_AUTH_DIGEST'];
32
	if ($phpcgi == 1) {
33
		$auth = $_SERVER['REDIRECT_REMOTE_USER'];
34
	}
35
	$data = http_digest_parse($auth);
36
	if (!array_key_exists($data['username'], $users)) {
37
		header('HTTP/1.1 401 Unauthorized');
38
		die('401 Unauthorized');
39
	}
40
		
41
	// generate the valid response
42
	$A1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]);
43
	$A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
44
	$valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);
45
	
46
	if ($data['response'] != $valid_response) {
47
		header('HTTP/1.1 401 Unauthorized');
48
		die('401 Unauthorized');
49
	}
50
	return TRUE;
51
}
52

  
53
function AuthenticationBasicHTTP($realm, $users, $phpcgi=0) {
54
	
55
	if (empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['REDIRECT_REMOTE_USER'])) {
56
		header('WWW-Authenticate: Basic realm="'.$realm.'"');
57
		header('HTTP/1.0 401 Unauthorized');
58
		die('401 Unauthorized');
59
	}
60
	
61
	$user = $_SERVER['PHP_AUTH_USER'];
62
	if ($phpcgi == 1) {		
63
		$matches = explode(' ', $_SERVER['REDIRECT_REMOTE_USER']);
64
		list($name, $password) = explode(':', base64_decode($matches[1]));
65
		$_SERVER['PHP_AUTH_USER'] = $user = strip_tags($name);
66
		$_SERVER['PHP_AUTH_PW']    = strip_tags($password);
67
	}
68

  
69
	if (array_key_exists($user, $users) && $users[$user] == extEncodePassword($_SERVER['PHP_AUTH_PW']) ){
70
		activate_user($user, extEncodePassword($_SERVER['PHP_AUTH_PW']));
71
		return TRUE;
72
	}
73

  
74
	header('WWW-Authenticate: Basic realm="'.$realm.'"');
75
	header('HTTP/1.0 401 Unauthorized');
76
	die('401 Unauthorized');
77
	return FALSE;
78
}
79
?>
0 80

  
trunk/webdav.php
1
<?php
2

  
3
# Author: Vincent JAULIN
4
# Copyright: Keyphrene.com 2008 @ all rights reserved
5

  
6
# Tests on:
7
# PHP 5 mode CGI
8
# PHP5 mode mod_php
9

  
10
# INSTALL
11
# 1 - Create a folder
12
# 2 - Extract and Copy package on your site with a client FTP
13
# 3 - Configure webdav.php (change this script name for security reason)
14
# 4 - Create .htaccess in your webdav folder (only PHP-CGI)
15
# <IfModule mod_rewrite.c>
16
#	RewriteEngine on
17
#	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
18
# </IfModule>
19
# 5 - Test with a Webdav Client (Naja for example ;-))
20
define('_JEXEC', 1 );
21

  
22
require_once(dirname(__FILE__)."/webdav_authenticate.php");
23
include_once(dirname(__FILE__)."/config/conf.php");
24

  
25
if( empty($GLOBALS['allow_webdav'] )) {
26
	header('HTTP/1.0 403 Forbidden');
27
	die('403 Forbidden');
28
}
29

  
30
include_once(dirname(__FILE__)."/include/users.php");
31
include_once(dirname(__FILE__)."/include/functions.php");
32
define('_EXT_PATH', dirname(__FILE__));
33

  
34
ini_set("default_charset", "UTF-8");
35
ini_set("display_errors", 0 );
36

  
37
# Activate if your PHP is CGI mode
38
$phpcgi = substr(PHP_SAPI, 0, 3) == 'cgi';
39
$realm = 'Restricted Area: eXtplorer WebDAV';
40

  
41
load_users();
42

  
43
foreach( $GLOBALS["users"] as $user ) {
44
	$users[$user[0]] = $user[1];
45
}
46

  
47
// Authenticate the user or ask to login. We have to use basic authorization, because the passwords are stored in an encrypted format
48
AuthenticationBasicHTTP($realm, $users, $phpcgi);
49

  
50
require_once( dirname(__FILE__). "/libraries/HTTP/WebDAV/Server/Filesystem.php");
51
$server = new HTTP_WebDAV_Server_Filesystem();
52
$server->db_host = $GLOBALS['DB_HOST'];
53
$server->db_name = $GLOBALS['DB_NAME'];
54
$server->db_user = $GLOBALS['DB_USER'];
55
$server->db_passwd = $GLOBALS['DB_PASSWORD'];
56
$server->db_type = $GLOBALS['DB_TYPE'];
57

  
58
# Real path of your site
59
$server->ServeRequest($GLOBALS["home_dir"]);
60

  
61
?>
trunk/webdav_table.sql.php
1
<?php if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
2

  
3
// This is the file to create a "webdav" database with 2 tables
4
// so you can use WebDAV with eXtplorer
5
// Just copy the SQL code below and execute it using a Database Management Script like phpMyAdmin
6
?>
7
CREATE DATABASE webdav;
8
USE webdav;
9

  
10
--
11
-- Table structure for table 'locks'
12
--
13

  
14
CREATE TABLE locks (
15
  token varchar(255) NOT NULL default '',
16
  path varchar(200) NOT NULL default '',
17
  expires int(11) NOT NULL default '0',
18
  owner varchar(200) default NULL,
19
  recursive int(11) default '0',
20
  writelock int(11) default '0',
21
  exclusivelock int(11) NOT NULL default 0,
22
  PRIMARY KEY  (token),
23
  UNIQUE KEY token (token),
24
  KEY path (path),
25
  KEY expires (expires)
26
) TYPE=MyISAM;
27

  
28
--
29
-- Dumping data for table 'locks'
30
--
31

  
32

  
33
--
34
-- Table structure for table 'properties'
35
--
36

  
37
CREATE TABLE properties (
38
  path varchar(255) NOT NULL default '',
39
  name varchar(120) NOT NULL default '',
40
  ns varchar(120) NOT NULL default 'DAV:',
41
  value text,
42
  PRIMARY KEY ( `ns` ( 100 ) , `path` ( 100 ) , `name` ( 50 ) ),
43
  KEY path (path)
44
) TYPE=MyISAM;
45

  
46
--
47
-- Dumping data for table 'properties'
48
--
49

  
50

  
0 51

  
trunk/config/conf.php
2 2
// ensure this file is being included by a parent file
3 3
if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
4 4

  
5
//-------------Configuration Variables---------------------------------------------
6
// Send gzipped content if accepted by the browser?
7
$GLOBALS['use_gzip'] = 1;
8

  
9
$GLOBALS['allow_webdav'] = 0;
10
// The following database settings are only necessary if you want to use WebDAV
11
// If you actually decide to enable the WebDAV interface, you must first of all create a new database
12
// by using the instructions from the file "webdav_table.sql.php", which can be found in the same directory as this file
13
$GLOBALS['DB_HOST'] = 'localhost';
14
$GLOBALS['DB_NAME'] = 'webdav';
15
$GLOBALS['DB_USER'] = 'root';
16
$GLOBALS['DB_PASSWORD'] = 'root';
17
$GLOBALS['DB_TYPE'] = 'mysql'; // Name of the Database Server Type
18

  
5 19
//------------------------------------------------------------------------------
6
// Configuration Variables
7
	// Send gzipped content if accepted by the browser?
8
	$GLOBALS['use_gzip'] = 1;
9
//------------------------------------------------------------------------------
10 20
// Global User Variables (used when $require_login==false)
11
	
12
	// show hidden files in eXtplorer: (hide files starting with '.', as in Linux/UNIX)
13
	$GLOBALS["show_hidden"] = true;
14
	
15
	// filenames not allowed to access: (uses PCRE regex syntax)
16
	// Example: Hide files starting with ".ht" (like .htaccess):  ^\.ht
17
	$GLOBALS["no_access"] = ''; // "^\.ht";
18
	
19
	// user permissions bitfield: (1=modify, 2=password, 4=admin, add the numbers)
20
	$GLOBALS["permissions"] = 7;
21

  
22
// show hidden files in eXtplorer: (hide files starting with '.', as in Linux/UNIX)
23
$GLOBALS["show_hidden"] = true;
24

  
25
// filenames not allowed to access: (uses PCRE regex syntax)
26
// Example: Hide files starting with ".ht" (like .htaccess):  ^\.ht
27
$GLOBALS["no_access"] = ''; // "^\.ht";
28

  
29
// user permissions bitfield: (1=modify, 2=password, 4=admin, add the numbers)
30
$GLOBALS["permissions"] = 7;
21 31
//------------------------------------------------------------------------------
22 32
/* NOTE:
23 33
	Users can be defined by using the Admin-section,
trunk/CHANGELOG.txt
2 2
Changelog for eXtplorer
3 3
Version $Id$
4 4
****************************
5

  
6
- added script for WebDAV access (disabled by default, requires 2 database tables and DB login credentials)
7
- fixed a security issue within script initialization
8

  
9
-- version 2.0.0 stable released (2008-08-05) ----
10

  
5 11
- added .csv to the editable file types
6 12
- when copying/moving multiple directories, only the first directory was processed
7 13
- fixed failing extraction of larger archives ("Failed to connect to the server")
trunk/languages/english.php
97 97
	"extractlink"	=> "Extract Archive",
98 98
	'chmodlink'		=> 'Change (chmod) Rights (Folder/File(s))', // new mic
99 99
	'mossysinfolink'	=> 'eXtplorer System Information (eXtplorer, Server, PHP, mySQL)', // new mic
100
	'logolink'		=> 'Go to the joomlaXplorer Website (new window)', // new mic
100
	'logolink'		=> 'Go to the eXtplorer Website (new window)', // new mic
101 101

  
102 102
	// list
103 103
	"nameheader"		=> "Name",
trunk/languages/romanian.php
1
<?php
2
// $Id: english.php 96 2008-02-03 18:13:22Z soeren $
3
// English Language Module for v2.3 (translated by the QuiX project)
4
global $_VERSION;
5

  
6
$GLOBALS["charset"] = "UTF-8";
7
$GLOBALS["text_dir"] = "ltr"; // ('ltr' for left to right, 'rtl' for right to left)
8
$GLOBALS["date_fmt"] = "Y/m/d H:i";
9
$GLOBALS["error_msg"] = array(
10
	// error
11
	"error"			=> "Eroare(i)",
12
	"message"			=> "Mesaj(e)",
13
	"back"			=> "Inapoi",
14

  
15
	// root
16
	"home"			=> "Directorul radacina nu exista, verificati setarile.",
17
	"abovehome"		=> "Directorul curent nu poate fi inaintea directorului radacina.",
18
	"targetabovehome"	=> "Directorul tinta nu poate fi inaintea directorului radacina.",
19

  
20
	// exist
21
	"direxist"		=> "Drectorul nu exista.",
22
	//"filedoesexist"	=> "This file already exists.",
23
	"fileexist"		=> "Fisierul nu exista.",
24
	"itemdoesexist"		=> "Elementul exista deja.",
25
	"itemexist"		=> "Elementul nu exista.",
26
	"targetexist"		=> "Directoul tinra nu exista.",
27
	"targetdoesexist"	=> "Elementul tinta deja exista .",
28

  
29
	// open
30
	"opendir"		=> "Nu pot deschide directorul.",
31
	"readdir"		=> "Nu pot citi directorul.",
32

  
33
	// access
34
	"accessdir"		=> "Nu aveti dreptul de a accesa acest director.",
35
	"accessfile"		=> "Nu aveti dreptul de a accesa acest fisier.",
36
	"accessitem"		=> "Nu aveti dreptul de a accesa acest element.",
37
	"accessfunc"		=> "Nu aveti dreptul de a folosi aceasta functie.",
38
	"accesstarget"		=> "Nu aveti dreptul de a accesa directorul tinta.",
39

  
40
	// actions
41
	"permread"		=> "Schimbarea permisiunilor esuata.",
42
	"permchange"		=> "Eroare CHMOD (de obicei datorita proprietatii unui fisier - ex. daca utilizatorul HTTP ('wwwrun' or 'nobody') si utilizatorul FTP sunt diferiti)",
43
	"openfile"		=> "Deschiderea fisierului esuata.",
44
	"savefile"		=> "Salvarea fisierului esuata.",
45
	"createfile"		=> "Crearea fisierului esuata.",
46
	"createdir"		=> "Crearea directorului esuata.",
47
	"uploadfile"		=> "Urcarea fisierului esuata.",
48
	"copyitem"		=> "Copiere esuata.",
49
	"moveitem"		=> "Mutare esuata.",
50
	"delitem"		=> "Stergere esuata.",
51
	"chpass"		=> "Schimbarea parolei esuata.",
52
	"deluser"		=> "Stergerea utilizatorului esuata.",
53
	"adduser"		=> "Adaugarea utilizatorului esuata.",
54
	"saveuser"		=> "Salvarea utilizatorului esuata.",
55
	"searchnothing"		=> "Trebuie sa introduceti ceva pt. cautare .",
56

  
57
	// misc
58
	"miscnofunc"		=> "Functie inaccesibila.",
59
	"miscfilesize"		=> "Fisierul depaseste marimea maxima.",
60
	"miscfilepart"		=> "Fisier urcat partial.",
61
	"miscnoname"		=> "Trebuie sa introduceti un nume.",
62
	"miscselitems"		=> "Nu ati selectat nici un element.",
63
	"miscdelitems"		=> "Sunteti sigur ca doriti stergerea acestui(acestor) {0}elemnt(e)?",
64
	"miscdeluser"		=> "Sunteti sigur ca doriti stergerea utilizatorului '{0}'?",
65
	"miscnopassdiff"	=> "Parola noua nu difera de cea curenta.",
66
	"miscnopassmatch"	=> "Parolele nu sunt identice.",
67
	"miscfieldmissed"	=> "Ati omis un camp important.",
68
	"miscnouserpass"	=> "Utilizator sau parola incorect(a).",
69
	"miscselfremove"	=> "Nu va puteti sterge pe dvs..",
70
	"miscuserexist"		=> "Utilizatorul deja exista.",
71
	"miscnofinduser"	=> "Nu gasesc utilizatorul.",
72
	"extract_noarchive" => "Fisierul nu este o arhiva pt. a putea fi extras.",
73
	"extract_unknowntype" => "Arhiva necunoscuta",
74

  
75
	'chmod_none_not_allowed' => 'Schimbarea Permisiunilor pt <none> nepermisa',
76
	'archive_dir_notexists' => 'Directorul Salveaza-Acolo specificat nu exista.',
77
	'archive_dir_unwritable' => 'Specificati un director tinta cu permisiune de scriere pt. salvarea arhivei.',
78
	'archive_creation_failed' => 'Salvarea fisierului Arhiva esuata'
79

  
80
);
81
$GLOBALS["messages"] = array(
82
	// links
83
	"permlink"		=> "Schimbarea permisiunilor",
84
	"editlink"		=> "Editare",
85
	"downlink"		=> "Descarcare",
86
	"uplink"		=> "Sus",
87
	"homelink"		=> "Acasa",
88
	"reloadlink"		=> "Reincarcare",
89
	"copylink"		=> "Copiere",
90
	"movelink"		=> "Mutare",
91
	"dellink"		=> "Stergere",
92
	"comprlink"		=> "Arhivare",
93
	"adminlink"		=> "Admin",
94
	"logoutlink"		=> "Deconectare",
95
	"uploadlink"		=> "Incarcare",
96
	"searchlink"		=> "Cautare",
97
	"extractlink"	=> "Extragere Arhiva",
98
	'chmodlink'		=> 'Schimbare drepturile (chmod) (Director/Fisie(e))', // new mic
99
	'mossysinfolink'	=> 'Sistemul de Informatii eXtplorer (eXtplorer, Server, PHP, mySQL)', // new mic
100
	'logolink'		=> 'Mergi la site-ul joomlaXplorer (fereastra noua)', // new mic
101

  
102
	// list
103
	"nameheader"		=> "Nume",
104
	"sizeheader"		=> "Marime",
105
	"typeheader"		=> "Tip",
106
	"modifheader"		=> "Modificat",
107
	"permheader"		=> "Permisiuni",
108
	"actionheader"		=> "Actiuni",
109
	"pathheader"		=> "Cale",
110

  
111
	// buttons
112
	"btncancel"		=> "Anuleaza",
113
	"btnsave"		=> "Salvare",
114
	"btnchange"		=> "Schimba",
115
	"btnreset"		=> "Reset",
116
	"btnclose"		=> "Inchide",
117
	"btncreate"		=> "Creaza",
118
	"btnsearch"		=> "Cauta",
119
	"btnupload"		=> "Urca",
120
	"btncopy"		=> "Copiaza",
121
	"btnmove"		=> "Muta",
122
	"btnlogin"		=> "Conectare",
123
	"btnlogout"		=> "Deconectare",
124
	"btnadd"		=> "Adaugare",
125
	"btnedit"		=> "Editare",
126
	"btnremove"		=> "Stergere",
127

  
128
	// user messages, new in joomlaXplorer 1.3.0
129
	'renamelink'	=> 'Redenumire',
130
	'confirm_delete_file' => 'Sigur stergeti acest fisier ? <br />%s',
131
	'success_delete_file' => 'Element(e) sters(e).',
132
	'success_rename_file' => 'Directorul/fisierul %s a fost redenumit in %s.',
133

  
134
	// actions
135
	"actdir"		=> "Director",
136
	"actperms"		=> "Schimba permisiuni",
137
	"actedit"		=> "Editeaza fisierul",
138
	"actsearchresults"	=> "Cauta rezultate",
139
	"actcopyitems"		=> "Copiaza elementul(e)",
140
	"actcopyfrom"		=> "Copiaza din /%s in /%s ",
141
	"actmoveitems"		=> "Muta elementul(e)",
142
	"actmovefrom"		=> "Muta din /%s in /%s ",
143
	"actlogin"		=> "Conectare",
144
	"actloginheader"	=> "Conectare pt. folosirea eXtplorer",
145
	"actadmin"		=> "Administrare",
146
	"actchpwd"		=> "Schimba pasrola",
147
	"actusers"		=> "Utilizatori",
148
	"actarchive"		=> "Element(e) Arciva",
149
	"actupload"		=> "Urcare fisier(e)",
150

  
151
	// misc
152
	"miscitems"		=> "Element(e)",
153
	"miscfree"		=> "Liber",
154
	"miscusername"		=> "Utilizator",
155
	"miscpassword"		=> "Parola",
156
	"miscoldpass"		=> "Parola veche",
157
	"miscnewpass"		=> "Parola noua",
158
	"miscconfpass"		=> "Confirma parola",
159
	"miscconfnewpass"	=> "Confirma noua parola",
160
	"miscchpass"		=> "Schimba parola",
161
	"mischomedir"		=> "Directorul radacina",
162
	"mischomeurl"		=> "URL radacina",
163
	"miscshowhidden"	=> "Afiseaza elementele ascunse",
164
	"mischidepattern"	=> "Sablon de ascundere",
165
	"miscperms"		=> "Permisiuni",
166
	"miscuseritems"		=> "(nume, director radacina, afiseaza elementele ascunse, permisiuni, activ)",
167
	"miscadduser"		=> "adauga utilizator",
168
	"miscedituser"		=> "editeaza utilizatorul '%s'",
169
	"miscactive"		=> "Activ",
170
	"misclang"		=> "Limba",
171
	"miscnoresult"		=> "Nici un rezultate.",
172
	"miscsubdirs"		=> "Cauta subdirectori",
173
	"miscpermnames"		=> array("Doar vedere","Modifica","Schimba parola","Modifica si Schimba parola",
174
					"Administrator"),
175
	"miscyesno"		=> array("DA","Nu","D","N"),
176
	"miscchmod"		=> array("Proprietar", "Grup", "Public"),
177

  
178
	// from here all new by mic
179
	'miscowner'			=> 'Proprietar',
180
	'miscownerdesc'		=> '<strong>Descriere:</strong><br />Utilizator (UID) /<br />Grup (GID)<br />Drepturi curente:<br /><strong> %s ( %s ) </strong>/<br /><strong> %s ( %s )</strong>',
181

  
182
	// sysinfo (new by mic)
183
	'simamsysinfo'		=> "Informatii sistem eXtplorer",
184
	'sisysteminfo'		=> 'Informatii Sistem',
185
	'sibuilton'			=> 'Sistem de Operare',
186
	'sidbversion'		=> 'Versiunea Bazei de Date(MySQL)',
187
	'siphpversion'		=> 'Versiunea PHP',
188
	'siphpupdate'		=> 'INFORMATII: <span style="color: red;">Versiunea PHP folosita<strong>nu</strong>este actualizata!</span><br />Pentru garantarea tuturor facilitatilor Mambo si a pachetelor auxiliare,<br />aveti nevoie de cel putin <strong>PHP.Versiunea 4.3</strong>!',
189
	'siwebserver'		=> 'Server Web',
190
	'siwebsphpif'		=> 'Server Web - Interfata PHP',
191
	'simamboversion'	=> 'Versiunea eXtplorer',
192
	'siuseragent'		=> 'Versiunea Browser-ului',
193
	'sirelevantsettings' => 'Setari PHP Importante',
194
	'sisafemode'		=> 'Mod de siguranta',
195
	'sibasedir'			=> 'Deschide directorul radacina',
196
	'sidisplayerrors'	=> 'Erori PHP',
197
	'sishortopentags'	=> 'Deschide Tag-uri scurte',
198
	'sifileuploads'		=> 'Urcare Fisiere',
199
	'simagicquotes'		=> 'Ghilimele Magice',
200
	'siregglobals'		=> 'Inregistreaza variabile globale',
201
	'sioutputbuf'		=> 'Afiseaza Buffer-ul',
202
	'sisesssavepath'	=> 'Calea de salvare a sesiunilor',
203
	'sisessautostart'	=> 'Pornire automata a sesiunilor',
204
	'sixmlenabled'		=> 'XML activat',
205
	'sizlibenabled'		=> 'ZLIB activat',
206
	'sidisabledfuncs'	=> 'Functii dezactivate',
207
	'sieditor'			=> 'WYSIWYG Editor',
208
	'siconfigfile'		=> 'Fisier configurare',
209
	'siphpinfo'			=> 'PHP Info',
210
	'siphpinformation'	=> 'Informatii PHP',
211
	'sipermissions'		=> 'Permisiuni',
212
	'sidirperms'		=> 'Permisiunile Directorului',
213
	'sidirpermsmess'	=> 'Pt. a fi sigur(a) ca toate functiile si facilitatile eXtplorer sunt executate corect, urmatori directori ttrebuie sa aiba permisiune de scriere [chmod 0777]',
214
	'sionoff'			=> array( 'Pornit', 'Oprit' ),
215

  
216
	'extract_warning' => "Sigur doriti extragerea fisierului ? Aici?<br />Aceasta va suprascrie fisiere existente daca nu exista atentie!",
217
	'extract_success' => "Extragere reusita",
218
	'extract_failure' => "Extragere nereusita",
219

  
220
	'overwrite_files' => 'Suprascrie fisierul(e) existent(e)?',
221
	"viewlink"		=> "Vizualizare",
222
	"actview"		=> "Afiseaza suersa fisierului",
223

  
224
	// added by Paulino Michelazzo (paulino@michelazzo.com.br) to fun_chmod.php file
225
	'recurse_subdirs'	=> 'Accesez in adancime subdirectorii?',
226

  
227
	// added by Paulino Michelazzo (paulino@michelazzo.com.br) to footer.php file
228
	'check_version'	=> 'Caut ultima versiune',
229

  
230
	// added by Paulino Michelazzo (paulino@michelazzo.com.br) to fun_rename.php file
231
	'rename_file'	=>	'Redenumesc un director sau fisier...',
232
	'newname'		=>	'Nume nou',
233

  
234
	// added by Paulino Michelazzo (paulino@michelazzo.com.br) to fun_edit.php file
235
	'returndir'	=>	'Revin in director dupa salvare?',
236
	'line'		=> 	'Linie',
237
	'column'	=>	'Coloana',
238
	'wordwrap'	=>	'Wordwrap: (doar in IE)',
239
	'copyfile'	=>	'Copiez continutul in acess fisier',
240

  
241
	// Bookmarks
242
	'quick_jump' => 'Salt rapid la',
243
	'already_bookmarked' => 'Director deja marcat',
244
	'bookmark_was_added' => 'Director adaugat in lista de marcaje.',
245
	'not_a_bookmark' => 'Directorul nu este un marcaj.',
246
	'bookmark_was_removed' => 'Director scos din lista de marcaje.',
247
	'bookmarkfile_not_writable' => "Eroare de marcare a %s.\n Fisierul de marcaje '%s' \nnu permite scrierea.",
248

  
249
	'lbl_add_bookmark' => 'Adauga acest Director ca Marcaj',
250
	'lbl_remove_bookmark' => 'Sterge acest Director din lista de marcaje',
251

  
252
	'enter_alias_name' => 'Introduceti un alias pentru acest marcaj',
253

  
254
	'normal_compression' => 'compresie normala',
255
	'good_compression' => 'compresie buna',
256
	'best_compression' => 'cea mai buna compresie',
257
	'no_compression' => 'fara compresie',
258

  
259
	'creating_archive' => 'Creea Arhiva...',
260
	'processed_x_files' => 'Am procesat %s din %s fisiere',
261

  
262
	'ftp_header' => 'Autentificare FTP locala',
263
	'ftp_login_lbl' => 'Introduceti datele de autentificare pentru serverul FTP',
264
	'ftp_login_name' => 'Utilizator FTP',
265
	'ftp_login_pass' => 'Parola FTP',
266
	'ftp_hostname_port' => 'Server FTP Hostname si Port <br />(Portul este optional)',
267
	'ftp_login_check' => 'Verificarea conexiunii FTP...',
268
	'ftp_connection_failed' => "Serverul FTP nu poate fi contactat. \nVerificati daca serverul FTP ruleaza pe serverul dvs.",
269
	'ftp_login_failed' => "Autentificarea FTP esuata. Verificati utilizatorul si parola si reincercati.",
270

  
271
	'switch_file_mode' => 'Mod curent: <strong>%s</strong>. Puteti schimba in modul %s.',
272
	'symlink_target' => 'Tinta Legaturii Simbolice',
273

  
274
	"permchange"		=> "CHMOD Reusit:",
275
	"savefile"		=> "Fisier salvat.",
276
	"moveitem"		=> "Mutare reusita.",
277
	"copyitem"		=> "Copiere reusita.",
278
	'archive_name' 	=> 'Numele fisierului Arhiva',
279
	'archive_saveToDir' 	=> 'Salveaza Arhiva in acest director',
280

  
281
	'editor_simple'	=> 'Editor in Mod Simplu',
282
	'editor_syntaxhighlight'	=> 'Mod Sintaxa-Evidentiata',
283

  
284
	'newlink'	=> 'Fisier/Director nou',
285
	'show_directories' => 'Afiseaza Directorii',
286
	'actlogin_success' => 'Conectare reusita!',
287
	'actlogin_failure' => 'Conectare esuata, reincercati.',
288
	'directory_tree' => 'Structura de directori',
289
	'browsing_directory' => 'Navigare in Directori',
290
	'filter_grid' => 'Filtru',
291
	'paging_page' => 'Pagina',
292
	'paging_of_X' => 'din {0}',
293
	'paging_firstpage' => 'Prima Pagina',
294
	'paging_lastpage' => 'Ultima Pagina',
295
	'paging_nextpage' => 'Urmatoarea Pagina',
296
	'paging_prevpage' => 'Pagina anterioara',
297

  
298
	'paging_info' => 'Afisez Elementele {0} - {1} din {2}',
299
	'paging_noitems' => 'Nici un element de afisat',
300
	'aboutlink' => 'Despre...',
301
	'password_warning_title' => 'Important - Schimbati parola!',
302
	'password_warning_text' => 'Utilizatorul cu are sunteti autentificat (admin cu parola: admin) corespunde setarilor implicite eXtplorer. Instalarea eXtplorer este vulneravila intrusilor si trebuie imediat sa fixati aceasta lucru!',
303
	'change_password_success' => 'Parola schimbata!',
304
	'success' => 'Succes',
305
	'failure' => 'Eroare',
306
	'dialog_title' => 'Site de dialog',
307
	'upload_processing' => 'Procesez Urcarea, asteptati...',
308
	'upload_completed' => 'Urcare reusita!',
309
	'acttransfer' => 'Transfer de la alt Server',
310
	'transfer_processing' => 'Procesez un transfer Server-Server, asteptati...',
311
	'transfer_completed' => 'Transfer terminat!',
312
	'max_file_size' => 'Marime maxima fisier',
313
	'max_post_size' => 'Limita de urcare maxima',
314
	'done' => 'Am terminat.',
315
	'permissions_processing' => 'Aplic permisiunile, asteptati...',
316
	'archive_created' => 'Arhiva creata!',
317
	'save_processing' => 'Salvez Fisierul...',
318
	'current_user' => 'Scruptul ruleaza momentan cu permisiunile utilizatorului:',
319
	'your_version' => 'Versiunea Dvs.',
320
	'search_processing' => 'Caut, asteptati...',
321
	'url_to_file' => 'Adresa URL a fisierului',
322
	'file' => 'Fisier'
323

  
324
);
325
?>
0 326

  
trunk/languages/romanian_mimes.php
1
<?php
2

  
3
// English Mimes Module for v2.3 (translated by the QuiX project)
4

  
5
$GLOBALS["mimes"]=array(
6
	// dir, exe, file
7
	"dir"	=> "Director",
8
	"exe"	=> "Fisier Executabil",
9
	"file"	=> "Fisier",
10
	"symlink"	=> "Legatura Simbolica",
11

  
12
	// text
13
	"text"	=> "Fisier Text",
14

  
15
	// programming
16
	"php"	=> "Script PHP",
17
	"sql"	=> "Fisier SQL",
18
	"perl"	=> "Script PERL",
19
	"html"	=> "Pagina HTML",
20
	"js"	=> "Fisier Javascript",
21
	"css"	=> "Fisier CSS",
22
	"cgi"	=> "Script CGI",
23
	// C++
24
	"cpps"	=> "Fisier sursa C++",
25
	"cpph"	=> "Fisier Header C++",
26
	// Java
27
	"javas"	=> "Fisier Sursa Java",
28
	"javac"	=> "Fisier Clasa Java",
29
	// Pascal
30
	"pas"	=> "Fisier Pascal",
31

  
32
	// images
33
	"gif"	=> "Imagine GIF",
34
	"jpg"	=> "Imagine JPG",
35
	"bmp"	=> "Imagine BMP",
36
	"png"	=> "Imagine PNG",
37

  
38
	// compressed
39
	"zip"	=> "Arhiva ZIP",
40
	"tar"	=> "Arhiva TAR",
41
	"gzip"	=> "Arhiva GZIP",
42
	"bzip2"	=> "Arhiva BZIP2",
43
	"rar"	=> "Arhiva RAR",
44

  
45
	// music
46
	"mp3"	=> "Fisier Audio MP3",
47
	"wav"	=> "Fisier Audio WAV",
48
	"midi"	=> "Fisier Audio MIDI",
49
	"real"	=> "Fisier RealAudio",
50

  
51
	// movie
52
	"mpg"	=> "Fisier Video MPG",
53
	"mov"	=> "Fisier Movie File",
54
	"avi"	=> "Fisier Video AVI",
55
	"flash"	=> "Fisier Flash Movie",
56

  
57
	// Micosoft / Adobe
58
	"word"	=> "Document Word",
59
	"excel"	=> "Document Excel",
60
	"pdf"	=> "Fisier PDF"
61
); ?>
0 62

  
trunk/languages/finnish.php
1 1
<?php
2
// Finnish Language file for eXtplorer 2.0.0 RC4 UTF-8
3
// Version 1.0 dated 04.06.2008
2
// Finnish language file for eXtplorer 2.0.0 Stable UTF-8
3
// Dated 06.08.2008
4 4
// Based on JoomlaXplorer 1.6.1 language file
5
// Markku Suominen / admin@joomlaportal.fi
5
// Author: Markku Suominen / admin@joomlaportal.fi
6
// Author/Editor: Sami Haaranen / mortti@joomlaportal.fi
6 7
// Finnish Joomla translation team, http://www.joomlaportal.fi
7 8
global $_VERSION;
8 9

  
......
56 57
	"adduser"		=> "Käyttäjän lisäys epäonnistui.",
57 58
	"saveuser"		=> "Käyttäjän tallennus epäonnistui.",
58 59
	"searchnothing"		=> "Sinun pitää antaa jotain etsittävää.",
59
	
60

  
60 61
	// misc
61 62
	"miscnofunc"		=> "Toiminto ei ole käytettävissä.",
62 63
	"miscfilesize"		=> "Tiedosto koko ylittää suurimman sallitun arvon.",
......
72 73
	"miscselfremove"	=> "Et voi poistaa omaa tunnustasi.",
73 74
	"miscuserexist"		=> "Käyttäjä on jo olemassa.",
74 75
	"miscnofinduser"	=> "Käyttäjää ei löydy.",
75
	"extract_noarchive" => "Tiedoston tyyppi ei ole sellainen joka voidaan purkaa.",
76
	"extract_noarchive" => "Tiedostomuoto ei ole sellainen joka voidaan purkaa.",
76 77
	"extract_unknowntype" => "Tuntematon arkistointimuoto",
77 78
	
78 79
	'chmod_none_not_allowed' => 'Käyttöoikeuksien muutos <none> ei ole sallittu',
79
	'archive_dir_notexists' => 'The Save-To Directory you have specified does not exist.',
80
	'archive_dir_unwritable' => 'Please specify a writable directory to save the archive to.',
80
	'archive_dir_notexists' => 'Tallennuksiin määriteltyä hakemistoa ei ole olemassa.',
81
	'archive_dir_unwritable' => 'Määrittele kirjoitettava hakemisto tallentaaksesi arkisto sinne.',
81 82
	'archive_creation_failed' => 'Arkistotiedoston tallennus epäonnistui'
82 83
	
83 84
);
......
101 102
	'chmodlink'		=> 'Muuta (chmod) oikeudet (kansio/tiedosto(t))', // new mic
102 103
	'mossysinfolink'	=> 'eXtplorer järjestelmätiedot (eXtplorer, palvelin, PHP, mySQL)', // new mic
103 104
	'logolink'		=> 'Siirry eXtplorer sivustolle(uusi ikkuna)', // new mic
104
	
105

  
105 106
	// list
106 107
	"nameheader"		=> "Nimi",
107 108
	"sizeheader"		=> "Koko",
......
110 111
	"permheader"		=> "Oikeudet",
111 112
	"actionheader"		=> "Toiminnot",
112 113
	"pathheader"		=> "Polku",
113
	
114

  
114 115
	// buttons
115 116
	"btncancel"		=> "Peru",
116 117
	"btnsave"		=> "Tallenna",
......
266 267
	'ftp_login_lbl' => 'Anna FTP-palvelimen vaatimat kirjatumistiedot',
267 268
	'ftp_login_name' => 'FTP käyttäjätunnus',
268 269
	'ftp_login_pass' => 'FTP salasana',
269
	'ftp_hostname_port' => 'FTP-palvelimen nimi ja portti<br />(portti on valinnainen)',
270
	'ftp_hostname_port' => 'FTP-palvelimen nimi ja portti <br />(portti on valinnainen)',
270 271
	'ftp_login_check' => 'Tarkistetaan FTP-yhteyttä...',
271 272
	'ftp_connection_failed' => "FTP-palvelimeen ei saada yhteyttä. \nTarkista että FTP-palvelin on toiminnassa.",
272 273
	'ftp_login_failed' => "FTP-kirjautuminen ei onnistunut. Tarkista käyttäjätunnus ja salasana ja yritä uudelleen.",
trunk/languages/finnish_mimes.php
1 1
<?php
2
// Finnish Language file for eXtplorer 2.0.0 RC4 UTF-8 
3
// Version 1.0 dated 04.06.2008
2
// Finnish language file for eXtplorer 2.0.0 Stable UTF-8
3
// Dated 06.08.2008
4 4
// Based on JoomlaXplorer 1.6.1 language file
5
// Markku Suominen / admin@joomlaportal.fi
5
// Author: Markku Suominen / admin@joomlaportal.fi
6
// Author/Editor: Sami Haaranen / mortti@joomlaportal.fi
6 7
// Finnish Joomla translation team, http://www.joomlaportal.fi
8

  
7 9
$GLOBALS["mimes"]=array(
8 10
	// dir, exe, file
9 11
	"dir"	=> "Hakemisto",
trunk/libraries/HTTP/WebDAV/Tools/_parse_proppatch.php
1
<?php
2
//
3
// +----------------------------------------------------------------------+
4
// | PHP Version 4                                                        |
5
// +----------------------------------------------------------------------+
6
// | Copyright (c) 1997-2003 The PHP Group                                |
7
// +----------------------------------------------------------------------+
8
// | This source file is subject to version 2.02 of the PHP license,      |
9
// | that is bundled with this package in the file LICENSE, and is        |
10
// | available at through the world-wide-web at                           |
11
// | http://www.php.net/license/2_02.txt.                                 |
12
// | If you did not receive a copy of the PHP license and are unable to   |
13
// | obtain it through the world-wide-web, please send a note to          |
14
// | license@php.net so we can mail you a copy immediately.               |
15
// +----------------------------------------------------------------------+
16
// | Authors: Hartmut Holzgraefe <hholzgra@php.net>                       |
17
// |          Christian Stocker <chregu@bitflux.ch>                       |
18
// +----------------------------------------------------------------------+
19
//
20
// $Id: _parse_proppatch.php,v 1.6 2006/10/10 11:53:17 hholzgra Exp $
21
//
22

  
23
/**
24
 * helper class for parsing PROPPATCH request bodies
25
 * 
26
 * @package HTTP_WebDAV_Server
27
 * @author Hartmut Holzgraefe <hholzgra@php.net>
28
 * @version @package-version@
29
 */
30
class _parse_proppatch 
31
{
32
    /**
33
     *
34
     * 
35
     * @var
36
     * @access
37
     */
38
    var $success;
39

  
40
    /**
41
     *
42
     * 
43
     * @var
44
     * @access
45
     */
46
    var $props;
47

  
48
    /**
49
     *
50
     * 
51
     * @var
52
     * @access
53
     */
54
    var $depth;
55

  
56
    /**
57
     *
58
     * 
59
     * @var
60
     * @access
61
     */
62
    var $mode;
63

  
64
    /**
65
     *
66
     * 
67
     * @var
68
     * @access
69
     */
70
    var $current;
71

  
72
    /**
73
     * constructor
74
     * 
75
     * @param  string  path of input stream 
76
     * @access public
77
     */
78
    function _parse_proppatch($path) 
79
    {
80
        $this->success = true;
81

  
82
        $this->depth = 0;
83
        $this->props = array();
84
        $had_input = false;
85

  
86
        $f_in = fopen($path, "r");
87
        if (!$f_in) {
88
            $this->success = false;
89
            return;
90
        }
91

  
92
        $xml_parser = xml_parser_create_ns("UTF-8", " ");
93

  
94
        xml_set_element_handler($xml_parser,
95
                                array(&$this, "_startElement"),
96
                                array(&$this, "_endElement"));
97

  
98
        xml_set_character_data_handler($xml_parser,
99
                                       array(&$this, "_data"));
100

  
101
        xml_parser_set_option($xml_parser,
102
                              XML_OPTION_CASE_FOLDING, false);
103

  
104
        while($this->success && !feof($f_in)) {
105
            $line = fgets($f_in);
106
            if (is_string($line)) {
107
                $had_input = true;
108
                $this->success &= xml_parse($xml_parser, $line, false);
109
            }
110
        } 
111
        
112
        if($had_input) {
113
            $this->success &= xml_parse($xml_parser, "", true);
114
        }
115

  
116
        xml_parser_free($xml_parser);
117

  
118
        fclose($f_in);
119
    }
120

  
121
    /**
122
     * tag start handler
123
     *
124
     * @param  resource  parser
125
     * @param  string    tag name
126
     * @param  array     tag attributes
127
     * @return void
128
     * @access private
129
     */
130
    function _startElement($parser, $name, $attrs) 
131
    {
132
        if (strstr($name, " ")) {
133
            list($ns, $tag) = explode(" ", $name);
134
            if ($ns == "")
135
                $this->success = false;
136
        } else {
137
            $ns = "";
138
            $tag = $name;
139
        }
140

  
141
        if ($this->depth == 1) {
142
            $this->mode = $tag;
143
        } 
144

  
145
        if ($this->depth == 3) {
146
            $prop = array("name" => $tag);
147
            $this->current = array("name" => $tag, "ns" => $ns, "status"=> 200);
148
            if ($this->mode == "set") {
149
                $this->current["val"] = "";     // default set val
150
            }
151
        }
152

  
153
        if ($this->depth >= 4) {
154
            $this->current["val"] .= "<$tag";
155
            if (isset($attr)) {
156
                foreach ($attr as $key => $val) {
157
                    $this->current["val"] .= ' '.$key.'="'.str_replace('"','&quot;', $val).'"';
158
                }
159
            }
160
            $this->current["val"] .= ">";
161
        }
162

  
163
        
164

  
165
        $this->depth++;
166
    }
167

  
168
    /**
169
     * tag end handler
170
     *
171
     * @param  resource  parser
172
     * @param  string    tag name
173
     * @return void
174
     * @access private
175
     */
176
    function _endElement($parser, $name) 
177
    {
178
        if (strstr($name, " ")) {
179
            list($ns, $tag) = explode(" ", $name);
180
            if ($ns == "")
181
                $this->success = false;
182
        } else {
183
            $ns = "";
184
            $tag = $name;
185
        }
186

  
187
        $this->depth--;
188

  
189
        if ($this->depth >= 4) {
190
            $this->current["val"] .= "</$tag>";
191
        }
192

  
193
        if ($this->depth == 3) {
194
            if (isset($this->current)) {
195
                $this->props[] = $this->current;
196
                unset($this->current);
197
            }
198
        }
199
    }
200

  
201
    /**
202
     * input data handler
203
     *
204
     * @param  resource  parser
205
     * @param  string    data
206
     * @return void
207
     * @access private
208
     */
209
    function _data($parser, $data) 
210
    {
211
        if (isset($this->current)) {
212
            $this->current["val"] .= $data;
213
        }
214
    }
215
}
216

  
217
/*
218
 * Local variables:
219
 * tab-width: 4
220
 * c-basic-offset: 4
221
 * indent-tabs-mode:nil
222
 * End:
223
 */
0 224

  
trunk/libraries/HTTP/WebDAV/Tools/_parse_propfind.php
1
<?php
2
//
3
// +----------------------------------------------------------------------+
4
// | PHP Version 4                                                        |
5
// +----------------------------------------------------------------------+
6
// | Copyright (c) 1997-2003 The PHP Group                                |
7
// +----------------------------------------------------------------------+
8
// | This source file is subject to version 2.02 of the PHP license,      |
9
// | that is bundled with this package in the file LICENSE, and is        |
10
// | available at through the world-wide-web at                           |
11
// | http://www.php.net/license/2_02.txt.                                 |
12
// | If you did not receive a copy of the PHP license and are unable to   |
13
// | obtain it through the world-wide-web, please send a note to          |
14
// | license@php.net so we can mail you a copy immediately.               |
15
// +----------------------------------------------------------------------+
16
// | Authors: Hartmut Holzgraefe <hholzgra@php.net>                       |
17
// |          Christian Stocker <chregu@bitflux.ch>                       |
18
// +----------------------------------------------------------------------+
19
//
20
// $Id: _parse_propfind.php,v 1.4 2006/10/10 11:53:17 hholzgra Exp $
21
//
22

  
23
/**
24
 * helper class for parsing PROPFIND request bodies
25
 * 
26
 * @package HTTP_WebDAV_Server
27
 * @author Hartmut Holzgraefe <hholzgra@php.net>
28
 * @version @package-version@
29
 */
30
class _parse_propfind 
31
{
32
    /**
33
     * success state flag
34
     *
35
     * @var bool
36
     * @access public
37
     */
38
    var $success = false;
39

  
40
    /**
41
     * found properties are collected here
42
     *
43
     * @var array
44
     * @access public
45
     */
46
    var $props = false;
47

  
48
    /**
49
     * internal tag nesting depth counter
50
     *
51
     * @var int
52
     * @access private
53
     */
54
    var $depth = 0;
55

  
56
    
57
    /**
58
     * constructor
59
     *
60
     * @access public
61
     */
62
    function _parse_propfind($path) 
63
    {
64
        // success state flag
65
        $this->success = true;
66
        
67
        // property storage array
68
        $this->props = array();
69

  
70
        // internal tag depth counter
71
        $this->depth = 0;
72

  
73
        // remember if any input was parsed
74
        $had_input = false;
75

  
76
        // open input stream
77
        $f_in = fopen($path, "r");
78
        if (!$f_in) {
79
            $this->success = false;
80
            return;
81
        }
82

  
83
        // create XML parser
84
        $xml_parser = xml_parser_create_ns("UTF-8", " ");
85

  
86
        // set tag and data handlers
87
        xml_set_element_handler($xml_parser,
88
                                array(&$this, "_startElement"),
89
                                array(&$this, "_endElement"));
90

  
91
        // we want a case sensitive parser
92
        xml_parser_set_option($xml_parser, 
93
                              XML_OPTION_CASE_FOLDING, false);
94

  
95

  
96
        // parse input
97
        while ($this->success && !feof($f_in)) {
98
            $line = fgets($f_in);
99
            if (is_string($line)) {
100
                $had_input = true;
101
                $this->success &= xml_parse($xml_parser, $line, false);
102
            }
103
        } 
104
        
105
        // finish parsing
106
        if ($had_input) {
107
            $this->success &= xml_parse($xml_parser, "", true);
108
        }
109

  
110
        // free parser
111
        xml_parser_free($xml_parser);
112
        
113
        // close input stream
114
        fclose($f_in);
115

  
116
        // if no input was parsed it was a request
117
        if(!count($this->props)) $this->props = "all"; // default
118
    }
119
    
120

  
121
    /**
122
     * start tag handler
123
     * 
124
     * @access private
125
     * @param  resource  parser
126
     * @param  string    tag name
127
     * @param  array     tag attributes
128
     */
129
    function _startElement($parser, $name, $attrs) 
130
    {
131
        // name space handling
132
        if (strstr($name, " ")) {
133
            list($ns, $tag) = explode(" ", $name);
134
            if ($ns == "")
135
                $this->success = false;
136
        } else {
137
            $ns  = "";
138
            $tag = $name;
139
        }
140

  
141
        // special tags at level 1: <allprop> and <propname>
142
        if ($this->depth == 1) {
143
            if ($tag == "allprop")
144
                $this->props = "all";
145

  
146
            if ($tag == "propname")
147
                $this->props = "names";
148
        }
149

  
150
        // requested properties are found at level 2
151
        if ($this->depth == 2) {
152
            $prop = array("name" => $tag);
153
            if ($ns)
154
                $prop["xmlns"] = $ns;
155
            $this->props[] = $prop;
156
        }
157

  
158
        // increment depth count
159
        $this->depth++;
160
    }
161
    
162

  
163
    /**
164
     * end tag handler
165
     * 
166
     * @access private
167
     * @param  resource  parser
168
     * @param  string    tag name
169
     */
170
    function _endElement($parser, $name) 
171
    {
172
        // here we only need to decrement the depth count
173
        $this->depth--;
174
    }
175
}
176

  
177

  
178
?>
0 179

  
trunk/libraries/HTTP/WebDAV/Tools/_parse_lockinfo.php
1
<?php
2
//
3
// +----------------------------------------------------------------------+
4
// | PHP Version 4                                                        |
5
// +----------------------------------------------------------------------+
6
// | Copyright (c) 1997-2003 The PHP Group                                |
7
// +----------------------------------------------------------------------+
8
// | This source file is subject to version 2.02 of the PHP license,      |
9
// | that is bundled with this package in the file LICENSE, and is        |
10
// | available at through the world-wide-web at                           |
11
// | http://www.php.net/license/2_02.txt.                                 |
12
// | If you did not receive a copy of the PHP license and are unable to   |
13
// | obtain it through the world-wide-web, please send a note to          |
14
// | license@php.net so we can mail you a copy immediately.               |
15
// +----------------------------------------------------------------------+
16
// | Authors: Hartmut Holzgraefe <hholzgra@php.net>                       |
17
// |          Christian Stocker <chregu@bitflux.ch>                       |
18
// +----------------------------------------------------------------------+
19
//
20
// $Id: _parse_lockinfo.php,v 1.4 2006/10/10 11:53:17 hholzgra Exp $
21
//
22

  
23
/**
24
 * helper class for parsing LOCK request bodies
25
 * 
26
 * @package HTTP_WebDAV_Server
27
 * @author Hartmut Holzgraefe <hholzgra@php.net>
28
 * @version @package-version@
29
 */
30
class _parse_lockinfo 
31
{
32
    /**
33
     * success state flag
34
     *
35
     * @var bool
36
     * @access public
37
     */
38
    var $success = false;
39

  
40
    /**
41
     * lock type, currently only "write"
42
     *
43
     * @var string
44
     * @access public
45
     */
46
    var $locktype = "";
47

  
48
    /**
49
     * lock scope, "shared" or "exclusive"
50
     *
51
     * @var string
52
     * @access public
53
     */
54
    var $lockscope = "";
55

  
56
    /**
57
     * lock owner information
58
     *
59
     * @var string
60
     * @access public
61
     */
62
    var $owner = "";
63

  
64
    /**
65
     * flag that is set during lock owner read
66
     *
67
     * @var bool
68
     * @access private
69
     */
70
    var $collect_owner = false;
71
    
72
    /**
73
     * constructor
74
     *
75
     * @param  string  path of stream to read
76
     * @access public
77
     */
78
    function _parse_lockinfo($path) 
79
    {
80
        // we assume success unless problems occur
81
        $this->success = true;
82

  
83
        // remember if any input was parsed
84
        $had_input = false;
85
        
86
        // open stream
87
        $f_in = fopen($path, "r");
88
        if (!$f_in) {
89
            $this->success = false;
90
            return;
91
        }
92

  
93
        // create namespace aware parser
94
        $xml_parser = xml_parser_create_ns("UTF-8", " ");
95

  
96
        // set tag and data handlers
97
        xml_set_element_handler($xml_parser,
98
                                array(&$this, "_startElement"),
99
                                array(&$this, "_endElement"));
100
        xml_set_character_data_handler($xml_parser,
101
                                       array(&$this, "_data"));
102

  
103
        // we want a case sensitive parser
104
        xml_parser_set_option($xml_parser,
105
                              XML_OPTION_CASE_FOLDING, false);
106

  
107
        // parse input
108
        while ($this->success && !feof($f_in)) {
109
            $line = fgets($f_in);
110
            if (is_string($line)) {
111
                $had_input = true;
112
                $this->success &= xml_parse($xml_parser, $line, false);
113
            }
114
        } 
115

  
116
        // finish parsing
117
        if ($had_input) {
118
            $this->success &= xml_parse($xml_parser, "", true);
119
        }
120

  
121
        // check if required tags where found
122
        $this->success &= !empty($this->locktype);
123
        $this->success &= !empty($this->lockscope);
124

  
125
        // free parser resource
126
        xml_parser_free($xml_parser);
127

  
128
        // close input stream
129
        fclose($f_in);      
130
    }
131
    
132

  
133
    /**
134
     * tag start handler
135
     *
136
     * @param  resource  parser
137
     * @param  string    tag name
138
     * @param  array     tag attributes
139
     * @return void
140
     * @access private
141
     */
142
    function _startElement($parser, $name, $attrs) 
143
    {
144
        // namespace handling
145
        if (strstr($name, " ")) {
146
            list($ns, $tag) = explode(" ", $name);
147
        } else {
148
            $ns  = "";
149
            $tag = $name;
150
        }
151
        
152
  
153
        if ($this->collect_owner) {
154
            // everything within the <owner> tag needs to be collected
155
            $ns_short = "";
156
            $ns_attr  = "";
157
            if ($ns) {
158
                if ($ns == "DAV:") {
159
                    $ns_short = "D:";
160
                } else {
161
                    $ns_attr = " xmlns='$ns'";
162
                }
163
            }
164
            $this->owner .= "<$ns_short$tag$ns_attr>";
165
        } else if ($ns == "DAV:") {
166
            // parse only the essential tags
167
            switch ($tag) {
168
            case "write":
169
                $this->locktype = $tag;
170
                break;
171
            case "exclusive":
172
            case "shared":
173
                $this->lockscope = $tag;
174
                break;
175
            case "owner":
176
                $this->collect_owner = true;
177
                break;
178
            }
179
        }
180
    }
181
    
182
    /**
183
     * data handler
184
     *
185
     * @param  resource  parser
186
     * @param  string    data
187
     * @return void
188
     * @access private
189
     */
190
    function _data($parser, $data) 
191
    {
192
        // only the <owner> tag has data content
193
        if ($this->collect_owner) {
194
            $this->owner .= $data;
195
        }
196
    }
197

  
198
    /**
199
     * tag end handler
200
     *
201
     * @param  resource  parser
202
     * @param  string    tag name
203
     * @return void
204
     * @access private
205
     */
206
    function _endElement($parser, $name) 
207
    {
208
        // namespace handling
209
        if (strstr($name, " ")) {
210
            list($ns, $tag) = explode(" ", $name);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff