| | |
| | | |
| | | public function check_module_permissions($module) { |
| | | // Check if the current user has the permissions to access this module |
| | | $module = trim(preg_replace('@\s+@', '', $module)); |
| | | $user_modules = explode(',',$_SESSION["s"]["user"]["modules"]); |
| | | if(!in_array($module,$user_modules)) { |
| | | // echo "LOGIN_REDIRECT:/index.php"; |
| | | header("Location: /index.php"); |
| | | exit; |
| | | if(strpos($module, ',') !== false){ |
| | | $can_use_module = false; |
| | | $tmp_modules = explode(',', $module); |
| | | if(is_array($tmp_modules) && !empty($tmp_modules)){ |
| | | foreach($tmp_modules as $tmp_module){ |
| | | if($tmp_module != ''){ |
| | | if(in_array($tmp_module,$user_modules)) { |
| | | $can_use_module = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(!$can_use_module){ |
| | | // echo "LOGIN_REDIRECT:/index.php"; |
| | | header("Location: /index.php"); |
| | | exit; |
| | | } |
| | | } else { |
| | | if(!in_array($module,$user_modules)) { |
| | | // echo "LOGIN_REDIRECT:/index.php"; |
| | | header("Location: /index.php"); |
| | | exit; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | $module['template'] = 'module.tpl.htm'; |
| | | $module['startpage'] = 'admin/server_list.php'; |
| | | $module['tab_width'] = '60'; |
| | | $module['order'] = '90'; |
| | | |
| | | |
| | | $items[] = array( 'title' => 'CP Users', |
| | |
| | | $available_dashlets_txt = ''; |
| | | $handle = @opendir(ISPC_WEB_PATH.'/dashboard/dashlets'); |
| | | while ($file = @readdir($handle)) { |
| | | if ($file != '.' && $file != '..' && !is_dir($file)) { |
| | | if ($file != '.' && $file != '..' && !is_dir(ISPC_WEB_PATH.'/dashboard/dashlets/'.$file)) { |
| | | $available_dashlets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.substr($file, 0, -4).']<pre class="addPlaceholderContent" style="display:none;">['.substr($file, 0, -4).'],</pre></a> '; |
| | | } |
| | | } |
| | |
| | | </tmpl_loop> |
| | | <tmpl_unless name="records"> |
| | | <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> |
| | | <td colspan="8">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | <td colspan="7">{tmpl_var name='globalsearch_noresults_text_txt'}</td> |
| | | </tr> |
| | | </tmpl_unless> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="8"><tmpl_var name="paging"></td> |
| | | <td colspan="7"><tmpl_var name="paging"></td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | |
| | | $module["template"] = "module.tpl.htm"; |
| | | $module["startpage"] = "client/client_list.php"; |
| | | $module["tab_width"] = ''; |
| | | $module['order'] = '20'; |
| | | |
| | | |
| | | $items[] = array( 'title' => "Edit Client", |
| | |
| | | $dashlet_list = array(); |
| | | $handle = @opendir(ISPC_WEB_PATH.'/dashboard/dashlets'); |
| | | while ($file = @readdir($handle)) { |
| | | if ($file != '.' && $file != '..' && !is_dir($file)) { |
| | | if ($file != '.' && $file != '..' && !is_dir(ISPC_WEB_PATH.'/dashboard/dashlets/'.$file)) { |
| | | $dashlet_name = substr($file, 0, -4); |
| | | $dashlet_class = 'dashlet_'.$dashlet_name; |
| | | include_once ISPC_WEB_PATH.'/dashboard/dashlets/'.$file; |
| | |
| | | include_once '../' . $mt.'/lib/module.conf.php'; |
| | | /* We don't want to show the dashboard */ |
| | | if ($mt != 'dashboard') { |
| | | if($mt == 'dns'){ |
| | | $dns_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE dns_server = 1 AND active = 1"); |
| | | if($dns_servers['cnt'] == 0) continue; |
| | | } |
| | | if($mt == 'mail'){ |
| | | $mail_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE mail_server = 1 AND active = 1"); |
| | | if($mail_servers['cnt'] == 0) continue; |
| | | } |
| | | if($mt == 'sites'){ |
| | | $web_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE web_server = 1 AND active = 1"); |
| | | if($web_servers['cnt'] == 0) continue; |
| | | } |
| | | |
| | | $module_title = $app->lng($module['title']); |
| | | if(function_exists('mb_strlen')) { |
| | | if(mb_strlen($module_title, "UTF-8") > 8) $module_title = mb_substr($module_title, 0, 7, "UTF-8").'..'; |
| | | } else { |
| | | if(strlen($module_title) > 8) $module_title = substr($module_title, 0, 7).'..'; |
| | | } |
| | | $mod[] = array( 'modules_title' => $module_title, |
| | | $mod[$module['order']] = array( 'modules_title' => $module_title, |
| | | 'modules_startpage' => $module['startpage'], |
| | | 'modules_name' => $module['name']); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ksort($mod); |
| | | $tpl->setloop('modules', $mod); |
| | | } |
| | | |
| | |
| | | $rows[] = array('title' => $item->get_title(), |
| | | 'link' => $item->get_link(), |
| | | 'content' => $item->get_content(), |
| | | 'date' => $item->get_date('Y-m-d') |
| | | 'date' => $item->get_date($app->lng('conf_format_dateshort')) |
| | | ); |
| | | } |
| | | $n++; |
| | |
| | | $module['template'] = 'dashboard.tpl.htm'; |
| | | $module['startpage'] = 'dashboard/dashboard.php'; |
| | | $module['tab_width'] = ''; |
| | | $module['order'] = '1'; |
| | | |
| | | //$items = array(); |
| | | // |
| | |
| | | $module["template"] = "module.tpl.htm"; |
| | | $module["startpage"] = "dns/dns_soa_list.php"; |
| | | $module["tab_width"] = ''; |
| | | $module['order'] = '50'; |
| | | |
| | | |
| | | $items[] = array( 'title' => "Add DNS Zone", |
| | |
| | | $module['template'] = 'module.tpl.htm'; |
| | | $module['startpage'] = 'mail/mail_domain_list.php'; |
| | | $module['tab_width'] = ''; |
| | | $module['order'] = '40'; |
| | | |
| | | |
| | | //**** Email accounts menu |
| | |
| | | $module["template"] = "module.tpl.htm"; |
| | | $module["tab_width"] = ''; |
| | | $module["startpage"] = "monitor/show_sys_state.php?state=system"; |
| | | $module['order'] = '60'; |
| | | |
| | | unset($items); |
| | | $items[] = array( 'title' => "Show Overview", |
| | |
| | | /* |
| | | * If the dashboard is in the list of modules it always has to be the first! |
| | | */ |
| | | /* |
| | | asort($modules); |
| | | if (in_array('dashboard', $modules)) { |
| | | $key = array_search('dashboard', $modules); |
| | | unset($modules[$key]); |
| | | $modules = array_merge(array('dashboard'), $modules); |
| | | } |
| | | */ |
| | | if(is_array($modules)) { |
| | | foreach($modules as $mt) { |
| | | if(is_file($mt.'/lib/module.conf.php')) { |
| | | if(!preg_match("/^[a-z]{2,20}$/i", $mt)) die('module name contains unallowed chars.'); |
| | | if($mt == 'dns'){ |
| | | $dns_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE dns_server = 1 AND active = 1"); |
| | | if($dns_servers['cnt'] == 0) continue; |
| | | } |
| | | if($mt == 'mail'){ |
| | | $mail_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE mail_server = 1 AND active = 1"); |
| | | if($mail_servers['cnt'] == 0) continue; |
| | | } |
| | | if($mt == 'sites'){ |
| | | $web_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE web_server = 1 AND active = 1"); |
| | | if($web_servers['cnt'] == 0) continue; |
| | | } |
| | | |
| | | include_once $mt.'/lib/module.conf.php'; |
| | | $language = (isset($_SESSION['s']['user']['language']))?$_SESSION['s']['user']['language']:$conf['language']; |
| | | $app->load_language_file('web/'.$mt.'/lib/'.$language.'.lng'); |
| | | $active = ($module['name'] == $_SESSION['s']['module']['name']) ? 1 : 0; |
| | | $topnav[] = array( 'title' => $app->lng($module['title']), |
| | | $topnav[$module['order']] = array( 'title' => $app->lng($module['title']), |
| | | 'active' => $active, |
| | | 'module' => $module['name']); |
| | | } |
| | | } |
| | | ksort($topnav); |
| | | } |
| | | } else { |
| | | //* Loading Login Module |
| | |
| | | $module["template"] = "module.tpl.htm"; |
| | | $module["startpage"] = "sites/web_vhost_domain_list.php"; |
| | | $module["tab_width"] = ''; |
| | | $module['order'] = '30'; |
| | | |
| | | // Websites menu |
| | | $items=array(); |
| | |
| | | jQuery('#parent_domain_id').change(function() { |
| | | reloadServerId(false); |
| | | }); |
| | | // new Vhostsubdomains/Vhostaliasdomains |
| | | if(serverId == '') jQuery('#parent_domain_id').trigger('change'); |
| | | |
| | | function reloadServerId(noFormChange) { |
| | | var parentWebId = jQuery('#parent_domain_id').val(); |
| | |
| | | |
| | | function reloadFastcgiPHPVersions(noFormChange) { |
| | | jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, php_type : jQuery('#php').val(), type : "getphpfastcgi", client_group_id : clientGroupId}, function(data) { |
| | | var options = '<option value="">Default</option>'; |
| | | //var options = '<option value="">Default</option>'; |
| | | var options = ''; |
| | | var phpfastcgiselected = ''; |
| | | $.each(data, function(key, val) { |
| | | <tmpl_if name="id"> |
| | | if($('#fastcgi_php_version').val() == key){ |
| | | phpfastcgiselected = ' selected="selected"'; |
| | | } else { |
| | | phpfastcgiselected = ''; |
| | | } |
| | | </tmpl_else> |
| | | phpfastcgiselected = ''; |
| | | </tmpl_if> |
| | | options += '<option value="'+key+'"'+phpfastcgiselected+'>'+val+'</option>'; |
| | | }); |
| | | <tmpl_if name="id"> |
| | | if($('#fastcgi_php_version').val() == ''){ |
| | | phpfastcgiselected = ' selected="selected"'; |
| | | } else { |
| | | phpfastcgiselected = ''; |
| | | } |
| | | </tmpl_else> |
| | | phpfastcgiselected = ''; |
| | | </tmpl_if> |
| | | options += '<option value=""'+phpfastcgiselected+'>{tmpl_var name="default_php_txt"}</option>'; |
| | | $('#fastcgi_php_version').html(options).change(); |
| | | if(noFormChange) ISPConfig.resetFormChanged(); |
| | | }); |
| | |
| | | $module['template'] = 'module.tpl.htm'; |
| | | $module['startpage'] = 'tools/index.php'; |
| | | $module['tab_width'] = '60'; |
| | | $module['order'] = '80'; |
| | | |
| | | |
| | | //**** Change User password |