UBB.Dev
Posted By: Felix 10 Restricted CP Access - 02/24/2003 6:00 PM
Is there a way to grant access to somebody, Moderator or not to the CP NewsFader settings ONLY?
Or, can I assign a Moderator Only for that function?

There are a few people willing update the NewsFader faster that me every morning but obviously I would not want them to have access to the whole CP.

Thank you
Felix

URL
UBB.classicTM 6.3.1.1
Posted By: PrimeTime Re: Restricted CP Access - 02/24/2003 10:10 PM
I may be completely wrong. laugh Try this:

Find (in cp_common.pl):

Code
[/code]and replace that with:

Code
</pre></div></div><span style="font-weight: bold">OR</span><br><br> [code]
smile
Posted By: PrimeTime Re: Restricted CP Access - 02/24/2003 10:22 PM
Hmm...Now when I think about it you may need to move the News Fader code. With the replaced News Fader code move it after this (code may not match completely):

[code][/code]
Posted By: Felix 10 Re: Restricted CP Access - 02/24/2003 10:50 PM
Thanks Prime. I will try it home tonight. What is all this supposed to do? Enable any member to update news or entitle a Moderator for NewsFader only?
Posted By: PrimeTime Re: Restricted CP Access - 02/24/2003 11:03 PM
Moderators only. smile I'm sure you can add specific members too with the "$membernumber" or "$pubname".
Posted By: Felix 10 Re: Restricted CP Access - 02/24/2003 11:53 PM
Prime, I dont get it, sorry?

Why would I give to a Moderator special permission to access NewsFader settings when he/she already have access to the whole CP?

I was interested in setting up just a member with this task, we dont have any moderators, this is a small community.

Thank you
Posted By: PrimeTime Re: Restricted CP Access - 02/25/2003 12:40 AM
Hehe...I edited the files so that no one (including moderators) have access to the CP except for an admin. I guess the code won't work in your case. laugh

Let me look at it again...
Posted By: PrimeTime Re: Restricted CP Access - 02/25/2003 1:44 AM
Sigh...I suck. tipsy

I seem to be missing a code or a whole bunch of codes here. So...The only option I can think of now is - and this is a bit unorthodox - is to:

- Create a new forum (name doesn't matter).
- Turn off the forum.
- Add the member you want to have access to the News Fader as a moderator for the forum you've just created.

---------------

Now add the code I gave you in the cp_common.pl file. After you place the code, whenever you find this code (from lines 22 - 260 and excluding the News Fader code):

Code
[/code]replace it with this:

[code]
Now only the member will be able to access the News Fader and nothing else in your CP.

It's rather unorthodox but unless I figure out how to grant access to any member specified or someone else is able to help you this is your best option for now.
laugh
Posted By: Felix 10 Re: Restricted CP Access - 02/25/2003 5:26 AM
Quote
quote:
Originally posted by PrimeTime:
Hehe...I edited the files so that no one (including moderators) have access to the CP except for an admin. I guess the code won't work in your case. laugh

Let me look at it again...
Prime, all this is a little confusing for me.

My forum does not need Moderators. We behave very nice smile no need for editing nor deleting posts. I dont want to name a Moderator, it would be just a useless title among friends, I dont want to do that, I want to give acceess to a few members/friends to the NewsFader to add news everyday, whoever wakes up first:)

Can you tell me clearly what to do?
Thank you my friend. smile

Felix
Posted By: PrimeTime Re: Restricted CP Access - 02/25/2003 6:01 AM
Err...I think you've missed my point. tipsy
Anyway, I haven't figured out how to give (selected) members access to the CP...Not yet anyway. I seem to be missing a "key" code somewhere.

**For anyone else who is reading this I'm playing around with "userStatus & $status", "pubname & $pubname", "username & $username", "user_number & $user_number" and "var" in a few UBB files.
Posted By: Gizmo Re: Restricted CP Access - 02/25/2003 10:05 AM
Prime, have you checked in cp_lib.cgi? In my Moderator Lockout modification I found a few calls in the cp_lib.cgi and wanted to be sure that everything would be locked down, you may need to add something to allow a moderator to update news.

I don't know 110% if you'd need to do this, but hey its just helpful criticism...
Posted By: PrimeTime Re: Restricted CP Access - 02/25/2003 10:29 AM
Yup...cp_lib.cgi was one of the files I've looked into. I'm able to grant access to the moderators but Felix wanted specific members. That has been kinda tricky for me.

Initially I thought only the cp.cgi and cp_common.pl files needed to be edited...And maybe it does. Well, so far I haven't found a way. I think if I tinker with it long enough I'll get it but not something I'll use since no one is allowed to access the CP.

Thanks Gizzy for the suggestion...I'll take a look at cp_lib.cgi again. smile
Posted By: Felix 10 Re: Restricted CP Access - 02/25/2003 8:28 PM
Prime, I didnt want you go through so much trouble, unless you like tha challange....

Tell me, just a thought, could you use anything from the Calendar? That script allows everybody to add posts, maybe if you work backwards allowing everybody and then go and restrict most of them? I dont know, I am just trying to help, I feel bad for putting this bug into your head...
Posted By: Brett Re: Restricted CP Access - 02/25/2003 10:59 PM
why not read it by user number instead of status?

cp.cgi:
if(($ubb eq 'vars_news_fader') && ($status eq 'Administrator)) {

to

if(($ubb eq 'vars_news_fader') && ($status eq 'Administrator || $admin_number eq 'usernumber' || $admin_number eq 'anotheruser')) {

(same for set_vars_news_fader too)

and then something similar to cp_common.pl.

BTW, if you choose this method, you'll have to change line 250 or so on cp.cgi. "if ($is_one ne 'true') {" to like

if ($is_one ne 'true' && ($admin_number ne 'goodnumber' || $admin_number ne 'another')) {

just a thought...
Posted By: PrimeTime Re: Restricted CP Access - 02/25/2003 11:38 PM
Quote
quote:
Originally posted by Brett:
why not read it by user number instead of status?
I've never thought about the "$admin_number" as I was focusing on "$user_number" which didn't work obviously. I assumed the "$admin_number" was strictly for users with a status of an administrator.

Now even if I get it so cp.cgi will allow a specific user's number access that will leave cp_common.pl. I'll try something like:

var admin_number = $admin_number

Thanks Brett. smile
Posted By: PrimeTime Re: Restricted CP Access - 02/25/2003 11:44 PM
Quote
quote:
Originally posted by Felix 10:
Prime, I didnt want you go through so much trouble, unless you like tha challange....
Actually, I think it's easier to allow everyone to have access than selecting a few and will be more work.

Anyway, it's a learning curve for me as well.... wink
Posted By: PrimeTime Re: Restricted CP Access - 02/26/2003 5:24 AM
Ahh...Ok. I think this will work. Using the "$admin_number" instead of "$username" or "$pubname" (in cp.cgi) suggested by Brett worked. I then added a few more codes in "cp_common.p" and tested it.

This will allow only one user to have access to the NewsFader via CP.

Click Here 4 Text File

Thanks again Brett...I didn't need to add the code for line 250 in cp.cgi, only the two for NewsFader. thumbsup

If you want more members to have access let me know Felix. Good luck! smile
Posted By: Felix 10 Re: Restricted CP Access - 02/26/2003 5:03 PM
Prime, I will try this today, I will keep you posted.

While at it, can you add 3 more numabers, just in case. Maybe my site will grow one day and if I have to add more "News Anchors" I wont have to play with the files anymore other than just change 2 digits.

Thank you
Posted By: PrimeTime Re: Restricted CP Access - 02/27/2003 10:01 AM
Here you go...3 selected users.

Click Here 4 Text File

smile
Posted By: Felix 10 Re: Restricted CP Access - 02/27/2003 5:41 PM
Hi Prime

It doesnt work. First of all I lost the NewsFader Worldlet so I cant even log into the Fader settings. I have to use this link

http://www.romanianational.com/cgi-bin/cp.cgi?ubb=vars_news_fader&r=XDB4BZ

which will ask user designed as News Editor will prompt for Admin name and pass. For admin will work though.
I logged as a test member set up to get newsfader access and I get the same login screen

here, you try it for yourself. URL
login name and pass: test

thank you
Felix
Posted By: PrimeTime Re: Restricted CP Access - 02/27/2003 11:30 PM
Hmm...Let me check again. It worked on my end but maybe I have missed something.
Posted By: PrimeTime Re: Restricted CP Access - 02/28/2003 1:33 AM
Ack...I made a huge error here. eek I wondered why I was able to gain access and you couldn't. To make a long story short, so happened that the test account I have was in fact a moderator, although one on a testing forum that is enabled "off". smash

Right now I'm stumped. tipsy
Posted By: Felix 10 Re: Restricted CP Access - 02/28/2003 6:54 AM
I had to take it out completely because was interfering with the CP. I couldnt view/edit categories! It was saying that I dont have to right to do that? strange..
Once I took your codes out the CP is back to normal and Wordlets reinstated.

let me know if any luck further.

thanks Prime
Posted By: PrimeTime Re: Restricted CP Access - 02/28/2003 7:08 AM
The code should not have affected the Administrators functions (logged in as a Administrator) in CP as those settings were never touched. Unfortunately if you logged in as the selected member you won't be able to view anything and will get the error message that you are not allowed. Other than that the CP settings were not compromised.

I'll let you know if there is a breakthrough. smile
Posted By: Brett Re: Restricted CP Access - 02/28/2003 7:46 AM
Quote
quote:
Originally posted by Brett:
BTW, if you choose this method, you'll have to change line 250 or so on cp.cgi. "if ($is_one ne 'true') {" to like

if ($is_one ne 'true' && ($admin_number ne 'goodnumber' || $admin_number ne 'another')) {
wink
Posted By: PrimeTime Re: Restricted CP Access - 02/28/2003 10:16 AM
Unfortunately I tried that Brett earlier today but that too didn't work. I did some other things too which had interesting results but nothing which would validate a selected user to gain access to the CP. confused
Posted By: PrimeTime Re: Restricted CP Access - 03/05/2003 2:05 PM
Hey Felix! Thanks to Brett here is the final version for Selected User CP Access. With this mod you can allocate up to 4 members who you want accessing the News Fader configuration:

Click Here

rockband
Posted By: Felix 10 Re: Restricted CP Access - 03/10/2003 5:49 AM
Hello Brett and PrimeTime.

I installed the hack, it does not work. The News Fader setting option in the Primary Settings vanishes the second do this:
Quote
quote:
###############################################
# Now open "cp_common.pl" and find and delete:
###############################################

document.writeln("");
I reinstate this line and the setting came back, but for ADMIN only, not for the "news editor" members though..

Options?

I have left everything as is, log in and have a look: CP
loging: test
pass: test

this is test member for one of the news editors.

Thank you
Posted By: PrimeTime Re: Restricted CP Access - 03/10/2003 6:15 AM
Umm...I think you've missed a couple of steps. Immediately after the instruction to delete the NewsFader drop down there is this code in the hack:

[code][/code]Do that and it should work...It was tested. smile
Posted By: Felix 10 Re: Restricted CP Access - 03/10/2003 6:19 AM
I did.

Even twice, trust me!
I can sent you my files if you want to see, but there is nothing I can do wrong in such a simple hack.
Posted By: PrimeTime Re: Restricted CP Access - 03/10/2003 6:20 AM
Alright...Let me check something...
Posted By: PrimeTime Re: Restricted CP Access - 03/10/2003 6:29 AM
I think I know. Try this and see if that works instead...Do everything the same up until you see "Find (first instance of)" in cp_common.pl:


[code][/code]Remember to back up your files as you have been doing. smile
Posted By: Felix 10 Re: Restricted CP Access - 03/10/2003 6:35 PM
Nope.. frown

same thing, once I delete that line in the cp_common.pl I lose the settings option for Admin and members set up with access dont see that regardless.

did you say it was tested? on a 6.3.1.1?

I'm on stand by, I wont remove anything for you to check.

thanks Prime.
Posted By: PrimeTime Re: Restricted CP Access - 03/11/2003 2:42 AM
I think Brett tested it on 6.3 as I did with 6.4...But that shouldn't matter since the codes from 6.3 will work to 6.5 for this hack.

Alright...Try this. Leave that line of code in in cp_common.pl. In addition add the code I stated above. What I'm thinking is that the original News Fader line is the placement inside the dropdown menu. The second NewsFader code with the "admin_number" is for the permissions for your selected members.
Posted By: Felix 10 Re: Restricted CP Access - 03/11/2003 6:26 AM
Still no go. In the drop down list I only get the
Modification Worldlet List. Isn't it strange?
Posted By: PrimeTime Re: Restricted CP Access - 03/11/2003 7:09 AM
Hmm...Please do this. Cut and paste the first NewsFader code and the other NewsFader code that you have in your cp_common.pl file. I need to see what's happening there.
Posted By: Felix 10 Re: Restricted CP Access - 03/12/2003 5:04 AM
HERE , whole things.

Thank Prime
Posted By: PrimeTime Re: Restricted CP Access - 03/12/2003 6:03 AM
I've looked at it and I didn't see anything wrong with the code...Then again if it doesn't work then obviously something is missing. Umm...Try this:

Find this code (cut it):

Code
[/code]then place it above this code:

[code]
Now I'm not sure if this will make a difference but you have "if(admin_number" and change it to "if (admin_number". Also change the numbers "00000000" to a valid member's number.

I'll take a look further tonight...
Posted By: Felix 10 Re: Restricted CP Access - 03/12/2003 9:52 PM
I already have that line after the code you quoted.

and what do you mean by"

"if(admin_number" and change it to "if (admin_number"

isnt it the same?
Posted By: Brett Re: Restricted CP Access - 03/12/2003 10:10 PM
Felix 10, which member numbers do you want to have access to the news fader?
Posted By: Felix 10 Re: Restricted CP Access - 03/13/2003 7:09 AM
Brett, I could change numbers, but if you ask: 46 and 55
Thank you.
smile
Posted By: Brett Re: Restricted CP Access - 03/13/2003 8:59 AM
[code][/code]Replace it where the other one was in cp_common.pl because i noticed in your file of cp_common the member numbers were still 0000000.
Posted By: Gizmo Re: Restricted CP Access - 03/13/2003 7:29 PM
wink wobble wobble, brett got ya! lol... Brett is good at code fixing, he assists me all the time wink ...
Posted By: Felix 10 Re: Restricted CP Access - 03/14/2003 12:19 AM
I know, I noticed that just after I posted, but then I went right back fixed it and tried again, so what you saw was the old.pl file but in my bins the file was already edited.
Even after I input the right numbers it still didnt work!
Maaan I need this so badly, I have no time in the morning to get the news in... frown
Posted By: PrimeTime Re: Restricted CP Access - 03/14/2003 7:52 AM
Well the instructions did say to change the "00000000" several times wink but I'm still not sure why you're having problems. Just to make sure I tested it on other CP pages and it worked. The only way I was able to replicate your problem was when I stripped out the "Moderator" (elsif) from cp_common.pl...But I don't think that is your problem.
Posted By: Brett Re: Restricted CP Access - 03/14/2003 4:56 PM
Well, Felix 10, did say something about only seeing the Modification worldets(which is odd) meaning the people can get in, in turn meaning it's just a cp_common problem.

The only way i see it, if the user numbers are initalized correctly, is the the var admin_number is not set/correct. Felix 10, are you sure you have the 'var admin_number = "$admin_number";' above the if statements in the javascript in that file?
Posted By: Felix 10 Re: Restricted CP Access - 03/14/2003 10:51 PM
Brett, thanks for looking into this for me.
Here, un update:
var admin_number = "$admin_number";
is where your mode text asks for, after: var userStatus = "$status";
I dont see any "if" statements there. where exactly you wanted it?


Code
[/code]I also moved the curly bracket a little from where the file calls from :
Code
</pre></div></div>like this:<br> [code]
but I dont think it makes a difference

However, I installed everything again and again, same thing all over again. these are the errors:
1. Admin doesn not have the News Fader setting anymore VIEW 1
2. member 00000046 doesnt have have the News Fader setting VIEW 2

I will leave these installed for you to check:]

member 00000046:
login: test
pass: test

Your .txt FILE

Please tell me what you requier me to do in order to get to the bottom of this annoying situation.

Thank you guys and Prime, congratulations for the spotwinning smile

Felix
Posted By: PrimeTime Re: Restricted CP Access - 03/15/2003 1:59 AM
Thanks. smile

In the instructions I made the mistake of finding and deleting the first NewsFader document in cp_common.pl...You will need both. Even so I think you made the adjustment and yet it didn't work. The right bracket won't matter where you have it placed as long as it's within that row above "if". I'm wondering if the "if" because it's touching "(" it will make a difference? I doubt it but here is the instructions revised:

Click Here

See if that works.
Posted By: Felix 10 Re: Restricted CP Access - 03/17/2003 4:51 PM
Prime, update with the new file. Now the Admin has hid option in editing Newsfader in CP but the the asigned users still dont have the option.

See THIS

Getting there anyway smile

Thank you,
Felix
Posted By: PrimeTime Re: Restricted CP Access - 03/18/2003 5:10 AM
Hmm...It might be a problem in cp_lib.cgi since when refreshing while inside CP as the selected member will show up in error. I'll check again.
Posted By: Brett Re: Restricted CP Access - 03/22/2003 3:57 PM
Sorry Felix 10 for taking so long to reply shocked

Ok, to get ahandle on what works and what isn't, can you try something out?

Can you selected members go to cp.cgi?ubb=vars_news_fader after logging in? If not, this is a cp.cgi problem.

But i'm more concerned as it being a cp_common.pl. The picture diplicted wordlets mods in the primary box which isn't right. Was that blank option the news fader? (It could also mean something wrong installed with the mod wordlets)?
If all else fails and the option is still blank, you can try replaceing the $vars_wordlets_mods{news_fader....} in cp_common with "News Fader Settings" or something like that.

As for this refreshing business, i'm putting my money into a cookie problem, not the software. But if others get this problem, then a closer look at the code will need to happen.
Posted By: Felix 10 Re: Restricted CP Access - 03/27/2003 1:02 AM
Hello Brett.

This is the requested feed back.

1. the selected members cannot go to "cp.cgi?ubb=vars_news_fader" as suggested

I have tried both of these links:

http://www.romanianational.com/cgi-bin/cp.cgi?ubb=vars_news_fader
http://www.romanianational.com/cgi-bin/cp.cgi/cp.cgi?ubb=vars_news_fader
http://www.romanianational.com/cgi-bin/cp.cgi?ubb=vars_news_fader&r=WKK34Y

I receive this message in all instances:
"Only administrators or moderators may perform this action."

2. I do not know what was suppose to fill the empty space. Your guess is as good as yours.
Here this is the settings VIEW .

3. In this sequence:
[code][/code]I replaced "$vars_wordlets_mods{news}"
with: "$vars_wordlets_mods{news_fader_settings}"

and: "$vars_wordlets_mods{News Fader Settings}"
This last line turns my CP in a white page with only this on it: "context-type: html"

What else should I try?

Thank you,
Felix
Posted By: Felix 10 Re: Restricted CP Access - 03/28/2003 7:27 AM
One more thing I've noticed.
The member asigned as NewsFader editor upon the change I am trying to do with all your suggestion looses the Avatar function and the link for the avatar in his profile switches to My picture. And, the member doesnt show on line, only shows as a guest you cant eveen IM him.
This is weird!

thanks
felix
Posted By: PrimeTime Re: Restricted CP Access - 03/29/2003 5:27 AM
Hmm...Then it could be a cookie issue here. For now Felix don't use this mod until it gets sorted. I still think you should give certain people moderator status then create a new forum BUT turn it off in the CP. laugh
Posted By: Felix 10 Re: Restricted CP Access - 04/02/2003 12:16 AM
Quote
quote:
Originally posted by PrimeTime:
I still think you should give certain people moderator status then create a new forum BUT turn it off in the CP. laugh
I did, but Prime, not even a Moderator can get into NewsFader Settings !!!! This is the whole thing here! I dont know if it supposed to be like this, but a Mod on my site only get access to the Forum Settings in the Primary Settings!. Is this normal?

Please reply, I need someone to put news up for me every day!
Posted By: PrimeTime Re: Restricted CP Access - 04/02/2003 1:50 AM
Hehe...Well probably that's how the hack was designed, only allowing Admins to edit the News Fader. I think however, if you were to set up the NewsFader in cp_common.pl the same way as the Forum Settings the moderators should have CP access and update the news.
© UBB.Developers