vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - admincp: Extra Security (htaccess) (https://vborg.vbsupport.ru/showthread.php?t=232257)

Marv 01-04-2010 10:00 PM

admincp: Extra Security (htaccess)
 
1 Attachment(s)
First of all: this isn?t my mod. I?have this one on my forums now for 4 or 5 years and was looking around here at vb.org for it but it seems it?s gone (or may be it never was released here). Yet, I haven?t found it so I tested this in vb4 and it works. Guess it?s quite useful for some of you so I share this with you.

This mod adds some extra security to your admincp. And your admincp only. The modcp remains untouched, so mods can access the modcp without a secondary login.

Files to edit: 1
Install time: 1 minute

Open admincp/index.php on your server.

Above:
PHP Code:

// ######################## SET PHP ENVIRONMENT ########################### 

add this:

PHP Code:

$index['public'] = $index['public'];
$phpkd['username'] = "Username";    // Here Is the User Name
$phpkd['password'] = "Password";    // Here Is The htaccess Password

if(!$index['public']){
if(
$_SERVER['PHP_AUTH_USER'] != $phpkd['username'] || $_SERVER['PHP_AUTH_PW'] != $phpkd['password']){
Header("WWW-Authenticate: Basic realm=\"Security Check\"");
Header("HTTP/1.0 401 Unauthorized");echo "<head><title>Unauthorized Login attempt</title></head><body bgcolor='#FFFFFF'><center><br>
<a href=\"../index.php\" style=\"text-decoration: none\" target=\"_self\">
<font face=\"MS Sans Serif\" color=\"#000000\" size=\"4\"><b><br>Unauthorized Login</b></a></body></html>"
;exit;}} 

Change "Username" and "Password" to whatever you want, save and upload the file to your admincp (overwrite the old index.php or rename it first to index.php.old) and you?re done. Fast and simple.

If the original author is still around hit me back so you can release this one under your name.

Marv 01-05-2010 02:18 PM

Weird but funny... :) I?ve found the original mod in the "Similiar Mod" section at the moment my post was published. It?s in the graveyard, huh? Guess thats the reason I hadn?t found it through the search engine before? So, all credits to SolidSnake@GTI. His original mod can be found here: https://vborg.vbsupport.ru/showthread.php?t=105179 .

SCSCSC 01-05-2010 02:30 PM

toooo goood man thanks so much

garretbyrne 01-05-2010 03:03 PM

Savage man, cheers for that

akee 01-05-2010 03:16 PM

If I have more then 1 administrator?
I have 3 admin.

Marv 01-05-2010 03:20 PM

Quote:

Originally Posted by akee (Post 1947959)
If I have more then 1 administrator?
I have 3 admin.

This mod can?t handle mutiple logins with different logins/passwords so you are forced to share this login with your mods.

we_are_borg 01-05-2010 05:03 PM

Well this is not true .htaccess because it's being used in the php file. If you want multiple logins look at http://www.javascriptkit.com/howto/htaccess3.shtml that should give you a idea for security. There even scripts that can make the login and password on the fly and add it in the .htaccess file.

Marv 01-05-2010 05:22 PM

True. Therefor I said this Mod can?t handle mutliple logins ;)

Alecsmith 01-05-2010 05:47 PM

Thanks u so much marv :)

Marv can u give code for mod cp also it will be really great :)

Marv 01-05-2010 06:02 PM

Quote:

Originally Posted by Alecsmith (Post 1948061)
Thanks u so much marv :)

Marv can u give code for mod cp also it will be really great :)

There is no special code for the modcp. You only have to put the code into root/modcp/index.php and you?re done.


All times are GMT. The time now is 04:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01009 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete