Changeset 9135
- Timestamp:
- 01/06/06 17:31:33 (3 years ago)
- Files:
-
- trunk/src/php-libs/webdav2/Server.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/php-libs/webdav2/Server.php
r8413 r9135 84 84 if (!$this->_repository_metadata_object) { 85 85 $this->add_to_log("Repository metadata object not found, trying to create"); 86 $topic = new NewMidgardTopic();86 $topic = new midgard_topic(); 87 87 $topic->up = 0; 88 88 $topic->name = "__MidgardDAV"; 89 89 $topic->extra = "Midgard WebDAV Server Metadata repository"; 90 $stat = $topic->create(); 91 if ($stat) { 92 $this->_repository_metadata_object = mgd_get_topic($stat); 90 if ($topic->create()) { 91 $this->_repository_metadata_object = $topic; 93 92 } else { 94 93 $this->add_to_log("Repository metadata object creation failed, reason ".mgd_errstr()); … … 112 111 */ 113 112 function check_auth($type, $user, $pass) { 114 if ($ GLOBALS["midgard"]->user) {113 if ($_MIDGARD['user']) { 115 114 return true; 116 115 } else { … … 147 146 $this->add_to_log("mapping '$path' " ); 148 147 $current_object = false; 149 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$path);148 $local_path = str_replace($_MIDGARD['self'],"",$path); 150 149 // to get extension etc. 151 150 // now the filename is $pathinfo['basename']! … … 381 380 $path = $options["path"] ; 382 381 383 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$path);382 $local_path = str_replace($_MIDGARD['self'],"",$path); 384 383 385 384 // prepare property array … … 533 532 534 533 // get document path 535 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$options['path']);534 $local_path = str_replace($_MIDGARD['self'],"",$options['path']); 536 535 537 536 $current_object =&$this->_map_path_to_object($local_path); … … 632 631 $snippet = mgd_get_snippet(); 633 632 $snippet->up = $this->_current_directory->id; 634 $user = mgd_get_person($ GLOBALS["midgard"]->user);633 $user = mgd_get_person($_MIDGARD['user']); 635 634 $snippet->author = $user->name; 636 635 $snippet->name = str_replace(".php","",urldecode(basename($options["path"]))); … … 657 656 $snippet = mgd_get_element(); 658 657 $snippet->style = $this->_current_directory->id; 659 $user = mgd_get_person($ GLOBALS["midgard"]->user);658 $user = mgd_get_person($_MIDGARD['user']); 660 659 $snippet->author = $user->name; 661 660 $snippet->name = str_replace(".php","",urldecode(basename($options["path"]))); … … 706 705 // get document path 707 706 $path = $options["path"]; 708 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$path);707 $local_path = str_replace($_MIDGARD['self'],"",$path); 709 708 $this->add_to_log("MKCOL for ".$path); 710 709 $new_folder = urldecode(basename($local_path)); … … 1088 1087 // get topic/document path 1089 1088 $path = $options["path"]; 1090 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$path);1089 $local_path = str_replace($_MIDGARD['self'],"",$path); 1091 1090 $this->add_to_log("PROPPATCH for ".$path); 1092 1091 $current_object =& $this->_map_path_to_object($local_path); … … 1119 1118 // get topic/document path 1120 1119 $path = $options["path"]; 1121 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$path);1120 $local_path = str_replace($_MIDGARD['self'],"",$path); 1122 1121 $this->add_to_log("LOCK for ".$path); 1123 1122 $current_object = &$this->_map_path_to_object($local_path); … … 1166 1165 // get topic/document path 1167 1166 $path = $options["path"]; 1168 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$path);1167 $local_path = str_replace($_MIDGARD['self'],"",$path); 1169 1168 $this->add_to_log("UNLOCK for ".$path); 1170 1169 $current_object = &$this->_map_path_to_object($local_path); … … 1197 1196 1198 1197 // get document path 1199 $local_path = str_replace($ GLOBALS["midgard"]->self,"",$path);1198 $local_path = str_replace($_MIDGARD['self'],"",$path); 1200 1199 // $this->add_to_log("checkLock for ".$path); 1201 1200 $current_object = &$this->_map_path_to_object($local_path); … … 1259 1258 function get_content(&$obj) { 1260 1259 switch (get_class($obj)) { 1261 case " NewMidgardArticle":1260 case "midgard_article": 1262 1261 case "MidgardArticle": 1263 1262 return $obj->content; 1264 1263 break; 1265 case " NewMidgardPage":1264 case "midgard_page": 1266 1265 case "MidgardPage": 1267 1266 return $obj->content; 1268 1267 break; 1269 case " NewMidgardElement":1268 case "midgard_element": 1270 1269 case "MidgardElement": 1271 1270 return $obj->value; 1272 1271 break; 1273 1272 1274 case " NewMidgardSnippet":1273 case "midgard_snippet": 1275 1274 case "MidgardSnippet": 1276 1275 return $obj->code; 1277 1276 break; 1278 case " NewMidgardTopic":1277 case "midgard_topic": 1279 1278 case "MidgardTopic": 1280 1279 return $obj->description; 1281 1280 break; 1282 case " NewMidgardPageElement":1281 case "midgard_pageelement": 1283 1282 case "MidgardPageElement": 1284 1283 return $obj->value; 1285 1284 break; 1286 case " NewMidgardGroup":1285 case "midgard_group": 1287 1286 case "MidgardGroup": 1288 1287 return $obj->name; 1289 1288 break; 1290 case " NewMidgardParameter":1289 case "midgard_parameter": 1291 1290 case "MidgardParameter": 1292 1291 return $obj->value; 1293 1292 break; 1294 case " NewMidgardPagelink":1293 case "midgard_pagelink": 1295 1294 case "MidgardPagelink": 1296 1295 return $obj->target; 1297 1296 break; 1298 case " NewMidgardPerson":1297 case "midgard_person": 1299 1298 case "MidgardPerson": 1300 1299 return $obj->name; 1301 1300 break; 1302 case " NewMidgardEvent":1301 case "midgard_event": 1303 1302 case "MidgardEvent": 1304 1303 return $obj->name; 1305 1304 break; 1306 case " NewMidgardSnippetdir":1305 case "midgard_snippetdir": 1307 1306 case "MidgardSnippetdir": 1308 1307 return $obj->name; 1309 1308 break; 1310 case " NewMidgardStyle":1309 case "midgard_style": 1311 1310 case "MidgardStyle": 1312 1311 return $obj->name; 1313 1312 break; 1314 case " NewMidgardAttachment":1313 case "midgard_attachment": 1315 1314 case "MidgardAttachment": 1316 1315 return $obj->name; 1317 1316 break; 1318 1317 1319 case " NewMidgardMember":1318 case "midgard_member": 1320 1319 case "MidgardMember": 1321 1320 return $obj->name; 1322 1321 break; 1323 1322 1324 case " NewMidgardHost":1323 case "midgard_host": 1325 1324 case "MidgardHost": 1326 1325 return $obj->name . $obj->prefix; 1327 1326 break; 1328 case " NewMidgardEventMember":1327 case "midgard_eventmember": 1329 1328 case "MidgardEventMember": 1330 1329 return $obj->name;
