From 45966656906337a4119f03df3d2cea55e22f1757 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 26 Jul 2008 07:20:58 +0000 Subject: [PATCH] Site admin priviledges available only for first registered company admins. --- admin/create_coy.php | 11 ++++++----- admin/inst_lang.php | 2 +- admin/inst_module.php | 2 +- config.php | 10 +++++++--- includes/current_user.inc | 4 +++- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/admin/create_coy.php b/admin/create_coy.php index a7cae00c..b40b41d7 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -1,6 +1,6 @@ $con) { - if ($_POST['host'] == $con['host'] && $_POST['dbname'] == $con['dbname']) + if($id != $selected_id && $_POST['host'] == $con['host'] + && $_POST['dbname'] == $con['dbname']) { if ($_POST['tbpref'] == $con['tbpref']) { @@ -232,8 +233,8 @@ function display_companies() label_cell($conn[$i]['tbpref']); label_cell($what); label_cell("" . _("Edit") . ""); - if ($i != $coyno) - label_cell("" . _("Delete") . ""); + label_cell( $i == $coyno ? '' : + "" . _("Delete") . ""); end_row(); } diff --git a/admin/inst_lang.php b/admin/inst_lang.php index d024970f..98776618 100644 --- a/admin/inst_lang.php +++ b/admin/inst_lang.php @@ -1,6 +1,6 @@ access]); + // first registered company has site admin privileges + return isset($page_level) && in_array($page_level, $security_groups[$this->access]) + && ($this->company == 0 || $page_level != 20); } function get_db_connection() -- 2.30.2