| View previous topic :: View next topic |
| Author |
Message |
JohnPace Guest
|
Posted: Tue Mar 16, 2004 6:01 pm Post subject: Access Denied message |
|
|
| Can the wording on the "Access Denied" splash screen be changed? I would like to be able to direct questions to our circulatuion desk. |
|
| Back to top |
|
 |
stonefish
Joined: 07 Apr 2003 Posts: 2448 Location: Bristol, UK
|
Posted: Tue Mar 16, 2004 10:15 pm Post subject: |
|
|
It can.
You'll find a number of perl scripts in /www2 with embedded html in them.
Modifying one or more of those should achieve what you want, without having to re-compile anything.
Don't forget to make a backup copy of the original, before you start playing.
Regards
Neil _________________ Neil Briscoe
Adelix Limited
neil.briscoe@adelix.com
Adelix Limited - WiFi, VoIP, CensorNet, Linux solutions and consultancy.
www.adelix.com www.censornet.com |
|
| Back to top |
|
 |
JohnPace Guest
|
Posted: Wed Mar 17, 2004 9:04 pm Post subject: |
|
|
How do I modify a perl script? I have not done that before
Thanks! |
|
| Back to top |
|
 |
JohnPace Guest
|
Posted: Wed Mar 17, 2004 9:53 pm Post subject: |
|
|
This is what I tried and it did not work:
I used WinSCP and found the www2 directory and the file I want to modify "dansguardian.pl". I tried replacing "Network Manager" with "Front Desk", saved it and exited. I tried to go to a blocked site and the entire message did not show up. The Access Denied box was there, the user was there, the "unblock" button was there... just missing then message. If I re-open the file and put it back exactly as it was originally, it works fine. If I change so much as a period, it will not work.
Any idea what I am doing wrong? |
|
| Back to top |
|
 |
Brian
Joined: 18 Jun 2003 Posts: 214 Location: Portsmouth
|
Posted: Wed Mar 17, 2004 10:44 pm Post subject: |
|
|
Check the access on the file, it sounds like you've uploaded the file and haven't set the access correctly, it might have to be something like
chmod o+rx
one the file you altered. I'm not sure if WinSCP can change he access of the file, I'll have look tomorrow when I'm back in the office where I have it installed |
|
| Back to top |
|
 |
Brian
Joined: 18 Jun 2003 Posts: 214 Location: Portsmouth
|
Posted: Thu Mar 18, 2004 9:02 am Post subject: |
|
|
I've just checked that WinSCP can be used to alter access rights and it can. Click on the file you want to check and press F9 or click on Properties on the bottom bar on the WinSCP window
My danguardian.pl file has access 755 so that
owner rwx
group rx
other rx
Make sure the replacement that you upload has these rights
Brian |
|
| Back to top |
|
 |
JohnPace Guest
|
Posted: Thu Mar 18, 2004 9:40 pm Post subject: |
|
|
I still have the same problem. I opened the dansguardian.pl file, modified the wording of the message to indicate "Circulation Desk", closed and saved the file. I then right clicked the file and opened the properties. Mine are the same as they originally were:
Owner: RWX
Group: R X
Others: R X
Octal: 755
When I go to a banned site, I still get the "access denied" splash screen, it identifies the user, but then the message is blank.
| Brian wrote: | I've just checked that WinSCP can be used to alter access rights and it can. Click on the file you want to check and press F9 or click on Properties on the bottom bar on the WinSCP window
My danguardian.pl file has access 755 so that
owner rwx
group rx
other rx
Make sure the replacement that you upload has these rights
Brian |
|
|
| Back to top |
|
 |
Brian
Joined: 18 Jun 2003 Posts: 214 Location: Portsmouth
|
Posted: Fri Mar 19, 2004 11:08 am Post subject: |
|
|
How about login into the box and using `nano` to edit the file directly, it might be that the editor you using on the Windows side is adding so funny characters causing the problem.
Not sure how comfortable you are with Linux but all you have to do is ssh to the box (use putty) and then
cd /www2
cp danguardin.pl danguardian.pl.bak
nano dansguardian.pl
Then all the commands are at the bottom of the screen.
Some of the paths above might be wrong as I'm doing this from memory as I'm not near the box today.
If you need more help ask
Brian |
|
| Back to top |
|
 |
JohnPace Guest
|
Posted: Fri Mar 19, 2004 3:36 pm Post subject: |
|
|
I edited the file directly using nano, and got the same result. When I edit the file, the message disappears, change the file text back and it reappears.
The good news is that I am learing a lot about various Linux commands and editing files :)
Any other ideas?
| Brian wrote: |
cd /www2
cp danguardin.pl danguardian.pl.bak
nano dansguardian.pl
Then all the commands are at the bottom of the screen.
Some of the paths above might be wrong as I'm doing this from memory as I'm not near the box today.
If you need more help ask
Brian |
|
|
| Back to top |
|
 |
Brian
Joined: 18 Jun 2003 Posts: 214 Location: Portsmouth
|
Posted: Fri Mar 19, 2004 10:11 pm Post subject: |
|
|
Try just editing one letter and see what happens,
Slowly slowly catchy monkey |
|
| Back to top |
|
 |
JohnPace Guest
|
Posted: Tue Mar 23, 2004 7:27 pm Post subject: |
|
|
Using nano and logged in as root, I changed one letter from a "s" to an "x", and the access denied message disappeared.
I first tried to access a blocked site and got the appropriate access denied message. Then I used nano and changed the text of the message from "Access to this page has been denied by the Web Filter" to "Accesx to this page has been denied by the Web Filter". Note the "x" in the word "access". Now the access denied message indicatesthe uses that is logged in and the rest of the message has dissapeared.
Very strange...
| Brian wrote: | Try just editing one letter and see what happens,
Slowly slowly catchy monkey |
|
|
| Back to top |
|
 |
Brian
Joined: 18 Jun 2003 Posts: 214 Location: Portsmouth
|
Posted: Tue Mar 23, 2004 8:32 pm Post subject: |
|
|
Strange, sounds like a job for one of the Censornet guys
Sorry
Brian |
|
| Back to top |
|
 |
stonefish
Joined: 07 Apr 2003 Posts: 2448 Location: Bristol, UK
|
Posted: Wed Mar 24, 2004 2:15 am Post subject: |
|
|
Your suggestion so upset my Censornet that it decided to suffer an interrupt overload on one of its NICS - a panic attack if ever I saw one. :D
This was a right pain because at the moment, using the Censornet is the only way I can log into this site. The Hotspot software I'm playing with on one of our Wireless Access Points at the moment has a strange interaction with this site. So far, its the only site I can't log into as normal. All the banking sites are fine.
But I digress.
I'll take a look at this particular issue during normal working hours.
Regards
Neil _________________ Neil Briscoe
Adelix Limited
neil.briscoe@adelix.com
Adelix Limited - WiFi, VoIP, CensorNet, Linux solutions and consultancy.
www.adelix.com www.censornet.com |
|
| Back to top |
|
 |
stonefish
Joined: 07 Apr 2003 Posts: 2448 Location: Bristol, UK
|
Posted: Wed Mar 24, 2004 3:53 am Post subject: |
|
|
Well, I still couldn't sleep - so I looked into it anyway.
If you read all the places where you can find the phrase "ACCESS DENIED!" you will see that it actually reads
$D{"ACCESS DENIED!"}
This is a perlism.
It means there is an associative array (%D) that has a bunch of keys.
A quick look through dansguardian.pl for %D finds just one foreach loop, at the top, which does a bit of sanitising, but nowhere which sets the values.
Hmm, well, Perl supports including other files. So I hunted for the word "require", one of two ways of reading in other perl scripts at that point.
Oh looky there - it requires /www2/${language}.pl
Well, theres only one possible candidate at the moment, and thats the file english.pl - so lets take a look.
And whats the very first line we read?
$D{"ACCESS DENIED!"} = "ACCESS DENIED!";
So there yer go.
So if you want to change the words here, change it to something like
$D{"ACCESS DENIED!"} = "GO TO BED!";
and don't modify the dansguardian.pl script at all.
Now, you'll get the words "GO TO BED!" in all the places that you used to get "ACCESS DENIED!".
So - take care to watch for Perlisms when editing the scripts - espeically the dansguardian.pl
By modifying the word ACCESS to ACCESSX in the dansguardian.pl script, you caused it to look for $D{"ACCESSX DENIED!"} - a key which doesn't exist within the array - and so - you got nothing.
Regards
Neil _________________ Neil Briscoe
Adelix Limited
neil.briscoe@adelix.com
Adelix Limited - WiFi, VoIP, CensorNet, Linux solutions and consultancy.
www.adelix.com www.censornet.com |
|
| Back to top |
|
 |
tonywhitmore

Joined: 04 Dec 2003 Posts: 392 Location: Hampshire
|
Posted: Wed Mar 24, 2004 8:32 am Post subject: |
|
|
/me passes Neil the Nightol.
You've earned it  |
|
| Back to top |
|
 |
|