fork download
  1. <?php
  2.  
  3. abstract class Checkrights{
  4. public $files;
  5. public $app;
  6.  
  7. public function __construct(\Slim\Slim &$app, $files){
  8. $this->app = $app;
  9. $this->files = $files;
  10. }
  11. public function GerFiles(){
  12. $this->cookieUser=$this->app->getCookie('username');
  13.  
  14. $obj = new Files();
  15. $obj->parseFile($this->files);
  16. $obj->CheckFormat();
  17.  
  18. $this->cookieDB = $obj->cookie;
  19. $this->cookieUser=$this->app->getCookie('username');
  20.  
  21. $this->public=$obj->public;
  22. $this->filesize = new Filesize();
  23. $obj->path = $this->preview;
  24. }
  25. abstract function Render();
  26. }
  27.  
  28.  
  29.  
  30.  
  31. class RenderPublic extends Checkrights{
  32. public function __construct(\Slim\Slim &$app, $files){
  33. parent::__construct(\Slim\Slim &$app, $files);
  34. }
  35.  
  36. public function GerFiles() { parent::GetFiles(); }
  37. function Render(){
  38. if($this->cookieUser==$this->cookieDB){
  39. $this->app->render('File.php', ['files'=>$this->files, 'filesize'=>$this->filesize]);
  40. }
  41. elseif($this->public==0) {
  42. $this->app->render('Public.php', ['files'=>$this->files, 'filesize'=>$this->filesize]);
  43. }
  44. else {
  45. $this->app->notFound();
  46. }
  47. }
  48. }
  49.  
  50. class RenderPreview extends Checkrights{
  51.  
  52. public function __construct(\Slim\Slim &$app, $files){
  53. parent::__construct(\Slim\Slim &$app, $files);
  54. }
  55.  
  56. public function GerFiles() { parent::GetFiles(); }
  57. function Render($preview){
  58. $this->preview = $preview;
  59. if($this->cookieUser==$this->cookieDB){
  60. $this->app->render('Preview.php',['files'=>$this->files]);
  61. }
  62. elseif($this->public==0) {
  63. $this->app->render('Public.php', ['files'=>$this->files]);
  64. }
  65. else {
  66. $this->app->notFound();
  67. }
  68. }
  69. }
Runtime error #stdin #stdout #stderr 0.02s 52432KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Declaration of RenderPreview::Render() must be compatible with Checkrights::Render() in /home/ZxD6wz/prog.php on line 69