Development

Changeset 24125

You must first sign up to be able to contribute.

Changeset 24125

Show
Ignore:
Timestamp:
11/18/09 11:28:24 (4 years ago)
Author:
francois.b
Message:

[sfUnobstrusiveWidgetPlugin] check method exists before use them in sfUoWidgetAdminMenu

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfUnobstrusiveWidgetPlugin/trunk/lib/widget/navigation/menu/sfUoWidgetAdminMenu.class.php

    r21399 r24125  
    124124    if (is_array($values) && array_key_exists($fieldName, $values) && !empty($values[$fieldName])) 
    125125    { 
    126       if (!$this->isAuthenticated()
     126      if (!$this->isAuthenticated() || !method_exists($this->getUser(), $method)
    127127      { 
    128128        return false; 
     
    157157   
    158158    $isSuperAdminMethod = $this->getOption('is_super_admin_method'); 
    159     return $this->getUser()->$isSuperAdminMethod()
     159    return method_exists($this->getUser(), $isSuperAdminMethod) ? $this->getUser()->$isSuperAdminMethod() : false
    160160  } 
    161161   
     
    168168  { 
    169169    $isAuthenticatedMethod = $this->getOption('is_authenticated_method'); 
    170     return $this->getUser()->$isAuthenticatedMethod()
     170    return method_exists($this->getUser(), $isAuthenticatedMethod) ? $this->getUser()->$isAuthenticatedMethod() : false
    171171  } 
    172172}