PDA

View Full Version : More Admin Security - Protect Templates, Templatesets and Styles!!!


Chris M
19 Oct 2002, 19:18
In conjunction with the request of others, I have released this add-on, which can be used in conjunction with my Total Admin Security (http://www.vbulletin.org/forum/showthread.php?s=&threadid=40738) hack...

So...

There is an easy way to ensure that they cannot change your templates, templatesets, or delete your templates, templatesets and styles...

Just use this hack below, and then they cant!!!

Just remember to follow any instructions in brackets ( ) that follows some PHP Code...

I have this used on DarkBlazes (my forums) - I cannot provide any screenshots at this time, but if anyone would, that would be good:)

Other Related Hacks:

Total Admin Security (http://www.vbulletin.org/forum/showthread.php?s=&threadid=40738)

Satan

Goldknight
19 Oct 2002, 20:02
lol other admin hack but good one.

(change X to the templatesetid, change Y to your userid) I wonder can I add more than one templatesetid like (1,2,3,etc..) if I have more than one set? And userid for who? for other admin?

Thanks

Chris M
19 Oct 2002, 20:13
To add another templateset, just copy the code again... (making sure you change the X and Y)

The userid is for you - I made it, by default, that nobody can delete the templatesets you dont want them to...

Then I made it so that they can delete individual templates (custom templates), but only the user(s) you specify...

Satan

Goldknight
19 Oct 2002, 20:24
Ah, thanks for answer. I m going to install this one. Thanks

Chris M
19 Oct 2002, 20:26
No problems:)

Satan

Vile
20 Oct 2002, 00:34
Sweet. Thanks for the hack. Installed :)

Chris M
20 Oct 2002, 01:08
Good:)

There shouldnt be any install problems, but if there are, just ask:)

Satan

Roman
01 Jan 2003, 18:54
this hack looks sweet, but while reading your instructions / hack i got few questions...

why is there no check for userid on the remove and the kill template set? This way even the main admin (me) can't delete that template, right?

and for the style... will this hack only protect the deletion of the style, and not the modification of styles? Cause i want the other admin to be able to do anything but touch my templetes and styles.

Dean C
01 Jan 2003, 19:06
Hehe nice hack satan :p

Chris M
01 Jan 2003, 21:40
The reason for the specified templateset is purely because, if that is your main Template Set, I am presuming you don't want it to be able to be deleted by anyone, including yourself;)

To protect styles from being modified, Find:
// ###################### Start Update #######################
if ($HTTP_POST_VARS['action']=="doupdate") {
Add below:
if(($styleid==X) and ($bbuserinfo[userid]!=Y)) {
echo "<p>You cannot edit this Style!</p>";
exit;
}
(change X to the styleid, change Y to your userid)

@Mist - Thanks:)

Satan

KelteN
18 Apr 2003, 09:17
Nice Hack :)

sonic3d
01 May 2003, 15:10
installed.

l8er
sonic

Logikos
12 May 2003, 10:56
If seperated bt commas it protects more correct? And same question for Total Admin Security? User IDs can be seperated by commas to protect other admins

Chris M
12 May 2003, 11:11
No you must expand the statement...

Explanation :

Normal code:
if(($styleid==X) and ($bbuserinfo[userid]!=Y)) {
echo "<p>You cannot edit this Style!</p>";
exit;
}
Expanded code (to allow 2 users) :
if(($styleid==X) and ($bbuserinfo[userid]!=Y or $bbuserinfo[userid]!=Z)) {
echo "<p>You cannot edit this Style!</p>";
exit;
}
Expanded code (to protect 2 styles) :
if(($styleid==X or $styleid==Z) and ($bbuserinfo[userid]!=Y)) {
echo "<p>You cannot edit this Style!</p>";
exit;
}
Expanded code (to protect 2 styles and allow 2 users) :
if(($styleid==X or $styleid==W) and ($bbuserinfo[userid]!=Y or $bbuserinfo[userid]!=Z)) {
echo "<p>You cannot edit this Style!</p>";
exit;
}

:)

Satan

Logikos
12 May 2003, 11:20
Thanks Man!!

Chris M
12 May 2003, 11:44
No problems;):)

Satan

-Sidekick-
30 May 2003, 23:46
Wouldn't it be easier to just restrict the primary actions to the userid of the board owners choice?

Chris M
31 May 2003, 10:24
@-Sidekick- - Perhaps, but this allows you let other admins add and edit their own styles, and not be able to edit your existing styles...

Satan

-Sidekick-
01 Jun 2003, 00:15
The reason I ask is cause I'm the only one messing with the Styles, Templates, & Replacements.

So just restricting the primary functions would be safe right? =]

Chris M
01 Jun 2003, 00:25
Well if you are the only one, simply restricting the entire file to just your userid is better;)

But, like me, if you have admins (in my case co-admins) editing styles, you want to ensure that your styles that you do not want deleting or being tampered with remain that way;):)

Satan

-Sidekick-
02 Jun 2003, 00:54
thanks. =]

X-Fan
02 Jun 2003, 14:33
Very nice hack, especially for boards with lots of templates and styles!

One less thing to worry about, thanks hs! :)

Chris M
02 Jun 2003, 19:37
No problems;)

I might release a more general hack for other admin files, or maybe implement some kind of "password" security soon;)

Satan

Raven
14 Jul 2003, 06:16
hi hellsatan

some i see this one here
then it is only the templates you protect or the Remove button

but you can still edit the templates and remove the templates there insted

but maby i am wrong

BlackxRam
17 Jan 2004, 17:55
Hey HellSatan...

Is there a way to add the restriction of EDITING certain styles and templates as well for Certain users? I have a bunch of Admins on my forums, and i dont want them editing templates and styles they shouldnt be editing except for ones i WANT them to edit.

Deletion protection is great but what about them editing templates. Can there be a restriction for that as well?

BlackxRam
17 Jan 2004, 17:59
I found the Styles Code to protect editing.. but what about saving TEMPLATES as well?

BlackxRam
17 Jan 2004, 18:02
Sorry for the Triple post... Itll never happen again...

But What is the code to ONLY allow a certain userID to edit CERTAIN styles and templates?