Author |
Message |
JRSweets
Worker


Joined: Aug 06, 2004
Posts: 192
|
Posted:
Wed Dec 22, 2004 10:13 am |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Dec 22, 2004 4:40 pm |
|
A quick solution would be, if you have .htaccess, you could add theis code to the top of your .htaccess (This is the CGI Auth code)Code:# -------------------------------------------
# Start of NukeSentinel(tm) admin.php Auth
# -------------------------------------------
<Files .staccess>
deny from all
</Files>
<Files modules/Forums/admin/index.php>
<Limit GET POST PUT>
require valid-user
</Limit>
AuthName "Restricted"
AuthType Basic
AuthUserFile /path/to/your/.staccess
</Files>
|
Then, you will need to set up your .staccess with valid user names and encrypted passwords. We should be able to get this into NukeSentinel where you won't need this, but this would be a quick fix. BTW, I haven't tested it so let me know if it works or not  |
|
|
|
 |
BobMarion
Former Admin in Good Standing

Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)
|
Posted:
Wed Dec 22, 2004 8:21 pm |
|
On my test site i've done this:Code:# -------------------------------------------
# Start of NukeSentinel(tm) admin.php Auth
# -------------------------------------------
<Files .staccess>
deny from all
</Files>
<Files admin.php>
<Limit GET POST PUT>
require valid-user
</Limit>
AuthName "Restricted by NukeSentinel(tm)"
AuthType Basic
AuthUserFile /my/path/to/.staccess
</Files>
<Files modules/Forums/admin/index.php>
<Limit GET POST PUT>
require valid-user
</Limit>
AuthName "Restricted by NukeSentinel(tm)"
AuthType Basic
AuthUserFile /my/path/to/.staccess
</Files>
# -------------------------------------------
# End of NukeSentinel(tm) admin.php Auth
# -------------------------------------------
|
However it's not bring up the forced login thru CGI Auth  |
_________________ Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login! |
|
|
 |
BobMarion

|
Posted:
Wed Dec 22, 2004 9:13 pm |
|
create a new .htaccess file for your modules/Forums/admin/ directory and add this:Code:# -------------------------------------------
# Start of NukeSentinel(tm) admin.php Auth
# -------------------------------------------
<Files index.php>
<Limit GET POST PUT>
require valid-user
</Limit>
AuthName "Restricted by NukeSentinel(tm)"
AuthType Basic
AuthUserFile /path/to/your/.staccess
</Files>
# -------------------------------------------
# End of NukeSentinel(tm) admin.php Auth
# -------------------------------------------
|
This requires that you have CGIAuth completely setup thru NukeSentinel on your site for this to work properly. |
|
|
|
 |
JRSweets

|
Posted:
Thu Dec 23, 2004 12:58 pm |
|
I don't use CGI Auth/.staccess I just use the .htaccess HTTP auth setting. Is there a way to do is using that or do I have to setup CGI Auth/.staccess? If so thats what I will do. |
|
|
|
 |
JRSweets

|
Posted:
Tue Jan 25, 2005 12:40 pm |
|
Raven or Bob,
Do you see a problem with doing this...
Open includes/sentinel.php and find:
Code:if (basename($_SERVER['SCRIPT_NAME'], '.php')==$admin_file) {
|
and replace with this:
Code:if ((basename($_SERVER['SCRIPT_NAME'], '.php')==$admin_file) OR ($_SERVER['SCRIPT_NAME'] == '/modules/Forums/admin/index.php')) {
|
It seems to work correctly for me and force the HTTP Auth when using a direct link to the forums ACP. |
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Tue Jan 25, 2005 3:56 pm |
|
Doesn't seem to work when I tried it but whats new lol!
But this seems to work ok for me:
if ((basename($_SERVER['SCRIPT_NAME'], '.php')==$admin_file) OR (stripos_clone($_SERVER['REQUEST_URI'], '/modules/Forums/admin/'))) { |
_________________ [b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 |
|
|
 |
sixonetonoffun

|
Posted:
Tue Jan 25, 2005 6:09 pm |
|
Giving this a little more thought just /admin would be pretty good too because it would catch any direct access to modules/modulename/admin too. I can't think of any conflicts off the top of my head. |
|
|
|
 |
Raven

|
Posted:
Tue Jan 25, 2005 9:24 pm |
|
It's good. I just put a separate CGIAuth in the admin folder. |
|
|
|
 |
JRSweets

|
Posted:
Tue Jan 25, 2005 10:08 pm |
|
This might be a dumb question but, whats the difference between $_SERVER['REQUEST_URI'] and $_SERVER['SCRIPT_NAME']? |
|
|
|
 |
sixonetonoffun

|
Posted:
Tue Jan 25, 2005 10:48 pm |
|
I thought $_SERVER['QUERY_STRING'] and $_SERVER['REQUEST_URI'] are basically the full request string and the $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] are the actual script file name. But I've been wrong before. |
|
|
|
 |
Raven

|
Posted:
Wed Jan 26, 2005 1:29 am |
|
|
|
 |
JRSweets

|
Posted:
Wed Jan 26, 2005 7:45 am |
|
Thanks guys.
So we could use something like this:
Code:if ((basename($_SERVER['SCRIPT_NAME'], '.php')==$admin_file) OR (stripos_clone($_SERVER['REQUEST_URI'], '/admin'))) {
|
or this
Code:if ((basename($_SERVER['SCRIPT_NAME'], '.php')==$admin_file) OR (stripos_clone($_SERVER['REQUEST_URI'], '/admin/'))) {
|
Which would be correct? |
|
|
|
 |
sixonetonoffun

|
Posted:
Mon Jan 31, 2005 10:18 am |
|
I went with this but there is slightly more of a potential for conflict. But it activates when accessing urls like /modules.php?name=Your_Account&file=admin which I like very much.
Code:
if ((basename($_SERVER['SCRIPT_NAME'], '.php')==$admin_file) OR (stripos_clone($_SERVER['REQUEST_URI'], 'admin'))) {
|
|
|
|
|
 |
|