Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-06 14:02:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

check_privs

What is lib/txplib_misc.php’s check_privs() function for? Doesn’t appear to be referenced directly from anywhere in the core. Any plugins use it? If not, can it be deprecated?

I was just looking for a function that could take a user and ask ‘does this user have one of these priv levels’. I don’t care whether they can access particular resources, I just want to know what level they are. Don’t think such a function or variable exists ($GLOBALS['privs'] isn’t set until pagetop()) so I guess I’ll make a DB call.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2010-10-06 15:16:03

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: check_privs

Appears to be an inferior equivalent of require_privs(), and as you say apparently not used by any core function. Deprecate away.


Code is topiary

Offline

#3 2010-10-06 17:50:46

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: check_privs

Looking back, it seems that is hasn’t been used by a core function in TXP 4.0.3 and newer (perhaps even for a longer time, but I don’t have access to an older TXP version).

Offline

Board footer

Powered by FluxBB