Example #1
0
 /**
  * Get our icon path + filename
  * @global type $controller
  * @return string Path to the icon file
  */
 static function getModuleIcon()
 {
     global $controller;
     $module_icon = "modules/" . $controller->GetControllerRequest('URL', 'module') . "/assets/icon.png";
     // Allows the theme to change the WHMCS icon
     // Credits & Source: Ron-e https://github.com/sentora/sentora-core/commit/b88b1295db03cff536b33eebb865f0fa69e783ce
     if (file_exists(ui_tpl_assetfolderpath::Template() . 'images/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png')) {
         $module_icon = ui_tpl_assetfolderpath::Template() . 'images/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png';
     } elseif (file_exists(ui_tpl_assetfolderpath::Template() . 'img/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png')) {
         $module_icon = ui_tpl_assetfolderpath::Template() . 'img/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png';
     }
     return $module_icon;
 }
Example #2
0
 public static function getServices()
 {
     global $controller;
     if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/up.gif') && file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/down.gif')) {
         $iconpath = '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/';
     } else {
         $iconpath = '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/';
     }
     $line = "<h2>" . ui_language::translate("Checking status of services...") . "</h2>";
     $line .= "<table>";
     $status = fs_director::CheckForEmptyValue(sys_monitoring::PortStatus($PortNum));
     $line .= '<tr><th>HTTP</th><td>' . module_controller::status_port(80, $iconpath) . '</td></tr>';
     $line .= '<tr><th>FTP</th><td>' . module_controller::status_port(21, $iconpath) . '</td></tr>';
     $line .= '<tr><th>SMTP</th><td>' . module_controller::status_port(25, $iconpath) . '</td></tr>';
     $line .= '<tr><th>POP3</th><td>' . module_controller::status_port(110, $iconpath) . '</td></tr>';
     $line .= '<tr><th>IMAP</th><td>' . module_controller::status_port(143, $iconpath) . '</td></tr>';
     $line .= '<tr><th>MySQL</th><td>' . module_controller::status_port(3306, $iconpath) . '</td></tr>';
     $line .= '<tr><th>DNS</th><td>' . module_controller::status_port(53, $iconpath) . '</td></tr>';
     $line .= '</table>';
     $line .= '<br><h2>' . ui_language::translate('Server Uptime') . '</h2>';
     $line .= ui_language::translate('Uptime') . ": " . sys_monitoring::ServerUptime();
     return $line;
 }
Example #3
0
 private static function DisplayChart($name, $used, $maximum)
 {
     global $controller;
     if ($maximum < 0) {
         //-1 = unlimited
         if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png')) {
             $res = '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
         } else {
             $res = '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
         }
     } else {
         $free = max($maximum - $used, 0);
         $res = '<img src="etc/lib/pChart2/MADmin/z3DPie.php?score=' . $free . '::' . $used . '&amp;imagesize=240::190&amp;chartsize=120::90&amp;radius=100' . '&amp;labels=Free: ' . $free . '::Used: ' . $used . '&amp;legendfont=verdana&amp;legendfontsize=8&amp;legendsize=10::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>';
     }
     return '<h2>' . ui_language::translate($name) . '</h2>' . $res;
 }
Example #4
0
 static function getFTPUsagepChart()
 {
     global $controller;
     $currentuser = ctrl_users::GetUserDetail();
     $maximum = $currentuser['ftpaccountsquota'];
     if ($maximum < 0) {
         //-1 = unlimited
         if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png')) {
             return '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
         } else {
             return '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
         }
     } else {
         $used = ctrl_users::GetQuotaUsages('ftpaccounts', $currentuser['userid']);
         $free = max($maximum - $used, 0);
         return '<img src="etc/lib/pChart2/MADmin/z3DPie.php?score=' . $free . '::' . $used . '&labels=Free: ' . $free . '::Used: ' . $used . '&legendfont=verdana&legendfontsize=8&imagesize=240::190&chartsize=120::90&radius=100&legendsize=150::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>';
     }
 }
 static function getForwardUsagepChart()
 {
     $currentuser = ctrl_users::GetUserDetail();
     $maximum = $currentuser['forwardersquota'];
     if ($maximum < 0) {
         //-1 = unlimited
         return '<img src="' . ui_tpl_assetfolderpath::Template() . 'images/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
     } else {
         $used = ctrl_users::GetQuotaUsages('forwarders', $currentuser['userid']);
         $free = max($maximum - $used, 0);
         return '<img src="etc/lib/pChart2/sentora/z3DPie.php?score=' . $free . '::' . $used . '&labels=Free: ' . $free . '::Used: ' . $used . '&legendfont=verdana&legendfontsize=8&imagesize=240::190&chartsize=120::90&radius=100&legendsize=150::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>';
     }
 }
 static function getMysqlUsagepChart()
 {
     return '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
 }
Example #7
0
 private static function DisplayChart($name, $used, $maximum)
 {
     if ($maximum < 0) {
         //-1 = unlimited
         $res = '<img src="' . ui_tpl_assetfolderpath::Template() . 'images/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
     } else {
         $free = max($maximum - $used, 0);
         $res = '<img src="etc/lib/pChart2/zpanel/z3DPie.php?score=' . $free . '::' . $used . '&amp;imagesize=240::190&amp;chartsize=120::90&amp;radius=100' . '&amp;labels=Free: ' . $free . '::Used: ' . $used . '&amp;legendfont=verdana&amp;legendfontsize=8&amp;legendsize=10::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>';
     }
     return '<h2>' . ui_language::translate($name) . '</h2>' . $res;
 }
Example #8
0
 static function getMysqlUsagepChart()
 {
     global $controller;
     if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png')) {
         return '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
     } else {
         return '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>';
     }
 }