Beispiel #1
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $serversList = new JsonDB(__serversdb);
     $sid = (int) $_GET['sid'];
     $fid = (int) $_GET['fid'];
     $serverTitle = $this->_LANG['store']['undefined'];
     $taskTitle = $this->_LANG['store']['undefined'];
     if (isset($serversList->data[$sid])) {
         $serverTitle = $serversList->data[$sid]['name'];
     }
     if (isset($serversList->data[$sid]['tasks'][$fid])) {
         $taskTitle = $serversList->data[$sid]['tasks'][$fid]['title'];
     }
     $header->data['title'] = $this->_LANG['store']['Store'] . " / " . $this->_LANG['store']['Remote'] . " / {$serverTitle} / {$taskTitle}";
     $this->data['serverTitle'] = $serverTitle;
     $this->data['taskTitle'] = $taskTitle;
     $this->data['files'] = $this->getlFolderFiles($serversList, $sid, $fid);
     $this->data['taskId'] = $fid;
     $this->data['serverId'] = $sid;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
Beispiel #2
0
 public function prepare()
 {
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $header->data['title'] = 'HotBackup installation';
     $this->data['title'] = 'HotBackup installation';
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $workUrl = 'http://' . $_SERVER['SERVER_NAME'] . str_replace('install/index.php', '', $_SERVER['SCRIPT_NAME']);
     $workFolder = str_replace('install/index.php', '', $_SERVER['SCRIPT_FILENAME']);
     $error = '';
     if (isset($_SESSION['error'])) {
         $error = $_SESSION['error'];
     }
     $formSent = array();
     if (isset($_SESSION['formSent'])) {
         $formSent = $_SESSION['formSent'];
     } else {
         $formSent['login'] = '******';
         $formSent['password'] = '';
         $formSent['confirmation'] = '';
         $formSent['email'] = '';
         $formSent['folder'] = $workFolder;
         $formSent['workUrl'] = $workUrl;
     }
     unset($_SESSION['error']);
     $this->data['formSent'] = $formSent;
     $this->data['error'] = $error;
 }
Beispiel #3
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = $this->_LANG['servers']['Connect to the server'];
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
     if (isset($_SESSION['formSent']) && !empty($_SESSION['formSent'])) {
         $formsent = $_SESSION['formSent'];
     }
     if (!isset($formsent['address'])) {
         $formsent['address'] = '';
     }
     if (!isset($formsent['apiKey'])) {
         $formsent['apiKey'] = '';
     }
     $this->data['formSent'] = $formsent;
     $_SESSION['formSent'] = array();
 }
Beispiel #4
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $tasksList = new JsonDB(__taskdb);
     $id = (int) $_GET['id'];
     if (isset($tasksList->data[$id])) {
         $this->data['taskTitle'] = $tasksList->data[$id]['title'];
         $header->data['title'] = $this->_LANG['store']['Store'] . ' / ' . $this->_LANG['store']['Local'] . ' / ' . $tasksList->data[$id]['title'];
     } else {
         $this->data['taskTitle'] = $this->_LANG['store']['undefined'];
         $header->data['title'] = $this->_LANG['store']['Store'] . ' / ' . $this->_LANG['store']['Local'] . ' / ' . $this->_LANG['store']['undefined'];
     }
     $this->data['files'] = $this->getlFolderFiles();
     $this->data['taskId'] = $id;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
Beispiel #5
0
 public function prepare()
 {
     header('HTTP/1.0 404 Not Found');
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $header->data['title'] = 'Page not found';
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
 }
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = $this->_LANG['tasks']['Edit MYSQL backup task'];
     $this->data['widgets'] = new Widgets($this->db, __corePath . 'widgets/', $this->config);
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
     $serversList = new JsonDB(__serversdb);
     $id = (int) $_GET['id'];
     $sid = (int) $_GET['sid'];
     $formsent = $serversList->data[$sid]['tasks'][$id];
     if (isset($_SESSION['formSent']) && !empty($_SESSION['formSent'])) {
         $formsent = $_SESSION['formSent'];
     }
     $_SESSION['formSent'] = array();
     if (!isset($formsent['title'])) {
         $formsent['title'] = '';
     }
     if (!isset($formsent['type'])) {
         $formsent['type'] = '';
     }
     if (!isset($formsent['status'])) {
         $formsent['status'] = '';
     }
     if (!isset($formsent['deep'])) {
         $formsent['deep'] = '';
     }
     if (!isset($formsent['mysql-backup-filename'])) {
         $formsent['mysql-backup-filename'] = '';
     }
     if (!isset($formsent['mysql-backup-address'])) {
         $formsent['mysql-backup-address'] = '';
     }
     if (!isset($formsent['mysql-backup-name'])) {
         $formsent['mysql-backup-name'] = '';
     }
     if (!isset($formsent['mysql-backup-user'])) {
         $formsent['mysql-backup-user'] = '';
     }
     if (!isset($formsent['mysql-backup-password'])) {
         $formsent['mysql-backup-password'] = '';
     }
     $this->data['task'] = $formsent;
     $this->data['serverName'] = $serversList->data[$sid]['name'];
     $this->data['id'] = $id;
     $this->data['sid'] = $sid;
     $_SESSION['formSent'] = array();
 }
Beispiel #7
0
 public function prepare()
 {
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $header->data['title'] = 'Successful installation';
     $basePath = str_replace('install/index.php', '', $_SERVER['SCRIPT_FILENAME']);
     $dashboardUrdl = 'http://' . $_SERVER['HTTP_HOST'] . str_replace('install/?r=success', '', $_SERVER['REQUEST_URI']);
     $this->data['title'] = 'Successful installation';
     $this->data['serversServiceCron'] = $basePath . 'serversService.php';
     $this->data['tasksServiceCron'] = $basePath . 'tasksService.php';
     $this->data['dashboardUrdl'] = $dashboardUrdl;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
 }
Beispiel #8
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = $this->_LANG['store']['Store'];
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
Beispiel #9
0
 public function prepare()
 {
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $header->data['title'] = 'Error';
     $error = 'Uknown error';
     if (isset($_SESSION['error'])) {
         $error = $_SESSION['error'];
     }
     $this->data['title'] = 'Error';
     $this->data['error'] = $error;
     $this->data['installPath'] = str_replace('index.php', '', $_SERVER['PHP_SELF']);
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
 }
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = $this->_LANG['tasks']['New MYSQL backup'];
     $this->data['widgets'] = new Widgets($this->db, __corePath . 'widgets/', $this->config);
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
Beispiel #11
0
 public function prepare()
 {
     $user = new User(1, __userdb);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $usersList = new JsonDB(__userdb);
     $header->data['title'] = 'Users list';
     $this->data['usersList'] = $usersList->data;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
 public function prepare()
 {
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $header->data['title'] = 'HotBackup prepare for install';
     $this->data['title'] = 'HotBackup prepare for install';
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     if (isset($_SESSION['notifications'])) {
         $this->data['visible'] = true;
         $this->data['notifications'] = $_SESSION['notifications'];
     } else {
         $this->data['visible'] = false;
     }
     unset($_SESSION['notifications']);
     $workUrl = 'http://' . $_SERVER['SERVER_NAME'] . str_replace('install/index.php', '', $_SERVER['SCRIPT_NAME']);
     $this->data['workUrl'] = $workUrl;
 }
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = $this->_LANG['tasks']['New MYSQL backup'];
     $this->data['widgets'] = new Widgets($this->db, __corePath . 'widgets/', $this->config);
     $serversList = new JsonDB(__serversdb);
     $sid = (int) $_GET['sid'];
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
     $this->data['serverName'] = $serversList->data[$sid]['name'];
     $this->data['sid'] = $sid;
 }
Beispiel #14
0
 public function prepare()
 {
     $user = new User(1, __userdb);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $usersList = new JsonDB(__userdb);
     $id = (int) $_GET['id'];
     $header->data['title'] = $this->_LANG['users']['Edit user, id:'] . ' ' . $id;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
     $user = $usersList->data[$id];
     $user['password1'] = '';
     $user['password2'] = '';
     $this->data['id'] = $id;
     if (isset($_SESSION['formSent']) && !empty($_SESSION['formSent'])) {
         $formsent = $_SESSION['formSent'];
         if (isset($formsent['login'])) {
             $user['login'] = $formsent['login'];
         }
         if (isset($formsent['email'])) {
             $user['email'] = $formsent['email'];
         }
         if (isset($formsent['accessGroup'])) {
             $user['accessGroup'] = $formsent['accessGroup'];
         }
         if (isset($formsent['alerts'])) {
             $user['alerts'] = $formsent['alerts'];
         }
         if (isset($formsent['login'])) {
             $user['login'] = $formsent['login'];
         }
         $_SESSION['formSent'] = array();
     }
     $this->data['user'] = $user;
 }
Beispiel #15
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = 'New task';
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
     if (isset($_SESSION['formSent']) && !empty($_SESSION['formSent'])) {
         $formsent = $_SESSION['formSent'];
     }
     #if( !isset($formsent['login'] )) $formsent['login'] = '';
     $this->data['formSent'] = $formsent;
     $_SESSION['formSent'] = array();
 }
Beispiel #16
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = $this->_LANG['servers']['Connectin information'];
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
     if (isset($_SESSION['formSent']) && !empty($_SESSION['formSent'])) {
         $formsent = $_SESSION['formSent'];
     } else {
         $serversDB = new JsonDB(__serversdb);
         $id = (int) $_GET['id'];
         $formsent = $serversDB->data[$id];
     }
     if (!isset($formsent['address'])) {
         $formsent['address'] = '';
     }
     if (!isset($formsent['apiKey'])) {
         $formsent['apiKey'] = '';
     }
     if (!isset($formsent['archSync'])) {
         $formsent['archSync'] = '';
     }
     if (!isset($formsent['archDepth'])) {
         $formsent['archDepth'] = '';
     }
     if (!isset($formsent['deleteSync'])) {
         $formsent['deleteSync'] = '';
     }
     $this->data['formSent'] = $formsent;
     $_SESSION['formSent'] = array();
 }
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $serversDB = new JsonDB(__serversdb);
     $serverId = (int) $_GET['id'];
     $server = $serversDB->data[$serverId];
     $query = new ApiQuery($server['address'], $server['apiKey']);
     $tasksList = $query->getTasksList(true);
     $header->data['title'] = $server['name'];
     $this->data['server'] = $server;
     $this->data['tasksList'] = $tasksList;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
Beispiel #18
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $settings = new JsonDB(__settingsdb);
     $settings->data = $this->checkSettings($settings->data);
     $header->data['title'] = $this->_LANG['settings']['Main settings'];
     $langs = glob(__corePath . "lang/*.php");
     foreach ($langs as $key => $val) {
         $langs[$key] = str_replace('.php', '', str_replace(__corePath . 'lang/', '', $val));
     }
     $this->data['langs'] = $langs;
     $this->data['settings'] = $settings->data;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
Beispiel #19
0
 public function prepare()
 {
     $user = new User(1);
     if (!$user->isAuthorized()) {
         $this->redirect('?r=auth');
     }
     $header = new PageHeader($this->curpage, $this->db, $this->config);
     $footer = new PageFooter($this->curpage, $this->db, $this->config);
     $topMenu = new TopMenu($this->curpage, $this->db, $this->config);
     $topMenu->prepare();
     $header->data['title'] = $this->_LANG['misc']['home_title'];
     $tasksList = new JsonDB(__taskdb);
     $serversList = new JsonDB(__serversdb);
     $backUpsUsage = array();
     $usedByAllBackups = 0;
     // for local backups
     foreach ($tasksList->data as $task) {
         $size = round(dirSize(__archiveDIR . 'local/' . $task['id']));
         $usedByAllBackups += $size;
         $backUpsUsage[] = array('value' => $size, 'label' => $this->_LANG['store']['Local'] . ' / ' . $task['title']);
     }
     //for remote backups
     foreach ($serversList->data as $server) {
         if (isset($server['tasks'])) {
             foreach ($server['tasks'] as $task) {
                 $size = round(dirSize(__archiveDIR . 'servers/' . $server['id'] . '/' . $task['id']));
                 $usedByAllBackups += $size;
                 $backUpsUsage[] = array('value' => $size, 'label' => $server['name'] . ' / ' . $task['title']);
             }
         }
     }
     function iCmp($a, $b)
     {
         if ($a['value'] > $b['value']) {
             return 0;
         } else {
             return 1;
         }
     }
     usort($backUpsUsage, "iCmp");
     $usedByBackupsTmp = dirSize(__archiveDIR . 'local/');
     $usedByBackups = round($usedByBackupsTmp / (1024 * 1024));
     $hddTotalSize = round(disk_total_space(__workfolder) / (1024 * 1024));
     $hddFreeSpace = round(disk_free_space(__workfolder) / (1024 * 1024));
     $hddUsedSpace = $hddTotalSize - $hddFreeSpace - $usedByBackups;
     $hddUsage = array();
     $hddUsage['title'] = $this->_LANG['misc']['HDD usage'];
     $hddUsage['data'] = array();
     $hddUsage['data'][] = array('value' => $usedByBackups, 'color' => '#008d32', 'highlight' => '#2ac360', 'label' => $this->_LANG['misc']['Used by BackUps (Mb)']);
     $hddUsage['data'][] = array('value' => $hddUsedSpace, 'color' => '#008aa3', 'highlight' => '#20abc4', 'label' => $this->_LANG['misc']['Hdd used by other (Mb)']);
     $hddUsage['data'][] = array('value' => $hddFreeSpace, 'color' => '#a65200', 'highlight' => '#cd741c', 'label' => $this->_LANG['misc']['Hdd free space (Mb)']);
     $widgets = new Widgets($this->db, __corePath . 'widgets/', $this->config);
     $maxUsage = 0;
     if (isset($backUpsUsage[0])) {
         $maxUsage = $backUpsUsage[0]['value'];
     }
     $this->data['hddUsage'] = $widgets->show('PieGraph', $hddUsage);
     $this->data['backUpsUsage'] = $backUpsUsage;
     $this->data['maxUsage'] = $maxUsage;
     $this->data['header'] = $header->show();
     $this->data['footer'] = $footer->show();
     $this->data['topMenu'] = $topMenu->show();
 }
Beispiel #20
0
 private function PageHtmlEndAsHTML()
 {
     $buffer = "";
     $footer = new PageFooter();
     $buffer .= $footer->render();
     $buffer .= "</div><div id=\"sideboard\"><div></div></div></body></html>";
     return $buffer;
 }