Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
squiz_server_config.inc
1 <?php
18 require_once SQ_LIB_PATH.'/config/config.inc';
19 
32 {
33 
34 
40  var $config_vars = Array(
41  'SQ_SERVER_SYSTEM_ROOT' => Array('editable' => 1, 'default' => ''),
42  'SQ_SERVER_SYSTEMID' => Array('editable' => 1, 'default' => ''),
43  'SQ_SERVER_DOMAIN' => Array('editable' => 1, 'default' => ''),
44  'SQ_SERVER_PORT' => Array('editable' => 1, 'default' => 0),
45  );
46 
47 
52  function __construct()
53  {
54  parent::__construct();
55  $this->config_file = SQ_DATA_PATH.'/private/conf/squiz_server.inc';
56 
57  }//end constructor
58 
59 
67  function canAcquireLock()
68  {
69  // need to be root
70  return $GLOBALS['SQ_SYSTEM']->userRoot();
71 
72  }//end canAcquireLock()
73 
74 
81  function writeAccess()
82  {
83  if (!parent::writeAccess()) return false;
84  if (!$GLOBALS['SQ_SYSTEM']->runLevelEnables(SQ_SECURITY_PERMISSIONS)) {
85  return true;
86  }
87 
88  // need to be root
89  return $GLOBALS['SQ_SYSTEM']->userRoot();
90 
91  }//end writeAccess()
92 
93 
106  function paintBackend(&$o)
107  {
108  parent::paintBackend($o);
109 
110  $write_access = $this->writeAccess();
111  $class = get_class_lower($this);
112 
113  $o->openSection(translate('squiz_server_configuration'));
114 
115  $o->openField(translate('system_root'));
116  if ($write_access) {
117  text_box($class.'[SQ_SERVER_SYSTEM_ROOT]', SQ_SERVER_SYSTEM_ROOT, 60);
118  } else {
119  echo SQ_SERVER_SYSTEM_ROOT;
120  }
121  $o->note(translate('squiz_server_path'));
122 
123  $o->openField(translate('system_id'));
124  if ($write_access) {
125  text_box($class.'[SQ_SERVER_SYSTEMID]', SQ_SERVER_SYSTEMID, 30);
126  } else {
127  echo SQ_SERVER_SYSTEMID;
128  }
129 
130  $o->openField(translate('domain'));
131  if ($write_access) {
132  text_box($class.'[SQ_SERVER_DOMAIN]', SQ_SERVER_DOMAIN, 30);
133  } else {
134  echo SQ_SERVER_DOMAIN;
135  }
136 
137  $o->openField(translate('port'));
138  if ($write_access) {
139  text_box($class.'[SQ_SERVER_PORT]', SQ_SERVER_PORT, 10);
140  } else {
141  echo SQ_SERVER_PORT;
142  }
143 
144  $o->closeSection();
145 
146  if ($write_access) $o->commitButton('', true);
147 
148 
149  }//end paintBackend()
150 
151 
152 }//end class
153 
154 ?>