Changeset 11845
- Timestamp:
- 08/30/07 10:37:46 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/baseclasses/components/request.php
r11359 r11845 579 579 function can_handle($argc, $argv) 580 580 { 581 debug_push_class($this, 'can_handle');582 583 581 // Call the general can_handle event handler 584 582 $result = $this->_on_can_handle($argc, $argv); 585 583 if (! $result) 586 584 { 585 debug_push_class($this, 'can_handle'); 587 586 debug_add('The _on_can_handle event handler returned false, aborting.'); 588 587 debug_pop(); … … 597 596 $namespace = $argv[0]; 598 597 $plugin = $argv[1]; 598 debug_push_class($this, 'can_handle'); 599 599 debug_add("Loading the plugin {$namespace}/{$plugin}"); 600 debug_pop(); 600 601 $this->_load_plugin($namespace, $plugin); 601 602 } 602 603 603 debug_add('Finally preparing the request switch for usage.');604 604 $this->_prepare_request_switch(); 605 605 606 debug_print_r('Checking against this argument list: ', $argv);607 606 foreach ($this->_request_switch as $key => $request) 608 { 609 debug_add("Checking handler ID {$key}"); 610 607 { 611 608 $fixed_args_count = count($request['fixed_args']); 612 609 $total_args_count = $fixed_args_count + $request['variable_args']; … … 614 611 if (( $argc != $total_args_count && ( $request['variable_args'] >= 0 )) || $fixed_args_count > $argc) 615 612 { 616 debug_add('Argument count does not match, skipping.');617 613 continue; 618 614 } … … 623 619 if ($argv[$i] != $request['fixed_args'][$i]) 624 620 { 625 debug_add("The argument {$i} did not match, got {$argv[$i]} should be {$request['fixed_args'][$i]}, skipping.");626 621 continue 2; 627 622 } … … 642 637 if (method_exists($handler, $method)) 643 638 { 644 debug_add("Executing {$method} on the handler object.");645 639 $result = $handler->$method($this->_handler['id'], $this->_handler['args'], $this->_request_data); 646 640 if ($result) 647 641 { 648 debug_add('The handler matches, the _can_handle callback returned true, reporting success.');649 debug_pop();650 642 return true; 651 643 } 644 else 645 { 646 debug_push_class($this, 'can_handle'); 647 debug_add("Handler method {$method} returned FALSE, we cannot handle this therefore."); 648 debug_pop(); 649 } 652 650 } 653 651 else 654 652 { 655 debug_add('The handler matches, no _can_handle callback is defined, reporting success.');656 debug_pop();657 653 return true; 658 654 } … … 660 656 661 657 // No match 662 debug_add('No match could be found, we cannot handle this therefore.'); 658 debug_push_class($this, 'can_handle'); 659 debug_add('No matching handler could be found, we cannot handle this therefore.'); 663 660 debug_pop(); 664 661 return false; … … 680 677 function handle($argc, $argv) 681 678 { 682 debug_push_class($this, 'handle');683 684 679 // Init 685 680 $handler =& $this->_handler['handler'][0]; … … 708 703 if (! $result) 709 704 { 705 debug_push_class($this, 'handle'); 710 706 debug_add('The _on_handle event handler returned false, aborting.'); 711 707 debug_pop(); … … 730 726 $_MIDCOM->cache->content->expires($this->_handler['expires']); 731 727 } 732 debug_pop(); 728 733 729 return $result; 734 730 } … … 801 797 802 798 } 803 804 /**805 * Returns the metadata of the currently selected object. It uses a callback to determine806 * a metadata object which contains the neccessary information.807 *808 * This interface function is no longer in use in MidCOM 2.4 upwards. Instead, the framework809 * accesses the metadata information directly.810 *811 * @return Array Metadata information812 * @see _on_get_metadata()813 * @deprecated in MidCOM 2.4814 */815 function get_metadata()816 {817 $metadata =& $this->_on_get_metadata();818 if (is_null($metadata))819 {820 return false;821 }822 $creator = $metadata->get('creator');823 $editor = $metadata->get('editor');824 return array825 (826 MIDCOM_META_CREATOR => $creator->id,827 MIDCOM_META_EDITOR => $editor->id,828 MIDCOM_META_CREATED => $metadata->get('created'),829 MIDCOM_META_EDITED => $metadata->get('editor')830 );831 }832 833 799 834 800 /** trunk/midcom/midcom.core/midcom/services/auth.php
r11843 r11845 810 810 return true; 811 811 } 812 debug_push_class(__CLASS__, __FUNCTION__);813 if (is_null($user))814 {815 debug_add("Querying privilege {$privilege} to {$object_class} {$object_guid}", MIDCOM_LOG_DEBUG);816 }817 else818 {819 if (is_string($user))820 {821 debug_add("Querying privilege {$privilege} to {$object_class} {$object_guid} (for user {$user})", MIDCOM_LOG_DEBUG);822 }823 else824 {825 debug_add("Querying privilege {$privilege} to {$object_class} {$object_guid} (for user {$user->id})", MIDCOM_LOG_DEBUG);826 }827 }828 812 829 813 if ($this->_internal_sudo) 830 814 { 831 debug_add('INTERNAL SUDO mode is enabled. Generic Read-Only mode set.', MIDCOM_LOG_DEBUG); 832 debug_pop(); 815 //debug_push_class(__CLASS__, __FUNCTION__); 816 //debug_add('INTERNAL SUDO mode is enabled. Generic Read-Only mode set.', MIDCOM_LOG_DEBUG); 817 //debug_pop(); 833 818 return $this->_can_do_internal_sudo($privilege); 834 819 } … … 836 821 if ($this->_component_sudo) 837 822 { 838 debug_pop();839 823 return true; 840 824 } … … 865 849 } 866 850 } 867 debug_add("privilege_key={$privilege_key}"); 851 868 852 if (!array_key_exists($privilege_key, $cached_privileges)) 869 853 { 854 debug_push_class(__CLASS__, __FUNCTION__); 870 855 debug_add("Cache miss, fetching privileges for {$object_guid}"); 871 856 debug_pop(); … … 874 859 if (! array_key_exists($privilege, $full_privileges)) 875 860 { 861 debug_push_class(__CLASS__, __FUNCTION__); 876 862 debug_add("The privilege {$privilege} is unknown at this point. Assuming not granted privilege.", MIDCOM_LOG_WARN); 877 863 debug_pop();
