Esempio n. 1
0
 /**
  * Returns configured logging mode
  *
  * @return int Logging mode
  */
 static function mode()
 {
     if (isset(self::$mode)) {
         return self::$mode;
     }
     $conf = Conf::get_instance();
     $mode = $conf->get('autodiscover', 'debug_mode');
     switch ($mode) {
         case self::TRACE:
         case 'trace':
         case 'TRACE':
             self::$mode = self::TRACE;
             break;
         case self::DEBUG:
         case 'debug':
         case 'DEBUG':
             self::$mode = self::DEBUG;
             break;
         case self::INFO:
         case 'info':
         case 'INFO':
             self::$mode = self::INFO;
             break;
         case self::WARNING:
         case 'warning':
         case 'WARNING':
             self::$mode = self::WARNING;
             break;
         case self::ERROR:
         default:
             self::$mode = self::ERROR;
     }
     return self::$mode;
 }
Esempio n. 2
0
 /**
  * Initialization of class instance
  */
 public function __construct()
 {
     require_once __DIR__ . '/Conf.php';
     require_once __DIR__ . '/Log.php';
     $this->conf = Conf::get_instance();
 }
Esempio n. 3
0
<?php

require_once "/usr/share/kolab-webadmin/lib/functions.php";
require_once "/usr/share/kolab-webadmin/lib/api/kolab_api_service_user_types.php";
$conf = Conf::get_instance();
$primary_domain = $conf->get('kolab', 'primary_domain');
$ldappassword = $conf->get('ldap', 'bind_pw');
$_SESSION['user'] = new User();
$valid = $_SESSION['user']->authenticate("cn=Directory Manager", $ldappassword, $primary_domain);
if ($valid === false) {
    die("cannot authenticate user cn=Directory Manager");
}
$auth = Auth::get_instance();
$user_types = new kolab_api_service_user_types(null);
$list = $user_types->user_types_list(null, null);
# copy the entry for kolab
if ($list['list'][1]['key'] != 'kolab') {
    echo "failure: expected user type kolab at position 1, but found " . $list['list'][1]['key'] . "\n";
    die;
}
$kolabUserType = $list['list'][1];
$kolabUserType['id'] = 1;
$kolabUserType['type'] = 'user';
$kolabUserType['attributes']['fields']['objectclass'][] = 'tbitskolabuser';
$kolabUserType['attributes']['form_fields']['tbitskolablastlogin'] = array('type' => 'text-unixtimestamp', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolabisdomainadmin'] = array('type' => 'checkbox', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolabmaxaccounts'] = array('type' => 'text', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolaboverallquota'] = array('type' => 'text-quota', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolabdefaultquota'] = array('type' => 'text-quota', 'optional' => 1);
$service_type = new kolab_api_service_type(null);
if (false === $service_type->type_edit(null, $kolabUserType)) {