 |
 |
 |
 |
#134020 - 05/07/01 10:08 AM
Re: [6.0x] ELY_M's Upload Modification
|
Admin / Code Breaker
Registered: 03/24/01
Posts: 7396
|
Another thing, you can disable uploads in some forums, but if the user enters cgi-bin/upload_form.cgi, it will upload anyway; also unregistered users can upload, and I don't think I can disable it; and the same thing if I want only admins/mods. What you can do is make it ultimatebb.cgi?ubb=upload_form (and to not make it confusing I think you should make the upload_form.cgi be ubb_upload_form.cgi and the other one ubb_upload.cgi), and then it will have all login information. Also, when you'll do it, the CGI path will be in $vars_config{CGIPath} or something like that, so you can just make it automatically $vars_config{CGIPath}/uploads.
Now, your script doesn't work if Variables Path is different than cgi-bin; it will also be fixed after you'll do it if you'll do $vars_config{VariablesPath}.
<FONT COLOR="#000000" SIZE="1">[ May 07, 2001 10:11 AM: Message edited by: LK ]</font>
_________________________
My Hacks Page (will be back with UBB 7!) UBBDev - We put the class into UBB.classic!
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#134026 - 05/11/01 02:22 AM
Re: [6.0x] ELY_M's Upload Modification
|
Admin / Code Breaker
Registered: 03/24/01
Posts: 7396
|
ELY: I think you should make that files have a random name, like a368dq46.jpg (8 random letters/numbers). Reasons: <OL TYPE=a> [*]If somebody posts something and I post another one with the sane name, it will overwrite the old one, and if it sucks they will blame the first one. [*]Files like .htpasswd can cause a security risk, so now it will be a456f34g.htpasswd, which I think it's okay. </OL> If you choose to do it, just make sure the file doesn't already exist, because there can be even 2 random things that are the same. If you think it's too ugly/dumb for you, make directories by the member number, like /cgi-bin/00000001/file.ext, and guests have 00000000; but I think it's worse, because of the guests and some other reasons I forgot  LK.
_________________________
My Hacks Page (will be back with UBB 7!) UBBDev - We put the class into UBB.classic!
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#134027 - 05/11/01 02:43 PM
Re: [6.0x] ELY_M's Upload Modification
|
Member
Registered: 03/09/01
Posts: 46
|
@ELY_M all the entrys of your hack in the vars_misc.cgi (After the when i Save the Settings in CP) beginn with and end with dosen't work and give this Error: The chmod is ok! The Perl is ok The hack is corecked added (i hope)! Can you help me? SkipperII  <FONT COLOR="#000000" SIZE="1">[ May 11, 2001 02:44 PM: Message edited by: SkipperII ]</font>
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#134029 - 05/11/01 07:25 PM
Re: [6.0x] ELY_M's Upload Modification
|
Junior Member
Registered: 04/13/01
Posts: 12
|
Ok, I changed some of the script, and seems to be working now.... here is what i did: In upload.cgi Find: and move it directly under the lines: Then find: and replace it with: This should make the script check the file type first, before uploading it. As well, it will also generate a random filename so that one file upload will not overwrite one that is already in the directory. I am pretty new at CGI, so someone may want to take a look at it..
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|