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?
Additional Admins Cannot See the Admin Area
Re: Additional Admins Cannot See the Admin Area
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
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.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Additional Admins Cannot See the Admin Area
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
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
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
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
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
Hello,
i need more than one super admins too.
Thanks much, Kai
i need more than one super admins too.
Thanks much, Kai
Re: Additional Admins Cannot See the Admin Area
I no doubt found this code on this forum somewhere but I don't remember where
I don't think I had to change anything. Navigate to /hooks/replace-appgini-functions.php on your site.
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;
}
Re: Additional Admins Cannot See the Admin Area
I need more than 1 super admin. Is there any progress on this? I am using the latest version 5.97
-
- Posts: 5
- Joined: 2021-12-07 17:58
Re: Additional Admins Cannot See the Admin Area
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 !
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 !