LoginLicenseAction.class.php (2038B)
1 <?php 2 namespace cms\action\login; 3 use cms\action\LoginAction; 4 use cms\action\Method; 5 use cms\base\Configuration; 6 use cms\model\User; 7 use util\Session; 8 9 10 class LoginLicenseAction extends LoginAction { 11 12 public function view() { 13 $software = array_map( function($lib) { 14 return [ 15 'name' => $lib[0], 16 'url' => $lib[1], 17 'license' => $lib[2] 18 ]; 19 },[ 20 ['OpenRat Content Management System' ,'http://www.openrat.de/' ,'GPL v2' ], 21 ['jQuery Core Javascript Framework' ,'http://jquery.com/' ,'MPL, GPL v2'], 22 ['GeSHi - Generic Syntax Highlighter','http://qbnz.com/highlighter/','GPL v2' ], 23 ['CodeMirror' ,'https://codemirror.net/' ,'MIT' ], 24 ['SimpleMDE' ,'https://simplemde.com/' ,'MIT' ], 25 ['Trumbowyg' ,'https://alex-d.github.io/Trumbowyg/','MIT' ], 26 ['JSON file format' ,'http://pear.php.net/pepr/pepr-proposal-show.php?id=198','BSD'], 27 ] ); 28 29 $this->setTemplateVar('software',$software); 30 31 32 33 $this->setTemplateVar('time' ,date('r') ); 34 $this->setTemplateVar('os' ,php_uname('s') ); 35 $this->setTemplateVar('release' ,php_uname('r') ); 36 $this->setTemplateVar('machine' ,php_uname('m') ); 37 $this->setTemplateVar('version' , phpversion() ); 38 39 $this->setTemplateVar('cms_name' , Configuration::Conf()->subset('application')->get('name' ) ); 40 $this->setTemplateVar('cms_version' , Configuration::Conf()->subset('application')->get('version' ) ); 41 $this->setTemplateVar('cms_operator', Configuration::Conf()->subset('application')->get('operator') ); 42 43 $user = $this->currentUser ?: new User(); // empty user object as default. 44 45 $this->setTemplateVar('user_login' , $user->loginDate ); 46 $this->setTemplateVar('user_name' , $user->name ); 47 $this->setTemplateVar('user_fullname', $user->fullname ); 48 } 49 50 51 public function checkAccess() 52 { 53 return true; 54 } 55 }