Exemplo n.º 1
0
 public function getFilterValues()
 {
     $filters = array();
     $filters['do_values'] = R3EcoGisHelper::getDomainList();
     $filters['us_name_email'] = $this->us_name_email;
     if ($this->auth->getConfigValue('PUBLIC_SITE', 'REGISTRATION_NEED_OPERATOR_CONFIRM', 'F') == 'T') {
         $filters['us_status_list'] = array('E' => _('Attivo'), 'D' => _('In attesa di attivazione'));
     }
     $filters['us_status'] = $this->us_status;
     return $filters;
 }
Exemplo n.º 2
0
 /**
  * Return the filter values (list form)
  */
 public function getFilterValues()
 {
     $filters = array();
     if ($this->auth->hasPerm('SHOW', 'ALL_DOMAINS')) {
         $do_id = null;
         $filters['do_values'] = R3EcoGisHelper::getDomainList();
     } else {
         $do_id = $this->auth->getDomainID();
     }
     $filters['pr_values'] = R3EcoGisHelper::getProvinceList($do_id);
     $filters['mu_values'] = R3EcoGisHelper::getMunicipalityList($do_id);
     $filters['bpu_values'] = R3EcoGisHelper::getBuildingPurposeUseList($do_id);
     $filters['do_id'] = $this->do_id;
     $filters['pr_id'] = $this->pr_id;
     $filters['mu_id'] = $this->mu_id;
     $filters['bpu_id'] = $this->bpu_id;
     return $filters;
 }
Exemplo n.º 3
0
 /**
  * Return the domain name
  * @param integer|null $do_id        the domain id. If null the current domain is used
  * return array                     the domain list
  */
 public static function getDomainName($do_id = null)
 {
     return R3EcoGisHelper::getDomainList($do_id);
 }
Exemplo n.º 4
0
 /**
  * Return the data for a single customer 
  */
 public function getLookupData($id = null)
 {
     $lkp = array();
     $lkp['do_values'] = R3EcoGisHelper::getDomainList();
     if (count($lkp['do_values']) == 1) {
         $lkp['mu_list'] = R3EcoGisMunicipalityCollectionHelper::getAvailableMunicipalityList(key($lkp['do_values']));
     }
     if ($this->act == 'mod') {
         $lkp['mu_selected'] = R3EcoGisMunicipalityCollectionHelper::getSelectedMunicipalityList($this->id);
     }
     return $lkp;
 }
Exemplo n.º 5
0
/**
 * Handle all the active stuff that usually happens in config.php.
 * This are things as opening db connections, start sessions etc.
 * 
 * Session is started
 * The folloy object are created:
 *  - $smarty
 *  - $auth
 */
function R3AppStart($type = null, array $opt = array())
{
    global $smarty, $auth, $languages, $mdb2;
    global $lang;
    // output var
    global $scriptStartTime;
    initLog();
    // Initialize ezLog
    $text = "{$_SERVER['REMOTE_ADDR']}: {$_SERVER['SCRIPT_FILENAME']}?{$_SERVER['QUERY_STRING']} started ({$_SERVER['REQUEST_METHOD']})";
    ezcLog::getInstance()->log($text, ezcLog::DEBUG);
    require_once R3_LIB_DIR . 'eco_utils.php';
    $isAuth = $auth->isAuth();
    if (!$isAuth && isset($opt['allow_change_password']) && $opt['allow_change_password'] === true && ($auth->getStatus() == AUTH_PASSWORD_REPLACE || $auth->getStatus() == AUTH_PASSWORD_EXPIRED)) {
        $isAuth = true;
        $auth->getAllPermsAsString();
    }
    if (!$isAuth) {
        ezcLog::getInstance()->log(sprintf("Non authenticated request: Logged out [%s]", $auth->getStatusText()), ezcLog::NOTICE);
        Header("location: logout.php?status=" . $auth->getStatusText());
        die;
    }
    if (1 == 1) {
        $sql = "SELECT set_session_var('R3UID', '{$auth->getUID()}')";
        $db = ezcDbInstance::get();
        $db->exec($sql);
        $mdb2->exec($sql);
    }
    $_SESSION['lang'] = $auth->getParam('us_lang', 1);
    $lang = $_SESSION['lang'];
    $smarty->assign('lang', $lang);
    R3Locale::setLanguageID($lang);
    /** Apply locale */
    setLang($languages[$_SESSION['lang']], LC_MESSAGES);
    bindtextdomain('messages', R3_LANG_DIR);
    textdomain('messages');
    bind_textdomain_codeset('messages', R3_APP_CHARSET);
    // Force domain
    if ($auth->hasPerm('SHOW', 'ALL_DOMAINS')) {
        $domainList = R3EcoGisHelper::getDomainList();
        $smarty->assign('domains', $domainList);
        if (!isset($_SESSION['do_id'])) {
            if (R3_IS_MULTIDOMAIN) {
                $_SESSION['do_id'] = key($domainList);
                // 1st domain
            } else {
                $_SESSION['do_id'] = $auth->getDomainID();
                // Default domain
            }
        }
    } else {
        $_SESSION['do_id'] = $auth->getDomainID();
        // Default domain
    }
    $smarty->assign('do_id', $_SESSION['do_id']);
    if (!isset($_REQUEST['method'])) {
        // Don't rebuild on ajax request
        // Rebuild css
        R3BuildCSS();
        // Rebuild js
        R3BuildJS();
    }
    if (defined('GZIP_PHP_PAGE') && GZIP_PHP_PAGE == true) {
        // Compress php page
        ob_start("ob_gzhandler");
    }
}