mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
small performance fixes
This commit is contained in:
parent
acec8dbdca
commit
47a938e92a
@ -135,11 +135,26 @@
|
|||||||
function read_groups($lid) {
|
function read_groups($lid) {
|
||||||
global $phpgw_info, $phpgw;
|
global $phpgw_info, $phpgw;
|
||||||
|
|
||||||
$db = $phpgw->db;
|
$db2 = $phpgw->db;
|
||||||
$db->query("select account_groups from accounts where account_lid='$lid'",__LINE__,__FILE__);
|
|
||||||
$db->next_record();
|
if (gettype($lid) == "integer") {
|
||||||
|
if ($phpgw_info["user"]["account_id"] != $lid) {
|
||||||
|
$db2->query("select account_groups from accounts where account_id=$lid",__LINE__,__FILE__);
|
||||||
|
$db2->next_record();
|
||||||
|
$gl = explode(",",$db2->f("account_groups"));
|
||||||
|
} else {
|
||||||
|
$gl = $phpgw_info["user"]["groups"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($phpgw_info["user"]["userid"] != $lid) {
|
||||||
|
$db2->query("select account_groups from accounts where account_lid='$lid'",__LINE__,__FILE__);
|
||||||
|
$db2->next_record();
|
||||||
|
$gl = explode(",",$db2->f("account_groups"));
|
||||||
|
} else {
|
||||||
|
$gl = $phpgw_info["user"]["groups"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$gl = explode(",",$db->f("account_groups"));
|
|
||||||
for ($i=1; $i<(count($gl)-1); $i++) {
|
for ($i=1; $i<(count($gl)-1); $i++) {
|
||||||
$ga = explode(":",$gl[$i]);
|
$ga = explode(":",$gl[$i]);
|
||||||
$groups[$ga[0]] = $ga[1];
|
$groups[$ga[0]] = $ga[1];
|
||||||
|
@ -85,6 +85,15 @@
|
|||||||
|
|
||||||
$db2 = $phpgw->db;
|
$db2 = $phpgw->db;
|
||||||
|
|
||||||
|
if (gettype($lid) == "integer") {
|
||||||
|
if ($phpgw_info["user"]["account_id"] != $lid) {
|
||||||
|
$db2->query("select account_groups from accounts where account_id=$lid",__LINE__,__FILE__);
|
||||||
|
$db2->next_record();
|
||||||
|
$gl = explode(",",$db2->f("account_groups"));
|
||||||
|
} else {
|
||||||
|
$gl = $phpgw_info["user"]["groups"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if ($phpgw_info["user"]["userid"] != $lid) {
|
if ($phpgw_info["user"]["userid"] != $lid) {
|
||||||
$db2->query("select account_groups from accounts where account_lid='$lid'",__LINE__,__FILE__);
|
$db2->query("select account_groups from accounts where account_lid='$lid'",__LINE__,__FILE__);
|
||||||
$db2->next_record();
|
$db2->next_record();
|
||||||
@ -92,6 +101,7 @@
|
|||||||
} else {
|
} else {
|
||||||
$gl = $phpgw_info["user"]["groups"];
|
$gl = $phpgw_info["user"]["groups"];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for ($i=1; $i<(count($gl)-1); $i++) {
|
for ($i=1; $i<(count($gl)-1); $i++) {
|
||||||
$ga = explode(":",$gl[$i]);
|
$ga = explode(":",$gl[$i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user