setCurDomain() 공개 정적인 메소드

Set the current domain.
public static setCurDomain ( $domain = null )
예제 #1
0
파일: Application.php 프로젝트: horde/horde
 protected function _init()
 {
     $this->driver = Vilma_Driver::factory();
     // Get the currently active domain, possibly storing a change into the
     // session.
     // Domain is passed in by ID, which may or may not be the
     // the same as the actual DNS domain name.
     $domain_id = Horde_Util::getFormData('domain_id');
     if (strlen($domain_id)) {
         $domain = $this->driver->getDomain($domain_id);
         if (!empty($domain['domain_name'])) {
             $this->curdomain = $domain;
             Vilma::setCurDomain($domain);
         }
     } elseif ($domain = $GLOBALS['session']->get('vilma', 'domain')) {
         $this->curdomain = $domain;
     }
 }
예제 #2
0
파일: index.php 프로젝트: jubinpatel/horde
/**
 * Copyright 2003-2014 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (BSD). If you did not
 * did not receive this file, see http://cvs.horde.org/co.php/vilma/LICENSE.
 *
 * @author Marko Djukic <*****@*****.**>
 */
require_once __DIR__ . '/../lib/Application.php';
$vilma = Horde_Registry::appInit('vilma');
/* Only admin should be using this. */
if (!Vilma::hasPermission()) {
    throw new Horde_Exception_AuthenticationFailure();
}
// Having a current domain doesn't make sense on this page
Vilma::setCurDomain();
try {
    $domains = $vilma->driver->getDomains();
} catch (Exception $e) {
    $notification->push($e, 'horde.error');
    $domains = array();
}
$editurl = Horde::url('domains/edit.php');
$deleteurl = Horde::url('domains/delete.php');
$userurl = Horde::url('users/index.php');
foreach ($domains as &$domain) {
    $domain['edit_url'] = $editurl->copy()->add('domain_id', $domain['domain_id']);
    $domain['del_url'] = $deleteurl->copy()->add('domain_id', $domain['domain_id']);
    $domain['view_url'] = $userurl->copy()->add('domain_id', $domain['domain_id']);
}
/* Set up the template fields. */