Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
admincp: Extra Security (htaccess) Details »»
admincp: Extra Security (htaccess)
Version: 1.00, by Marv Marv is offline
Developer Last Online: Feb 2021 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.0.0 Rating:
Released: 01-04-2010 Last Update: Never Installs: 39
Code Changes Translations Is in Beta Stage  
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 01-05-2010, 06:32 PM
Alecsmith Alecsmith is offline
 
Join Date: Sep 2009
Location: Still On Earth
Posts: 217
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working thanks
Reply With Quote
  #13  
Old 01-05-2010, 08:11 PM
Eric's Avatar
Eric Eric is offline
 
Join Date: May 2006
Location: Kentucky
Posts: 792
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No need for a file edit for the admincp

There is a hook that could be used

PHP Code:
($hook vBulletinHook::fetch_hook('admin_global')) ? eval($hook) : false
Reply With Quote
  #14  
Old 01-05-2010, 10:59 PM
HolyKiller HolyKiller is offline
 
Join Date: Dec 2006
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by akee View Post
If I have more then 1 administrator?
I have 3 admin.
HERE ya go
Reply With Quote
  #15  
Old 01-06-2010, 12:06 PM
Marv Marv is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool Good addition; HolyKiller !
Reply With Quote
  #16  
Old 01-06-2010, 01:29 PM
steve1966 steve1966 is offline
 
Join Date: Dec 2007
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SecondV View Post
No need for a file edit for the admincp

There is a hook that could be used

PHP Code:
($hook vBulletinHook::fetch_hook('admin_global')) ? eval($hook) : false
sorry for my bad but how do we use the hook?

also will this mod work if i have changed my admincp name?

thanks
Reply With Quote
  #17  
Old 01-06-2010, 04:39 PM
cnutter cnutter is offline
 
Join Date: Jan 2005
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another easy way to do this is just create two files one called .htaccess one called .htpasswd

In .htaccess put the following:

AuthName "Password Required"
AuthType Basic
AuthUserFile /home/forums/.htpasswd <-- path to passwd file
AuthGroupFile /dev/null

require user JohnDoe <-- this is the user that will have access (case sensitive)
require user JohnDoe2 <-- Add as many as users as you need using this format.

in the .htpasswd file put the user name and the encrypted paswd in this format:
JohnDoe:XPHPiphsU8rkM <--- examples only
JohnDoe2:PRrJjeFUT5ZWg

Use .htaccess / .htpasswd will give you a two step login that offers server side protect.

Here is a link to a great how to on this plus it offers a tool for creating the encrypted passwords.

http://www.javascriptkit.com/howto/htaccess.shtml
Reply With Quote
  #18  
Old 01-07-2010, 10:18 AM
HolyKiller HolyKiller is offline
 
Join Date: Dec 2006
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cnutter View Post
Another easy way to do this is just create two files one called .htaccess one called .htpasswd

...
Yep, like i did

HERE
Reply With Quote
  #19  
Old 01-07-2010, 12:02 PM
cnutter cnutter is offline
 
Join Date: Jan 2005
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HolyKiller View Post
Yep, like i did

HERE
Yep like you did there. Didn't see that one thanx for the link. It should be pointed out in this thread at least that .htaccess/.htpasswd can and should be used to protect both the admincp and the modcp. You should also change the names of these area for added security though security though Obscurity isn't really security. Man can you say that one three times really fast? I can't.
Reply With Quote
  #20  
Old 02-08-2010, 08:22 PM
darkdevilz darkdevilz is offline
 
Join Date: Sep 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another methos is;

find first and foremost
<?php

and add this to under

PHP Code:
$ourLogin "username";  
$ourPassword "password";  


session_start();  

if (
$_SESSION['login']!=$ourLogin && $_SESSION['password']!=$ourPassword) {  


if (
$_POST['login']==$ourLogin && $_POST['password']==$ourPassword) {  


$_SESSION['login'] = $_POST['login'];  
$_SESSION['password'] = $_POST['password'];  
header("Location: index.php");  


}  
else {  


echo 
"  
<form action=index.php method=post>  

<center><b>Are you sure to login ?</b></center>
<br>
<br>


Giris Ismi:<br>  
<input type=text name=login value=********><br>  

Giris Kodu:<br>  
<input type=password name=password value=********><br>  

<input type=submit value=' Login '>  


</form>  
"
;  

exit;  

}  


Reply With Quote
  #21  
Old 02-19-2011, 04:12 AM
synseal's Avatar
synseal synseal is offline
 
Join Date: Apr 2009
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very hand to have, thanks.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:26 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05666 seconds
  • Memory Usage 2,336KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete