PDA

View Full Version : "Hidden" accounts


Voratus
01-29-2004, 01:33 AM
Does anyone have an idea if it would be possible, and if so how easy, to make user accounts "hidden", in that browsing the users they wouldn't display.
I can only imagine creating a new field in the accounts table called "hidden" (for example), and making it either 1 or 0, 0 being default.
Then in the list.php, adding in to not display users with a ['hidden']==1.
The syntax of the list.php isn't as simple (to me, at least) as other pages, so I don't really know of a way to implement it there.
The reason is I created an account and took away its display name, and I use it to denote simple actions, or to RP the NPCs. However, it still is listed on the warrior list, just with no name (and level 0). I'd like for it to be invisible.
Or, a way for an admin to enter complete text in a "chat" page, instead of "charactername says" or "charactername does".

(edited as I changed the internal wording around)

rax
01-29-2004, 06:46 PM
I've implemented something similar on my server. I added a field in accounts called 'npc' and use it as a boolean that I set to true for accounts I don't want to show up. Then I modified the SQL statements to filter out those characters.

Example:

$sql = "SELECT name,login,alive,location,sex,level,laston,loggedi n,lastip,uniqueid FROM accounts WHERE locked=0 AND npc=0 $search ORDER BY level DESC, dragonkills DESC, login ASC $limit";

I also use this field for keeping tests accounts from appearing in the daily news (when I'm testing things that cause events to be logged) Just put everything inside function addnews() inside an if block:

if($session[user][npc] == 0){
//Code to add to the news here
}


Hope that helps!!

Voratus
01-29-2004, 09:53 PM
I was just tinkering in the files, and I wound up doing exactly what you did, except my field was called "hidden", and I just added a AND hidden=0 to the SQL query to display the warriors, and also added it to where it takes the count.

I'll look into the news thing, too.

lonestrider
02-07-2004, 11:02 PM
Does anyone have an idea if it would be possible, and if so how easy, to make user accounts "hidden", in that browsing the users they wouldn't display.
(edited as I changed the internal wording around)

What I've got working rather well on LegendGard is pretty simple. Instead of bloating the account database with yet another field (I've enough already), I've gone ahead and added another type of superuser (in this case Superuser4) which I call in my User.php (Admin -stealth)

Then I make sure the HOF, List and the Index don't log Superuser 4.

That is the easiest way to go about it and it works great on
Legendgard Elite.

rax
02-09-2004, 04:48 PM
What I've got working rather well on LegendGard is pretty simple. Instead of bloating the account database with yet another field (I've enough already), I've gone ahead and added another type of superuser (in this case Superuser4) which I call in my User.php (Admin -stealth)

Then I make sure the HOF, List and the Index don't log Superuser 4.

That is the easiest way to go about it and it works great on
Legendgard Elite.

I completely understand what you are trying to do by avoiding excessive fields in the database (I too am trying to keep things as neat and efficient and possible). The only problem I see is that your Superuser4 accounts will all have at least Admin level access (3+), which could create a security risk.

I'm not sure if you could do this, but could you not create a "stealth" account as super user level -1 and just filter off of that? The reason I ask is because my hidden characters aren't really admins, just npcs I use for adding commentary, etc.

lonestrider
02-14-2004, 10:22 PM
I'm not sure if you could do this, but could you not create a "stealth" account as super user level -1 and just filter off of that? The reason I ask is because my hidden characters aren't really admins, just npcs I use for adding commentary, etc.


Well, for me, there's no security risk, for I wouldn't GIVE a stealth account to anyone but the HIGHEST level admin. NPCs and such I'd actually WANT to be seen online, but I imagine there's two ways you can do it. First, if you move your admin level to 4 or 5, then your stealth level could be 3.

But then you'd have to go through the entire Superuser accessable code and change the [user][superuser]>3
to >4(or 5)

I don't know if a negative number would work, but I don't see why it wouldn't. It's just an INT field, so it should.