Skip to content

Commit 89a57ff

Browse files
committed
- Fixed a bug in plugin event onUpdate for form plugins.
- Added alternative code for a is_group function which might perform better then the old implementation. It has to be tested yet and is commented out.
1 parent 8e12d4d commit 89a57ff

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

interface/lib/classes/tform_actions.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function onUpdate() {
114114

115115
// Call plugin
116116
foreach($this->plugins as $plugin) {
117-
$plugin->onInsert();
117+
$plugin->onUpdate();
118118
}
119119

120120
$this->onAfterUpdate();

server/lib/classes/system.inc.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,28 @@ function is_group($group){
464464
return false;
465465
}
466466

467+
/*
468+
// Alternative implementation of the is_group function. Should be faster then the old one To be tested.
469+
function is_group($group) {
470+
$groupfile = '/etc/group';
471+
if(is_file($groupfile)) {
472+
$handle = fopen ($groupfile, "r");
473+
while (!feof($handle)) {
474+
$line = trim(fgets($handle, 4096));
475+
if($line != ""){
476+
$parts = explode(":", $line);
477+
if($parts[0] == $group) {
478+
fclose ($handle);
479+
return true;
480+
}
481+
}
482+
}
483+
fclose ($handle);
484+
}
485+
return false;
486+
}
487+
*/
488+
467489
function root_group(){
468490
global $app;
469491
$group_datei = $this->server_conf["group_datei"];

0 commit comments

Comments
 (0)