Changeset 690
- Timestamp:
- 11/05/06 04:51:30 (2 years ago)
- Files:
-
- devel/_files/download.php (modified) (2 diffs)
- devel/_files/icon.php (modified) (1 diff)
- devel/_icons/icon.php (modified) (3 diffs)
- devel/htaccess-dist (modified) (1 diff)
- devel/lib/filelib.php (modified) (2 diffs)
- devel/lib/templates.php (modified) (1 diff)
- devel/mod/browser/index.php (modified) (1 diff)
- devel/profile/profile.class.php (modified) (4 diffs)
- devel/units/admin/admin_users_add.php (modified) (1 diff)
- devel/units/communities/communities_edit.php (modified) (1 diff)
- devel/units/communities/communities_members.php (modified) (1 diff)
- devel/units/communities/communities_membership_requests.php (modified) (1 diff)
- devel/units/communities/communities_moderator_of.php (modified) (1 diff)
- devel/units/files/files_links_make.php (modified) (1 diff)
- devel/units/files/folder_view.php (modified) (1 diff)
- devel/units/files/function_search.php (modified) (1 diff)
- devel/units/friends/friends_edit.php (modified) (1 diff)
- devel/units/friends/friends_of_edit.php (modified) (1 diff)
- devel/units/friends/generate_foaf.php (modified) (2 diffs)
- devel/units/friends/user_friendship_requests.php (modified) (1 diff)
- devel/units/icons/function_edit_icons.php (modified) (1 diff)
- devel/units/profile/function_search.php (modified) (1 diff)
- devel/units/profile/function_search_ecl.php (modified) (1 diff)
- devel/units/profile/profile_user_info.php (modified) (1 diff)
- devel/units/rpc/lib/class_user.php (modified) (1 diff)
- devel/units/weblogs/default_template.php (modified) (2 diffs)
- devel/units/weblogs/function_search.php (modified) (1 diff)
- devel/units/weblogs/weblogs_posts_view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/_files/download.php
r662 r690 19 19 // ... and the owner of the file in the URL line hasn't been spoofed ... 20 20 $files_name = optional_param('files_name'); 21 if (user_info_username('ident', $files_name) == $file->owner22 || user_info_username('ident', $files_name)== $file->files_owner) {21 $userid = user_info_username('ident', $files_name); 22 if ($userid == $file->owner || $userid == $file->files_owner) { 23 23 24 24 // ... and the current user is allowed to access it ... 25 26 if (run("users:access_level_check",$file->access) == true || $file->owner == $_SESSION['userid']) { 27 28 // ... and the file exists on disk ... 25 if ($file->access == 'PUBLIC' || $file->owner == $_SESSION['userid'] || run("users:access_level_check",$file->access) == true) { 29 26 30 27 // Then output some appropriate headers and send the file data! 31 require_once($CFG->dirroot . 'lib/filelib.php');32 $mimetype = mimeinfo('type',$file->location);33 34 28 if ($file->access == 'PUBLIC') { 35 29 header("Pragma: public"); … … 40 34 header("Cache-Control: private"); 41 35 } 36 37 require_once($CFG->dirroot . 'lib/filelib.php'); 38 $mimetype = mimeinfo('type',$file->location); 42 39 43 40 if ($mimetype == "application/octet-stream") { devel/_files/icon.php
r678 r690 16 16 // ... and the file exists ... 17 17 if ($file = get_record('files','ident',$id)) { 18 if ( run("users:access_level_check",$file->access) == true) {18 if ($file->access == 'PUBLIC' || run("users:access_level_check",$file->access) == true) { 19 19 20 20 require_once($CFG->dirroot . 'lib/filelib.php'); 21 21 require_once($CFG->dirroot . 'lib/iconslib.php'); 22 22 23 // images most likely don't want compressing, and this will kill the Vary header 24 @apache_setenv('no-gzip', '1'); 25 26 if ($file->access == 'PUBLIC') { 27 header("Pragma: public"); 28 header("Cache-Control: public"); 29 } else { 30 // "Cache-Control: private" to allow a user's browser to cache the file, but not a shared proxy 31 // Also to override PHP's default "DON'T EVER CACHE THIS EVER" header 32 header("Cache-Control: private"); 33 } 34 23 35 $mimetype = mimeinfo('type',$file->originalname); 24 if ($mimetype == "image/jpeg" || $mimetype == "image/png" ) {36 if ($mimetype == "image/jpeg" || $mimetype == "image/png" || $mimetype == "image/gif") { 25 37 // file is an image 26 27 // images most likely don't want compressing, and this will kill the Vary header28 @apache_setenv('no-gzip', '1');29 30 if ($file->access == 'PUBLIC') {31 header("Pragma: public");32 header("Cache-Control: public");33 } else {34 // "Cache-Control: private" to allow a user's browser to cache the file, but not a shared proxy35 // Also to override PHP's default "DON'T EVER CACHE THIS EVER" header36 header("Cache-Control: private");37 }38 38 39 39 $phpthumbconfig['w'] = 90; devel/_icons/icon.php
r662 r690 2 2 3 3 // User icon serving script. 4 // Usage: http://URL/ {username}/icons/{icon_id}4 // Usage: http://URL/_icon/user/{icon_id} 5 5 6 6 // Run includes 7 7 define("context","icons"); 8 8 require_once(dirname(dirname(__FILE__))."/includes.php"); 9 $textlib = textlib_get_instance();10 9 11 10 // If an ID number for the file has been specified ... … … 24 23 } 25 24 if (!$default) { 26 $upload_folder = $textlib->substr($user->username,0,1);25 $upload_folder = substr($user->username,0,1); 27 26 $filepath = $CFG->dataroot . "icons/" . $upload_folder . "/" . $user->username . "/".$file->filename; 28 27 if (!file_exists($filepath)) { … … 72 71 // 100 pixels requested, redirect to attributeless icon url for cacheability fun 73 72 header($_SERVER['SERVER_PROTOCOL'] . " 301 Moved Permanently"); 74 header("Location: " . $CFG->wwwroot . $user->username . '/icons/' . $id);73 header("Location: " . $CFG->wwwroot . '_icon/user/' . $id); 75 74 die(); 76 75 } devel/htaccess-dist
r675 r690 81 81 RewriteRule ^([A-Za-z0-9]+)\/files\/rss\/(.+)\/?$ _files/rss2.php?files_name=$1&tag=$2 82 82 83 RewriteRule ^([A-Za-z0-9]+)\/icons\/([-0-9]+)\/?$ _icons/icon.php?id=$2 84 RewriteRule ^([A-Za-z0-9]+)\/icons\/([-0-9]+)\/([A-Za-z])\/([0-9]+)\/?$ _icons/icon.php?id=$2&constraint1=$3&size1=$4 85 RewriteRule ^([A-Za-z0-9]+)\/icons\/([-0-9]+)\/([A-Za-z])\/([0-9]+)\/([A-Za-z])\/([0-9]+)\/?$ _icons/icon.php?id=$2&constraint1=$3&size1=$4&constraint2=$5&size2=$6 83 RewriteRule ^_icon\/user/([-0-9]+)\/?$ _icons/icon.php?id=$1 84 RewriteRule ^_icon\/user/([-0-9]+)\/([A-Za-z])\/([0-9]+)\/?$ _icons/icon.php?id=$1&constraint1=$2&size1=$3 85 RewriteRule ^_icon\/user/([-0-9]+)\/([A-Za-z])\/([0-9]+)\/([A-Za-z])\/([0-9]+)\/?$ _icons/icon.php?id=$1&constraint1=$2&size1=$3&constraint2=$4&size2=$5 86 RewriteRule ^_icon\/file/([-0-9]+)\/?$ _files/icon.php?id=$1 86 87 87 88 # Some blogging clients probe Wordpress or MoveableType endpoints, devel/lib/filelib.php
r674 r690 509 509 if ($tstamp < $timenow) { 510 510 header("Last-Modified: " . $lm); 511 } 512 513 if ($tstamp < ($timenow - 3600)) { 514 header('Expires: ' . gmdate("D, d M Y H:i:s", ($timenow+3600)) . " GMT"); 511 if ($tstamp < ($timenow - 3600)) { 512 header('Expires: ' . gmdate("D, d M Y H:i:s", ($timenow+3600)) . " GMT"); 513 } 515 514 } 516 515 … … 532 531 533 532 if ($mimetype) { 534 header("Content- type: $mimetype");533 header("Content-Type: $mimetype"); 535 534 } 536 535 readfile($filepath); 536 } else { 537 header("{$_SERVER['SERVER_PROTOCOL']} 404 Not Found"); 537 538 } 538 539 exit; devel/lib/templates.php
r665 r690 1274 1274 <td align="center"> 1275 1275 <div class="image_holder"> 1276 <a href="{$CFG->wwwroot}{$user->username}/"><img src="{$CFG->wwwroot} {$user->username}/icons/{$user->iconid}/w/80/h/80" border="0" /></a>1276 <a href="{$CFG->wwwroot}{$user->username}/"><img src="{$CFG->wwwroot}_icon/user/{$user->iconid}/w/80/h/80" border="0" /></a> 1277 1277 </div> 1278 1278 <div class="userdetails"> devel/mod/browser/index.php
r666 r690 177 177 $description = get_record_sql("SELECT ".$CFG->prefix."profile_data.value FROM ".$CFG->prefix."profile_data WHERE owner = {$result->ident} AND name = 'minibio'"); 178 178 179 $icon = "{$CFG->wwwroot} {$result->username}/icons/{$result->icon}/h/67/";179 $icon = "{$CFG->wwwroot}_icon/user/{$result->icon}/h/67/"; 180 180 181 181 $description = @stripslashes($description->value); devel/profile/profile.class.php
r659 r690 305 305 <p> 306 306 <a href="{$CFG->wwwroot}{$friends_username}/"> 307 <img src="{$CFG->wwwroot} {$friends_username}/icons/{$info->icon}/w/{$width}" alt="{$friends_name}" border="0" /></a><br />307 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$width}" alt="{$friends_name}" border="0" /></a><br /> 308 308 <span class="userdetails"> 309 309 {$friends_name} … … 377 377 WHERE '.$searchline)) { 378 378 foreach($result as $key => $info) { 379 $icon = url . $info->username . '/icons/'.$post->icon;379 $icon = url . '_icon/user/'.$post->icon; 380 380 $sub_result .= "\t\t\t<item>\n"; 381 381 $sub_result .= "\t\t\t\t<name><![CDATA[" . htmlspecialchars(stripslashes($info->name), ENT_COMPAT, 'utf-8') . "]]></name>\n"; … … 808 808 809 809 // If this is someone else's portfolio, display the user's icon 810 $run_result = "<div class=\"box_user\">";810 $run_result = '<div class="box_user">'; 811 811 812 812 $info = get_record('users','ident',$page_owner); … … 818 818 } 819 819 820 $icon = "<img alt=\"\" src=\"".url.$info->username.'icons/'.$info->icon.'/w/67" />';820 $icon = '<img alt="" src="' . url . '_icon/user/' . $info->icon . '/w/67" />'; 821 821 $name = stripslashes($info->name); 822 822 $url = url . $info->username . "/"; devel/units/admin/admin_users_add.php
r659 r690 6 6 7 7 global $admin_users_add; 8 if (!isset($admin_users_add)) { 9 $admin_users_add = array("", "", "", "", "", "", "", "", "", "", "", ""); 10 } else { 11 for ($i = 0; $i < 12; $i++) { 12 if (!isset($admin_users_add[$i])) { 13 $admin_users_add[$i] = ""; 14 } 8 for ($i = 0; $i < 12; $i++) { 9 if (!isset($admin_users_add[$i])) { 10 //$admin_users_add[$i] = ""; 11 $admin_users_add[$i]->username = ""; 12 $admin_users_add[$i]->name = ""; 13 $admin_users_add[$i]->email = ""; 15 14 } 16 15 } devel/units/communities/communities_edit.php
r659 r690 32 32 <p> 33 33 <a href="{$CFG->wwwroot}{$info->username}/"> 34 <img src="{$CFG->wwwroot} {$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />34 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 35 35 <span class="userdetails"> 36 36 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/communities/communities_members.php
r659 r690 32 32 <p> 33 33 <a href="{$CFG->wwwroot}{$info->username}/"> 34 <img src="{$CFG->wwwroot} {$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />34 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 35 35 <span class="userdetails"> 36 36 {$friends_name} devel/units/communities/communities_membership_requests.php
r659 r690 37 37 $body .= templates_draw(array( 38 38 'context' => 'adminTable', 39 'name' => "<img src=\"" . url . " {$pending_user->username}/icons/{$pending_user->icon}/" . $icon . "\" />",39 'name' => "<img src=\"" . url . "_icon/user/{$pending_user->icon}/" . $icon . "\" />", 40 40 'column1' => $col1, 41 41 'column2' => $col2 devel/units/communities/communities_moderator_of.php
r659 r690 31 31 <p> 32 32 <a href="{$CFG->wwwroot}{$info->username}/"> 33 <img src="{$CFG->wwwroot} {$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />33 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 34 34 <span class="userdetails"> 35 35 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/files/files_links_make.php
r676 r690 39 39 $run_result .= $CFG->wwwroot . user_info('username', $file->owner) . "/files/" . $file->folder . "/" . $file->ident . "/" . $file->originalname; 40 40 $run_result .= "\" >"; 41 $run_result .= '<img src="' . $CFG->wwwroot . '_ files/icon.php?id=' . $file->ident . '" alt="' . htmlspecialchars(stripslashes($file->title), ENT_COMPAT, 'utf-8') . '" />';41 $run_result .= '<img src="' . $CFG->wwwroot . '_icon/file/' . $file->ident . '" alt="' . htmlspecialchars(stripslashes($file->title), ENT_COMPAT, 'utf-8') . '" />'; 42 42 $run_result .= "</a>"; 43 43 } else { devel/units/files/folder_view.php
r679 r690 118 118 $originalname = stripslashes($file->originalname); 119 119 $filemenu = round(($file->size / 1000000),4) . "Mb "; 120 $icon = $CFG->wwwroot . "_ files/icon.php?id=" . $file->ident;120 $icon = $CFG->wwwroot . "_icon/file/" . $file->ident; 121 121 $filepath = $CFG->wwwroot . "$username/files/$folder/$ident/" . urlencode($originalname); 122 122 require_once($CFG->dirroot.'lib/filelib.php'); devel/units/files/function_search.php
r659 r690 133 133 <p> 134 134 <a href="{$CFG->wwwroot}search/index.php?file={$link_keyword}&owner={$friends_userid}"> 135 <img src="{$CFG->wwwroot} {$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />135 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 136 136 <span class="userdetails"> 137 137 {$friends_name} devel/units/friends/friends_edit.php
r659 r690 31 31 <p> 32 32 <a href="{$CFG->wwwroot}{$info->username}/"> 33 <img src="{$CFG->wwwroot} {$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />33 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 34 34 <span class="userdetails"> 35 35 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/friends/friends_of_edit.php
r659 r690 32 32 <p> 33 33 <a href="{$CFG->wwwroot}{$info->username}/"> 34 <img src="{$CFG->wwwroot} {$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />34 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 35 35 <span class="userdetails"> 36 36 <a href="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a> devel/units/friends/generate_foaf.php
r454 r690 12 12 13 13 if ($user->icon != -1) { 14 $iconstring = "<foaf:depiction rdf:resource=\"". $CFG->wwwroot . $user->username."/icons/".$user->icon."\" />";14 $iconstring = "<foaf:depiction rdf:resource=\"". $CFG->wwwroot . "_icon/user/".$user->icon."\" />"; 15 15 } else { 16 16 $iconstring = ""; … … 57 57 $foafurl = $personalurl . "foaf/"; 58 58 if ($friend->icon != -1) { 59 $iconstring = "<foaf:depiction rdf:resource=\"". url . $friend->username."/icons/".$friend->icon."\" />";59 $iconstring = "<foaf:depiction rdf:resource=\"". url . "_icon/user/".$friend->icon."\" />"; 60 60 } else { 61 61 $iconstring = ""; devel/units/friends/user_friendship_requests.php
r659 r690 40 40 $body .= templates_draw(array( 41 41 'context' => 'adminTable', 42 'name' => "<img src=\"" . url . " {$pending_user->username}/icons/{$pending_user->icon}\" />",42 'name' => "<img src=\"" . url . "_icon/user/{$pending_user->icon}\" />", 43 43 'column1' => $col1, 44 44 'column2' => $col2 devel/units/icons/function_edit_icons.php
r659 r690 46 46 $defaulticon = htmlspecialchars(stripslashes($icon->description), ENT_COMPAT, 'utf-8'); 47 47 $column1 = <<< END 48 <img alt="{$defaulticon}" src="{$CFG->wwwroot} {$page_username}/icons/{$icon->ident}" />48 <img alt="{$defaulticon}" src="{$CFG->wwwroot}_icon/user/{$icon->ident}" /> 49 49 END; 50 50 if ($icon->filename == $currenticon) { devel/units/profile/function_search.php
r659 r690 61 61 <p> 62 62 <a href="{$CFG->wwwroot}{$friends_username}/"> 63 <img src="{$CFG->wwwroot} {$friends_username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />63 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 64 64 <span class="userdetails"> 65 65 <a href="{$CFG->wwwroot}{$friends_username}/">{$friends_name}</a> devel/units/profile/function_search_ecl.php
r454 r690 24 24 foreach($result as $key => $info) { 25 25 26 $icon = url . $info->username . "/icons/".$info->icon;26 $icon = url . "_icon/user/".$info->icon; 27 27 28 28 $sub_result .= "\t\t\t<item>\n"; devel/units/profile/profile_user_info.php
r659 r690 19 19 $info->icon = run("icons:get", $page_owner); 20 20 21 $icon = '<img alt="" src="'.url. $ul_username.'/icons/'.$info->icon.'/h/67/w/67" border="0" />'; // height is the important one here.21 $icon = '<img alt="" src="'.url. '_icon/user/'.$info->icon.'/h/67/w/67" border="0" />'; // height is the important one here. 22 22 $name = stripslashes($info->name); 23 23 //$name = run("profile:display:name"); devel/units/rpc/lib/class_user.php
r471 r690 84 84 } 85 85 86 $this->icon = url .$this->username.'/icons/'.$info->icon;86 $this->icon = url . '_icon/user/' . $info->icon; 87 87 } 88 88 } devel/units/weblogs/default_template.php
r659 r690 28 28 <div class="entry"><!-- Open class entry --> 29 29 <div class="user"><!-- Open class user --> 30 <a href="{{url}}{{username}}/weblog/"><img alt="" src="{{url}} {{username}}/icons/{{usericon}}"/></a><br /><a href="{{url}}{{username}}/weblog/">{{fullname}}</a>30 <a href="{{url}}{{username}}/weblog/"><img alt="" src="{{url}}_icon/user/{{usericon}}"/></a><br /><a href="{{url}}{{username}}/weblog/">{{fullname}}</a> 31 31 </div><!-- Close class user --> 32 32 <div class="weblog_title"><h3>{{title}}</h3></div> … … 85 85 <li> 86 86 {{body}} 87 <div class="comment_owner">87 <div class="comment_owner"> 88 88 <p> 89 89 {{usericon}}{{postedname}} on {{posted}} <a href="{{permalink}}">#</a> 90 90 </p> 91 </div>91 </div> 92 92 </li> 93 93 devel/units/weblogs/function_search.php
r659 r690 102 102 <p> 103 103 <a href="{$CFG->wwwroot}search/index.php?weblog={$link_keyword}&owner={$friends_userid}"> 104 <img src="{$CFG->wwwroot} {$info->username}/icons/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br />104 <img src="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt="{$friends_name}" border="0" /></a><br /> 105 105 <span class="userdetails"> 106 106 {$friends_name} devel/units/weblogs/weblogs_posts_view.php
r673 r690 162 162 $commentownerusername = user_info('username', $comment->owner); 163 163 $comment->postedname = '<a href="' . url . $commentownerusername . '/">' . $comment->postedname . '</a>'; 164 $comment->icon = '<a href="' . url . $commentownerusername . '/">' . "<img src=\"" . $CFG->wwwroot . $commentownerusername . "/icons/" . run("icons:get",$comment->owner) . "/w/50/h/50/\" border=\"0\" align=\"left\" alt=\"\" /></a>";164 $comment->icon = '<a href="' . url . $commentownerusername . '/">' . "<img src=\"" . $CFG->wwwroot . "_icon/user/" . run("icons:get",$comment->owner) . "/w/50/h/50/\" border=\"0\" align=\"left\" alt=\"\" /></a>"; 165 165 $comment->body = run("weblogs:text:process", array($comment->body, false)); 166 166 } else {
