61 $this->Messages =
get_package(
'page::messages' ,
'last' , __FILE__ );
62 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
63 $this->SecurityValidator =
get_package(
'security::security_validator' ,
'last' , __FILE__ );
64 $this->Trace =
get_package(
'trace' ,
'last' , __FILE__ );
94 $this->Messages->add_error_message(
'no_permits' );
95 $this->Trace->add_trace_string(
96 "{lang:permits_validation_not_passed} : $Validation" , COMMON
98 $this->Trace->add_trace_string(
"GET : ".wordwrap( serialize( $_GET ) ) , COMMON );
99 $this->Trace->add_trace_string(
"POST : ".wordwrap( serialize( $_POST ) ) , COMMON );
101 catch( Exception $e )
129 function get_section( &$Config , $SectionName , $Default =
'_throw_exception' )
133 if( isset( $Config[ $SectionName ] ) )
135 return( $Config[ $SectionName ] );
139 if( $Default ==
'_throw_exception' )
143 "Section \"$SectionName\" was not found in config ".wordwrap( serialize( $Config ) )
150 catch( Exception $e )
186 if( $Config ===
false )
188 throw(
new Exception(
'Config was not set' ) );
191 if( isset( $Config[ $SectionName ] ) )
193 $this->Trace->add_trace_string(
"{lang:section_was_found} : $SectionName" , COMMON );
197 $this->Trace->add_trace_string(
"{lang:section_was_not_found} : $SectionName" , COMMON );
200 return( isset( $Config[ $SectionName ] ) );
202 catch( Exception $e )
222 private function compile_global_success_message()
226 if( $this->
section_exists( $this->Config ,
'global_success_message' ) )
228 $SuccessMessage = $this->
get_section( $this->Config ,
'global_success_message' );
230 if( $this->Security->get_s(
'direct_controller' ,
'integer' , 0 ) == 0 )
232 $this->Security->reset_s(
'success_message' , $SuccessMessage );
234 $this->Messages->add_success_message( $SuccessMessage );
237 catch( Exception $e )
265 private function get_success_message( &$Options )
269 $SuccessMessage =
false;
271 if( $Options->get_setting(
'success_message' ,
false ) !== false )
273 $SuccessMessage = $Options->get_setting(
'success_message' );
275 elseif( $this->
section_exists( $this->Config ,
'success_message' ) )
277 $SuccessMessage = $this->
get_section( $this->Config ,
'success_message' );
280 return( $SuccessMessage );
282 catch( Exception $e )
310 $SuccessMessage = $this->get_success_message( $Options );
312 if( $SuccessMessage !==
false )
314 if( $this->Security->get_s(
'direct_controller' ,
'integer' , 0 ) === 0 )
316 $PageName = $this->Security->get_gp(
'page_name' ,
'command' );
318 $this->Security->reset_s(
"$PageName:success_message" , $SuccessMessage );
321 $this->Messages->add_success_message( $SuccessMessage );
324 $this->compile_global_success_message();
326 catch( Exception $e )
350 private function print_get_post_filter_trace( $Filter )
354 $this->Trace->add_trace_string(
"{lang:get_post_filter_not_passed} : $Filter" , COMMON );
355 $this->Trace->add_trace_string(
"GET : ".wordwrap( serialize( $_GET ) ) , COMMON );
356 $this->Trace->add_trace_string(
"POST : ".wordwrap( serialize( $_POST ) ) , COMMON );
358 catch( Exception $e )
394 if( $this->
section_exists( $Config ,
'get_post_filter' ) ==
false )
399 $Filter = $this->
get_section( $Config ,
'get_post_filter' );
401 $this->Trace->add_trace_string(
"{lang:get_post_filter} : $Filter" , COMMON );
403 if( $this->SecurityValidator->validate_fields( $Filter ) === false )
405 $this->print_get_post_filter_trace( $Filter );
410 catch( Exception $e )
444 $GetPostValidation = $this->
get_section( $Config ,
'get_post_validation' );
446 return( $this->SecurityValidator->validate_fields( $GetPostValidation ) );
451 catch( Exception $e )
479 $Name = $this->
get_section( $Config ,
'custom_validation_package_name' ,
false );
481 if( $Name !==
false )
483 $Version = $this->
get_section( $Config ,
'custom_validation_package_version' ,
'last' );
485 $ValidationObject =
get_package( $Name , $Version , __FILE__ );
489 $ValidationObject = $Owner;
492 return( $ValidationObject );
494 catch( Exception $e )