Mixin_WordPress_Security_Token

The NextGEN Gallery Mixin WordPress Security Token class.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/security/package.module.security.php  
  1. class Mixin_Wordpress_Security_Token extends Mixin 
  2. public function get_request_list($args = null) 
  3. $prefix = isset($args['prefix']) ? $args['prefix'] : null; 
  4. $action_name = $this->object->get_action_name(); 
  5. $list = array(); 
  6. if ($prefix != null) { 
  7. $list[$action_name . '_prefix'] = $prefix; 
  8. $action = $this->object->get_nonce_name(); 
  9. $list[$prefix . $action_name . '_sec'] = wp_create_nonce($action); 
  10. return $list; 
  11. public function get_form_html($args = null) 
  12. $list = $this->object->get_request_list($args); 
  13. $out = null; 
  14. foreach ($list as $name => $value) { 
  15. $out .= '<input type="hidden" name="' . esc_attr($name) . '" value="' . esc_attr($value) . '" />'; 
  16. return $out; 
  17. public function get_json($args = null) 
  18. $list = $this->object->get_request_list($args); 
  19. return json_encode($list); 
  20. public function check_request($request_values) 
  21. $action_name = $this->object->get_action_name(); 
  22. $action = $this->object->get_nonce_name(); 
  23. $prefix = isset($request_values[$action_name . '_prefix']) ? $request_values[$action_name . '_prefix'] : null; 
  24. if (isset($request_values[$prefix . $action_name . '_sec'])) { 
  25. $nonce = $request_values[$prefix . $action_name . '_sec']; 
  26. $result = wp_verify_nonce($nonce, $action); 
  27. if ($result) { 
  28. return true; 
  29. return false; 
  30. public function get_nonce_name() 
  31. $action_name = $this->object->get_action_name(); 
  32. $prop_list = $this->object->get_property_list(); 
  33. $action = $action_name; 
  34. foreach ($prop_list as $prop_name) { 
  35. $property = $this->object->get_property($prop_name); 
  36. $action .= '_' . strval($property); 
  37. return $action;