Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Katsunami on August 04, 2006, 08:19:19 PM

Title: Remove SMF version from forum footer
Post by: Katsunami on August 04, 2006, 08:19:19 PM
Hello,

This is quite a simple question. I do not mind the copyright that is shown in the footer of the forum (far from it, credit where credit is deserved), but I'd like to remove the version number, or replace it with somthing such as X. The reason is simple; if the version number can be readily seen, then someone could target the forum with an exploit known to work on that version.

I have looked for it, but I cannot find the function theme_copyright() anywhere, which seems to put out the copyright strings. Where is it (if that is what I need to modify) ? I also found some occurrences of "1.0.7" in the database, and tried to change them to X or 0.00, but that had no effect.

Thanks for any help :)
Title: Re: Remove SMF version from forum footer
Post by: Thantos on August 04, 2006, 09:24:54 PM
open index.php and towards the top you should see something like:
$forum_version = 'SMF 1.0.7';

Change that to
$forum_version = 'SMF';

The SMF part has to be there or it'll throw an error.  Also realize that some administrative functions of SMF won't work properly as it won't know which version you are running.
Title: Re: Remove SMF version from forum footer
Post by: B Patterson on August 04, 2006, 09:28:36 PM
I'm just a stupid idiot... only trying to help... pay no attention to me....
Title: Re: Remove SMF version from forum footer
Post by: 1MileCrash on August 04, 2006, 09:32:20 PM
[Unknown] gave a weird vibe toward this..

Quote from: [Unknown] on July 19, 2005, 07:51:48 PM
You can remove the version number if you like, but don't expect to get as good support from us if you do.

You cannot change the "format" of the copyright statement.  If you don't like it, use another software.

-[Unknown]
Just remember not to touch anything else.

The chances of someone "exploiting" your forum simply because they see the version is minute. It really isnt much defense..
Title: Re: Remove SMF version from forum footer
Post by: Orstio on August 04, 2006, 09:50:43 PM
Do not ever change the $forum_copyright variable.  That would be a violation of the SMF license.

If you feel you need to change the version, change it in the index.php variable $forum_version.
Title: Re: Remove SMF version from forum footer
Post by: B Patterson on August 04, 2006, 09:55:32 PM
Apparently I'm always wrong....
Title: Re: Remove SMF version from forum footer
Post by: 1MileCrash on August 04, 2006, 09:56:24 PM
Quote from: bpat1434 on August 04, 2006, 09:55:32 PM
Um... why can't you change the forum_copyright variable?  Can't you just edit it to say:
QuotePowered by SMF (http://www.simplemachines.org) | SMF © 2001-2005, Lewis Media (http://www.simplemachines.org/about/copyright.php)
?

That's not violating it.... is it?  No different than modifying the index.php page ;)

Obey Orstio.
Title: Re: Remove SMF version from forum footer
Post by: Orstio on August 04, 2006, 09:59:52 PM
Have you read the SMF license?

http://www.simplemachines.org/about/license.php

Part 1) a. of the agreement reads:

QuoteAll copyright notices within source files and as generated by the Software as output are retained, unchanged.

Therefore, you cannot change the $forum_copyright variable without violating the license.
Title: Re: Remove SMF version from forum footer
Post by: B Patterson on August 04, 2006, 10:01:52 PM
Nope... I'm still wrong....
Title: Re: Remove SMF version from forum footer
Post by: Isaac on August 04, 2006, 10:03:35 PM
Obey Orstio. 

The forum version number is different from the copyright.
Title: Re: Remove SMF version from forum footer
Post by: Orstio on August 04, 2006, 10:08:06 PM
Changing the $forum_version variable does not alter the way in which the $forum_copyright is output.  It changes the visible output of the version within the copyright statement, but not the way in which the copyright is displayed.

So no; modifying $forum_version is not the same as modifying $forum_copyright.
Title: Re: Remove SMF version from forum footer
Post by: B Patterson on August 04, 2006, 10:09:23 PM
whatever.... I'll remove my posts...

Removal of posts done...
Title: Re: Remove SMF version from forum footer
Post by: Isaac on August 04, 2006, 10:15:03 PM
Quote from: bpat1434 on August 04, 2006, 10:09:23 PM
whatever.... I'll remove my posts...

Removal of posts done...
Great, now the entire thread is messed up, and it is now useless for anyone to learn from in the future. 
Title: Re: Remove SMF version from forum footer
Post by: B Patterson on August 04, 2006, 10:16:22 PM
NOpe.... they can learn... I didn't edit anything non-essential... plus I don't want to encourage breaking the license, so all of my attempts to help, although shady, were wrong and I removed them so no-one can say "Well I saw on the SMF forum that you can modify $forum_copyright".... so it's a Cover My Ass thing.
Title: Re: Remove SMF version from forum footer
Post by: Orstio on August 04, 2006, 10:26:16 PM
Thank you.

While I do understand that your intention was to be helpful, it is also important that the proper information is given to help.

This would be a case where doing things right is just as important as doing the right thing.  ;)
Title: Re: Remove SMF version from forum footer
Post by: Katsunami on August 05, 2006, 03:15:42 AM
First, I'd like to make clear that I do not want to to violate any license or copyrights. As a technical programmer myself, I know enough about programming and how much work it is.

Quote from: Thantos on August 04, 2006, 09:24:54 PM
open index.php and towards the top you should see something like:
$forum_version = 'SMF 1.0.7';

Change that to
$forum_version = 'SMF';

The SMF part has to be there or it'll throw an error.  Also realize that some administrative functions of SMF won't work properly as it won't know which version you are running.

Thanks for your reply. But, why would administrative functions need to know the version number ? Are they functions that behave differently between different forum versions, and select their behaviour using an "if" or "select" statment or somesuch ?

Quote from: Tippmaster on August 04, 2006, 09:32:20 PM
The chances of someone "exploiting" your forum simply because they see the version is minute. It really isnt much defense..

Are you sure about this ? I have seen about 3 phpBB boards gone down almost the same day they were activated after porting them from another (less well known) software package. After the security leak was patched and the version number of the software removed from the main page, they stayed up without problems.
Title: Re: Remove SMF version from forum footer
Post by: Orstio on August 05, 2006, 08:15:24 AM
QuoteAre you sure about this ? I have seen about 3 phpBB boards gone down almost the same day they were activated after porting them from another (less well known) software package. After the security leak was patched and the version number of the software removed from the main page, they stayed up without problems.

Script-kiddies typically use something called a "defacer tool".  These work by running through a list of URLs that are input by the script-kiddie, and attempting their "hack" on every URL in the list.  If your site happens to be on some script-kiddie's list of URLs to try, it doesn't matter what software you are using, nor what version.  Their script is going to hit your URL regardless.

Case in point:  I'm using Mambo and SMF on my site, yet some of the hits on my site are from defacer tools designed for IPB, PhpNuke, PhpBB, etc. 
Title: Re: Remove SMF version from forum footer
Post by: Harzem on August 05, 2006, 08:23:13 AM
You don't need to change $forum_version in index.php. This will affect the way of some administrative functions, as said before.

You also can't change $forum_copyright variable.

There is one thing to be done, which is what I've done in one of my sites.

Open Themes/default/languages/index.english.php

Find:

$forum_copyright = '<a href="http://www.simplemachines.org/" title="Simple Machines Forum" target="_blank">Powered by ' . $forum_version . '</a> |
<a href="http://www.simplemachines.org/about/copyright.php" title="Free Forum Software" target="_blank">SMF &copy; 2001-2005, Lewis Media</a>';



Add this before it:


$real_version = $forum_version;
$forum_version = "SMF";


add this after it:


$forum_version =  $real_version;


So everything works in admin area properly, plus you have removed the version number from the footer. Also you haven't modified $forum_copyright.
Title: Re: Remove SMF version from forum footer
Post by: Arbalot on August 05, 2006, 08:26:52 AM
Harzem this is nice but somebody use this coding badly
Title: Re: Remove SMF version from forum footer
Post by: Harzem on August 05, 2006, 08:27:55 AM
Quote from: Arbalot on August 05, 2006, 08:26:52 AM
Harzem this is nice but somebody use this coding badly

No, if someone alters the copyright in another way, he will get the ILLEGAL error.
Title: Re: Remove SMF version from forum footer
Post by: Arbalot on August 05, 2006, 08:30:45 AM
but somebody write
$forum_version = "Copyright by Arbalot"; :D
Title: Re: Remove SMF version from forum footer
Post by: Harzem on August 05, 2006, 08:32:19 AM
Quote from: Arbalot on August 05, 2006, 08:30:45 AM
but somebody write
$forum_version = "Copyright by Arbalot"; :D

Try it and see ;) SMF is more clever!
Title: Re: Remove SMF version from forum footer
Post by: Grudge on August 05, 2006, 08:42:30 AM
My preferred way of doing this is in index.php, find:

loadUserSettings();


Add After:

if (!$user_info['is_admin']))
  $GLOBALS['forum_version'] = 'SMF';


This will ensure that all the admin functions still work for the admin.
Title: Re: Remove SMF version from forum footer
Post by: Harzem on August 05, 2006, 08:44:23 AM
Grudge is clever too :P I have a new preferred way now!
Title: Re: Remove SMF version from forum footer
Post by: Katsunami on August 06, 2006, 06:30:32 PM
Ah, both ways are quite useful :) I should have figured the first one out by myself because it's quite logical... (but I blame the fact that I don't know everything about SMF for not doing so) :P

Thanks for your help :)
Title: Re: Remove SMF version from forum footer
Post by: Gargoyle on August 26, 2006, 04:00:15 PM
Quote from: Grudge on August 05, 2006, 08:42:30 AM
My preferred way of doing this is in index.php, find:

loadUserSettings();


Add After:

if (!$user_info['is_admin']))
  $GLOBALS['forum_version'] = 'SMF';


This will ensure that all the admin functions still work for the admin.

I've tried doing this 4 times and every time I get nothing but a blank screen... Any idea why ?
Title: Re: Remove SMF version from forum footer
Post by: winrules on August 26, 2006, 04:02:02 PM
When do you get the blank screen?
Title: Re: Remove SMF version from forum footer
Post by: Gargoyle on August 26, 2006, 06:59:56 PM
when i upload the file with the edits.