user roles?

Where we find trouble with the latest release... and shoot it.

Post Reply
thekabal
Posts: 100
Joined: Sat Apr 19, 2014 22:32 UTC

Re: user roles?

Post by thekabal » Sun Jun 15, 2014 01:36 UTC

coolmates wrote:forgive me for being dense.. but how/where do i set user roles?
What do you mean by user roles?

thekabal
Posts: 100
Joined: Sat Apr 19, 2014 22:32 UTC

Re: user roles?

Post by thekabal » Sun Jun 15, 2014 22:45 UTC

coolmates wrote:such as admin or developer. for example, settings.php infers that no game admins or developers are in my game.
Ah. That setting hasn't really been completed.

TMD partially added it, and we never really completed it. I think it is possible to edit settings.php and (maybe?) ranking, but I don't know the particulars.

Maybe TMD will reply.

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: user roles?

Post by TheMightyDude » Sun Jun 15, 2014 23:42 UTC

Yeah, that feature hasn't been completed as yet and just the section on settings.php and ranking.php (sort of) access it.
I started to add it a while back, but thought I would wait until we separate the account, character and ship information in the database.

You can hack the code to display the list of admins by adding 1+ lines in common.php

look for the following line:
$admin_list = array ();

then add the following code after that line:

Code: Select all

// Repeat following line for each admin you have.
// Line below is all on 1 line.
array_push($admin_list, array('name'=>"ADMIN_NAME", 'character'=>"PLAYER_NAME", 'level'=>"Game Admin", 'role'=>"admin"));
Replace ADMIN_NAME with your Admin Name.
Replace PLAYER_NAME with your Player Name in on game.
Leave the rest as is.

Doing the above will list you as an admin on the setting page.
The only issue is that all your admins will have to be quick to create their accounts when your games resets or else you run the risk of having players pick said names and be listed as an admin.

To have you listed as an admin on the ranking page (i.e. blue name etc) is to either use the same email address as the admin_mail config variable or create a team for all your admins and add them, then go into the database and change the admin field in the teams table for your team to "Y" and save.

Now you and your other admins should be listed as admins on the ranking page.
This (admin) team cannot be seen normally unless you use the id of the team.

Like I said its partly done and waiting for the separation before its fully added.
You don't really gain anything from doing the above du to its not complete and is just for show.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: user roles?

Post by TheMightyDude » Tue Jun 17, 2014 02:05 UTC

coolmates wrote:erm.. i dont have the file: common.php
Ah, then you will have a problem doing what I said in my last post, and if common.php was added after release then maybe settings.php was changed as well.
Saying that I do recall doing a lot to settings.php and ranking.php so this may not work.

After looking at the database that is created via includes/schema.php what I said for showing admin players as blue names should still work.

Ok...
Just looked at the release code and that line that needs to be put in common.php should be put in the global_cleanups.php file.
Just look for that line I said i.e. $admin_list = array();
And add that array_push(...) line I said in my last post on the next line so it should look something like the following:

Code: Select all

$admin_list = array();

// Repeat following line for each admin you have.
// Line below is all on 1 line.
array_push($admin_list, array('name'=>"ADMIN_NAME", 'character'=>"PLAYER_NAME", 'level'=>"Game Admin", 'role'=>"admin"));

// Set to your server's local time zone - PHP throws a notice if this is not set.
date_default_timezone_set('America/New_York');
Let me know if that works.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

User avatar
TheMightyDude
Site Admin
Posts: 311
Joined: Thu Apr 17, 2014 09:15 UTC

Re: user roles?

Post by TheMightyDude » Wed Jun 18, 2014 16:38 UTC

coolmates wrote:thanks.. i followed your instructions and admin (adc) now listed and in blue in settings.php, but online is showing as not enabled even when logged in. and admin character not showing in blue in rankings.
Yeah, now that code isn't added, and is hard coded to not enabled.
TheMightyDude::Blacknova Development.
Development Blog YouTube Dev Channel Twitter Twitch

Post Reply