예제 #1
0
 /**
  * Loads config parameters depending on domain
  *
  * @todo	syntax errors in INI files are not reported
  */
 function CDomain_config()
 {
     global $config;
     $config_file = multidomain_get_file("config.ini.php", false);
     if ($config_file) {
         @($this->cfg = parse_ini_file($config_file));
     }
 }
예제 #2
0
<?php

/**
 *	Set attributes for all pages in user interface
 * 
 *	@author     Karel Kozlik
 *	@version    $Id: page_attributes.php,v 1.9 2012/08/29 16:06:43 kozlik Exp $
 *	@package    serweb
 *	@subpackage user_pages
 */
/**
 *	Get real name of the user
 */
function get_user_real_name($user)
{
    global $config;
    $at =& $config->attr_names;
    $attrs =& User_Attrs::singleton($user->get_uid());
    if (false === ($fname = $attrs->get_attribute($at['fname']))) {
        return false;
    }
    if (false === ($lname = $attrs->get_attribute($at['lname']))) {
        return false;
    }
    return array('fname' => $fname, 'lname' => $lname, 'uname' => $user->get_username(), 'realm' => $user->get_domainname());
}
$page_attributes = array('title' => $config->display_page_heading ? $config->domain . " " . $lang_str['user_management'] : null, 'tab_collection' => $config->user_tabs, 'path_to_pages' => $config->user_pages_path, 'logout' => true, 'self_account_delete' => $sess->url($config->user_pages_path . "account_delete.php"), 'css_file' => array(multidomain_get_file("styles.css")), 'ie_selects' => true, 'author_meta_tag' => "Karel Kozlik <karel at iptel dot org>");
예제 #3
0
 *	@author     Karel Kozlik
 *	@version    $Id: page_attributes.php,v 1.17 2012/08/29 16:06:42 kozlik Exp $
 *	@package    serweb
 *	@subpackage admin_pages
 */
/**
 *	Disable tabs that aro not accessible to admin due to not enought privileges
 */
function _disable_unneeded_tabs(&$page_attributes)
{
    global $perm, $config;
    if (isset($page_attributes['tab_collection']) and is_array($page_attributes['tab_collection'])) {
        foreach ($page_attributes['tab_collection'] as $key => $val) {
            if ($val->page == "customers.php") {
                if (is_object($perm) and !$perm->have_perm("hostmaster") or !$config->multidomain) {
                    $page_attributes['tab_collection'][$key]->disable();
                }
            } elseif ($val->page == "list_of_domains.php") {
                if (!$config->multidomain) {
                    $page_attributes['tab_collection'][$key]->disable();
                }
            } elseif (in_array($val->page, $config->hostmaster_only_tabs)) {
                if (is_object($perm) and !$perm->have_perm("hostmaster")) {
                    $page_attributes['tab_collection'][$key]->disable();
                }
            }
        }
    }
}
$page_attributes = array('title' => $config->display_page_heading ? $config->domain . " " . $lang_str['admin_interface'] : null, 'tab_collection' => $config->admin_tabs, 'path_to_pages' => $config->admin_pages_path, 'run_at_html_body_begin' => '_disable_unneeded_tabs', 'logout' => true, 'self_account_delete' => $sess->url($config->user_pages_path . "account_delete.php?admin_interface=1"), 'css_file' => array(multidomain_get_file("styles.css")), 'ie_selects' => true, 'prolog' => "<body><h1>", 'separator' => "</h1><hr class='separator' />", 'epilog' => "</body>", 'author_meta_tag' => "Karel Kozlik <karel at iptel dot org>");
예제 #4
0
/**
 *  Print end of html body
 * 
 *  This function should be replaced by smarty template
 *  
 *  @deprecated
 */
function print_html_body_end(&$parameters)
{
    global $config, $_page_tab;
    echo "</div><!-- swMain -->\n";
    if (isset($parameters['epilog'])) {
        echo $parameters['epilog'];
    } else {
        virtual(multidomain_get_file($config->html_epilog));
    }
    echo "</body>\n";
}
예제 #5
0
<?php

/**
 *	New domain wizard - page attributes
 * 
 *	@author     Karel Kozlik
 *	@version    $Id: page_attributes.php,v 1.5 2007/02/19 09:36:06 kozlik Exp $
 *	@package    serweb
 *	@subpackage admin_pages
 */
$page_attributes = array('title' => $lang_str['create_new_domain'], 'logout' => false, 'css_file' => multidomain_get_file("styles.css"), 'prolog' => "<body class=\"swWizard\"><h1>", 'separator' => "</h1><hr class='separator' />", 'epilog' => "</body>", 'author_meta_tag' => "Karel Kozlik <karel at iptel dot org>");