879039f4b3d2c1f0cb5bf3fa3730779d072d0439
1 <?php
2 /*
3 * This code is part of GOsa (https://gosa.gonicus.de)
4 * Copyright (C) 2003-2006 - Cajus Pollmeier <pollmeier@gonicus.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
21 class config {
23 /* XML parser */
24 var $parser;
25 var $config_found= FALSE;
26 var $tags= array();
27 var $level= 0;
28 var $gpc= 0;
29 var $section= "";
30 var $currentLocation= "";
32 /* Selected connection */
33 var $current= array();
35 /* Link to LDAP-server */
36 var $ldap= NULL;
37 var $referrals= array();
39 /* Configuration data */
40 var $data= array( 'TABS' => array(), 'LOCATIONS' => array(), 'SERVERS' => array(),
41 'MAIN' => array( 'LANGUAGES' => array(), 'FAXFORMATS' => array() ),
42 'MENU' => array(), 'SERVICE' => array());
43 var $basedir= "";
45 /* Keep a copy of the current deparment list */
46 var $departments= array();
47 var $idepartments= array();
48 var $adepartments= array();
50 function config($filename, $basedir= "")
51 {
52 $this->parser = xml_parser_create();
53 $this->basedir= $basedir;
55 xml_set_object($this->parser, $this);
56 xml_set_element_handler($this->parser, "tag_open", "tag_close");
58 /* Parse config file directly? */
59 if ($filename != ""){
60 $this->parse($filename);
61 }
62 }
64 function parse($filename)
65 {
66 $fh= fopen($filename, "r");
67 $xmldata= fread($fh, 100000);
68 fclose($fh);
69 if(!xml_parse($this->parser, chop($xmldata))){
70 print_red(sprintf(_("XML error in gosa.conf: %s at line %d"),
71 xml_error_string(xml_get_error_code($this->parser)),
72 xml_get_current_line_number($this->parser)));
73 echo $_SESSION['errors'];
74 exit;
75 }
76 }
78 function tag_open($parser, $tag, $attrs)
79 {
80 /* Save last and current tag for reference */
81 $this->tags[$this->level]= $tag;
82 $this->level++;
84 /* Trigger on CONF section */
85 if ($tag == 'CONF'){
86 $this->config_found= TRUE;
87 }
89 /* Return if we're not in config section */
90 if (!$this->config_found){
91 return;
92 }
94 /* yes/no to true/false and upper case TRUE to true and so on*/
95 foreach($attrs as $name => $value){
96 if(preg_match("/^(true|yes)$/i",$value)){
97 $attrs[$name] = "true";
98 }elseif(preg_match("/^(false|no)$/i",$value)){
99 $attrs[$name] = "false";
100 }
101 }
103 /* Look through attributes */
104 switch ($this->tags[$this->level-1]){
106 /* Handle tab section */
107 case 'TAB': $name= $this->tags[$this->level-2];
109 /* Create new array? */
110 if (!isset($this->data['TABS'][$name])){
111 $this->data['TABS'][$name]= array();
112 }
114 /* Add elements */
115 $this->data['TABS'][$name][]= $attrs;
116 break;
118 /* Handle location */
119 case 'LOCATION':
120 if ($this->tags[$this->level-2] == 'MAIN'){
121 $name= $attrs['NAME'];
122 $this->currentLocation= $name;
124 /* Add location elements */
125 $this->data['LOCATIONS'][$name]= $attrs;
126 }
127 break;
129 /* Handle referral tags */
130 case 'REFERRAL':
131 if ($this->tags[$this->level-2] == 'LOCATION'){
132 $url= $attrs['URL'];
133 $server= preg_replace('!^([^:]+://[^/]+)/.*$!', '\\1', $url);
135 /* Add location elements */
136 if (!isset($this->data['LOCATIONS'][$this->currentLocation]['REFERRAL'])){
137 $this->data['LOCATIONS'][$this->currentLocation]['REFERRAL']= array();
138 }
140 $this->data['LOCATIONS'][$this->currentLocation]['REFERRAL'][$server]= $attrs;
141 }
142 break;
144 /* Handle language */
145 case 'LANGUAGE':
146 if ($this->tags[$this->level-2] == 'MAIN'){
147 /* Add languages */
148 $this->data['MAIN']['LANGUAGES'][$attrs['NAME']]=
149 $attrs['TAG'];
150 }
151 break;
153 /* Handle faxformat */
154 case 'FAXFORMAT':
155 if ($this->tags[$this->level-2] == 'MAIN'){
156 /* Add fax formats */
157 $this->data['MAIN']['FAXFORMATS'][]= $attrs['TYPE'];
158 }
159 break;
161 /* Load main parameters */
162 case 'MAIN':
163 $this->data['MAIN']= array_merge ($this->data['MAIN'], $attrs);
164 break;
166 /* Load menu */
167 case 'SECTION':
168 if ($this->tags[$this->level-2] == 'MENU'){
169 $this->section= $attrs['NAME'];
170 $this->data['MENU'][$this->section]= array(); ;
171 }
172 break;
174 /* Inser plugins */
175 case 'PLUGIN':
176 if ($this->tags[$this->level-3] == 'MENU' &&
177 $this->tags[$this->level-2] == 'SECTION'){
179 $this->data['MENU'][$this->section][$this->gpc++]= $attrs;
180 }
181 if ($this->tags[$this->level-2] == 'SERVICEMENU'){
182 $this->data['SERVICE'][$attrs['CLASS']]= $attrs;
183 }
184 break;
185 }
186 }
188 function tag_close($parser, $tag)
189 {
190 /* Close config section */
191 if ($tag == 'CONF'){
192 $this->config_found= FALSE;
193 }
194 $this->level--;
195 }
197 function get_ldap_link($sizelimit= FALSE)
198 {
199 /* Build new connection */
200 $this->ldap= ldap_init ($this->current['SERVER'], $this->current['BASE'],
201 $this->current['ADMIN'], $this->current['PASSWORD']);
203 /* Check for connection */
204 if (is_null($this->ldap) || (is_int($this->ldap) && $this->ldap == 0)){
205 $smarty= get_smarty();
206 print_red (_("Can't bind to LDAP. Please contact the system administrator."));
207 $smarty->display (get_template_path('headers.tpl'));
208 echo '<body style="background-image:none">'.$_SESSION['errors'].'</body></html>';
209 exit();
210 }
212 if (!isset($_SESSION['size_limit'])){
213 $_SESSION['size_limit']= $this->current['SIZELIMIT'];
214 $_SESSION['size_ignore']= $this->current['SIZEIGNORE'];
215 }
217 if ($sizelimit){
218 $this->ldap->set_size_limit($_SESSION['size_limit']);
219 } else {
220 $this->ldap->set_size_limit(0);
221 }
223 /* Move referrals */
224 if (!isset($this->current['REFERRAL'])){
225 $this->ldap->referrals= array();
226 } else {
227 $this->ldap->referrals= $this->current['REFERRAL'];
228 }
230 return ($this->ldap);
231 }
233 function set_current($name)
234 {
235 $this->current= $this->data['LOCATIONS'][$name];
236 if (!isset($this->current['PEOPLE'])){
237 $this->current['PEOPLE']= "ou=people";
238 }
239 if (!isset($this->current['GROUPS'])){
240 $this->current['GROUPS']= "ou=groups";
241 }
242 if (!isset($this->current['WINSTATIONS'])){
243 $this->current['WINSTATIONS']= "ou=winstations,ou=systems";
244 }
245 if (!isset($this->current['HASH'])){
246 $this->current['HASH']= "crypt";
247 }
248 if (!isset($this->current['DNMODE'])){
249 $this->current['DNMODE']= "cn";
250 }
251 if (!isset($this->current['MINID'])){
252 $this->current['MINID']= 100;
253 }
254 if (!isset($this->current['SIZELIMIT'])){
255 $this->current['SIZELIMIT']= 200;
256 }
257 if (!isset($this->current['SIZEINGORE'])){
258 $this->current['SIZEIGNORE']= TRUE;
259 } else {
260 if (preg_match("/true/i", $this->current['SIZEIGNORE'])){
261 $this->current['SIZEIGNORE']= TRUE;
262 } else {
263 $this->current['SIZEIGNORE']= FALSE;
264 }
265 }
267 /* Sort referrals, if present */
268 if (isset ($this->current['REFERRAL'])){
269 $bases= array();
270 $servers= array();
271 foreach ($this->current['REFERRAL'] as $ref){
272 $server= preg_replace('%^(.*)/[^/]+$%', '\\1', $ref['URL']);
273 $base= preg_replace('%^.*/([^/]+)$%', '\\1', $ref['URL']);
274 $bases[$base]= strlen($base);
275 $servers[$base]= $server;
276 }
277 asort($bases);
278 reset($bases);
279 }
281 /* SERVER not defined? Load the one with the shortest base */
282 if (!isset($this->current['SERVER'])){
283 $this->current['SERVER']= $servers[key($bases)];
284 }
286 /* BASE not defined? Load the one with the shortest base */
287 if (!isset($this->current['BASE'])){
288 $this->current['BASE']= key($bases);
289 }
291 /* Convert BASE to have escaped special characters */
292 $this->current['BASE']= @LDAP::convert($this->current['BASE']);
294 /* Parse LDAP referral informations */
295 if (!isset($this->current['ADMIN']) || !isset($this->current['PASSWORD'])){
296 $url= $this->current['SERVER'];
297 $referral= $this->current['REFERRAL'][$url];
298 $this->current['ADMIN']= $referral['ADMIN'];
299 $this->current['PASSWORD']= $referral['PASSWORD'];
300 }
302 /* Load server informations */
303 $this->load_servers();
304 }
306 function load_servers ()
307 {
308 /* Only perform actions if current is set */
309 if ($this->current == NULL){
310 return;
311 }
313 /* Fill imap servers */
314 $ldap= $this->get_ldap_link();
315 $ldap->cd ($this->current['BASE']);
316 $ldap->search ("(objectClass=goImapServer)");
318 $this->data['SERVERS']['IMAP']= array();
319 error_reporting(0);
320 while ($attrs= $ldap->fetch()){
321 $name= $attrs['goImapName'][0];
322 $this->data['SERVERS']['IMAP'][$name]= array( "connect" => $attrs['goImapConnect'][0],
323 "admin" => $attrs['goImapAdmin'][0],
324 "password" => $attrs['goImapPassword'][0],
325 "sieve_server" => $attrs['goImapSieveServer'][0],
326 "sieve_port" => $attrs['goImapSievePort'][0]);
327 }
328 error_reporting(E_ALL);
330 /* Get kerberos server. FIXME: only one is supported currently */
331 $ldap->cd ($this->current['BASE']);
332 $ldap->search ("(objectClass=goKrbServer)");
333 if ($ldap->count()){
334 $attrs= $ldap->fetch();
335 $this->data['SERVERS']['KERBEROS']= array( 'SERVER' => $attrs['cn'][0],
336 'REALM' => $attrs['goKrbRealm'][0],
337 'ADMIN' => $attrs['goKrbAdmin'][0],
338 'PASSWORD' => $attrs['goKrbPassword'][0]);
339 }
341 /* Get cups server. FIXME: only one is supported currently */
342 $ldap->cd ($this->current['BASE']);
343 $ldap->search ("(objectClass=goCupsServer)");
344 if ($ldap->count()){
345 $attrs= $ldap->fetch();
346 $this->data['SERVERS']['CUPS']= $attrs['cn'][0];
347 }
349 /* Get fax server. FIXME: only one is supported currently */
350 $ldap->cd ($this->current['BASE']);
351 $ldap->search ("(objectClass=goFaxServer)");
352 if ($ldap->count()){
353 $attrs= $ldap->fetch();
354 $this->data['SERVERS']['FAX']= array( 'SERVER' => $attrs['cn'][0],
355 'LOGIN' => $attrs['goFaxAdmin'][0],
356 'PASSWORD' => $attrs['goFaxPassword'][0]);
357 }
359 /* Get asterisk servers */
360 $ldap->cd ($this->current['BASE']);
361 $ldap->search ("(objectClass=goFonServer)");
362 if ($ldap->count()){
363 $attrs= $ldap->fetch();
364 $this->data['SERVERS']['FON']= array(
365 'SERVER' => $attrs['cn'][0],
366 'LOGIN' => $attrs['goFonAdmin'][0],
367 'PASSWORD' => $attrs['goFonPassword'][0],
368 'DB' => "gophone",
369 'SIP_TABLE' => "sip_users",
370 'EXT_TABLE' => "extensions",
371 'VOICE_TABLE' => "voicemail_users",
372 'QUEUE_TABLE' => "queues",
373 'QUEUE_MEMBER_TABLE' => "queue_members");
374 }
376 /* Get glpi servers */
377 $ldap->cd ($this->current['BASE']);
378 $ldap->search ("(&(objectClass=goGlpiServer)(cn=*)(goGlpiAdmin=*)(goGlpiDatabase=*))",array("cn","goGlpiPassword","goGlpiAdmin","goGlpiDatabase"));
379 if ($ldap->count()){
380 $attrs= $ldap->fetch();
381 if(!isset($attrs['goGlpiPassword'])){
382 $attrs['goGlpiPassword'][0] ="";
383 }
384 $this->data['SERVERS']['GLPI']= array(
385 'SERVER' => $attrs['cn'][0],
386 'LOGIN' => $attrs['goGlpiAdmin'][0],
387 'PASSWORD' => $attrs['goGlpiPassword'][0],
388 'DB' => $attrs['goGlpiDatabase'][0]);
389 }
390 /* Get logdb server */
391 $ldap->cd ($this->current['BASE']);
392 $ldap->search ("(objectClass=goLogDBServer)");
393 if ($ldap->count()){
394 $attrs= $ldap->fetch();
395 $this->data['SERVERS']['LOG']= array( 'SERVER' => $attrs['cn'][0],
396 'LOGIN' => $attrs['goLogAdmin'][0],
397 'PASSWORD' => $attrs['goLogPassword'][0]);
398 }
400 /* Get NFS server lists */
401 $tmp= array("default");
402 $ldap->cd ($this->current['BASE']);
403 $ldap->search ("(&(objectClass=goShareServer)(goExportEntry=*))");
404 while ($attrs= $ldap->fetch()){
405 for ($i= 0; $i<$attrs["goExportEntry"]["count"]; $i++){
406 $path= preg_replace ("/\s.*$/", "", $attrs["goExportEntry"][$i]);
407 $tmp[]= $attrs["cn"][0].":$path";
408 }
409 }
410 $this->data['SERVERS']['NFS']= $tmp;
413 /* Load Terminalservers */
414 $ldap->cd ($this->current['BASE']);
415 $ldap->search ("(objectClass=goTerminalServer)");
416 $this->data['SERVERS']['TERMINAL']= array();
417 $this->data['SERVERS']['TERMINAL'][]= "default";
419 $this->data['SERVERS']['FONT']= array();
420 $this->data['SERVERS']['FONT'][]= "default";
421 while ($attrs= $ldap->fetch()){
422 $this->data['SERVERS']['TERMINAL'][]= $attrs["cn"][0];
423 for ($i= 0; $i<$attrs["goFontPath"]["count"]; $i++){
424 $this->data['SERVERS']['FONT'][]= $attrs["goFontPath"][$i];
425 }
426 }
428 /* Ldap Server */
429 $this->data['SERVERS']['LDAP']= array();
430 $ldap->cd ($this->current['BASE']);
431 $ldap->search ("(objectClass=goLdapServer)");
432 while ($attrs= $ldap->fetch()){
433 if (isset($attrs["goLdapBase"])){
434 for ($i= 0; $i<$attrs["goLdapBase"]["count"]; $i++){
435 $this->data['SERVERS']['LDAP'][]= $attrs["cn"][0].":".$attrs["goLdapBase"][$i];
436 }
437 }
438 }
440 /* Get misc server lists */
441 $this->data['SERVERS']['SYSLOG']= array("default");
442 $this->data['SERVERS']['NTP']= array("default");
443 $ldap->cd ($this->current['BASE']);
444 $ldap->search ("(objectClass=goNtpServer)");
445 while ($attrs= $ldap->fetch()){
446 $this->data['SERVERS']['NTP'][]= $attrs["cn"][0];
447 }
448 $ldap->cd ($this->current['BASE']);
449 $ldap->search ("(objectClass=goSyslogServer)");
450 while ($attrs= $ldap->fetch()){
451 $this->data['SERVERS']['SYSLOG'][]= $attrs["cn"][0];
452 }
454 /* Get samba servers from LDAP, in case of samba3 */
455 if ($this->current['SAMBAVERSION'] == 3){
456 $this->data['SERVERS']['SAMBA']= array();
457 $ldap->cd ($this->current['BASE']);
458 $ldap->search ("(objectClass=sambaDomain)");
459 while ($attrs= $ldap->fetch()){
460 $this->data['SERVERS']['SAMBA'][$attrs['sambaDomainName'][0]]= array(
461 "SID" => $attrs["sambaSID"][0],
462 "RIDBASE" => $attrs["sambaAlgorithmicRidBase"][0]);
463 }
465 /* If no samba servers are found, look for configured sid/ridbase */
466 if (count($this->data['SERVERS']['SAMBA']) == 0){
467 if (!isset($this->current["SID"]) || !isset($this->current["RIDBASE"])){
468 print_red(_("SID and/or RIDBASE missing in your configuration!"));
469 echo $_SESSION['errors'];
470 exit;
471 } else {
472 $this->data['SERVERS']['SAMBA']['DEFAULT']= array(
473 "SID" => $this->current["SID"],
474 "RIDBASE" => $this->current["RIDBASE"]);
475 }
476 }
477 }
478 }
481 function get_departments($ignore_dn= "")
482 {
483 global $config;
485 /* Initialize result hash */
486 $result= array();
487 $administrative= array();
488 $result['/']= $this->current['BASE'];
490 /* Get list of department objects */
491 $ldap= $this->get_ldap_link();
492 $ldap->cd ($this->current['BASE']);
493 $ldap->search ("(objectClass=gosaDepartment)", array("ou", "objectClass", "gosaUnitTag"));
494 while ($attrs= $ldap->fetch()){
495 $dn= $ldap->getDN();
497 /* Save administrative departments */
498 if (in_array_ics("gosaAdministrativeUnit", $attrs['objectClass']) &&
499 isset($attrs['gosaUnitTag'][0])){
500 $administrative[$dn]= $attrs['gosaUnitTag'][0];
501 }
503 if ($dn == $ignore_dn){
504 continue;
505 }
507 /* Only assign non-root departments */
508 if ($dn != $result['/']){
509 $result[convert_department_dn($dn)]= $dn;
510 }
511 }
513 $this->adepartments= $administrative;
514 $this->departments= $result;
515 }
518 function make_idepartments($max_size= 28)
519 {
520 global $config;
521 $base = $config->current['BASE'];
523 $arr = array();
525 $this->idepartments= array();
527 /* Create multidimensional array, with all departments. */
528 foreach ($this->departments as $key => $val){
530 /* remove base from dn */
531 $val2 = str_replace($base,"",$val);
533 /* Get every single ou */
534 $str = preg_replace("/ou=/","|ou=",$val2);
535 $elements = array_reverse(split("\|",$str));
537 /* Save last array position */
538 $last = &$arr;
540 /* Get array depth */
541 $cnt = count($elements);
543 /* Add last ou element of current dn to our array */
544 foreach($elements as $key => $ele){
546 /* skip enpty */
547 if(empty($ele)) continue;
549 /* Extract department name */
550 $elestr = preg_replace("/^ou=/","", $ele);
551 $elestr = preg_replace("/,$/","",$elestr);
553 /* Add to array */
554 if($key == ($cnt-2)){
555 $last[$elestr]['ENTRY'] = $val;
556 }
558 /* Set next array appending position */
559 $last = &$last[$elestr]['SUB'];
560 }
561 }
563 /* Add base entry */
564 $ret["/"]["ENTRY"] = $base;
565 $ret["/"]["SUB"] = $arr;
567 $this->idepartments= $this->generateDepartmentArray($ret,-1,$max_size);
568 }
571 /* Creates display friendly output from make_idepartments */
572 function generateDepartmentArray($arr,$depth = -1,$max_size){
573 $ret = array();
574 $depth ++;
576 /* Walk through array */
577 foreach($arr as $name => $entries){
579 /* If this department is the last in the current tree position
580 * remove it, to avoid generating output for it */
581 if(count($entries['SUB'])==0){
582 unset($entries['SUB']);
583 }
585 /* Fix name, if it contains a replace tag */
586 $name= @LDAP::fix($name);
588 /* Check if current name is too long, then cut it */
589 if(mb_strlen($name, 'UTF-8')> $max_size){
590 $name = mb_substr($name,0,($max_size-3), 'UTF-8')." ...";
591 }
593 /* Append the name to the list */
594 if(isset($entries['ENTRY'])){
595 $a = "";
596 for($i = 0 ; $i < $depth ; $i ++){
597 $a.=" ";
598 }
599 $ret[$entries['ENTRY']]=$a." ".$name;
600 }
602 /* recursive add of subdepartments */
603 if(isset($entries['SUB'])){
604 $ret = array_merge($ret,$this->generateDepartmentArray($entries['SUB'],$depth,$max_size));
605 }
606 }
608 return($ret);
609 }
611 /* This function returns all available Shares defined in this ldap
612 * There are two ways to call this function, if listboxEntry is true
613 * only name and path are attached to the array, in it is false, the whole
614 * entry will be parsed an atached to the result.
615 */
616 function getShareList($listboxEntry = false)
617 {
618 $ldap= $this->get_ldap_link();
619 $a_res = $ldap->search("(objectClass=goShareServer)",array("goExportEntry","cn"));
620 $return= array();
621 while($entry = $ldap->fetch($a_res)){
622 if(isset($entry['goExportEntry']['count'])){
623 unset($entry['goExportEntry']['count']);
624 }
625 if(isset($entry['goExportEntry'])){
626 foreach($entry['goExportEntry'] as $export){
627 $shareAttrs = split("\|",$export);
628 if($listboxEntry) {
629 $return[$shareAttrs[0]."|".$entry['cn'][0]] = $shareAttrs[0]." - ".$entry['cn'][0];
630 }else{
631 $return[$shareAttrs[0]."|".$entry['cn'][0]]['server'] = $entry['cn'][0];
632 $return[$shareAttrs[0]."|".$entry['cn'][0]]['name'] = $shareAttrs[0];
633 $return[$shareAttrs[0]."|".$entry['cn'][0]]['description'] = $shareAttrs[1];
634 $return[$shareAttrs[0]."|".$entry['cn'][0]]['type'] = $shareAttrs[2];
635 $return[$shareAttrs[0]."|".$entry['cn'][0]]['charset'] = $shareAttrs[3];
636 $return[$shareAttrs[0]."|".$entry['cn'][0]]['path'] = $shareAttrs[4];
637 $return[$shareAttrs[0]."|".$entry['cn'][0]]['option'] = $shareAttrs[5];
638 }
639 }
640 }
641 }
642 return($return);
643 }
645 /* This function returns all available ShareServer */
646 function getShareServerList()
647 {
648 $ldap= $this->get_ldap_link();
649 $a_res = $ldap->search("(&(objectClass=goShareServer)(goExportEntry=*))",array("goExportEntry","cn"));
650 $return= array();
651 while($entry = $ldap->fetch($a_res)){
652 if(isset($entry['goExportEntry']['count'])){
653 unset($entry['goExportEntry']['count']);
654 }
655 foreach($entry['goExportEntry'] as $share){
656 $a_share = split("\|",$share);
657 $sharename = $a_share[0];
658 $return[$entry['cn'][0]."|".$sharename] = $entry['cn'][0]." [".$sharename."]";
659 }
660 }
661 return($return);
662 }
664 /* Check if there's the specified bool value set in the configuration */
665 function boolValueIsTrue($section, $value)
666 {
667 $section= strtoupper($section);
668 $value= strtoupper($value);
669 if (isset($this->data[$section][$value])){
671 $data= $this->data[$section][$value];
672 if (preg_match("/^true$/i", $data) || preg_match("/yes/i", $data)){
673 return TRUE;
674 }
676 }
678 return FALSE;
679 }
681 }
683 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
684 ?>