From dd415d521f762111eebbcfced77e83c7662e4401 Mon Sep 17 00:00:00 2001 From: sullrich Date: Thu, 3 Dec 2009 15:59:15 -0500 Subject: Roll custom run_plugins routine --- etc/inc/priv.inc | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc index ad00a3b..4ff4905 100644 --- a/etc/inc/priv.inc +++ b/etc/inc/priv.inc @@ -45,8 +45,33 @@ */ /* Load and process custom privs. */ -run_plugins("/etc/inc/priv/"); +function load_custom_privs() { + global $priv_list; + $directory = "/etc/inc/priv"; + $dir_array = array(); + if(!is_dir($directory)) + return; + if ($dh = opendir($directory)) { + while (($file = readdir($dh)) !== false) { + $canadd = 0; + if($file == ".") + $canadd = 1; + if($file == "..") + $canadd = 1; + if($canadd == 0) + array_push($dir_array, $file); + } + closedir($dh); + } + if(!is_array($dir_array)) + return; + foreach ($dir_array as $file) + if (!is_dir("{$directory}/{$file}") && stristr($file,".inc")) + include("{$directory}/{$file}"); +} +// Load and sort privs +load_custom_privs(); sort_privs($priv_list); function cmp_privkeys($a, $b) { -- cgit v1.1