How to make more than one user and "Admin"?

Post here to discuss topics relate to the 4.x version for the ASP Football Pool software program. All support topics should go here.
Post Reply
User avatar
admin
Site Admin
Posts: 159
Joined: Mon Aug 26, 2013 3:47 pm

How to make more than one user and "Admin"?

Post by admin »

Anyone know how to make more than one user of the pool an Admin?

I have someone that helps me out and I'd like to give him the ability to have Admin rights without giving him the Admin login, just to be safe. Any thoughts?


Phil
kristoffae
Posts: 15
Joined: Wed Aug 28, 2013 9:19 am

Re: How to make more than one user and "Admin"?

Post by kristoffae »

This one would be tough to do since the Admin privileges are assigned strictly based on the username "Admin." I opened the Users table in the database and changed the Admin username to something else. I was then able to login as that user but it no longer had the Admin privileges and was just like any other player account. Most of the code in the ASP makes references to the "Admin" username which would make it difficult to have more than one Admin. I wonder if providing multiple admin username values in the ASP would then allow multiple Admins. Something I think I am going to test.
User avatar
Bam
Posts: 34
Joined: Sun Sep 14, 2014 1:55 pm

Re: How to make more than one user and "Admin"?

Post by Bam »

I know this is old, but I thought I would post a solution here for this.
As kristoffae said correctly, the code is written to use the name Admin as the only admin.
ALAS there is a work around for this. I haven't fully tested this but tested most functions. The trick is to re-code where the IsAdmin is declared.
in the common.asp find this:

Code: Select all

'--------------------------------------------------------------------------
	' Returns true if the current user is the Administrator.
	'--------------------------------------------------------------------------
	function IsAdmin()

		IsAdmin = false
		if Session(SESSION_USERNAME_KEY) = ADMIN_USERNAME  then
			IsAdmin = true
		end if

	end function
and add the name pf the user you wish to add as an admin here like this:

Code: Select all

'--------------------------------------------------------------------------
	' Returns true if the current user is the Administrator.
	'--------------------------------------------------------------------------
	function IsAdmin()

		IsAdmin = false
		if Session(SESSION_USERNAME_KEY) = ADMIN_USERNAME or Session(SESSION_USERNAME_KEY) = "Bam" then
			IsAdmin = true
		end if

	end function
The code checks the session for IsAdmin, now this will be true.
Hopes this helps.
"It is nice to be important, but more important to be nice"~~~ The Rock (Dwayne Johnson)
Post Reply