Changeset 456
- Timestamp:
- 10/17/2003 07:26:05 PM (22 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
b2-include/b2functions.php (modified) (1 diff)
-
wp-admin/b2upload.php (modified) (4 diffs)
-
wp-admin/upgrade-071-to-072.php (modified) (2 diffs)
-
wp-admin/wp-edit.form.php (modified) (2 diffs)
-
wp-admin/wp-install.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/b2-include/b2functions.php
r455 r456 1285 1285 } 1286 1286 1287 1288 // implementation of in_array that also should work on PHP3 1289 if (!function_exists('in_array')) { 1290 1291 function in_array($needle, $haystack) { 1292 $needle = strtolower($needle); 1293 1294 for ($i = 0; $i < count($haystack); $i++) { 1295 if (strtolower($haystack[$i]) == $needle) { 1296 return true; 1297 } 1298 } 1299 1300 return false; 1301 } 1302 } 1303 1287 1304 ?> -
trunk/wp-admin/b2upload.php
r435 r456 10 10 if (!$use_fileupload) //Checks if file upload is enabled in the config 11 11 die ("The admin disabled this function"); 12 13 $allowed_types = explode(" ", trim($fileupload_allowedtypes)); 12 14 13 15 ?><html> … … 93 95 94 96 if (!$HTTP_POST_VARS["submit"]) { 95 $i = explode(" ",$fileupload_allowedtypes); 96 $i = implode(", ",array_slice($i, 1, count($i)-2)); 97 ?> 97 $i = implode(", ", $allowed_types); 98 ?> 98 99 <p><strong>File upload</strong></p> 99 100 <p>You can upload files of type:<br /><em><?php echo $i ?></em></p> … … 136 137 137 138 $imgtype = explode(".",$img1_name); 138 $imgtype = " ".$imgtype[count($imgtype)-1]." ";139 140 if ( !ereg(strtolower($imgtype), strtolower($fileupload_allowedtypes))) {139 $imgtype = $imgtype[count($imgtype)-1]; 140 141 if (in_array($imgtype, $allowed_types) == false) { 141 142 die("File $img1_name of type $imgtype is not allowed."); 142 143 } … … 188 189 <input type="hidden" name="img1_type" value="<?php echo $img1_type;?>" /> 189 190 <input type="hidden" name="img1_name" value="<?php echo $img2_name;?>" /> 191 <input type="hidden" name="img1_size" value="<?php echo $img1_size;?>" /> 190 192 <input type="hidden" name="img1" value="<?php echo $pathtofile2;?>" /> 191 193 Alternate name:<br /><input type="text" name="imgalt" size="30" class="uploadform" value="<?php echo $img2_name;?>" /><br /> -
trunk/wp-admin/upgrade-071-to-072.php
r439 r456 428 428 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(32,'fileupload_realpath', 3, '/home/your/site/wordpress/images', 'enter the real path of the directory where you\'ll upload the pictures \nif you\'re unsure about what your real path is, please ask your host\'s support staff \nnote that the directory must be writable by the webserver (chmod 766) \nnote for windows-servers users: use forwardslashes instead of backslashes', 8, 40)", 429 429 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(33,'fileupload_url', 3, 'http://example.com/images', 'enter the URL of that directory (it\'s used to generate the links to the uploded files)', 8, 40)", 430 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(34,'fileupload_allowedtypes', 3, ' jpg gif png ', 'accepted file types, you can add to that list if you want. note: add a space before and after each file type. example: \' jpg gif png\'', 8, 20)",430 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(34,'fileupload_allowedtypes', 3, ' jpg gif png ', 'accepted file types, separated by spaces. example: \'jpg gif png\'', 8, 20)", 431 431 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(35,'fileupload_maxk', 1, '96', 'by default, most servers limit the size of uploads to 2048 KB, if you want to set it to a lower value, here it is (you cannot set a higher value than your server limit)', 8, 20)", 432 432 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(36,'fileupload_minlevel', 1, '1', 'you may not want all users to upload pictures/files, so you can set a minimum level for this', 8, 20)", 433 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces if you leave that variable blank, all users who have the minimum level are authorized to upload note: add a space before and after each login name example: \' barbara anne\'', 8, 30)",433 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'', 8, 30)", 434 434 // email settings 435 435 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(38,'mailserver_url', 3, 'mail.example.com', 'mailserver settings', 8, 20)", … … 527 527 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'postbypost','post by post',null,null,4)", 528 528 // select data for time diff 529 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (51, null, null, 13, -13, null)",529 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (51, 'hours', 'hours', 23, -23, null)", 530 530 // select data for start of week 531 531 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '0', 'Sunday', null,null,1)", -
trunk/wp-admin/wp-edit.form.php
r453 r456 3 3 <div class="wrap"> 4 4 <?php 5 6 $allowed_users = explode(" ", trim($fileupload_allowedusers)); 5 7 6 8 function selected($selected, $current) { … … 207 209 208 210 209 <?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ( (ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>211 <?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && (in_array($user_login, $allowed_users) || (trim($fileupload_allowedusers)=="")) ) { ?> 210 212 <input type="button" value="upload a file/image" onclick="launchupload();" class="search" tabindex="10" /> 211 213 <?php } -
trunk/wp-admin/wp-install.php
r424 r456 407 407 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(32,'fileupload_realpath', 3, '/home/your/site/wordpress/images', 'enter the real path of the directory where you\'ll upload the pictures \nif you\'re unsure about what your real path is, please ask your host\'s support staff \nnote that the directory must be writable by the webserver (chmod 766) \nnote for windows-servers users: use forwardslashes instead of backslashes', 8, 40)", 408 408 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(33,'fileupload_url', 3, 'http://example.com/images', 'enter the URL of that directory (it\'s used to generate the links to the uploded files)', 8, 40)", 409 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(34,'fileupload_allowedtypes', 3, ' jpg gif png ', 'accepted file types, you can add to that list if you want. note: add a space before and after each file type. example: \' jpg gif png\'', 8, 20)",409 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(34,'fileupload_allowedtypes', 3, 'jpg gif png', 'accepted file types, separated by spaces. example: \'jpg gif png\'', 8, 20)", 410 410 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(35,'fileupload_maxk', 1, '96', 'by default, most servers limit the size of uploads to 2048 KB, if you want to set it to a lower value, here it is (you cannot set a higher value than your server limit)', 8, 20)", 411 411 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(36,'fileupload_minlevel', 1, '1', 'you may not want all users to upload pictures/files, so you can set a minimum level for this', 8, 20)", 412 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces if you leave that variable blank, all users who have the minimum level are authorized to upload note: add a space before and after each login name example: \' barbara anne\'', 8, 30)",412 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'', 8, 30)", 413 413 // email settings 414 414 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(38,'mailserver_url', 3, 'mail.example.com', 'mailserver settings', 8, 20)", … … 506 506 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'postbypost','post by post',null,null,4)", 507 507 // select data for time diff 508 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (51, null, null, 13, -13, null)",508 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (51, 'hours', 'hours', 23, -23, null)", 509 509 // select data for start of week 510 510 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '0', 'Sunday', null,null,1)",
Note: See TracChangeset
for help on using the changeset viewer.