Page 1 of 1
Additional Admins Cannot See the Admin Area
Posted: 2014-08-12 13:48
by TheCodeRed
I have an application that has 3 admins assigned. For some reason, it will only display the 'Admin Area' button to the default Admin. The other two just get brough to the homepage and never display the option for the admin section.
If I try to browse directly to the /admin page it will keep asking for a login unless I am already logged in with the default administrator.
Any possible known issues?
Re: Additional Admins Cannot See the Admin Area
Posted: 2014-10-13 06:04
by apirnar
I too have the same issue. Is it the way that's supposed to be? A yes/no would help. Thanks.
Re: Additional Admins Cannot See the Admin Area
Posted: 2014-10-14 06:17
by a.gneady
Currently, AppGini supports only one "super admin" .. That is the one you define during setup and can be modified later from the admin area > admin settings. All other members of the admins group have full access to all tables but not to the admin area. We plan to change this in the future to support several super admins.
Re: Additional Admins Cannot See the Admin Area
Posted: 2015-04-26 23:10
by yak1982
Hello. In current version of the app (5.31) this is still an issue. Could you provide Admin group members with ability to get into Admin Area?
Re: Additional Admins Cannot See the Admin Area
Posted: 2015-05-26 14:44
by Diogenes
This sounds like an area that could be handled by a plugin that can be updated separately as AppGini changes and then incorporated as a native function later.
I particularly need to create at least 4 Different permissions that apply to pages and views and permissions, such as
Employees: "Allowed to see pages c, d, h
Page c Add, Delete, Modify
Page d View, List
Page h Add, Delete, Modify, Print, Export"
Employees list: (If I have 45 permissions to set for new employees I see the names in rows and the buttons in columns to Apply and Save)
1) Abby Hil // Radio Buttons: * Admin * Employees * Client * Office staff
2) Jon Blaze // Radio Buttons: * Admin * Employees * Client * Office staff
3) James Cameron // Radio Buttons: * Admin * Employees * Client * Office staff
4) Michelle Strand // Radio Buttons: * Admin * Employees * Client * Office staff
Re: Additional Admins Cannot See the Admin Area
Posted: 2020-02-18 18:07
by pfrumkin
Hi
I am a newbie. Is there an update on this post? From what I've seen, AppGini still allows only one super admin.
Thank you.
Paul
Re: Additional Admins Cannot See the Admin Area
Posted: 2020-06-07 22:07
by SkayyHH
Hello,
i need more than one super admins too.
Thanks much, Kai
Re: Additional Admins Cannot See the Admin Area
Posted: 2020-06-08 16:52
by pfrumkin
I no doubt found this code on this forum somewhere but I don't remember where
Code: Select all
<?php // Save this file as 'hooks/replace-appgini-functions.php'
$hooks_dir = dirname(__FILE__);
include("{$hooks_dir}/../defaultLang.php");
include("{$hooks_dir}/../language.php");
include("{$hooks_dir}/../lib.php");
// Step 1: Specify the file containing the function we want to overwrite
$appgini_file = "{$hooks_dir}/../admin/incFunctions.php";
// Step 2: Specify the file containing our version of the function
$mod_file = "{$hooks_dir}/custom.GetLoggedAdmin.php";
// Step 3: Specify the name of the function we want to overwrite
$func_name = 'getLoggedAdmin';
echo "<br>{$func_name}: " . replace_function($appgini_file, $func_name, $mod_file);
#######################################
function replace_function($appgini_file, $function_name, $mod_file) {
// read the new code from the mod file
$new_code = @file($mod_file);
if(empty($new_code)) return 'No custom code found.';
// remove the first line containing PHP opening tag and keep the rest as $new_snippet
array_shift($new_code);
$new_snippet = implode('', $new_code);
$pattern1 = '/\s*function\s+' . $function_name . '\s*\(.*\).*(\R.*){200}/';
$pattern2 = '/\t#+(.*\R)*/';
$entire_code = file_get_contents($appgini_file);
if(!$entire_code) return 'Invalid AppGini file.';
$m = [];
if(!preg_match_all($pattern1, $entire_code, $m)) return 'Function to replace not found.';
$snippet = $m[0][0];
if(!preg_match_all($pattern2, $snippet, $m)) return 'Could not find the end of the function.';
$snippet = str_replace($m[0][0], '', $snippet);
$snippet_nocrlf = str_replace("\r\n", "\n", $snippet);
$new_snippet_nocrlf = str_replace("\r\n", "\n", $new_snippet);
if(trim($snippet_nocrlf) == trim($new_snippet_nocrlf)) return 'Function already replaced.';
// back up the file before overwriting
if(!@copy(
$appgini_file,
preg_replace('/\.php$/', '.backup.' . date('Y.m.d.H.i.s') . '.php', $appgini_file)
)) return 'Could not make a backup copy of file.';
$new_code = str_replace(trim($snippet), trim($new_snippet), $entire_code);
if(!@file_put_contents($appgini_file, $new_code)) return "Couldn't overwrite file.";
return 'Function overwritten successfully.';
}
Code: Select all
<?php // save this file as 'hooks/custom.getLoggedAdmin.php'
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(!isset($_SESSION['memberID']) || empty($_SESSION['memberID'])) return false;
$current_user = $_SESSION['memberID'];
$current_user_safe = makeSafe($_SESSION['memberID']);
$sql = "SELECT COUNT(1) FROM membership_users u
LEFT JOIN membership_groups g ON u.groupID = g.groupID
WHERE LCASE(u.memberID) = LCASE('{$current_user_safe}') AND g.name = 'Admins'";
$is_admin = sqlValue($sql);
if(!$is_admin) return false;
$_SESSION['adminUsername'] = $current_user;
return $current_user;
}
I don't think I had to change anything. Navigate to /hooks/replace-appgini-functions.php on your site.
Re: Additional Admins Cannot See the Admin Area
Posted: 2021-08-16 17:33
by rpierce
I need more than 1 super admin. Is there any progress on this? I am using the latest version 5.97
Re: Additional Admins Cannot See the Admin Area
Posted: 2024-02-18 22:35
by mberthiaume
Hi Team APPgini,
I tried the code for the Admin Area, I have the last Version 24.10
The code section was modified in incFunctions.php
Now, I assign an other user in Admins Group
I can see the Link *Admin Aeria* ... so when I click ... can't access ...
Only the master admin define in Preconfigured users and groups can access.
I believe we are near ...
Have you an idea ?
Thank's and have a nice Sunday !
Re: Additional Admins Cannot See the Admin Area
Posted: 2024-02-26 00:54
by peebee

- appgini-1.jpg (45.89 KiB) Viewed 3766 times

- appgini2.jpg (83.22 KiB) Viewed 3766 times