diff options
| author | Simon Rettberg | 2016-05-03 19:03:09 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2016-05-03 19:03:09 +0200 |
| commit | 50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66 (patch) | |
| tree | 05e99fdffa696434960d7c77966c0bc36d6339e8 /modules/webinterface/page.inc.php | |
| parent | Second half of merge.... (diff) | |
| download | slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.tar.gz slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.tar.xz slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.zip | |
WIP
Diffstat (limited to 'modules/webinterface/page.inc.php')
| -rw-r--r-- | modules/webinterface/page.inc.php | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/modules/webinterface/page.inc.php b/modules/webinterface/page.inc.php deleted file mode 100644 index c301dec9..00000000 --- a/modules/webinterface/page.inc.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -class Page_WebInterface extends Page -{ - - protected function doPreprocess() - { - User::load(); - if (!User::hasPermission('superadmin')) { - Message::addError('no-permission'); - Util::redirect('?do=Main'); - } - switch (Request::post('action')) { - case 'https': - $this->actionConfigureHttps(); - break; - case 'password': - $this->actionShowHidePassword(); - break; - } - } - - private function actionConfigureHttps() - { - $task = false; - switch (Request::post('mode')) { - case 'off': - $task = $this->setHttpsOff(); - break; - case 'random': - $task = $this->setHttpsRandomCert(); - break; - case 'custom': - $task = $this->setHttpsCustomCert(); - break; - } - if (isset($task['id'])) { - Session::set('https-id', $task['id']); - Util::redirect('?do=WebInterface&show=httpsupdate'); - } - } - - private function actionShowHidePassword() - { - Property::setPasswordFieldType(Request::post('mode') === 'show' ? 'text' : 'password'); - Util::redirect('?do=WebInterface'); - } - - protected function doRender() - { - Render::setTitle(Dictionary::translate('lang_titleWebinterface')); - if (Request::get('show') === 'httpsupdate') { - Render::addTemplate('httpd-restart', array('taskid' => Session::get('https-id'))); - } - Render::addTemplate('https', array('httpsEnabled' => file_exists('/etc/lighttpd/server.pem'))); - $data = array(); - if (Property::getPasswordFieldType() === 'text') - $data['selected_show'] = 'checked'; - else - $data['selected_hide'] = 'checked'; - Render::addTemplate('passwords', $data); - } - - private function setHttpsOff() - { - return Taskmanager::submit('LighttpdHttps', array()); - } - - private function setHttpsRandomCert() - { - return Taskmanager::submit('LighttpdHttps', array( - 'proxyip' => Property::getServerIp() - )); - } - - private function setHttpsCustomCert() - { - return Taskmanager::submit('LighttpdHttps', array( - 'importcert' => Request::post('certificate', 'bla'), - 'importkey' => Request::post('privatekey', 'bla'), - 'importchain' => Request::post('cachain', '') - )); - } - -} |
