diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc
index 548bc34ad7f420cc61ee2e2b0f67361f646c909c..cdde338d23707dc1633d2ef41693645db15bd4ef 100644 (file)
class phoneAccount extends plugin
{
/* Definitions */
- var $plHeadline= "Phone";
+ var $plHeadline = "Phone";
var $plDescription= "This does something";
+ var $plIcon = "plugins/gofon/images/phoneAccount.png";
/* Attributes */
var $telephoneNumber = array();
* Search for all available phone hardware
*/
$tmp = get_sub_list("(objectClass=goFonHardware)","phone",array(get_ou("phoneou")),
- $this->config->current['BASE'],array("cn","description"), GL_NO_ACL_CHECK);
+ $this->config->current['BASE'],array("cn","description"), GL_SUBSEARCH);
foreach($tmp as $attrs){
$cn= $attrs['cn'][0];
$description= "";
get_ou("phoneou"));
$tmp = get_sub_list("(goFonHardware=*)","phone",$deps_a,$this->config->current['BASE'],
- array('cn','dn','goFonHardware'),GL_NO_ACL_CHECK);
+ array('cn','dn','goFonHardware'),GL_SUBSEARCH);
foreach($tmp as $attrs){
$cn = $attrs['goFonHardware'][0];
if(isset($this->hardware_list[$cn])){
* an array with name and parameters
*/
$tmp = get_sub_list("(&(objectClass=goFonMacro)(goFonMacroVisible=1))","gofonmacro",array(get_ou("macroou")),
- $this->config->current['BASE'],array("displayName","goFonMacroParameter","dn","cn"), GL_NONE);
+ $this->config->current['BASE'],array("displayName","goFonMacroParameter","dn","cn"), GL_NO_ACL_CHECK | GL_SUBSEARCH );
/* Add none for no macro*/
/* Fetch all Macros*/
foreach($tmp as $attrs){
+ $ui = get_userinfo();
+ $acl = $ui->get_permissions($attrs['dn'],"gofonmacro/macro","");
+
+ /* Skip all macros we are not able to read
+ execpt, the currently selected macro.
+ */
+ if(!preg_match("/r/",$acl) && !preg_match("/^".normalizePreg($attrs['dn'])."/",$this->goFonMacro)){
+ continue;
+ }
+
/* unset Count, we don't need that here */
unset($attrs['displayName']['count']);
$i_is_accounted = false; // Ensure that extension entry, for name to number is only once in table
- restore_error_handler();
-
/* Prepare some basic attributes */
$oldnums = array();
foreach($this->a_old_telenums as $tele){
"plProvidedAcls" => array(
"telephoneNumber" => _("Telephone number"),
- "goFonHomeServer" => _("Home server"),
"goFonMacro" => _("Macro settings"),
"goFonHardware" => _("Phone hardware"),
+ "goFonHomeServer" => _("Home server"),
"goFonContext" => _("Phone context"),
"goFonVoiceMailContext" => _("Voice mail context"),
"goFonPIN" => _("Telephone pin"),