Jump to content


Photo
- - - - -

Rename Manager Directory In 0.6.1 Rtm


  • Please log in to reply
9 replies to this topic

#1 grandpa

grandpa

    Etomite Forum Newbie

  • Member
  • 12 posts

Posted 29 January 2006 - 11:00 PM

Background: I really like being secure, so any extra level of protection I can add is something I look forward to. So, I decided to rename my manager directory. I then searched the forums to see if anyone had tried to do this before, but I only stumbled across a thread that was 2 years old!!! So, I proceeded to create a PHP script that would rename the manager directory and allow the manager to function the correct way.


Modifications: Unfortunately, the default install has ~10 files that rely on a statically defined manager directory. To make things easier on myself, I coded a PHP script that will take your default manager directory and rename it to the new manager name you want. These core files are affected:

'manager/includes/accesscontrol.inc.php'
'manager/actions/dynamic/mutate_content.dynamic.action.php',
'manager/actions/dynamic/mutate_settings.dynamic.action.php',
'manager/actions/static/export_site.static.action.php',
'manager/frames/1.php',
'manager/frames/2.php',
'manager/frames/6.php',
'manager/frames/12.php',
'manager/media/ibrowser/config/config.inc.php'
'index.php'

Usage: Just pop this script in your root etomite directory. Browse the file from your browser and type which name you want in the "New Manager Folder Name" box. That's it. The prefix is designed to prevent accidental repeats the script may encounter. If you know what you're doing, you can remove it. If you need to rename everything back to the default (for example, when the Final distro comes out), just replace the "Old Manager Folder Name" with your current working manager installation directory name, type 'manager' in the "New Manager Folder Name", and clear the "Prefix" field.

Notes: Tested with PHP 4.3.11, slackware linux, kernel 2.4.26, etomite 0.6.1 RTM (Prelude), Firefox 1.07

Disclaimer: ALWAYS make a backup before you try anyone's code. It may or may not work on your system. This worked for me, but alot of servers have very different configurations than mine.

Attached Files



#2 grandpa

grandpa

    Etomite Forum Newbie

  • Member
  • 12 posts

Posted 29 January 2006 - 11:10 PM

Update:Sorry, forgot to add the manager/media/xinha/plugins/InsertFile/config.php file. I don't use Xinha, so it didn't affect mine. You can add this to the $fnames array if you really need it.

#3 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,786 posts

Posted 29 January 2006 - 11:43 PM

Ralph, can you check the script out before I pin it?

#4 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 30 January 2006 - 02:02 AM

Yes, Dean, grandpa's directory name changer does work... I should stress that there are several considerations which should be taken before anyone attempts to use this script on a production site...

As stated above, any references within editors and other optional modules will require manual editing of any manager file path references...

Any manager path references within any Etomite manager resources must be checked manually to assure that any such links are not broken... For example, the Blogger or EtoBlog snippets would require manual remapping of the editor path...

After running this script it is very important that you login to your Etomite manager, reverify that all paths are set correctly within your Etomite configuration and save them... You must also perform a Clear site cache from the main menu even if you don't use caching for your sites documents as Etomite itself uses caching for internal purposes...

And as a reminder, this is an unofficial modification, even though I have successfully used this script, and as such any support will be somewhat limited due to possible differences in behavior when run on individual installations... This script should only be used if you are running a mission critical site, don't feel that your routine backups offer enough security, and/or are overly paranoid and are willing to deal with any potential problems that its use may generate... You have been warned...

#5 breezer

breezer

    Likes Etomite Forums!

  • Member
  • PipPip
  • 308 posts

Posted 30 January 2006 - 02:14 AM

I tried it and it renamed correctly and worked fine both ways on one of my test rtm sites, but it allowed the manager folder to be exposed in the filemanager... another path to track down grandpa :D

#6 grandpa

grandpa

    Etomite Forum Newbie

  • Member
  • 12 posts

Posted 30 January 2006 - 08:09 AM

Update:Thanks breezer for tracking that down. The definition to exclude files in the file manager is located in /manager/actions/static/files.static.action.php around line 12. It is the $excludes array and is used to exlude files from showing. I have added the code in and it works.

Response:To Dean and Ralph, I just was playing around with the code a while and it dawned on me that maybe the manager directory could be configureable through a single file like /manager/includes/config.inc.php. I don't think it would be a major deal to go through the 10 or so files and configure them to pull the name of the manager directory from a variable defined in the config.inc.php file. But of course, you probably have to worry about alot of extra things including extra plugins and snippets and add-ons and any of the hundred things that make etomite great. :betterwink: (Alas, the life of a developer who arrives on the scene of pre-written code and has to pull teeth to add new capabilities...)

To everyone else who may be thinking about using this, please understand that my code is not robust enough to understand changes you may have made to the aforementioned files. (Yet.) If you find it isn't working or need some explanation on the functionality, don't hesitate to ask or comment.

Attached Files



#7 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 30 January 2006 - 03:27 PM

Yes, grandpa, I have been entertaining the idea of making the manager directory name be user selectable for some time now... I doubt that we will implement this feature until the next major release, however... I think we've traumatized members enough with the many major changes throughout the 0.6.1 development branch already...

#8 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,786 posts

Posted 27 July 2006 - 02:35 PM

Has anyone used this on a 0.6.1 final install?

#9 DeniseDD

DeniseDD

    Etomite Forum Fan

  • Member
  • Pip
  • 79 posts

Posted 05 August 2006 - 02:04 PM

Hi grandpa how are you?

#10 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,786 posts

Posted 19 February 2007 - 09:52 PM

If anyone gets a chance to update this, it would be great :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users