Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [ADMIN MOD] Change your Login Panel URL as an Admin Setting  (Read 3279 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
[ADMIN MOD] Change your Login Panel URL as an Admin Setting
« on: December 31, 2007, 10:48:35 pm »

This mod provides a new field in the Admin Settings >> Settings Panel where you can change the URL path to your Login Panel. There are a few good reasons to use this mod:
1 - If you don't want to have a "login" link displayed in any visible location on your web page,
2 - If you want to change the URL path to your Login Panel on a regular basis, making it next to impossible for outsiders to locate,
3 - If you are using an MU package... and you have a 'former' Editor you no longer want accessing your Admin area... this is like re-keying the locks on your doors.

This mod will work with the default, MU, MESU and MEMU 1.6 packages.


Step 1: Create a new global variable array - The default sNews package does not make use of a global variable array. If you are adding this to a default sNews 1.6 package, then add this complete array underneath the $db database settings array near the top of your snews.php file. If you are using an MEMU or MESU 1.6 package, this array may already be within your config.php file. In that case, you need only copy the 3rd, 4th and 5th lines into/under the last variable string in your function.

Code: [Select]
function gl($variable) {
$gl = array();
/* ----- DO NOT EDIT THE VALUE IN THIS VARIABLE ---------------
Value comes from settings dbase table, as entered by Admin in Settings Panel. */
$gl['loginLink'] = ''.s('login_url').'';

return $gl[$variable];
}


Step 2: In the Language Variable Array
a) Under - #login - add a new variable - $l['url_to_logpanel'] = 'URL path to your login panel';
b) Near the end of the Language Variable array section, locate the string that starts with - $l['cat_listSEF'] = $l['home_sef'].
   Within the string, locate the word - login and change it to login_url.

Step 3: In the // STARTUP function - Scroll down a bit in this function until you come to switch(true) and, below it, replace the first case string with the following:

Code: [Select]
# login url mod - (keys)
case ((!$categoryID || !is_numeric($categoryID)) && check_category($categorySEF) == false && $categorySEF != s('login_url') ):
# default string
//case ((!$categoryID || !is_numeric($categoryID)) && check_category($categorySEF) == false):


Step 4: In function // CENTER - Search for - case 'login': login(); break; and replace it with the following:

Code: [Select]
        # login url mod - (keys)
        case gl('loginLink'): login(); break;
//case 'login': login(); break;


Step 5: In function // SETTINGS FORM - Scroll down until you come to the echo string that starts like - echo html_input('text', 'home_sef', 'webSEF', and paste the following strings under it:

Code: [Select]
# login url mod - (keys)
echo html_input('text', 'login_url', 'loginurl', s('login_url'), l('url_to_logpanel'), '', '', '', '', '', '', '', '', '', '');


Step 6: In /*** PROCESSING (CATEGORIES, CONTENTS, COMMENTS) ***/ - Scroll down and find (or search for) case 'save_settings': and... a few lines down within the variable strings, paste in the following new string:

Code: [Select]
# login url mod - Dec.31.07
$login_url = $_POST['login_url'];

And... further down in the same function, locate (search for) the big string that begins with $ufield = array. This string ties values to their variables, as used throughout the snews.php file. At the end of this string... just before its closing bracket... paste in the following (including the comma):

Code: [Select]
,'login_url' => $login_url 


Step 8: Update the datebase Settings Table - Add a data row in your database Settings table, using phpMyAdmin. If the ID number in the last row of your table data is 23 (as it is in the default snews 1.6 database) then the Field id will be 24. If the last data row in your table is different, then use a Field id number that would follow in order (27 after 26)

   Field id:   24   ( or 1 higher than the number used by the last existing row )
   field name:   login_url
   Field value:   login


USAGE:

If all your modifications were done correctly, you should now be able to login by adding login to the end of your site's URL and the login panel should display.

After logging in, go to the Settings >> Settings Panel and you will find a new field... under the Home SEF field... with URL path to your login panel above it... and login within it as the default setting. Change this to something abstract... like men39ul271 and save your settings. Write down whatever you used so you won't forget it. Then log out.

To log in again, have your Home page in view, and add the new URL path to the end of your domain name... as men39ul271 making sure there is a forward slash before and after it. Your login panel should appear as usual. Save that URL in your browser's Favorites somewhere where you keep other useful URLs to your own site(s). When you want to login to your site, just choose that URL from your Favorites.
« Last Edit: December 31, 2007, 10:50:22 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [ADMIN MOD] Change your Login Panel URL as an Admin Setting
« Reply #1 on: January 24, 2008, 07:08:34 am »

It works! Thanks Keyrocks! I like security things :)
Logged
By(e) Henrich :)
------------------------------
IT related blog

azad

  • Newbie
  • *
  • Karma: 0
  • Posts: 21
Re: [ADMIN MOD] Change your Login Panel URL as an Admin Setting
« Reply #2 on: March 11, 2008, 06:57:02 am »

Hi,
Keyrocks and henrich

thanks Keyrocks it's very useful
Logged

niceboy

  • Newbie
  • *
  • Karma: 0
  • Posts: 21
    • Best paid web hosting service
Re: [ADMIN MOD] Change your Login Panel URL as an Admin Setting
« Reply #3 on: April 12, 2008, 07:21:40 am »

thanks. i'm going to try this.