Page 1 of 1

Multiple Super Admins?

Posted: 2019-03-02 17:17
by nycwebmaster
How can I modify any application to have more than one super admin?

Is there a file that I can hard code them with user and password so I can circumvent the limitation of only one super admin in appgini?

My main goal is to have more than one super admin to be able to change the record owner. I want to have a few people that is able to change the record owner in all the tables of the database.

Re: Multiple Super Admins?

Posted: 2019-03-08 13:15
by bescott53
Sure, nycwebmaster,

go to incfunctions.php in the Admin folder

locate the Function get logged admin

and update to this

Code: Select all

function getLoggedAdmin(){
                                // checks session variables to see whether the admin is logged or not
                                // if not, it returns FALSE
                                // if logged, it returns the user id

                                $adminConfig = config('adminConfig');

                                if($_SESSION['adminUsername']!=''){
                                                return $_SESSION['adminUsername'];
                                }elseif($_SESSION['memberGroupID']==2){
                                                $_SESSION['adminUsername']=$_SESSION['memberID'];
                                                return $_SESSION['adminUsername'];
                                }else{
                                                return FALSE;
                                }
                }


Re: Multiple Super Admins?

Posted: 2019-03-13 13:23
by a.gneady
Thanks @bescott53 ... Please also check this blog post, which explains a method of modifying AppGini-generated files in a more maintainable manner: https://bigprof.com/blog/appgini/custom ... dmin-area/

Re: Multiple Super Admins?

Posted: 2019-12-27 18:14
by artemisia
I tried this and it prevented the login dialog from appearing. Using AG 5.81, php7.0, mysql 5.7

I'm trying to allow another admin user to see the Users and admin functions pages. Due to issues with updates and fixes, at present no existing users can login in, only newly created users. Making manual changes to user tables to allow new admin user to be created, but it can't see the admin pages.

Re: Multiple Super Admins?

Posted: 2021-03-16 05:55
by Philou
Hi,

I have try to follow the post for hack with a hook but the result is an error 500..
probably have I made a mistake but as this thread is pretty old (I use the 5.94) there is perhaps a news version of this getloggegadmin function ?

Re: Multiple Super Admins?

Posted: 2021-03-16 08:29
by onoehring
Hi Ahmed,

I just red the blog post you mentioned. Wouldn't it be much easier to check for custom functions first and use AG internal functions if no custom function exists?
This way the developer would be able to create his functions in e.g. /custom (or /hooks/custom) with the same filename you are using e.g. incfunctions.php. You go ahead and include these files first and the original AG files afterwards with something like this

Code: Select all

if (!function_exists('getLoggedInUser')) {
    function getLoggedInUser{
         ....
    }
}
I think this approach is for example used in the CMS Concrete5 (https://Concrete5.org) where all original files to into a different directory than custom files.

Olaf

Re: Multiple Super Admins?

Posted: 2021-03-16 13:27
by pfrumkin
Great idea Olaf!

Re: Multiple Super Admins?

Posted: 2021-03-16 14:30
by onoehring
Hi,

I made this a feature request: viewtopic.php?f=6&p=16830#p16830

Olaf