From df45f1030543687b3f99ff5c3b9ba7e501617f62 Mon Sep 17 00:00:00 2001 From: Benjamin Mercier Date: Sun, 21 Feb 2016 14:28:40 +0100 Subject: [PATCH] Migration SVN --- system/api/action.api.php | 137 + system/api/api.php | 22 + system/api/cron.api.php | 252 ++ system/api/database.api.php | 125 + system/api/history.api.php | 161 ++ system/api/hosting.api.php | 329 +++ system/api/html.api.php | 159 ++ system/api/lang.api.php | 102 + system/api/myexception.api.php | 152 ++ system/api/mysql.api.php | 140 + system/api/pagination.api.php | 155 ++ system/api/security.api.php | 49 + system/api/support.api.php | 515 ++++ system/api/template.api.php | 187 ++ system/api/textverification.api.php | 199 ++ system/api/user.api.php | 327 +++ system/api/vhost.api.php | 297 +++ system/configuration.php | 106 + system/core.php | 50 + system/lang/en/lang | 260 ++ system/lang/fr/lang | 288 ++ system/libs/smarty/Config_File.class.php | 393 +++ system/libs/smarty/Smarty.class.php | 1960 ++++++++++++++ system/libs/smarty/Smarty_Compiler.class.php | 2351 +++++++++++++++++ system/libs/smarty/debug.tpl | 157 ++ system/libs/smarty/demo/configs/test.conf | 5 + system/libs/smarty/demo/index.php | 25 + system/libs/smarty/demo/templates/footer.tpl | 2 + system/libs/smarty/demo/templates/header.tpl | 6 + system/libs/smarty/demo/templates/index.tpl | 81 + .../%%0E^0E4^0E407559%%footer.tpl.php | 4 + .../%%15^15C^15C1795C%%test.conf%7Csetup.php | 5 + .../%%45^45E^45E480CD%%index.tpl.php | 147 ++ .../%%5A^5AE^5AE3C49A%%debug.tpl.php | 263 ++ .../%%F7^F7F^F7F34188%%header.tpl.php | 13 + .../core.assemble_plugin_filepath.php | 67 + .../core.assign_smarty_interface.php | 43 + .../internals/core.create_dir_structure.php | 79 + .../internals/core.display_debug_console.php | 61 + .../internals/core.get_include_path.php | 44 + .../smarty/internals/core.get_microtime.php | 23 + .../internals/core.get_php_resource.php | 80 + .../libs/smarty/internals/core.is_secure.php | 59 + .../libs/smarty/internals/core.is_trusted.php | 47 + .../smarty/internals/core.load_plugins.php | 125 + .../internals/core.load_resource_plugin.php | 74 + .../internals/core.process_cached_inserts.php | 71 + .../core.process_compiled_include.php | 37 + .../smarty/internals/core.read_cache_file.php | 101 + system/libs/smarty/internals/core.rm_auto.php | 71 + system/libs/smarty/internals/core.rmdir.php | 54 + .../internals/core.run_insert_handler.php | 71 + .../internals/core.smarty_include_php.php | 50 + .../internals/core.write_cache_file.php | 96 + .../internals/core.write_compiled_include.php | 91 + .../core.write_compiled_resource.php | 35 + .../libs/smarty/internals/core.write_file.php | 54 + .../libs/smarty/plugins/block.textformat.php | 103 + .../libs/smarty/plugins/compiler.assign.php | 40 + system/libs/smarty/plugins/compiler.defun.php | 122 + .../libs/smarty/plugins/compiler.endwhile.php | 20 + system/libs/smarty/plugins/compiler.while.php | 22 + .../plugins/function.assign_debug_info.php | 40 + .../libs/smarty/plugins/function.bitwise.php | 25 + .../smarty/plugins/function.config_load.php | 142 + .../libs/smarty/plugins/function.counter.php | 80 + system/libs/smarty/plugins/function.cycle.php | 102 + .../smarty/plugins/function.date_diff.php | 44 + system/libs/smarty/plugins/function.debug.php | 35 + system/libs/smarty/plugins/function.eval.php | 49 + system/libs/smarty/plugins/function.fetch.php | 221 ++ .../plugins/function.html_checkboxes.php | 143 + .../smarty/plugins/function.html_image.php | 142 + .../smarty/plugins/function.html_options.php | 122 + .../smarty/plugins/function.html_radios.php | 156 ++ .../plugins/function.html_select_date.php | 331 +++ .../plugins/function.html_select_time.php | 194 ++ .../smarty/plugins/function.html_table.php | 177 ++ .../libs/smarty/plugins/function.mailto.php | 165 ++ system/libs/smarty/plugins/function.math.php | 84 + system/libs/smarty/plugins/function.popup.php | 119 + .../smarty/plugins/function.popup_init.php | 40 + .../smarty/plugins/modifier.capitalize.php | 43 + system/libs/smarty/plugins/modifier.cat.php | 33 + .../plugins/modifier.count_characters.php | 32 + .../plugins/modifier.count_paragraphs.php | 29 + .../plugins/modifier.count_sentences.php | 29 + .../smarty/plugins/modifier.count_words.php | 33 + .../smarty/plugins/modifier.date_format.php | 58 + .../plugins/modifier.debug_print_var.php | 90 + .../libs/smarty/plugins/modifier.default.php | 32 + .../libs/smarty/plugins/modifier.escape.php | 93 + .../libs/smarty/plugins/modifier.indent.php | 28 + system/libs/smarty/plugins/modifier.lower.php | 26 + system/libs/smarty/plugins/modifier.money.php | 35 + system/libs/smarty/plugins/modifier.nl2br.php | 35 + .../smarty/plugins/modifier.regex_replace.php | 48 + .../libs/smarty/plugins/modifier.replace.php | 30 + .../libs/smarty/plugins/modifier.spacify.php | 30 + .../smarty/plugins/modifier.string_format.php | 29 + system/libs/smarty/plugins/modifier.strip.php | 33 + .../smarty/plugins/modifier.strip_tags.php | 32 + .../libs/smarty/plugins/modifier.truncate.php | 50 + system/libs/smarty/plugins/modifier.upper.php | 26 + .../libs/smarty/plugins/modifier.vertical.php | 38 + .../libs/smarty/plugins/modifier.wordwrap.php | 29 + .../plugins/outputfilter.trimwhitespace.php | 101 + .../plugins/shared.escape_special_chars.php | 31 + .../smarty/plugins/shared.make_timestamp.php | 46 + web/.htaccess | 18 + web/admin/support.php | 51 + web/ajax.php | 720 +++++ web/critical_error.html | 10 + web/error.php | 13 + web/history.php | 30 + web/hosting/crons.php | 42 + web/hosting/domainnames.php | 36 + web/hosting/hosting.php | 33 + web/hosting/informations.php | 24 + web/image/big-icon/computer.png | Bin 0 -> 11918 bytes web/image/big-icon/computer_128.png | Bin 0 -> 21326 bytes web/image/big-icon/configuration.png | Bin 0 -> 8295 bytes web/image/big-icon/cron.png | Bin 0 -> 9566 bytes web/image/big-icon/database.png | Bin 0 -> 3796 bytes web/image/big-icon/dns.png | Bin 0 -> 8047 bytes web/image/big-icon/domain_name.png | Bin 0 -> 8191 bytes web/image/big-icon/email.png | Bin 0 -> 3106 bytes web/image/big-icon/faq.png | Bin 0 -> 8064 bytes web/image/big-icon/ftp.png | Bin 0 -> 5639 bytes web/image/big-icon/information.png | Bin 0 -> 6260 bytes web/image/big-icon/installation.png | Bin 0 -> 6842 bytes web/image/big-icon/quota.png | Bin 0 -> 4112 bytes web/image/big-icon/stop.png | Bin 0 -> 7120 bytes web/image/flag/ad.png | Bin 0 -> 643 bytes web/image/flag/ae.png | Bin 0 -> 408 bytes web/image/flag/af.png | Bin 0 -> 604 bytes web/image/flag/ag.png | Bin 0 -> 591 bytes web/image/flag/ai.png | Bin 0 -> 643 bytes web/image/flag/al.png | Bin 0 -> 600 bytes web/image/flag/am.png | Bin 0 -> 497 bytes web/image/flag/an.png | Bin 0 -> 488 bytes web/image/flag/ao.png | Bin 0 -> 428 bytes web/image/flag/ar.png | Bin 0 -> 506 bytes web/image/flag/as.png | Bin 0 -> 647 bytes web/image/flag/at.png | Bin 0 -> 403 bytes web/image/flag/au.png | Bin 0 -> 673 bytes web/image/flag/aw.png | Bin 0 -> 524 bytes web/image/flag/ax.png | Bin 0 -> 663 bytes web/image/flag/az.png | Bin 0 -> 589 bytes web/image/flag/ba.png | Bin 0 -> 593 bytes web/image/flag/bb.png | Bin 0 -> 585 bytes web/image/flag/bd.png | Bin 0 -> 504 bytes web/image/flag/be.png | Bin 0 -> 449 bytes web/image/flag/bf.png | Bin 0 -> 497 bytes web/image/flag/bg.png | Bin 0 -> 462 bytes web/image/flag/bh.png | Bin 0 -> 457 bytes web/image/flag/bi.png | Bin 0 -> 675 bytes web/image/flag/bj.png | Bin 0 -> 486 bytes web/image/flag/bm.png | Bin 0 -> 611 bytes web/image/flag/bn.png | Bin 0 -> 639 bytes web/image/flag/bo.png | Bin 0 -> 500 bytes web/image/flag/br.png | Bin 0 -> 593 bytes web/image/flag/bs.png | Bin 0 -> 526 bytes web/image/flag/bt.png | Bin 0 -> 631 bytes web/image/flag/bv.png | Bin 0 -> 512 bytes web/image/flag/bw.png | Bin 0 -> 443 bytes web/image/flag/by.png | Bin 0 -> 514 bytes web/image/flag/bz.png | Bin 0 -> 600 bytes web/image/flag/ca.png | Bin 0 -> 628 bytes web/image/flag/catalonia.png | Bin 0 -> 398 bytes web/image/flag/cc.png | Bin 0 -> 625 bytes web/image/flag/cd.png | Bin 0 -> 528 bytes web/image/flag/cf.png | Bin 0 -> 614 bytes web/image/flag/cg.png | Bin 0 -> 521 bytes web/image/flag/ch.png | Bin 0 -> 367 bytes web/image/flag/ci.png | Bin 0 -> 453 bytes web/image/flag/ck.png | Bin 0 -> 586 bytes web/image/flag/cl.png | Bin 0 -> 450 bytes web/image/flag/cm.png | Bin 0 -> 525 bytes web/image/flag/cn.png | Bin 0 -> 472 bytes web/image/flag/co.png | Bin 0 -> 483 bytes web/image/flag/cr.png | Bin 0 -> 477 bytes web/image/flag/cs.png | Bin 0 -> 439 bytes web/image/flag/cu.png | Bin 0 -> 563 bytes web/image/flag/cv.png | Bin 0 -> 529 bytes web/image/flag/cx.png | Bin 0 -> 608 bytes web/image/flag/cy.png | Bin 0 -> 428 bytes web/image/flag/cz.png | Bin 0 -> 476 bytes web/image/flag/de.png | Bin 0 -> 545 bytes web/image/flag/dj.png | Bin 0 -> 572 bytes web/image/flag/dk.png | Bin 0 -> 495 bytes web/image/flag/dm.png | Bin 0 -> 620 bytes web/image/flag/do.png | Bin 0 -> 508 bytes web/image/flag/dz.png | Bin 0 -> 582 bytes web/image/flag/ec.png | Bin 0 -> 500 bytes web/image/flag/ee.png | Bin 0 -> 429 bytes web/image/flag/eg.png | Bin 0 -> 465 bytes web/image/flag/eh.png | Bin 0 -> 508 bytes web/image/flag/england.png | Bin 0 -> 496 bytes web/image/flag/er.png | Bin 0 -> 653 bytes web/image/flag/es.png | Bin 0 -> 469 bytes web/image/flag/et.png | Bin 0 -> 592 bytes web/image/flag/europeanunion.png | Bin 0 -> 479 bytes web/image/flag/fam.png | Bin 0 -> 532 bytes web/image/flag/fi.png | Bin 0 -> 489 bytes web/image/flag/fj.png | Bin 0 -> 610 bytes web/image/flag/fk.png | Bin 0 -> 648 bytes web/image/flag/fm.png | Bin 0 -> 552 bytes web/image/flag/fo.png | Bin 0 -> 474 bytes web/image/flag/fr.png | Bin 0 -> 545 bytes web/image/flag/ga.png | Bin 0 -> 489 bytes web/image/flag/gb.png | Bin 0 -> 599 bytes web/image/flag/gd.png | Bin 0 -> 637 bytes web/image/flag/ge.png | Bin 0 -> 594 bytes web/image/flag/gf.png | Bin 0 -> 545 bytes web/image/flag/gh.png | Bin 0 -> 490 bytes web/image/flag/gi.png | Bin 0 -> 463 bytes web/image/flag/gl.png | Bin 0 -> 470 bytes web/image/flag/gm.png | Bin 0 -> 493 bytes web/image/flag/gn.png | Bin 0 -> 480 bytes web/image/flag/gp.png | Bin 0 -> 488 bytes web/image/flag/gq.png | Bin 0 -> 537 bytes web/image/flag/gr.png | Bin 0 -> 487 bytes web/image/flag/gs.png | Bin 0 -> 630 bytes web/image/flag/gt.png | Bin 0 -> 493 bytes web/image/flag/gu.png | Bin 0 -> 509 bytes web/image/flag/gw.png | Bin 0 -> 516 bytes web/image/flag/gy.png | Bin 0 -> 645 bytes web/image/flag/hk.png | Bin 0 -> 527 bytes web/image/flag/hm.png | Bin 0 -> 673 bytes web/image/flag/hn.png | Bin 0 -> 537 bytes web/image/flag/hr.png | Bin 0 -> 524 bytes web/image/flag/ht.png | Bin 0 -> 487 bytes web/image/flag/hu.png | Bin 0 -> 432 bytes web/image/flag/id.png | Bin 0 -> 430 bytes web/image/flag/ie.png | Bin 0 -> 481 bytes web/image/flag/il.png | Bin 0 -> 431 bytes web/image/flag/in.png | Bin 0 -> 503 bytes web/image/flag/io.png | Bin 0 -> 658 bytes web/image/flag/iq.png | Bin 0 -> 515 bytes web/image/flag/ir.png | Bin 0 -> 512 bytes web/image/flag/is.png | Bin 0 -> 532 bytes web/image/flag/it.png | Bin 0 -> 420 bytes web/image/flag/jm.png | Bin 0 -> 637 bytes web/image/flag/jo.png | Bin 0 -> 473 bytes web/image/flag/jp.png | Bin 0 -> 420 bytes web/image/flag/ke.png | Bin 0 -> 569 bytes web/image/flag/kg.png | Bin 0 -> 510 bytes web/image/flag/kh.png | Bin 0 -> 549 bytes web/image/flag/ki.png | Bin 0 -> 656 bytes web/image/flag/km.png | Bin 0 -> 577 bytes web/image/flag/kn.png | Bin 0 -> 604 bytes web/image/flag/kp.png | Bin 0 -> 561 bytes web/image/flag/kr.png | Bin 0 -> 592 bytes web/image/flag/kw.png | Bin 0 -> 486 bytes web/image/flag/ky.png | Bin 0 -> 643 bytes web/image/flag/kz.png | Bin 0 -> 616 bytes web/image/flag/la.png | Bin 0 -> 563 bytes web/image/flag/lb.png | Bin 0 -> 517 bytes web/image/flag/lc.png | Bin 0 -> 520 bytes web/image/flag/li.png | Bin 0 -> 537 bytes web/image/flag/lk.png | Bin 0 -> 627 bytes web/image/flag/lr.png | Bin 0 -> 466 bytes web/image/flag/ls.png | Bin 0 -> 628 bytes web/image/flag/lt.png | Bin 0 -> 508 bytes web/image/flag/lu.png | Bin 0 -> 481 bytes web/image/flag/lv.png | Bin 0 -> 465 bytes web/image/flag/ly.png | Bin 0 -> 419 bytes web/image/flag/ma.png | Bin 0 -> 432 bytes web/image/flag/mc.png | Bin 0 -> 380 bytes web/image/flag/md.png | Bin 0 -> 566 bytes web/image/flag/me.png | Bin 0 -> 448 bytes web/image/flag/mg.png | Bin 0 -> 453 bytes web/image/flag/mh.png | Bin 0 -> 628 bytes web/image/flag/mk.png | Bin 0 -> 664 bytes web/image/flag/ml.png | Bin 0 -> 474 bytes web/image/flag/mm.png | Bin 0 -> 483 bytes web/image/flag/mn.png | Bin 0 -> 492 bytes web/image/flag/mo.png | Bin 0 -> 588 bytes web/image/flag/mp.png | Bin 0 -> 597 bytes web/image/flag/mq.png | Bin 0 -> 655 bytes web/image/flag/mr.png | Bin 0 -> 569 bytes web/image/flag/ms.png | Bin 0 -> 614 bytes web/image/flag/mt.png | Bin 0 -> 420 bytes web/image/flag/mu.png | Bin 0 -> 496 bytes web/image/flag/mv.png | Bin 0 -> 542 bytes web/image/flag/mw.png | Bin 0 -> 529 bytes web/image/flag/mx.png | Bin 0 -> 574 bytes web/image/flag/my.png | Bin 0 -> 571 bytes web/image/flag/mz.png | Bin 0 -> 584 bytes web/image/flag/na.png | Bin 0 -> 647 bytes web/image/flag/nc.png | Bin 0 -> 591 bytes web/image/flag/ne.png | Bin 0 -> 537 bytes web/image/flag/nf.png | Bin 0 -> 602 bytes web/image/flag/ng.png | Bin 0 -> 482 bytes web/image/flag/ni.png | Bin 0 -> 508 bytes web/image/flag/nl.png | Bin 0 -> 453 bytes web/image/flag/no.png | Bin 0 -> 512 bytes web/image/flag/np.png | Bin 0 -> 443 bytes web/image/flag/nr.png | Bin 0 -> 527 bytes web/image/flag/nu.png | Bin 0 -> 572 bytes web/image/flag/nz.png | Bin 0 -> 639 bytes web/image/flag/om.png | Bin 0 -> 478 bytes web/image/flag/pa.png | Bin 0 -> 519 bytes web/image/flag/pe.png | Bin 0 -> 397 bytes web/image/flag/pf.png | Bin 0 -> 498 bytes web/image/flag/pg.png | Bin 0 -> 593 bytes web/image/flag/ph.png | Bin 0 -> 538 bytes web/image/flag/pk.png | Bin 0 -> 569 bytes web/image/flag/pl.png | Bin 0 -> 374 bytes web/image/flag/pm.png | Bin 0 -> 689 bytes web/image/flag/pn.png | Bin 0 -> 657 bytes web/image/flag/pr.png | Bin 0 -> 556 bytes web/image/flag/ps.png | Bin 0 -> 472 bytes web/image/flag/pt.png | Bin 0 -> 554 bytes web/image/flag/pw.png | Bin 0 -> 550 bytes web/image/flag/py.png | Bin 0 -> 473 bytes web/image/flag/qa.png | Bin 0 -> 450 bytes web/image/flag/re.png | Bin 0 -> 545 bytes web/image/flag/ro.png | Bin 0 -> 495 bytes web/image/flag/rs.png | Bin 0 -> 423 bytes web/image/flag/ru.png | Bin 0 -> 420 bytes web/image/flag/rw.png | Bin 0 -> 533 bytes web/image/flag/sa.png | Bin 0 -> 551 bytes web/image/flag/sb.png | Bin 0 -> 624 bytes web/image/flag/sc.png | Bin 0 -> 608 bytes web/image/flag/scotland.png | Bin 0 -> 649 bytes web/image/flag/sd.png | Bin 0 -> 492 bytes web/image/flag/se.png | Bin 0 -> 542 bytes web/image/flag/sg.png | Bin 0 -> 468 bytes web/image/flag/sh.png | Bin 0 -> 645 bytes web/image/flag/si.png | Bin 0 -> 510 bytes web/image/flag/sj.png | Bin 0 -> 512 bytes web/image/flag/sk.png | Bin 0 -> 562 bytes web/image/flag/sl.png | Bin 0 -> 436 bytes web/image/flag/sm.png | Bin 0 -> 502 bytes web/image/flag/sn.png | Bin 0 -> 532 bytes web/image/flag/so.png | Bin 0 -> 527 bytes web/image/flag/sr.png | Bin 0 -> 513 bytes web/image/flag/st.png | Bin 0 -> 584 bytes web/image/flag/sv.png | Bin 0 -> 501 bytes web/image/flag/sy.png | Bin 0 -> 422 bytes web/image/flag/sz.png | Bin 0 -> 643 bytes web/image/flag/tc.png | Bin 0 -> 624 bytes web/image/flag/td.png | Bin 0 -> 570 bytes web/image/flag/tf.png | Bin 0 -> 527 bytes web/image/flag/tg.png | Bin 0 -> 562 bytes web/image/flag/th.png | Bin 0 -> 452 bytes web/image/flag/tj.png | Bin 0 -> 496 bytes web/image/flag/tk.png | Bin 0 -> 638 bytes web/image/flag/tl.png | Bin 0 -> 514 bytes web/image/flag/tm.png | Bin 0 -> 593 bytes web/image/flag/tn.png | Bin 0 -> 495 bytes web/image/flag/to.png | Bin 0 -> 426 bytes web/image/flag/tr.png | Bin 0 -> 492 bytes web/image/flag/tt.png | Bin 0 -> 617 bytes web/image/flag/tv.png | Bin 0 -> 536 bytes web/image/flag/tw.png | Bin 0 -> 465 bytes web/image/flag/tz.png | Bin 0 -> 642 bytes web/image/flag/ua.png | Bin 0 -> 446 bytes web/image/flag/ug.png | Bin 0 -> 531 bytes web/image/flag/um.png | Bin 0 -> 571 bytes web/image/flag/us.png | Bin 0 -> 609 bytes web/image/flag/uy.png | Bin 0 -> 532 bytes web/image/flag/uz.png | Bin 0 -> 515 bytes web/image/flag/va.png | Bin 0 -> 553 bytes web/image/flag/vc.png | Bin 0 -> 577 bytes web/image/flag/ve.png | Bin 0 -> 528 bytes web/image/flag/vg.png | Bin 0 -> 630 bytes web/image/flag/vi.png | Bin 0 -> 616 bytes web/image/flag/vn.png | Bin 0 -> 474 bytes web/image/flag/vu.png | Bin 0 -> 604 bytes web/image/flag/wales.png | Bin 0 -> 652 bytes web/image/flag/wf.png | Bin 0 -> 554 bytes web/image/flag/ws.png | Bin 0 -> 476 bytes web/image/flag/ye.png | Bin 0 -> 413 bytes web/image/flag/yt.png | Bin 0 -> 593 bytes web/image/flag/za.png | Bin 0 -> 642 bytes web/image/flag/zm.png | Bin 0 -> 500 bytes web/image/flag/zw.png | Bin 0 -> 574 bytes web/image/gritter-bg-tile.png | Bin 0 -> 171 bytes web/image/gritter-bottom.png | Bin 0 -> 473 bytes web/image/gritter-close-ie6.gif | Bin 0 -> 718 bytes web/image/gritter-close.png | Bin 0 -> 1910 bytes web/image/gritter-top.png | Bin 0 -> 522 bytes web/image/icon/accept.png | Bin 0 -> 781 bytes web/image/icon/add.png | Bin 0 -> 733 bytes web/image/icon/anchor.png | Bin 0 -> 523 bytes web/image/icon/application.png | Bin 0 -> 464 bytes web/image/icon/application_add.png | Bin 0 -> 619 bytes web/image/icon/application_cascade.png | Bin 0 -> 524 bytes web/image/icon/application_delete.png | Bin 0 -> 610 bytes web/image/icon/application_double.png | Bin 0 -> 533 bytes web/image/icon/application_edit.png | Bin 0 -> 703 bytes web/image/icon/application_error.png | Bin 0 -> 656 bytes web/image/icon/application_form.png | Bin 0 -> 467 bytes web/image/icon/application_form_add.png | Bin 0 -> 592 bytes web/image/icon/application_form_delete.png | Bin 0 -> 605 bytes web/image/icon/application_form_edit.png | Bin 0 -> 714 bytes web/image/icon/application_form_magnify.png | Bin 0 -> 612 bytes web/image/icon/application_get.png | Bin 0 -> 581 bytes web/image/icon/application_go.png | Bin 0 -> 634 bytes web/image/icon/application_home.png | Bin 0 -> 685 bytes web/image/icon/application_key.png | Bin 0 -> 670 bytes web/image/icon/application_lightning.png | Bin 0 -> 656 bytes web/image/icon/application_link.png | Bin 0 -> 701 bytes web/image/icon/application_osx.png | Bin 0 -> 487 bytes web/image/icon/application_osx_terminal.png | Bin 0 -> 525 bytes web/image/icon/application_put.png | Bin 0 -> 585 bytes web/image/icon/application_side_boxes.png | Bin 0 -> 478 bytes web/image/icon/application_side_contract.png | Bin 0 -> 547 bytes web/image/icon/application_side_expand.png | Bin 0 -> 581 bytes web/image/icon/application_side_list.png | Bin 0 -> 510 bytes web/image/icon/application_side_tree.png | Bin 0 -> 483 bytes web/image/icon/application_split.png | Bin 0 -> 520 bytes .../icon/application_tile_horizontal.png | Bin 0 -> 432 bytes web/image/icon/application_tile_vertical.png | Bin 0 -> 492 bytes web/image/icon/application_view_columns.png | Bin 0 -> 493 bytes web/image/icon/application_view_detail.png | Bin 0 -> 576 bytes web/image/icon/application_view_gallery.png | Bin 0 -> 555 bytes web/image/icon/application_view_icons.png | Bin 0 -> 476 bytes web/image/icon/application_view_list.png | Bin 0 -> 473 bytes web/image/icon/application_view_tile.png | Bin 0 -> 465 bytes web/image/icon/application_xp.png | Bin 0 -> 426 bytes web/image/icon/application_xp_terminal.png | Bin 0 -> 507 bytes web/image/icon/arrow_branch.png | Bin 0 -> 582 bytes web/image/icon/arrow_divide.png | Bin 0 -> 677 bytes web/image/icon/arrow_down.png | Bin 0 -> 379 bytes web/image/icon/arrow_in.png | Bin 0 -> 600 bytes web/image/icon/arrow_inout.png | Bin 0 -> 551 bytes web/image/icon/arrow_join.png | Bin 0 -> 626 bytes web/image/icon/arrow_left.png | Bin 0 -> 345 bytes web/image/icon/arrow_merge.png | Bin 0 -> 484 bytes web/image/icon/arrow_out.png | Bin 0 -> 594 bytes web/image/icon/arrow_redo.png | Bin 0 -> 625 bytes web/image/icon/arrow_refresh.png | Bin 0 -> 685 bytes web/image/icon/arrow_refresh_small.png | Bin 0 -> 506 bytes web/image/icon/arrow_right.png | Bin 0 -> 349 bytes web/image/icon/arrow_rotate_anticlockwise.png | Bin 0 -> 608 bytes web/image/icon/arrow_rotate_clockwise.png | Bin 0 -> 602 bytes web/image/icon/arrow_switch.png | Bin 0 -> 683 bytes web/image/icon/arrow_turn_left.png | Bin 0 -> 516 bytes web/image/icon/arrow_turn_right.png | Bin 0 -> 489 bytes web/image/icon/arrow_undo.png | Bin 0 -> 631 bytes web/image/icon/arrow_up.png | Bin 0 -> 372 bytes web/image/icon/asterisk_orange.png | Bin 0 -> 760 bytes web/image/icon/asterisk_yellow.png | Bin 0 -> 743 bytes web/image/icon/attach.png | Bin 0 -> 391 bytes web/image/icon/award_star_add.png | Bin 0 -> 853 bytes web/image/icon/award_star_bronze_1.png | Bin 0 -> 733 bytes web/image/icon/award_star_bronze_2.png | Bin 0 -> 755 bytes web/image/icon/award_star_bronze_3.png | Bin 0 -> 754 bytes web/image/icon/award_star_delete.png | Bin 0 -> 849 bytes web/image/icon/award_star_gold_1.png | Bin 0 -> 753 bytes web/image/icon/award_star_gold_2.png | Bin 0 -> 770 bytes web/image/icon/award_star_gold_3.png | Bin 0 -> 781 bytes web/image/icon/award_star_silver_1.png | Bin 0 -> 714 bytes web/image/icon/award_star_silver_2.png | Bin 0 -> 734 bytes web/image/icon/award_star_silver_3.png | Bin 0 -> 738 bytes web/image/icon/basket.png | Bin 0 -> 669 bytes web/image/icon/basket_add.png | Bin 0 -> 752 bytes web/image/icon/basket_delete.png | Bin 0 -> 773 bytes web/image/icon/basket_edit.png | Bin 0 -> 811 bytes web/image/icon/basket_error.png | Bin 0 -> 794 bytes web/image/icon/basket_go.png | Bin 0 -> 777 bytes web/image/icon/basket_put.png | Bin 0 -> 733 bytes web/image/icon/basket_remove.png | Bin 0 -> 738 bytes web/image/icon/bell.png | Bin 0 -> 789 bytes web/image/icon/bell_add.png | Bin 0 -> 816 bytes web/image/icon/bell_delete.png | Bin 0 -> 824 bytes web/image/icon/bell_error.png | Bin 0 -> 813 bytes web/image/icon/bell_go.png | Bin 0 -> 836 bytes web/image/icon/bell_link.png | Bin 0 -> 850 bytes web/image/icon/bin.png | Bin 0 -> 476 bytes web/image/icon/bin_closed.png | Bin 0 -> 363 bytes web/image/icon/bin_empty.png | Bin 0 -> 475 bytes web/image/icon/bomb.png | Bin 0 -> 793 bytes web/image/icon/book.png | Bin 0 -> 593 bytes web/image/icon/book_add.png | Bin 0 -> 714 bytes web/image/icon/book_addresses.png | Bin 0 -> 770 bytes web/image/icon/book_delete.png | Bin 0 -> 719 bytes web/image/icon/book_edit.png | Bin 0 -> 813 bytes web/image/icon/book_error.png | Bin 0 -> 734 bytes web/image/icon/book_go.png | Bin 0 -> 745 bytes web/image/icon/book_key.png | Bin 0 -> 779 bytes web/image/icon/book_link.png | Bin 0 -> 789 bytes web/image/icon/book_next.png | Bin 0 -> 702 bytes web/image/icon/book_open.png | Bin 0 -> 622 bytes web/image/icon/book_previous.png | Bin 0 -> 680 bytes web/image/icon/box.png | Bin 0 -> 555 bytes web/image/icon/brick.png | Bin 0 -> 452 bytes web/image/icon/brick_add.png | Bin 0 -> 729 bytes web/image/icon/brick_delete.png | Bin 0 -> 745 bytes web/image/icon/brick_edit.png | Bin 0 -> 775 bytes web/image/icon/brick_error.png | Bin 0 -> 798 bytes web/image/icon/brick_go.png | Bin 0 -> 790 bytes web/image/icon/brick_link.png | Bin 0 -> 764 bytes web/image/icon/bricks.png | Bin 0 -> 825 bytes web/image/icon/briefcase.png | Bin 0 -> 793 bytes web/image/icon/bug.png | Bin 0 -> 774 bytes web/image/icon/bug_add.png | Bin 0 -> 806 bytes web/image/icon/bug_delete.png | Bin 0 -> 836 bytes web/image/icon/bug_edit.png | Bin 0 -> 873 bytes web/image/icon/bug_error.png | Bin 0 -> 841 bytes web/image/icon/bug_go.png | Bin 0 -> 831 bytes web/image/icon/bug_link.png | Bin 0 -> 847 bytes web/image/icon/building.png | Bin 0 -> 556 bytes web/image/icon/building_add.png | Bin 0 -> 631 bytes web/image/icon/building_delete.png | Bin 0 -> 633 bytes web/image/icon/building_edit.png | Bin 0 -> 731 bytes web/image/icon/building_error.png | Bin 0 -> 653 bytes web/image/icon/building_go.png | Bin 0 -> 665 bytes web/image/icon/building_key.png | Bin 0 -> 705 bytes web/image/icon/building_link.png | Bin 0 -> 668 bytes web/image/icon/bullet_add.png | Bin 0 -> 286 bytes web/image/icon/bullet_arrow_bottom.png | Bin 0 -> 229 bytes web/image/icon/bullet_arrow_down.png | Bin 0 -> 201 bytes web/image/icon/bullet_arrow_top.png | Bin 0 -> 230 bytes web/image/icon/bullet_arrow_up.png | Bin 0 -> 201 bytes web/image/icon/bullet_black.png | Bin 0 -> 211 bytes web/image/icon/bullet_blue.png | Bin 0 -> 289 bytes web/image/icon/bullet_delete.png | Bin 0 -> 308 bytes web/image/icon/bullet_disk.png | Bin 0 -> 483 bytes web/image/icon/bullet_error.png | Bin 0 -> 454 bytes web/image/icon/bullet_feed.png | Bin 0 -> 262 bytes web/image/icon/bullet_go.png | Bin 0 -> 410 bytes web/image/icon/bullet_green.png | Bin 0 -> 295 bytes web/image/icon/bullet_key.png | Bin 0 -> 436 bytes web/image/icon/bullet_orange.png | Bin 0 -> 283 bytes web/image/icon/bullet_picture.png | Bin 0 -> 470 bytes web/image/icon/bullet_pink.png | Bin 0 -> 286 bytes web/image/icon/bullet_purple.png | Bin 0 -> 294 bytes web/image/icon/bullet_red.png | Bin 0 -> 287 bytes web/image/icon/bullet_star.png | Bin 0 -> 331 bytes web/image/icon/bullet_toggle_minus.png | Bin 0 -> 207 bytes web/image/icon/bullet_toggle_plus.png | Bin 0 -> 209 bytes web/image/icon/bullet_white.png | Bin 0 -> 201 bytes web/image/icon/bullet_wrench.png | Bin 0 -> 448 bytes web/image/icon/bullet_yellow.png | Bin 0 -> 287 bytes web/image/icon/cake.png | Bin 0 -> 676 bytes web/image/icon/calculator.png | Bin 0 -> 543 bytes web/image/icon/calculator_add.png | Bin 0 -> 660 bytes web/image/icon/calculator_delete.png | Bin 0 -> 692 bytes web/image/icon/calculator_edit.png | Bin 0 -> 767 bytes web/image/icon/calculator_error.png | Bin 0 -> 731 bytes web/image/icon/calculator_link.png | Bin 0 -> 723 bytes web/image/icon/calendar.png | Bin 0 -> 675 bytes web/image/icon/calendar_add.png | Bin 0 -> 723 bytes web/image/icon/calendar_delete.png | Bin 0 -> 742 bytes web/image/icon/calendar_edit.png | Bin 0 -> 777 bytes web/image/icon/calendar_link.png | Bin 0 -> 795 bytes web/image/icon/calendar_view_day.png | Bin 0 -> 572 bytes web/image/icon/calendar_view_month.png | Bin 0 -> 595 bytes web/image/icon/calendar_view_week.png | Bin 0 -> 480 bytes web/image/icon/camera.png | Bin 0 -> 665 bytes web/image/icon/camera_add.png | Bin 0 -> 800 bytes web/image/icon/camera_delete.png | Bin 0 -> 797 bytes web/image/icon/camera_edit.png | Bin 0 -> 872 bytes web/image/icon/camera_error.png | Bin 0 -> 835 bytes web/image/icon/camera_go.png | Bin 0 -> 809 bytes web/image/icon/camera_link.png | Bin 0 -> 839 bytes web/image/icon/camera_small.png | Bin 0 -> 489 bytes web/image/icon/cancel.png | Bin 0 -> 587 bytes web/image/icon/car.png | Bin 0 -> 610 bytes web/image/icon/car_add.png | Bin 0 -> 677 bytes web/image/icon/car_delete.png | Bin 0 -> 689 bytes web/image/icon/cart.png | Bin 0 -> 421 bytes web/image/icon/cart_add.png | Bin 0 -> 711 bytes web/image/icon/cart_delete.png | Bin 0 -> 742 bytes web/image/icon/cart_edit.png | Bin 0 -> 789 bytes web/image/icon/cart_error.png | Bin 0 -> 790 bytes web/image/icon/cart_go.png | Bin 0 -> 763 bytes web/image/icon/cart_put.png | Bin 0 -> 763 bytes web/image/icon/cart_remove.png | Bin 0 -> 769 bytes web/image/icon/cd.png | Bin 0 -> 673 bytes web/image/icon/cd_add.png | Bin 0 -> 758 bytes web/image/icon/cd_burn.png | Bin 0 -> 756 bytes web/image/icon/cd_delete.png | Bin 0 -> 767 bytes web/image/icon/cd_edit.png | Bin 0 -> 790 bytes web/image/icon/cd_eject.png | Bin 0 -> 786 bytes web/image/icon/cd_go.png | Bin 0 -> 793 bytes web/image/icon/chart_bar.png | Bin 0 -> 541 bytes web/image/icon/chart_bar_add.png | Bin 0 -> 626 bytes web/image/icon/chart_bar_delete.png | Bin 0 -> 636 bytes web/image/icon/chart_bar_edit.png | Bin 0 -> 754 bytes web/image/icon/chart_bar_error.png | Bin 0 -> 671 bytes web/image/icon/chart_bar_link.png | Bin 0 -> 712 bytes web/image/icon/chart_curve.png | Bin 0 -> 710 bytes web/image/icon/chart_curve_add.png | Bin 0 -> 761 bytes web/image/icon/chart_curve_delete.png | Bin 0 -> 782 bytes web/image/icon/chart_curve_edit.png | Bin 0 -> 822 bytes web/image/icon/chart_curve_error.png | Bin 0 -> 837 bytes web/image/icon/chart_curve_go.png | Bin 0 -> 823 bytes web/image/icon/chart_curve_link.png | Bin 0 -> 829 bytes web/image/icon/chart_line.png | Bin 0 -> 526 bytes web/image/icon/chart_line_add.png | Bin 0 -> 655 bytes web/image/icon/chart_line_delete.png | Bin 0 -> 675 bytes web/image/icon/chart_line_edit.png | Bin 0 -> 718 bytes web/image/icon/chart_line_error.png | Bin 0 -> 741 bytes web/image/icon/chart_line_link.png | Bin 0 -> 749 bytes web/image/icon/chart_organisation.png | Bin 0 -> 444 bytes web/image/icon/chart_organisation_add.png | Bin 0 -> 551 bytes web/image/icon/chart_organisation_delete.png | Bin 0 -> 563 bytes web/image/icon/chart_pie.png | Bin 0 -> 918 bytes web/image/icon/chart_pie_add.png | Bin 0 -> 975 bytes web/image/icon/chart_pie_delete.png | Bin 0 -> 983 bytes web/image/icon/chart_pie_edit.png | Bin 0 -> 986 bytes web/image/icon/chart_pie_error.png | Bin 0 -> 989 bytes web/image/icon/chart_pie_link.png | Bin 0 -> 1021 bytes web/image/icon/clock.png | Bin 0 -> 882 bytes web/image/icon/clock_add.png | Bin 0 -> 925 bytes web/image/icon/clock_delete.png | Bin 0 -> 952 bytes web/image/icon/clock_edit.png | Bin 0 -> 967 bytes web/image/icon/clock_error.png | Bin 0 -> 953 bytes web/image/icon/clock_go.png | Bin 0 -> 959 bytes web/image/icon/clock_link.png | Bin 0 -> 961 bytes web/image/icon/clock_pause.png | Bin 0 -> 927 bytes web/image/icon/clock_play.png | Bin 0 -> 943 bytes web/image/icon/clock_red.png | Bin 0 -> 889 bytes web/image/icon/clock_stop.png | Bin 0 -> 922 bytes web/image/icon/cog.png | Bin 0 -> 512 bytes web/image/icon/cog_add.png | Bin 0 -> 814 bytes web/image/icon/cog_delete.png | Bin 0 -> 847 bytes web/image/icon/cog_edit.png | Bin 0 -> 865 bytes web/image/icon/cog_error.png | Bin 0 -> 869 bytes web/image/icon/cog_go.png | Bin 0 -> 859 bytes web/image/icon/coins.png | Bin 0 -> 732 bytes web/image/icon/coins_add.png | Bin 0 -> 789 bytes web/image/icon/coins_delete.png | Bin 0 -> 775 bytes web/image/icon/color_swatch.png | Bin 0 -> 209 bytes web/image/icon/color_wheel.png | Bin 0 -> 892 bytes web/image/icon/comment.png | Bin 0 -> 413 bytes web/image/icon/comment_add.png | Bin 0 -> 530 bytes web/image/icon/comment_delete.png | Bin 0 -> 548 bytes web/image/icon/comment_edit.png | Bin 0 -> 644 bytes web/image/icon/comments.png | Bin 0 -> 557 bytes web/image/icon/comments_add.png | Bin 0 -> 648 bytes web/image/icon/comments_delete.png | Bin 0 -> 670 bytes web/image/icon/compress.png | Bin 0 -> 766 bytes web/image/icon/computer.png | Bin 0 -> 667 bytes web/image/icon/computer_add.png | Bin 0 -> 781 bytes web/image/icon/computer_delete.png | Bin 0 -> 775 bytes web/image/icon/computer_edit.png | Bin 0 -> 792 bytes web/image/icon/computer_error.png | Bin 0 -> 784 bytes web/image/icon/computer_go.png | Bin 0 -> 777 bytes web/image/icon/computer_key.png | Bin 0 -> 771 bytes web/image/icon/computer_link.png | Bin 0 -> 792 bytes web/image/icon/connect.png | Bin 0 -> 748 bytes web/image/icon/contrast.png | Bin 0 -> 434 bytes web/image/icon/contrast_decrease.png | Bin 0 -> 695 bytes web/image/icon/contrast_high.png | Bin 0 -> 435 bytes web/image/icon/contrast_increase.png | Bin 0 -> 717 bytes web/image/icon/contrast_low.png | Bin 0 -> 421 bytes web/image/icon/control_eject.png | Bin 0 -> 603 bytes web/image/icon/control_eject_blue.png | Bin 0 -> 727 bytes web/image/icon/control_end.png | Bin 0 -> 621 bytes web/image/icon/control_end_blue.png | Bin 0 -> 737 bytes web/image/icon/control_equalizer.png | Bin 0 -> 432 bytes web/image/icon/control_equalizer_blue.png | Bin 0 -> 764 bytes web/image/icon/control_fastforward.png | Bin 0 -> 607 bytes web/image/icon/control_fastforward_blue.png | Bin 0 -> 736 bytes web/image/icon/control_pause.png | Bin 0 -> 598 bytes web/image/icon/control_pause_blue.png | Bin 0 -> 721 bytes web/image/icon/control_play.png | Bin 0 -> 592 bytes web/image/icon/control_play_blue.png | Bin 0 -> 717 bytes web/image/icon/control_repeat.png | Bin 0 -> 422 bytes web/image/icon/control_repeat_blue.png | Bin 0 -> 750 bytes web/image/icon/control_rewind.png | Bin 0 -> 614 bytes web/image/icon/control_rewind_blue.png | Bin 0 -> 745 bytes web/image/icon/control_start.png | Bin 0 -> 604 bytes web/image/icon/control_start_blue.png | Bin 0 -> 720 bytes web/image/icon/control_stop.png | Bin 0 -> 403 bytes web/image/icon/control_stop_blue.png | Bin 0 -> 695 bytes web/image/icon/controller.png | Bin 0 -> 666 bytes web/image/icon/controller_add.png | Bin 0 -> 759 bytes web/image/icon/controller_delete.png | Bin 0 -> 770 bytes web/image/icon/controller_error.png | Bin 0 -> 815 bytes web/image/icon/creditcards.png | Bin 0 -> 693 bytes web/image/icon/cross.png | Bin 0 -> 655 bytes web/image/icon/css.png | Bin 0 -> 524 bytes web/image/icon/css_add.png | Bin 0 -> 666 bytes web/image/icon/css_delete.png | Bin 0 -> 654 bytes web/image/icon/css_go.png | Bin 0 -> 655 bytes web/image/icon/css_valid.png | Bin 0 -> 661 bytes web/image/icon/cup.png | Bin 0 -> 633 bytes web/image/icon/cup_add.png | Bin 0 -> 715 bytes web/image/icon/cup_delete.png | Bin 0 -> 731 bytes web/image/icon/cup_edit.png | Bin 0 -> 778 bytes web/image/icon/cup_error.png | Bin 0 -> 790 bytes web/image/icon/cup_go.png | Bin 0 -> 780 bytes web/image/icon/cup_key.png | Bin 0 -> 776 bytes web/image/icon/cup_link.png | Bin 0 -> 760 bytes web/image/icon/cursor.png | Bin 0 -> 354 bytes web/image/icon/cut.png | Bin 0 -> 648 bytes web/image/icon/cut_red.png | Bin 0 -> 650 bytes web/image/icon/database.png | Bin 0 -> 390 bytes web/image/icon/database_add.png | Bin 0 -> 658 bytes web/image/icon/database_connect.png | Bin 0 -> 763 bytes web/image/icon/database_delete.png | Bin 0 -> 659 bytes web/image/icon/database_edit.png | Bin 0 -> 767 bytes web/image/icon/database_error.png | Bin 0 -> 682 bytes web/image/icon/database_gear.png | Bin 0 -> 468 bytes web/image/icon/database_go.png | Bin 0 -> 698 bytes web/image/icon/database_key.png | Bin 0 -> 764 bytes web/image/icon/database_lightning.png | Bin 0 -> 775 bytes web/image/icon/database_link.png | Bin 0 -> 679 bytes web/image/icon/database_refresh.png | Bin 0 -> 770 bytes web/image/icon/database_save.png | Bin 0 -> 755 bytes web/image/icon/database_table.png | Bin 0 -> 726 bytes web/image/icon/date.png | Bin 0 -> 626 bytes web/image/icon/date_add.png | Bin 0 -> 703 bytes web/image/icon/date_delete.png | Bin 0 -> 716 bytes web/image/icon/date_edit.png | Bin 0 -> 799 bytes web/image/icon/date_error.png | Bin 0 -> 753 bytes web/image/icon/date_go.png | Bin 0 -> 753 bytes web/image/icon/date_link.png | Bin 0 -> 764 bytes web/image/icon/date_magnify.png | Bin 0 -> 711 bytes web/image/icon/date_next.png | Bin 0 -> 688 bytes web/image/icon/date_previous.png | Bin 0 -> 720 bytes web/image/icon/delete.png | Bin 0 -> 715 bytes web/image/icon/disconnect.png | Bin 0 -> 796 bytes web/image/icon/disk.png | Bin 0 -> 620 bytes web/image/icon/disk_multiple.png | Bin 0 -> 691 bytes web/image/icon/door.png | Bin 0 -> 412 bytes web/image/icon/door_in.png | Bin 0 -> 693 bytes web/image/icon/door_open.png | Bin 0 -> 508 bytes web/image/icon/door_out.png | Bin 0 -> 688 bytes web/image/icon/drink.png | Bin 0 -> 692 bytes web/image/icon/drink_empty.png | Bin 0 -> 433 bytes web/image/icon/drive.png | Bin 0 -> 346 bytes web/image/icon/drive_add.png | Bin 0 -> 623 bytes web/image/icon/drive_burn.png | Bin 0 -> 608 bytes web/image/icon/drive_cd.png | Bin 0 -> 734 bytes web/image/icon/drive_cd_empty.png | Bin 0 -> 341 bytes web/image/icon/drive_delete.png | Bin 0 -> 628 bytes web/image/icon/drive_disk.png | Bin 0 -> 695 bytes web/image/icon/drive_edit.png | Bin 0 -> 714 bytes web/image/icon/drive_error.png | Bin 0 -> 705 bytes web/image/icon/drive_go.png | Bin 0 -> 661 bytes web/image/icon/drive_key.png | Bin 0 -> 681 bytes web/image/icon/drive_link.png | Bin 0 -> 679 bytes web/image/icon/drive_magnify.png | Bin 0 -> 641 bytes web/image/icon/drive_network.png | Bin 0 -> 585 bytes web/image/icon/drive_rename.png | Bin 0 -> 494 bytes web/image/icon/drive_user.png | Bin 0 -> 712 bytes web/image/icon/drive_web.png | Bin 0 -> 686 bytes web/image/icon/dvd.png | Bin 0 -> 764 bytes web/image/icon/dvd_add.png | Bin 0 -> 788 bytes web/image/icon/dvd_delete.png | Bin 0 -> 800 bytes web/image/icon/dvd_edit.png | Bin 0 -> 844 bytes web/image/icon/dvd_error.png | Bin 0 -> 854 bytes web/image/icon/dvd_go.png | Bin 0 -> 854 bytes web/image/icon/dvd_key.png | Bin 0 -> 816 bytes web/image/icon/dvd_link.png | Bin 0 -> 819 bytes web/image/icon/email.png | Bin 0 -> 641 bytes web/image/icon/email_add.png | Bin 0 -> 761 bytes web/image/icon/email_attach.png | Bin 0 -> 793 bytes web/image/icon/email_delete.png | Bin 0 -> 756 bytes web/image/icon/email_edit.png | Bin 0 -> 756 bytes web/image/icon/email_error.png | Bin 0 -> 792 bytes web/image/icon/email_go.png | Bin 0 -> 754 bytes web/image/icon/email_link.png | Bin 0 -> 821 bytes web/image/icon/email_open.png | Bin 0 -> 783 bytes web/image/icon/email_open_image.png | Bin 0 -> 811 bytes web/image/icon/emoticon_evilgrin.png | Bin 0 -> 727 bytes web/image/icon/emoticon_grin.png | Bin 0 -> 714 bytes web/image/icon/emoticon_happy.png | Bin 0 -> 731 bytes web/image/icon/emoticon_smile.png | Bin 0 -> 725 bytes web/image/icon/emoticon_surprised.png | Bin 0 -> 741 bytes web/image/icon/emoticon_tongue.png | Bin 0 -> 727 bytes web/image/icon/emoticon_unhappy.png | Bin 0 -> 723 bytes web/image/icon/emoticon_waii.png | Bin 0 -> 737 bytes web/image/icon/emoticon_wink.png | Bin 0 -> 712 bytes web/image/icon/error.png | Bin 0 -> 666 bytes web/image/icon/error_add.png | Bin 0 -> 710 bytes web/image/icon/error_delete.png | Bin 0 -> 729 bytes web/image/icon/error_go.png | Bin 0 -> 734 bytes web/image/icon/exclamation.png | Bin 0 -> 701 bytes web/image/icon/eye.png | Bin 0 -> 750 bytes web/image/icon/feed.png | Bin 0 -> 691 bytes web/image/icon/feed_add.png | Bin 0 -> 763 bytes web/image/icon/feed_delete.png | Bin 0 -> 746 bytes web/image/icon/feed_disk.png | Bin 0 -> 738 bytes web/image/icon/feed_edit.png | Bin 0 -> 801 bytes web/image/icon/feed_error.png | Bin 0 -> 770 bytes web/image/icon/feed_go.png | Bin 0 -> 761 bytes web/image/icon/feed_key.png | Bin 0 -> 771 bytes web/image/icon/feed_link.png | Bin 0 -> 806 bytes web/image/icon/feed_magnify.png | Bin 0 -> 737 bytes web/image/icon/female.png | Bin 0 -> 590 bytes web/image/icon/film.png | Bin 0 -> 653 bytes web/image/icon/film_add.png | Bin 0 -> 739 bytes web/image/icon/film_delete.png | Bin 0 -> 730 bytes web/image/icon/film_edit.png | Bin 0 -> 855 bytes web/image/icon/film_error.png | Bin 0 -> 800 bytes web/image/icon/film_go.png | Bin 0 -> 813 bytes web/image/icon/film_key.png | Bin 0 -> 835 bytes web/image/icon/film_link.png | Bin 0 -> 830 bytes web/image/icon/film_save.png | Bin 0 -> 806 bytes web/image/icon/find.png | Bin 0 -> 659 bytes web/image/icon/flag_blue.png | Bin 0 -> 671 bytes web/image/icon/flag_green.png | Bin 0 -> 672 bytes web/image/icon/flag_orange.png | Bin 0 -> 669 bytes web/image/icon/flag_pink.png | Bin 0 -> 651 bytes web/image/icon/flag_purple.png | Bin 0 -> 656 bytes web/image/icon/flag_red.png | Bin 0 -> 665 bytes web/image/icon/flag_yellow.png | Bin 0 -> 671 bytes web/image/icon/folder.png | Bin 0 -> 537 bytes web/image/icon/folder_add.png | Bin 0 -> 668 bytes web/image/icon/folder_bell.png | Bin 0 -> 781 bytes web/image/icon/folder_brick.png | Bin 0 -> 735 bytes web/image/icon/folder_bug.png | Bin 0 -> 829 bytes web/image/icon/folder_camera.png | Bin 0 -> 729 bytes web/image/icon/folder_database.png | Bin 0 -> 687 bytes web/image/icon/folder_delete.png | Bin 0 -> 666 bytes web/image/icon/folder_edit.png | Bin 0 -> 733 bytes web/image/icon/folder_error.png | Bin 0 -> 727 bytes web/image/icon/folder_explore.png | Bin 0 -> 679 bytes web/image/icon/folder_feed.png | Bin 0 -> 691 bytes web/image/icon/folder_find.png | Bin 0 -> 795 bytes web/image/icon/folder_go.png | Bin 0 -> 694 bytes web/image/icon/folder_heart.png | Bin 0 -> 741 bytes web/image/icon/folder_image.png | Bin 0 -> 677 bytes web/image/icon/folder_key.png | Bin 0 -> 720 bytes web/image/icon/folder_lightbulb.png | Bin 0 -> 741 bytes web/image/icon/folder_link.png | Bin 0 -> 785 bytes web/image/icon/folder_magnify.png | Bin 0 -> 686 bytes web/image/icon/folder_page.png | Bin 0 -> 688 bytes web/image/icon/folder_page_white.png | Bin 0 -> 639 bytes web/image/icon/folder_palette.png | Bin 0 -> 822 bytes web/image/icon/folder_picture.png | Bin 0 -> 713 bytes web/image/icon/folder_star.png | Bin 0 -> 755 bytes web/image/icon/folder_table.png | Bin 0 -> 675 bytes web/image/icon/folder_user.png | Bin 0 -> 730 bytes web/image/icon/folder_wrench.png | Bin 0 -> 740 bytes web/image/icon/font.png | Bin 0 -> 567 bytes web/image/icon/font_add.png | Bin 0 -> 634 bytes web/image/icon/font_delete.png | Bin 0 -> 661 bytes web/image/icon/font_go.png | Bin 0 -> 700 bytes web/image/icon/group.png | Bin 0 -> 753 bytes web/image/icon/group_add.png | Bin 0 -> 807 bytes web/image/icon/group_delete.png | Bin 0 -> 827 bytes web/image/icon/group_edit.png | Bin 0 -> 785 bytes web/image/icon/group_error.png | Bin 0 -> 842 bytes web/image/icon/group_gear.png | Bin 0 -> 824 bytes web/image/icon/group_go.png | Bin 0 -> 842 bytes web/image/icon/group_key.png | Bin 0 -> 813 bytes web/image/icon/group_link.png | Bin 0 -> 858 bytes web/image/icon/heart.png | Bin 0 -> 749 bytes web/image/icon/heart_add.png | Bin 0 -> 820 bytes web/image/icon/heart_delete.png | Bin 0 -> 823 bytes web/image/icon/help.png | Bin 0 -> 786 bytes web/image/icon/hourglass.png | Bin 0 -> 744 bytes web/image/icon/hourglass_add.png | Bin 0 -> 814 bytes web/image/icon/hourglass_delete.png | Bin 0 -> 829 bytes web/image/icon/hourglass_go.png | Bin 0 -> 866 bytes web/image/icon/hourglass_link.png | Bin 0 -> 871 bytes web/image/icon/house.png | Bin 0 -> 806 bytes web/image/icon/house_go.png | Bin 0 -> 861 bytes web/image/icon/house_link.png | Bin 0 -> 868 bytes web/image/icon/html.png | Bin 0 -> 578 bytes web/image/icon/html_add.png | Bin 0 -> 698 bytes web/image/icon/html_delete.png | Bin 0 -> 688 bytes web/image/icon/html_go.png | Bin 0 -> 692 bytes web/image/icon/html_valid.png | Bin 0 -> 704 bytes web/image/icon/image.png | Bin 0 -> 516 bytes web/image/icon/image_add.png | Bin 0 -> 653 bytes web/image/icon/image_delete.png | Bin 0 -> 653 bytes web/image/icon/image_edit.png | Bin 0 -> 783 bytes web/image/icon/image_link.png | Bin 0 -> 773 bytes web/image/icon/images.png | Bin 0 -> 661 bytes web/image/icon/information.png | Bin 0 -> 778 bytes web/image/icon/ipod.png | Bin 0 -> 463 bytes web/image/icon/ipod_cast.png | Bin 0 -> 711 bytes web/image/icon/ipod_cast_add.png | Bin 0 -> 796 bytes web/image/icon/ipod_cast_delete.png | Bin 0 -> 809 bytes web/image/icon/ipod_sound.png | Bin 0 -> 678 bytes web/image/icon/joystick.png | Bin 0 -> 559 bytes web/image/icon/joystick_add.png | Bin 0 -> 669 bytes web/image/icon/joystick_delete.png | Bin 0 -> 671 bytes web/image/icon/joystick_error.png | Bin 0 -> 711 bytes web/image/icon/key.png | Bin 0 -> 612 bytes web/image/icon/key_add.png | Bin 0 -> 703 bytes web/image/icon/key_delete.png | Bin 0 -> 724 bytes web/image/icon/key_go.png | Bin 0 -> 744 bytes web/image/icon/keyboard.png | Bin 0 -> 570 bytes web/image/icon/keyboard_add.png | Bin 0 -> 683 bytes web/image/icon/keyboard_delete.png | Bin 0 -> 681 bytes web/image/icon/keyboard_magnify.png | Bin 0 -> 651 bytes web/image/icon/layers.png | Bin 0 -> 597 bytes web/image/icon/layout.png | Bin 0 -> 480 bytes web/image/icon/layout_add.png | Bin 0 -> 577 bytes web/image/icon/layout_content.png | Bin 0 -> 519 bytes web/image/icon/layout_delete.png | Bin 0 -> 608 bytes web/image/icon/layout_edit.png | Bin 0 -> 716 bytes web/image/icon/layout_error.png | Bin 0 -> 666 bytes web/image/icon/layout_header.png | Bin 0 -> 500 bytes web/image/icon/layout_link.png | Bin 0 -> 660 bytes web/image/icon/layout_sidebar.png | Bin 0 -> 479 bytes web/image/icon/lightbulb.png | Bin 0 -> 782 bytes web/image/icon/lightbulb_add.png | Bin 0 -> 839 bytes web/image/icon/lightbulb_delete.png | Bin 0 -> 857 bytes web/image/icon/lightbulb_off.png | Bin 0 -> 700 bytes web/image/icon/lightning.png | Bin 0 -> 634 bytes web/image/icon/lightning_add.png | Bin 0 -> 746 bytes web/image/icon/lightning_delete.png | Bin 0 -> 745 bytes web/image/icon/lightning_go.png | Bin 0 -> 739 bytes web/image/icon/link.png | Bin 0 -> 343 bytes web/image/icon/link_add.png | Bin 0 -> 570 bytes web/image/icon/link_break.png | Bin 0 -> 657 bytes web/image/icon/link_delete.png | Bin 0 -> 600 bytes web/image/icon/link_edit.png | Bin 0 -> 703 bytes web/image/icon/link_error.png | Bin 0 -> 698 bytes web/image/icon/link_go.png | Bin 0 -> 655 bytes web/image/icon/lock.png | Bin 0 -> 749 bytes web/image/icon/lock_add.png | Bin 0 -> 824 bytes web/image/icon/lock_break.png | Bin 0 -> 771 bytes web/image/icon/lock_delete.png | Bin 0 -> 815 bytes web/image/icon/lock_edit.png | Bin 0 -> 861 bytes web/image/icon/lock_go.png | Bin 0 -> 829 bytes web/image/icon/lock_open.png | Bin 0 -> 727 bytes web/image/icon/lorry.png | Bin 0 -> 582 bytes web/image/icon/lorry_add.png | Bin 0 -> 689 bytes web/image/icon/lorry_delete.png | Bin 0 -> 683 bytes web/image/icon/lorry_error.png | Bin 0 -> 739 bytes web/image/icon/lorry_flatbed.png | Bin 0 -> 450 bytes web/image/icon/lorry_go.png | Bin 0 -> 699 bytes web/image/icon/lorry_link.png | Bin 0 -> 775 bytes web/image/icon/magifier_zoom_out.png | Bin 0 -> 657 bytes web/image/icon/magnifier.png | Bin 0 -> 615 bytes web/image/icon/magnifier_zoom_in.png | Bin 0 -> 680 bytes web/image/icon/male.png | Bin 0 -> 629 bytes web/image/icon/map.png | Bin 0 -> 804 bytes web/image/icon/map_add.png | Bin 0 -> 836 bytes web/image/icon/map_delete.png | Bin 0 -> 835 bytes web/image/icon/map_edit.png | Bin 0 -> 876 bytes web/image/icon/map_go.png | Bin 0 -> 842 bytes web/image/icon/map_magnify.png | Bin 0 -> 797 bytes web/image/icon/medal_bronze_1.png | Bin 0 -> 640 bytes web/image/icon/medal_bronze_2.png | Bin 0 -> 654 bytes web/image/icon/medal_bronze_3.png | Bin 0 -> 646 bytes web/image/icon/medal_bronze_add.png | Bin 0 -> 747 bytes web/image/icon/medal_bronze_delete.png | Bin 0 -> 730 bytes web/image/icon/medal_gold_1.png | Bin 0 -> 629 bytes web/image/icon/medal_gold_2.png | Bin 0 -> 641 bytes web/image/icon/medal_gold_3.png | Bin 0 -> 634 bytes web/image/icon/medal_gold_add.png | Bin 0 -> 733 bytes web/image/icon/medal_gold_delete.png | Bin 0 -> 724 bytes web/image/icon/medal_silver_1.png | Bin 0 -> 589 bytes web/image/icon/medal_silver_2.png | Bin 0 -> 600 bytes web/image/icon/medal_silver_3.png | Bin 0 -> 597 bytes web/image/icon/medal_silver_add.png | Bin 0 -> 727 bytes web/image/icon/medal_silver_delete.png | Bin 0 -> 714 bytes web/image/icon/money.png | Bin 0 -> 738 bytes web/image/icon/money_add.png | Bin 0 -> 784 bytes web/image/icon/money_delete.png | Bin 0 -> 806 bytes web/image/icon/money_dollar.png | Bin 0 -> 630 bytes web/image/icon/money_euro.png | Bin 0 -> 605 bytes web/image/icon/money_pound.png | Bin 0 -> 565 bytes web/image/icon/money_yen.png | Bin 0 -> 562 bytes web/image/icon/monitor.png | Bin 0 -> 612 bytes web/image/icon/monitor_add.png | Bin 0 -> 692 bytes web/image/icon/monitor_delete.png | Bin 0 -> 691 bytes web/image/icon/monitor_edit.png | Bin 0 -> 769 bytes web/image/icon/monitor_error.png | Bin 0 -> 714 bytes web/image/icon/monitor_go.png | Bin 0 -> 696 bytes web/image/icon/monitor_lightning.png | Bin 0 -> 768 bytes web/image/icon/monitor_link.png | Bin 0 -> 736 bytes web/image/icon/mouse.png | Bin 0 -> 634 bytes web/image/icon/mouse_add.png | Bin 0 -> 729 bytes web/image/icon/mouse_delete.png | Bin 0 -> 741 bytes web/image/icon/mouse_error.png | Bin 0 -> 790 bytes web/image/icon/music.png | Bin 0 -> 385 bytes web/image/icon/new.png | Bin 0 -> 378 bytes web/image/icon/newspaper.png | Bin 0 -> 658 bytes web/image/icon/newspaper_add.png | Bin 0 -> 750 bytes web/image/icon/newspaper_delete.png | Bin 0 -> 775 bytes web/image/icon/newspaper_go.png | Bin 0 -> 779 bytes web/image/icon/newspaper_link.png | Bin 0 -> 787 bytes web/image/icon/note.png | Bin 0 -> 500 bytes web/image/icon/note_add.png | Bin 0 -> 641 bytes web/image/icon/note_delete.png | Bin 0 -> 631 bytes web/image/icon/note_edit.png | Bin 0 -> 731 bytes web/image/icon/note_error.png | Bin 0 -> 680 bytes web/image/icon/note_go.png | Bin 0 -> 661 bytes web/image/icon/overlays.png | Bin 0 -> 716 bytes web/image/icon/package.png | Bin 0 -> 853 bytes web/image/icon/package_add.png | Bin 0 -> 899 bytes web/image/icon/package_delete.png | Bin 0 -> 891 bytes web/image/icon/package_go.png | Bin 0 -> 898 bytes web/image/icon/package_green.png | Bin 0 -> 896 bytes web/image/icon/package_link.png | Bin 0 -> 939 bytes web/image/icon/page.png | Bin 0 -> 635 bytes web/image/icon/page_add.png | Bin 0 -> 739 bytes web/image/icon/page_attach.png | Bin 0 -> 794 bytes web/image/icon/page_code.png | Bin 0 -> 818 bytes web/image/icon/page_copy.png | Bin 0 -> 663 bytes web/image/icon/page_delete.png | Bin 0 -> 740 bytes web/image/icon/page_edit.png | Bin 0 -> 807 bytes web/image/icon/page_error.png | Bin 0 -> 793 bytes web/image/icon/page_excel.png | Bin 0 -> 817 bytes web/image/icon/page_find.png | Bin 0 -> 879 bytes web/image/icon/page_gear.png | Bin 0 -> 833 bytes web/image/icon/page_go.png | Bin 0 -> 779 bytes web/image/icon/page_green.png | Bin 0 -> 621 bytes web/image/icon/page_key.png | Bin 0 -> 801 bytes web/image/icon/page_lightning.png | Bin 0 -> 839 bytes web/image/icon/page_link.png | Bin 0 -> 830 bytes web/image/icon/page_paintbrush.png | Bin 0 -> 813 bytes web/image/icon/page_paste.png | Bin 0 -> 703 bytes web/image/icon/page_red.png | Bin 0 -> 641 bytes web/image/icon/page_refresh.png | Bin 0 -> 858 bytes web/image/icon/page_save.png | Bin 0 -> 774 bytes web/image/icon/page_white.png | Bin 0 -> 294 bytes web/image/icon/page_white_acrobat.png | Bin 0 -> 591 bytes web/image/icon/page_white_actionscript.png | Bin 0 -> 664 bytes web/image/icon/page_white_add.png | Bin 0 -> 512 bytes web/image/icon/page_white_c.png | Bin 0 -> 587 bytes web/image/icon/page_white_camera.png | Bin 0 -> 656 bytes web/image/icon/page_white_cd.png | Bin 0 -> 666 bytes web/image/icon/page_white_code.png | Bin 0 -> 603 bytes web/image/icon/page_white_code_red.png | Bin 0 -> 587 bytes web/image/icon/page_white_coldfusion.png | Bin 0 -> 592 bytes web/image/icon/page_white_compressed.png | Bin 0 -> 724 bytes web/image/icon/page_white_copy.png | Bin 0 -> 309 bytes web/image/icon/page_white_cplusplus.png | Bin 0 -> 621 bytes web/image/icon/page_white_csharp.png | Bin 0 -> 700 bytes web/image/icon/page_white_cup.png | Bin 0 -> 639 bytes web/image/icon/page_white_database.png | Bin 0 -> 579 bytes web/image/icon/page_white_delete.png | Bin 0 -> 536 bytes web/image/icon/page_white_dvd.png | Bin 0 -> 638 bytes web/image/icon/page_white_edit.png | Bin 0 -> 618 bytes web/image/icon/page_white_error.png | Bin 0 -> 623 bytes web/image/icon/page_white_excel.png | Bin 0 -> 663 bytes web/image/icon/page_white_find.png | Bin 0 -> 676 bytes web/image/icon/page_white_flash.png | Bin 0 -> 582 bytes web/image/icon/page_white_freehand.png | Bin 0 -> 639 bytes web/image/icon/page_white_gear.png | Bin 0 -> 402 bytes web/image/icon/page_white_get.png | Bin 0 -> 516 bytes web/image/icon/page_white_go.png | Bin 0 -> 612 bytes web/image/icon/page_white_h.png | Bin 0 -> 603 bytes web/image/icon/page_white_horizontal.png | Bin 0 -> 296 bytes web/image/icon/page_white_key.png | Bin 0 -> 616 bytes web/image/icon/page_white_lightning.png | Bin 0 -> 669 bytes web/image/icon/page_white_link.png | Bin 0 -> 614 bytes web/image/icon/page_white_magnify.png | Bin 0 -> 554 bytes web/image/icon/page_white_medal.png | Bin 0 -> 706 bytes web/image/icon/page_white_office.png | Bin 0 -> 779 bytes web/image/icon/page_white_paint.png | Bin 0 -> 688 bytes web/image/icon/page_white_paintbrush.png | Bin 0 -> 618 bytes web/image/icon/page_white_paste.png | Bin 0 -> 620 bytes web/image/icon/page_white_php.png | Bin 0 -> 538 bytes web/image/icon/page_white_picture.png | Bin 0 -> 650 bytes web/image/icon/page_white_powerpoint.png | Bin 0 -> 588 bytes web/image/icon/page_white_put.png | Bin 0 -> 523 bytes web/image/icon/page_white_ruby.png | Bin 0 -> 626 bytes web/image/icon/page_white_stack.png | Bin 0 -> 317 bytes web/image/icon/page_white_star.png | Bin 0 -> 565 bytes web/image/icon/page_white_swoosh.png | Bin 0 -> 634 bytes web/image/icon/page_white_text.png | Bin 0 -> 342 bytes web/image/icon/page_white_text_width.png | Bin 0 -> 315 bytes web/image/icon/page_white_tux.png | Bin 0 -> 668 bytes web/image/icon/page_white_vector.png | Bin 0 -> 644 bytes web/image/icon/page_white_visualstudio.png | Bin 0 -> 702 bytes web/image/icon/page_white_width.png | Bin 0 -> 309 bytes web/image/icon/page_white_word.png | Bin 0 -> 651 bytes web/image/icon/page_white_world.png | Bin 0 -> 734 bytes web/image/icon/page_white_wrench.png | Bin 0 -> 613 bytes web/image/icon/page_white_zip.png | Bin 0 -> 386 bytes web/image/icon/page_word.png | Bin 0 -> 777 bytes web/image/icon/page_world.png | Bin 0 -> 903 bytes web/image/icon/paintbrush.png | Bin 0 -> 548 bytes web/image/icon/paintcan.png | Bin 0 -> 707 bytes web/image/icon/palette.png | Bin 0 -> 856 bytes web/image/icon/paste_plain.png | Bin 0 -> 605 bytes web/image/icon/paste_word.png | Bin 0 -> 701 bytes web/image/icon/pencil.png | Bin 0 -> 450 bytes web/image/icon/pencil_add.png | Bin 0 -> 589 bytes web/image/icon/pencil_delete.png | Bin 0 -> 603 bytes web/image/icon/pencil_go.png | Bin 0 -> 666 bytes web/image/icon/phone.png | Bin 0 -> 488 bytes web/image/icon/phone_add.png | Bin 0 -> 621 bytes web/image/icon/phone_delete.png | Bin 0 -> 615 bytes web/image/icon/phone_sound.png | Bin 0 -> 703 bytes web/image/icon/photo.png | Bin 0 -> 589 bytes web/image/icon/photo_add.png | Bin 0 -> 707 bytes web/image/icon/photo_delete.png | Bin 0 -> 703 bytes web/image/icon/photo_link.png | Bin 0 -> 784 bytes web/image/icon/photos.png | Bin 0 -> 647 bytes web/image/icon/picture.png | Bin 0 -> 606 bytes web/image/icon/picture_add.png | Bin 0 -> 745 bytes web/image/icon/picture_delete.png | Bin 0 -> 744 bytes web/image/icon/picture_edit.png | Bin 0 -> 826 bytes web/image/icon/picture_empty.png | Bin 0 -> 463 bytes web/image/icon/picture_error.png | Bin 0 -> 755 bytes web/image/icon/picture_go.png | Bin 0 -> 758 bytes web/image/icon/picture_key.png | Bin 0 -> 794 bytes web/image/icon/picture_link.png | Bin 0 -> 835 bytes web/image/icon/picture_save.png | Bin 0 -> 755 bytes web/image/icon/pictures.png | Bin 0 -> 704 bytes web/image/icon/pilcrow.png | Bin 0 -> 361 bytes web/image/icon/pill.png | Bin 0 -> 719 bytes web/image/icon/pill_add.png | Bin 0 -> 797 bytes web/image/icon/pill_delete.png | Bin 0 -> 805 bytes web/image/icon/pill_go.png | Bin 0 -> 817 bytes web/image/icon/plugin.png | Bin 0 -> 591 bytes web/image/icon/plugin_add.png | Bin 0 -> 691 bytes web/image/icon/plugin_delete.png | Bin 0 -> 692 bytes web/image/icon/plugin_disabled.png | Bin 0 -> 347 bytes web/image/icon/plugin_edit.png | Bin 0 -> 746 bytes web/image/icon/plugin_error.png | Bin 0 -> 702 bytes web/image/icon/plugin_go.png | Bin 0 -> 694 bytes web/image/icon/plugin_link.png | Bin 0 -> 759 bytes web/image/icon/printer.png | Bin 0 -> 731 bytes web/image/icon/printer_add.png | Bin 0 -> 782 bytes web/image/icon/printer_delete.png | Bin 0 -> 792 bytes web/image/icon/printer_empty.png | Bin 0 -> 350 bytes web/image/icon/printer_error.png | Bin 0 -> 854 bytes web/image/icon/rainbow.png | Bin 0 -> 655 bytes web/image/icon/report.png | Bin 0 -> 649 bytes web/image/icon/report_add.png | Bin 0 -> 714 bytes web/image/icon/report_delete.png | Bin 0 -> 729 bytes web/image/icon/report_disk.png | Bin 0 -> 760 bytes web/image/icon/report_edit.png | Bin 0 -> 762 bytes web/image/icon/report_go.png | Bin 0 -> 756 bytes web/image/icon/report_key.png | Bin 0 -> 760 bytes web/image/icon/report_link.png | Bin 0 -> 754 bytes web/image/icon/report_magnify.png | Bin 0 -> 738 bytes web/image/icon/report_picture.png | Bin 0 -> 733 bytes web/image/icon/report_user.png | Bin 0 -> 785 bytes web/image/icon/report_word.png | Bin 0 -> 731 bytes web/image/icon/resultset_first.png | Bin 0 -> 522 bytes web/image/icon/resultset_last.png | Bin 0 -> 524 bytes web/image/icon/resultset_next.png | Bin 0 -> 395 bytes web/image/icon/resultset_previous.png | Bin 0 -> 389 bytes web/image/icon/rosette.png | Bin 0 -> 673 bytes web/image/icon/rss.png | Bin 0 -> 530 bytes web/image/icon/rss_add.png | Bin 0 -> 649 bytes web/image/icon/rss_delete.png | Bin 0 -> 633 bytes web/image/icon/rss_go.png | Bin 0 -> 635 bytes web/image/icon/rss_valid.png | Bin 0 -> 660 bytes web/image/icon/ruby.png | Bin 0 -> 592 bytes web/image/icon/ruby_add.png | Bin 0 -> 691 bytes web/image/icon/ruby_delete.png | Bin 0 -> 704 bytes web/image/icon/ruby_gear.png | Bin 0 -> 716 bytes web/image/icon/ruby_get.png | Bin 0 -> 692 bytes web/image/icon/ruby_go.png | Bin 0 -> 720 bytes web/image/icon/ruby_key.png | Bin 0 -> 732 bytes web/image/icon/ruby_link.png | Bin 0 -> 767 bytes web/image/icon/ruby_put.png | Bin 0 -> 694 bytes web/image/icon/script.png | Bin 0 -> 748 bytes web/image/icon/script_add.png | Bin 0 -> 811 bytes web/image/icon/script_code.png | Bin 0 -> 859 bytes web/image/icon/script_code_red.png | Bin 0 -> 868 bytes web/image/icon/script_delete.png | Bin 0 -> 811 bytes web/image/icon/script_edit.png | Bin 0 -> 880 bytes web/image/icon/script_error.png | Bin 0 -> 861 bytes web/image/icon/script_gear.png | Bin 0 -> 861 bytes web/image/icon/script_go.png | Bin 0 -> 839 bytes web/image/icon/script_key.png | Bin 0 -> 853 bytes web/image/icon/script_lightning.png | Bin 0 -> 879 bytes web/image/icon/script_link.png | Bin 0 -> 876 bytes web/image/icon/script_palette.png | Bin 0 -> 917 bytes web/image/icon/script_save.png | Bin 0 -> 804 bytes web/image/icon/server.png | Bin 0 -> 530 bytes web/image/icon/server_add.png | Bin 0 -> 676 bytes web/image/icon/server_chart.png | Bin 0 -> 673 bytes web/image/icon/server_compressed.png | Bin 0 -> 721 bytes web/image/icon/server_connect.png | Bin 0 -> 755 bytes web/image/icon/server_database.png | Bin 0 -> 666 bytes web/image/icon/server_delete.png | Bin 0 -> 668 bytes web/image/icon/server_edit.png | Bin 0 -> 749 bytes web/image/icon/server_error.png | Bin 0 -> 678 bytes web/image/icon/server_go.png | Bin 0 -> 706 bytes web/image/icon/server_key.png | Bin 0 -> 746 bytes web/image/icon/server_lightning.png | Bin 0 -> 729 bytes web/image/icon/server_link.png | Bin 0 -> 706 bytes web/image/icon/server_uncompressed.png | Bin 0 -> 669 bytes web/image/icon/shading.png | Bin 0 -> 225 bytes web/image/icon/shape_align_bottom.png | Bin 0 -> 398 bytes web/image/icon/shape_align_center.png | Bin 0 -> 384 bytes web/image/icon/shape_align_left.png | Bin 0 -> 402 bytes web/image/icon/shape_align_middle.png | Bin 0 -> 414 bytes web/image/icon/shape_align_right.png | Bin 0 -> 401 bytes web/image/icon/shape_align_top.png | Bin 0 -> 406 bytes web/image/icon/shape_flip_horizontal.png | Bin 0 -> 403 bytes web/image/icon/shape_flip_vertical.png | Bin 0 -> 418 bytes web/image/icon/shape_group.png | Bin 0 -> 553 bytes web/image/icon/shape_handles.png | Bin 0 -> 538 bytes web/image/icon/shape_move_back.png | Bin 0 -> 395 bytes web/image/icon/shape_move_backwards.png | Bin 0 -> 358 bytes web/image/icon/shape_move_forwards.png | Bin 0 -> 381 bytes web/image/icon/shape_move_front.png | Bin 0 -> 435 bytes web/image/icon/shape_rotate_anticlockwise.png | Bin 0 -> 657 bytes web/image/icon/shape_rotate_clockwise.png | Bin 0 -> 673 bytes web/image/icon/shape_square.png | Bin 0 -> 353 bytes web/image/icon/shape_square_add.png | Bin 0 -> 539 bytes web/image/icon/shape_square_delete.png | Bin 0 -> 537 bytes web/image/icon/shape_square_edit.png | Bin 0 -> 660 bytes web/image/icon/shape_square_error.png | Bin 0 -> 570 bytes web/image/icon/shape_square_go.png | Bin 0 -> 566 bytes web/image/icon/shape_square_key.png | Bin 0 -> 607 bytes web/image/icon/shape_square_link.png | Bin 0 -> 642 bytes web/image/icon/shape_ungroup.png | Bin 0 -> 666 bytes web/image/icon/shield.png | Bin 0 -> 702 bytes web/image/icon/shield_add.png | Bin 0 -> 758 bytes web/image/icon/shield_delete.png | Bin 0 -> 768 bytes web/image/icon/shield_go.png | Bin 0 -> 775 bytes web/image/icon/sitemap.png | Bin 0 -> 278 bytes web/image/icon/sitemap_color.png | Bin 0 -> 406 bytes web/image/icon/sound.png | Bin 0 -> 610 bytes web/image/icon/sound_add.png | Bin 0 -> 684 bytes web/image/icon/sound_delete.png | Bin 0 -> 711 bytes web/image/icon/sound_low.png | Bin 0 -> 524 bytes web/image/icon/sound_mute.png | Bin 0 -> 474 bytes web/image/icon/sound_none.png | Bin 0 -> 417 bytes web/image/icon/spellcheck.png | Bin 0 -> 603 bytes web/image/icon/sport_8ball.png | Bin 0 -> 490 bytes web/image/icon/sport_basketball.png | Bin 0 -> 977 bytes web/image/icon/sport_football.png | Bin 0 -> 875 bytes web/image/icon/sport_golf.png | Bin 0 -> 504 bytes web/image/icon/sport_raquet.png | Bin 0 -> 719 bytes web/image/icon/sport_shuttlecock.png | Bin 0 -> 683 bytes web/image/icon/sport_soccer.png | Bin 0 -> 517 bytes web/image/icon/sport_tennis.png | Bin 0 -> 884 bytes web/image/icon/star.png | Bin 0 -> 670 bytes web/image/icon/status_away.png | Bin 0 -> 794 bytes web/image/icon/status_busy.png | Bin 0 -> 751 bytes web/image/icon/status_offline.png | Bin 0 -> 422 bytes web/image/icon/status_online.png | Bin 0 -> 722 bytes web/image/icon/stop.png | Bin 0 -> 700 bytes web/image/icon/style.png | Bin 0 -> 813 bytes web/image/icon/style_add.png | Bin 0 -> 844 bytes web/image/icon/style_delete.png | Bin 0 -> 865 bytes web/image/icon/style_edit.png | Bin 0 -> 927 bytes web/image/icon/style_go.png | Bin 0 -> 862 bytes web/image/icon/sum.png | Bin 0 -> 289 bytes web/image/icon/tab.png | Bin 0 -> 323 bytes web/image/icon/tab_add.png | Bin 0 -> 488 bytes web/image/icon/tab_delete.png | Bin 0 -> 493 bytes web/image/icon/tab_edit.png | Bin 0 -> 580 bytes web/image/icon/tab_go.png | Bin 0 -> 552 bytes web/image/icon/table.png | Bin 0 -> 566 bytes web/image/icon/table_add.png | Bin 0 -> 663 bytes web/image/icon/table_delete.png | Bin 0 -> 660 bytes web/image/icon/table_edit.png | Bin 0 -> 744 bytes web/image/icon/table_error.png | Bin 0 -> 687 bytes web/image/icon/table_gear.png | Bin 0 -> 714 bytes web/image/icon/table_go.png | Bin 0 -> 683 bytes web/image/icon/table_key.png | Bin 0 -> 746 bytes web/image/icon/table_lightning.png | Bin 0 -> 736 bytes web/image/icon/table_link.png | Bin 0 -> 728 bytes web/image/icon/table_multiple.png | Bin 0 -> 612 bytes web/image/icon/table_refresh.png | Bin 0 -> 795 bytes web/image/icon/table_relationship.png | Bin 0 -> 663 bytes web/image/icon/table_row_delete.png | Bin 0 -> 629 bytes web/image/icon/table_row_insert.png | Bin 0 -> 641 bytes web/image/icon/table_save.png | Bin 0 -> 723 bytes web/image/icon/table_sort.png | Bin 0 -> 678 bytes web/image/icon/tag.png | Bin 0 -> 389 bytes web/image/icon/tag_blue.png | Bin 0 -> 586 bytes web/image/icon/tag_blue_add.png | Bin 0 -> 671 bytes web/image/icon/tag_blue_delete.png | Bin 0 -> 701 bytes web/image/icon/tag_blue_edit.png | Bin 0 -> 748 bytes web/image/icon/tag_green.png | Bin 0 -> 613 bytes web/image/icon/tag_orange.png | Bin 0 -> 586 bytes web/image/icon/tag_pink.png | Bin 0 -> 579 bytes web/image/icon/tag_purple.png | Bin 0 -> 599 bytes web/image/icon/tag_red.png | Bin 0 -> 592 bytes web/image/icon/tag_yellow.png | Bin 0 -> 586 bytes web/image/icon/telephone.png | Bin 0 -> 791 bytes web/image/icon/telephone_add.png | Bin 0 -> 860 bytes web/image/icon/telephone_delete.png | Bin 0 -> 856 bytes web/image/icon/telephone_edit.png | Bin 0 -> 893 bytes web/image/icon/telephone_error.png | Bin 0 -> 884 bytes web/image/icon/telephone_go.png | Bin 0 -> 865 bytes web/image/icon/telephone_key.png | Bin 0 -> 881 bytes web/image/icon/telephone_link.png | Bin 0 -> 909 bytes web/image/icon/television.png | Bin 0 -> 696 bytes web/image/icon/television_add.png | Bin 0 -> 809 bytes web/image/icon/television_delete.png | Bin 0 -> 810 bytes web/image/icon/text_align_center.png | Bin 0 -> 234 bytes web/image/icon/text_align_justify.png | Bin 0 -> 209 bytes web/image/icon/text_align_left.png | Bin 0 -> 209 bytes web/image/icon/text_align_right.png | Bin 0 -> 209 bytes web/image/icon/text_allcaps.png | Bin 0 -> 284 bytes web/image/icon/text_bold.png | Bin 0 -> 304 bytes web/image/icon/text_columns.png | Bin 0 -> 246 bytes web/image/icon/text_dropcaps.png | Bin 0 -> 314 bytes web/image/icon/text_heading_1.png | Bin 0 -> 276 bytes web/image/icon/text_heading_2.png | Bin 0 -> 304 bytes web/image/icon/text_heading_3.png | Bin 0 -> 306 bytes web/image/icon/text_heading_4.png | Bin 0 -> 293 bytes web/image/icon/text_heading_5.png | Bin 0 -> 304 bytes web/image/icon/text_heading_6.png | Bin 0 -> 310 bytes web/image/icon/text_horizontalrule.png | Bin 0 -> 317 bytes web/image/icon/text_indent.png | Bin 0 -> 353 bytes web/image/icon/text_indent_remove.png | Bin 0 -> 351 bytes web/image/icon/text_italic.png | Bin 0 -> 223 bytes web/image/icon/text_kerning.png | Bin 0 -> 495 bytes web/image/icon/text_letter_omega.png | Bin 0 -> 541 bytes web/image/icon/text_letterspacing.png | Bin 0 -> 503 bytes web/image/icon/text_linespacing.png | Bin 0 -> 363 bytes web/image/icon/text_list_bullets.png | Bin 0 -> 344 bytes web/image/icon/text_list_numbers.png | Bin 0 -> 357 bytes web/image/icon/text_lowercase.png | Bin 0 -> 709 bytes web/image/icon/text_padding_bottom.png | Bin 0 -> 237 bytes web/image/icon/text_padding_left.png | Bin 0 -> 271 bytes web/image/icon/text_padding_right.png | Bin 0 -> 271 bytes web/image/icon/text_padding_top.png | Bin 0 -> 236 bytes web/image/icon/text_replace.png | Bin 0 -> 691 bytes web/image/icon/text_signature.png | Bin 0 -> 524 bytes web/image/icon/text_smallcaps.png | Bin 0 -> 260 bytes web/image/icon/text_strikethrough.png | Bin 0 -> 269 bytes web/image/icon/text_subscript.png | Bin 0 -> 422 bytes web/image/icon/text_superscript.png | Bin 0 -> 421 bytes web/image/icon/text_underline.png | Bin 0 -> 273 bytes web/image/icon/text_uppercase.png | Bin 0 -> 747 bytes web/image/icon/textfield.png | Bin 0 -> 153 bytes web/image/icon/textfield_add.png | Bin 0 -> 321 bytes web/image/icon/textfield_delete.png | Bin 0 -> 335 bytes web/image/icon/textfield_key.png | Bin 0 -> 455 bytes web/image/icon/textfield_rename.png | Bin 0 -> 273 bytes web/image/icon/thumb_down.png | Bin 0 -> 601 bytes web/image/icon/thumb_up.png | Bin 0 -> 619 bytes web/image/icon/tick.png | Bin 0 -> 537 bytes web/image/icon/time.png | Bin 0 -> 793 bytes web/image/icon/time_add.png | Bin 0 -> 827 bytes web/image/icon/time_delete.png | Bin 0 -> 853 bytes web/image/icon/time_go.png | Bin 0 -> 882 bytes web/image/icon/timeline_marker.png | Bin 0 -> 327 bytes web/image/icon/transmit.png | Bin 0 -> 749 bytes web/image/icon/transmit_add.png | Bin 0 -> 803 bytes web/image/icon/transmit_blue.png | Bin 0 -> 814 bytes web/image/icon/transmit_delete.png | Bin 0 -> 827 bytes web/image/icon/transmit_edit.png | Bin 0 -> 848 bytes web/image/icon/transmit_error.png | Bin 0 -> 883 bytes web/image/icon/transmit_go.png | Bin 0 -> 842 bytes web/image/icon/tux.png | Bin 0 -> 696 bytes web/image/icon/user.png | Bin 0 -> 741 bytes web/image/icon/user_add.png | Bin 0 -> 746 bytes web/image/icon/user_comment.png | Bin 0 -> 743 bytes web/image/icon/user_delete.png | Bin 0 -> 767 bytes web/image/icon/user_edit.png | Bin 0 -> 833 bytes web/image/icon/user_female.png | Bin 0 -> 663 bytes web/image/icon/user_go.png | Bin 0 -> 793 bytes web/image/icon/user_gray.png | Bin 0 -> 706 bytes web/image/icon/user_green.png | Bin 0 -> 722 bytes web/image/icon/user_orange.png | Bin 0 -> 723 bytes web/image/icon/user_red.png | Bin 0 -> 717 bytes web/image/icon/user_suit.png | Bin 0 -> 748 bytes web/image/icon/vcard.png | Bin 0 -> 533 bytes web/image/icon/vcard_add.png | Bin 0 -> 661 bytes web/image/icon/vcard_delete.png | Bin 0 -> 651 bytes web/image/icon/vcard_edit.png | Bin 0 -> 775 bytes web/image/icon/vector.png | Bin 0 -> 481 bytes web/image/icon/vector_add.png | Bin 0 -> 616 bytes web/image/icon/vector_delete.png | Bin 0 -> 635 bytes web/image/icon/wand.png | Bin 0 -> 570 bytes web/image/icon/weather_clouds.png | Bin 0 -> 581 bytes web/image/icon/weather_cloudy.png | Bin 0 -> 694 bytes web/image/icon/weather_lightning.png | Bin 0 -> 641 bytes web/image/icon/weather_rain.png | Bin 0 -> 626 bytes web/image/icon/weather_snow.png | Bin 0 -> 341 bytes web/image/icon/weather_sun.png | Bin 0 -> 623 bytes web/image/icon/webcam.png | Bin 0 -> 728 bytes web/image/icon/webcam_add.png | Bin 0 -> 786 bytes web/image/icon/webcam_delete.png | Bin 0 -> 805 bytes web/image/icon/webcam_error.png | Bin 0 -> 821 bytes web/image/icon/world.png | Bin 0 -> 923 bytes web/image/icon/world_add.png | Bin 0 -> 940 bytes web/image/icon/world_delete.png | Bin 0 -> 945 bytes web/image/icon/world_edit.png | Bin 0 -> 945 bytes web/image/icon/world_go.png | Bin 0 -> 944 bytes web/image/icon/world_link.png | Bin 0 -> 957 bytes web/image/icon/wrench.png | Bin 0 -> 610 bytes web/image/icon/wrench_orange.png | Bin 0 -> 584 bytes web/image/icon/xhtml.png | Bin 0 -> 595 bytes web/image/icon/xhtml_add.png | Bin 0 -> 703 bytes web/image/icon/xhtml_delete.png | Bin 0 -> 696 bytes web/image/icon/xhtml_go.png | Bin 0 -> 697 bytes web/image/icon/xhtml_valid.png | Bin 0 -> 718 bytes web/image/icon/zoom.png | Bin 0 -> 692 bytes web/image/icon/zoom_in.png | Bin 0 -> 725 bytes web/image/icon/zoom_out.png | Bin 0 -> 708 bytes web/image/tipsy-east.gif | Bin 0 -> 3224 bytes web/image/tipsy-north.gif | Bin 0 -> 3223 bytes web/image/tipsy-south.gif | Bin 0 -> 3222 bytes web/image/tipsy-west.gif | Bin 0 -> 3224 bytes .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 0 -> 260 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 0 -> 251 bytes web/image/ui-bg_flat_10_000000_40x100.png | Bin 0 -> 178 bytes web/image/ui-bg_glass_100_f6f6f6_1x400.png | Bin 0 -> 104 bytes web/image/ui-bg_glass_100_fdf5ce_1x400.png | Bin 0 -> 125 bytes web/image/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 0 -> 3762 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 0 -> 90 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 0 -> 129 bytes web/image/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes web/image/ui-icons_228ef1_256x240.png | Bin 0 -> 4369 bytes web/image/ui-icons_ef8c08_256x240.png | Bin 0 -> 4369 bytes web/image/ui-icons_ffd27a_256x240.png | Bin 0 -> 4369 bytes web/image/ui-icons_ffffff_256x240.png | Bin 0 -> 4369 bytes web/index.php | 23 + web/javascript/forms.js | 230 ++ web/javascript/general.js | 9 + .../jquery/external_plugins/gritter.js | 268 ++ .../jquery/external_plugins/tipsy.js | 59 + web/javascript/jquery/jquery-1.3.2.min.js | 19 + .../jquery/jquery-ui-1.7.2.custom.min.js | 298 +++ web/javascript/pagination.js | 123 + web/myaccount.php | 33 + web/myhostings.php | 25 + web/style/gritter.css | 98 + web/style/jquery-ui-1.7.2.custom.css | 406 +++ web/style/tipsy.css | 6 + web/support.php | 70 + web/tests/apc_admin.php | 1341 ++++++++++ web/tests/text_parse_ini_file.php | 4 + web/themes/underground/image/bg.gif | Bin 0 -> 280 bytes web/themes/underground/image/bullet.gif | Bin 0 -> 334 bytes web/themes/underground/image/footerbg.gif | Bin 0 -> 98 bytes web/themes/underground/image/headerbg.gif | Bin 0 -> 168 bytes web/themes/underground/image/quote.gif | Bin 0 -> 338 bytes web/themes/underground/image/tableft.gif | Bin 0 -> 363 bytes web/themes/underground/image/tabright.gif | Bin 0 -> 1772 bytes .../underground/javascript/myaccount.js | 126 + web/themes/underground/javascript/vhosts.js | 19 + web/themes/underground/style/crons.css | 9 + web/themes/underground/style/hosting.css | 31 + web/themes/underground/style/informations.css | 35 + web/themes/underground/style/main.css | 364 +++ .../underground/template/_contentbegin.tpl | 55 + .../underground/template/_contentend.tpl | 19 + .../template/admin/support/list.tpl | 47 + .../template/admin/support/show.tpl | 86 + .../template/error/not_in_offer.tpl | 6 + web/themes/underground/template/footer.tpl | 13 + web/themes/underground/template/header.tpl | 19 + web/themes/underground/template/history.tpl | 34 + .../template/hosting/crons/add.tpl | 65 + .../template/hosting/crons/list.tpl | 48 + .../underground/template/hosting/hosting.tpl | 31 + .../template/hosting/informations.tpl | 111 + .../template/hosting/vhosts/add.tpl | 164 ++ .../template/hosting/vhosts/list.tpl | 31 + web/themes/underground/template/index.tpl | 32 + .../template/javascript_execution.tpl | 6 + web/themes/underground/template/myaccount.tpl | 150 ++ .../underground/template/myhostings.tpl | 25 + web/themes/underground/template/sidebar.tpl | 61 + .../underground/template/support/create.tpl | 43 + .../underground/template/support/list.tpl | 25 + .../underground/template/support/show.tpl | 99 + web/themes/underground/template/title.tpl | 3 + 1455 files changed, 20440 insertions(+) create mode 100755 system/api/action.api.php create mode 100755 system/api/api.php create mode 100755 system/api/cron.api.php create mode 100755 system/api/database.api.php create mode 100755 system/api/history.api.php create mode 100755 system/api/hosting.api.php create mode 100755 system/api/html.api.php create mode 100755 system/api/lang.api.php create mode 100755 system/api/myexception.api.php create mode 100755 system/api/mysql.api.php create mode 100755 system/api/pagination.api.php create mode 100755 system/api/security.api.php create mode 100755 system/api/support.api.php create mode 100755 system/api/template.api.php create mode 100755 system/api/textverification.api.php create mode 100755 system/api/user.api.php create mode 100755 system/api/vhost.api.php create mode 100755 system/configuration.php create mode 100755 system/core.php create mode 100755 system/lang/en/lang create mode 100755 system/lang/fr/lang create mode 100755 system/libs/smarty/Config_File.class.php create mode 100755 system/libs/smarty/Smarty.class.php create mode 100755 system/libs/smarty/Smarty_Compiler.class.php create mode 100755 system/libs/smarty/debug.tpl create mode 100755 system/libs/smarty/demo/configs/test.conf create mode 100755 system/libs/smarty/demo/index.php create mode 100755 system/libs/smarty/demo/templates/footer.tpl create mode 100755 system/libs/smarty/demo/templates/header.tpl create mode 100755 system/libs/smarty/demo/templates/index.tpl create mode 100755 system/libs/smarty/demo/templates_c/%%0E^0E4^0E407559%%footer.tpl.php create mode 100755 system/libs/smarty/demo/templates_c/%%15^15C^15C1795C%%test.conf%7Csetup.php create mode 100755 system/libs/smarty/demo/templates_c/%%45^45E^45E480CD%%index.tpl.php create mode 100755 system/libs/smarty/demo/templates_c/%%5A^5AE^5AE3C49A%%debug.tpl.php create mode 100755 system/libs/smarty/demo/templates_c/%%F7^F7F^F7F34188%%header.tpl.php create mode 100755 system/libs/smarty/internals/core.assemble_plugin_filepath.php create mode 100755 system/libs/smarty/internals/core.assign_smarty_interface.php create mode 100755 system/libs/smarty/internals/core.create_dir_structure.php create mode 100755 system/libs/smarty/internals/core.display_debug_console.php create mode 100755 system/libs/smarty/internals/core.get_include_path.php create mode 100755 system/libs/smarty/internals/core.get_microtime.php create mode 100755 system/libs/smarty/internals/core.get_php_resource.php create mode 100755 system/libs/smarty/internals/core.is_secure.php create mode 100755 system/libs/smarty/internals/core.is_trusted.php create mode 100755 system/libs/smarty/internals/core.load_plugins.php create mode 100755 system/libs/smarty/internals/core.load_resource_plugin.php create mode 100755 system/libs/smarty/internals/core.process_cached_inserts.php create mode 100755 system/libs/smarty/internals/core.process_compiled_include.php create mode 100755 system/libs/smarty/internals/core.read_cache_file.php create mode 100755 system/libs/smarty/internals/core.rm_auto.php create mode 100755 system/libs/smarty/internals/core.rmdir.php create mode 100755 system/libs/smarty/internals/core.run_insert_handler.php create mode 100755 system/libs/smarty/internals/core.smarty_include_php.php create mode 100755 system/libs/smarty/internals/core.write_cache_file.php create mode 100755 system/libs/smarty/internals/core.write_compiled_include.php create mode 100755 system/libs/smarty/internals/core.write_compiled_resource.php create mode 100755 system/libs/smarty/internals/core.write_file.php create mode 100755 system/libs/smarty/plugins/block.textformat.php create mode 100755 system/libs/smarty/plugins/compiler.assign.php create mode 100755 system/libs/smarty/plugins/compiler.defun.php create mode 100755 system/libs/smarty/plugins/compiler.endwhile.php create mode 100755 system/libs/smarty/plugins/compiler.while.php create mode 100755 system/libs/smarty/plugins/function.assign_debug_info.php create mode 100755 system/libs/smarty/plugins/function.bitwise.php create mode 100755 system/libs/smarty/plugins/function.config_load.php create mode 100755 system/libs/smarty/plugins/function.counter.php create mode 100755 system/libs/smarty/plugins/function.cycle.php create mode 100755 system/libs/smarty/plugins/function.date_diff.php create mode 100755 system/libs/smarty/plugins/function.debug.php create mode 100755 system/libs/smarty/plugins/function.eval.php create mode 100755 system/libs/smarty/plugins/function.fetch.php create mode 100755 system/libs/smarty/plugins/function.html_checkboxes.php create mode 100755 system/libs/smarty/plugins/function.html_image.php create mode 100755 system/libs/smarty/plugins/function.html_options.php create mode 100755 system/libs/smarty/plugins/function.html_radios.php create mode 100755 system/libs/smarty/plugins/function.html_select_date.php create mode 100755 system/libs/smarty/plugins/function.html_select_time.php create mode 100755 system/libs/smarty/plugins/function.html_table.php create mode 100755 system/libs/smarty/plugins/function.mailto.php create mode 100755 system/libs/smarty/plugins/function.math.php create mode 100755 system/libs/smarty/plugins/function.popup.php create mode 100755 system/libs/smarty/plugins/function.popup_init.php create mode 100755 system/libs/smarty/plugins/modifier.capitalize.php create mode 100755 system/libs/smarty/plugins/modifier.cat.php create mode 100755 system/libs/smarty/plugins/modifier.count_characters.php create mode 100755 system/libs/smarty/plugins/modifier.count_paragraphs.php create mode 100755 system/libs/smarty/plugins/modifier.count_sentences.php create mode 100755 system/libs/smarty/plugins/modifier.count_words.php create mode 100755 system/libs/smarty/plugins/modifier.date_format.php create mode 100755 system/libs/smarty/plugins/modifier.debug_print_var.php create mode 100755 system/libs/smarty/plugins/modifier.default.php create mode 100755 system/libs/smarty/plugins/modifier.escape.php create mode 100755 system/libs/smarty/plugins/modifier.indent.php create mode 100755 system/libs/smarty/plugins/modifier.lower.php create mode 100755 system/libs/smarty/plugins/modifier.money.php create mode 100755 system/libs/smarty/plugins/modifier.nl2br.php create mode 100755 system/libs/smarty/plugins/modifier.regex_replace.php create mode 100755 system/libs/smarty/plugins/modifier.replace.php create mode 100755 system/libs/smarty/plugins/modifier.spacify.php create mode 100755 system/libs/smarty/plugins/modifier.string_format.php create mode 100755 system/libs/smarty/plugins/modifier.strip.php create mode 100755 system/libs/smarty/plugins/modifier.strip_tags.php create mode 100755 system/libs/smarty/plugins/modifier.truncate.php create mode 100755 system/libs/smarty/plugins/modifier.upper.php create mode 100755 system/libs/smarty/plugins/modifier.vertical.php create mode 100755 system/libs/smarty/plugins/modifier.wordwrap.php create mode 100755 system/libs/smarty/plugins/outputfilter.trimwhitespace.php create mode 100755 system/libs/smarty/plugins/shared.escape_special_chars.php create mode 100755 system/libs/smarty/plugins/shared.make_timestamp.php create mode 100755 web/.htaccess create mode 100755 web/admin/support.php create mode 100755 web/ajax.php create mode 100755 web/critical_error.html create mode 100755 web/error.php create mode 100755 web/history.php create mode 100755 web/hosting/crons.php create mode 100755 web/hosting/domainnames.php create mode 100755 web/hosting/hosting.php create mode 100755 web/hosting/informations.php create mode 100755 web/image/big-icon/computer.png create mode 100755 web/image/big-icon/computer_128.png create mode 100755 web/image/big-icon/configuration.png create mode 100755 web/image/big-icon/cron.png create mode 100755 web/image/big-icon/database.png create mode 100755 web/image/big-icon/dns.png create mode 100755 web/image/big-icon/domain_name.png create mode 100755 web/image/big-icon/email.png create mode 100755 web/image/big-icon/faq.png create mode 100755 web/image/big-icon/ftp.png create mode 100755 web/image/big-icon/information.png create mode 100755 web/image/big-icon/installation.png create mode 100755 web/image/big-icon/quota.png create mode 100755 web/image/big-icon/stop.png create mode 100755 web/image/flag/ad.png create mode 100755 web/image/flag/ae.png create mode 100755 web/image/flag/af.png create mode 100755 web/image/flag/ag.png create mode 100755 web/image/flag/ai.png create mode 100755 web/image/flag/al.png create mode 100755 web/image/flag/am.png create mode 100755 web/image/flag/an.png create mode 100755 web/image/flag/ao.png create mode 100755 web/image/flag/ar.png create mode 100755 web/image/flag/as.png create mode 100755 web/image/flag/at.png create mode 100755 web/image/flag/au.png create mode 100755 web/image/flag/aw.png create mode 100755 web/image/flag/ax.png create mode 100755 web/image/flag/az.png create mode 100755 web/image/flag/ba.png create mode 100755 web/image/flag/bb.png create mode 100755 web/image/flag/bd.png create mode 100755 web/image/flag/be.png create mode 100755 web/image/flag/bf.png create mode 100755 web/image/flag/bg.png create mode 100755 web/image/flag/bh.png create mode 100755 web/image/flag/bi.png create mode 100755 web/image/flag/bj.png create mode 100755 web/image/flag/bm.png create mode 100755 web/image/flag/bn.png create mode 100755 web/image/flag/bo.png create mode 100755 web/image/flag/br.png create mode 100755 web/image/flag/bs.png create mode 100755 web/image/flag/bt.png create mode 100755 web/image/flag/bv.png create mode 100755 web/image/flag/bw.png create mode 100755 web/image/flag/by.png create mode 100755 web/image/flag/bz.png create mode 100755 web/image/flag/ca.png create mode 100755 web/image/flag/catalonia.png create mode 100755 web/image/flag/cc.png create mode 100755 web/image/flag/cd.png create mode 100755 web/image/flag/cf.png create mode 100755 web/image/flag/cg.png create mode 100755 web/image/flag/ch.png create mode 100755 web/image/flag/ci.png create mode 100755 web/image/flag/ck.png create mode 100755 web/image/flag/cl.png create mode 100755 web/image/flag/cm.png create mode 100755 web/image/flag/cn.png create mode 100755 web/image/flag/co.png create mode 100755 web/image/flag/cr.png create mode 100755 web/image/flag/cs.png create mode 100755 web/image/flag/cu.png create mode 100755 web/image/flag/cv.png create mode 100755 web/image/flag/cx.png create mode 100755 web/image/flag/cy.png create mode 100755 web/image/flag/cz.png create mode 100755 web/image/flag/de.png create mode 100755 web/image/flag/dj.png create mode 100755 web/image/flag/dk.png create mode 100755 web/image/flag/dm.png create mode 100755 web/image/flag/do.png create mode 100755 web/image/flag/dz.png create mode 100755 web/image/flag/ec.png create mode 100755 web/image/flag/ee.png create mode 100755 web/image/flag/eg.png create mode 100755 web/image/flag/eh.png create mode 100755 web/image/flag/england.png create mode 100755 web/image/flag/er.png create mode 100755 web/image/flag/es.png create mode 100755 web/image/flag/et.png create mode 100755 web/image/flag/europeanunion.png create mode 100755 web/image/flag/fam.png create mode 100755 web/image/flag/fi.png create mode 100755 web/image/flag/fj.png create mode 100755 web/image/flag/fk.png create mode 100755 web/image/flag/fm.png create mode 100755 web/image/flag/fo.png create mode 100755 web/image/flag/fr.png create mode 100755 web/image/flag/ga.png create mode 100755 web/image/flag/gb.png create mode 100755 web/image/flag/gd.png create mode 100755 web/image/flag/ge.png create mode 100755 web/image/flag/gf.png create mode 100755 web/image/flag/gh.png create mode 100755 web/image/flag/gi.png create mode 100755 web/image/flag/gl.png create mode 100755 web/image/flag/gm.png create mode 100755 web/image/flag/gn.png create mode 100755 web/image/flag/gp.png create mode 100755 web/image/flag/gq.png create mode 100755 web/image/flag/gr.png create mode 100755 web/image/flag/gs.png create mode 100755 web/image/flag/gt.png create mode 100755 web/image/flag/gu.png create mode 100755 web/image/flag/gw.png create mode 100755 web/image/flag/gy.png create mode 100755 web/image/flag/hk.png create mode 100755 web/image/flag/hm.png create mode 100755 web/image/flag/hn.png create mode 100755 web/image/flag/hr.png create mode 100755 web/image/flag/ht.png create mode 100755 web/image/flag/hu.png create mode 100755 web/image/flag/id.png create mode 100755 web/image/flag/ie.png create mode 100755 web/image/flag/il.png create mode 100755 web/image/flag/in.png create mode 100755 web/image/flag/io.png create mode 100755 web/image/flag/iq.png create mode 100755 web/image/flag/ir.png create mode 100755 web/image/flag/is.png create mode 100755 web/image/flag/it.png create mode 100755 web/image/flag/jm.png create mode 100755 web/image/flag/jo.png create mode 100755 web/image/flag/jp.png create mode 100755 web/image/flag/ke.png create mode 100755 web/image/flag/kg.png create mode 100755 web/image/flag/kh.png create mode 100755 web/image/flag/ki.png create mode 100755 web/image/flag/km.png create mode 100755 web/image/flag/kn.png create mode 100755 web/image/flag/kp.png create mode 100755 web/image/flag/kr.png create mode 100755 web/image/flag/kw.png create mode 100755 web/image/flag/ky.png create mode 100755 web/image/flag/kz.png create mode 100755 web/image/flag/la.png create mode 100755 web/image/flag/lb.png create mode 100755 web/image/flag/lc.png create mode 100755 web/image/flag/li.png create mode 100755 web/image/flag/lk.png create mode 100755 web/image/flag/lr.png create mode 100755 web/image/flag/ls.png create mode 100755 web/image/flag/lt.png create mode 100755 web/image/flag/lu.png create mode 100755 web/image/flag/lv.png create mode 100755 web/image/flag/ly.png create mode 100755 web/image/flag/ma.png create mode 100755 web/image/flag/mc.png create mode 100755 web/image/flag/md.png create mode 100755 web/image/flag/me.png create mode 100755 web/image/flag/mg.png create mode 100755 web/image/flag/mh.png create mode 100755 web/image/flag/mk.png create mode 100755 web/image/flag/ml.png create mode 100755 web/image/flag/mm.png create mode 100755 web/image/flag/mn.png create mode 100755 web/image/flag/mo.png create mode 100755 web/image/flag/mp.png create mode 100755 web/image/flag/mq.png create mode 100755 web/image/flag/mr.png create mode 100755 web/image/flag/ms.png create mode 100755 web/image/flag/mt.png create mode 100755 web/image/flag/mu.png create mode 100755 web/image/flag/mv.png create mode 100755 web/image/flag/mw.png create mode 100755 web/image/flag/mx.png create mode 100755 web/image/flag/my.png create mode 100755 web/image/flag/mz.png create mode 100755 web/image/flag/na.png create mode 100755 web/image/flag/nc.png create mode 100755 web/image/flag/ne.png create mode 100755 web/image/flag/nf.png create mode 100755 web/image/flag/ng.png create mode 100755 web/image/flag/ni.png create mode 100755 web/image/flag/nl.png create mode 100755 web/image/flag/no.png create mode 100755 web/image/flag/np.png create mode 100755 web/image/flag/nr.png create mode 100755 web/image/flag/nu.png create mode 100755 web/image/flag/nz.png create mode 100755 web/image/flag/om.png create mode 100755 web/image/flag/pa.png create mode 100755 web/image/flag/pe.png create mode 100755 web/image/flag/pf.png create mode 100755 web/image/flag/pg.png create mode 100755 web/image/flag/ph.png create mode 100755 web/image/flag/pk.png create mode 100755 web/image/flag/pl.png create mode 100755 web/image/flag/pm.png create mode 100755 web/image/flag/pn.png create mode 100755 web/image/flag/pr.png create mode 100755 web/image/flag/ps.png create mode 100755 web/image/flag/pt.png create mode 100755 web/image/flag/pw.png create mode 100755 web/image/flag/py.png create mode 100755 web/image/flag/qa.png create mode 100755 web/image/flag/re.png create mode 100755 web/image/flag/ro.png create mode 100755 web/image/flag/rs.png create mode 100755 web/image/flag/ru.png create mode 100755 web/image/flag/rw.png create mode 100755 web/image/flag/sa.png create mode 100755 web/image/flag/sb.png create mode 100755 web/image/flag/sc.png create mode 100755 web/image/flag/scotland.png create mode 100755 web/image/flag/sd.png create mode 100755 web/image/flag/se.png create mode 100755 web/image/flag/sg.png create mode 100755 web/image/flag/sh.png create mode 100755 web/image/flag/si.png create mode 100755 web/image/flag/sj.png create mode 100755 web/image/flag/sk.png create mode 100755 web/image/flag/sl.png create mode 100755 web/image/flag/sm.png create mode 100755 web/image/flag/sn.png create mode 100755 web/image/flag/so.png create mode 100755 web/image/flag/sr.png create mode 100755 web/image/flag/st.png create mode 100755 web/image/flag/sv.png create mode 100755 web/image/flag/sy.png create mode 100755 web/image/flag/sz.png create mode 100755 web/image/flag/tc.png create mode 100755 web/image/flag/td.png create mode 100755 web/image/flag/tf.png create mode 100755 web/image/flag/tg.png create mode 100755 web/image/flag/th.png create mode 100755 web/image/flag/tj.png create mode 100755 web/image/flag/tk.png create mode 100755 web/image/flag/tl.png create mode 100755 web/image/flag/tm.png create mode 100755 web/image/flag/tn.png create mode 100755 web/image/flag/to.png create mode 100755 web/image/flag/tr.png create mode 100755 web/image/flag/tt.png create mode 100755 web/image/flag/tv.png create mode 100755 web/image/flag/tw.png create mode 100755 web/image/flag/tz.png create mode 100755 web/image/flag/ua.png create mode 100755 web/image/flag/ug.png create mode 100755 web/image/flag/um.png create mode 100755 web/image/flag/us.png create mode 100755 web/image/flag/uy.png create mode 100755 web/image/flag/uz.png create mode 100755 web/image/flag/va.png create mode 100755 web/image/flag/vc.png create mode 100755 web/image/flag/ve.png create mode 100755 web/image/flag/vg.png create mode 100755 web/image/flag/vi.png create mode 100755 web/image/flag/vn.png create mode 100755 web/image/flag/vu.png create mode 100755 web/image/flag/wales.png create mode 100755 web/image/flag/wf.png create mode 100755 web/image/flag/ws.png create mode 100755 web/image/flag/ye.png create mode 100755 web/image/flag/yt.png create mode 100755 web/image/flag/za.png create mode 100755 web/image/flag/zm.png create mode 100755 web/image/flag/zw.png create mode 100755 web/image/gritter-bg-tile.png create mode 100755 web/image/gritter-bottom.png create mode 100755 web/image/gritter-close-ie6.gif create mode 100755 web/image/gritter-close.png create mode 100755 web/image/gritter-top.png create mode 100755 web/image/icon/accept.png create mode 100755 web/image/icon/add.png create mode 100755 web/image/icon/anchor.png create mode 100755 web/image/icon/application.png create mode 100755 web/image/icon/application_add.png create mode 100755 web/image/icon/application_cascade.png create mode 100755 web/image/icon/application_delete.png create mode 100755 web/image/icon/application_double.png create mode 100755 web/image/icon/application_edit.png create mode 100755 web/image/icon/application_error.png create mode 100755 web/image/icon/application_form.png create mode 100755 web/image/icon/application_form_add.png create mode 100755 web/image/icon/application_form_delete.png create mode 100755 web/image/icon/application_form_edit.png create mode 100755 web/image/icon/application_form_magnify.png create mode 100755 web/image/icon/application_get.png create mode 100755 web/image/icon/application_go.png create mode 100755 web/image/icon/application_home.png create mode 100755 web/image/icon/application_key.png create mode 100755 web/image/icon/application_lightning.png create mode 100755 web/image/icon/application_link.png create mode 100755 web/image/icon/application_osx.png create mode 100755 web/image/icon/application_osx_terminal.png create mode 100755 web/image/icon/application_put.png create mode 100755 web/image/icon/application_side_boxes.png create mode 100755 web/image/icon/application_side_contract.png create mode 100755 web/image/icon/application_side_expand.png create mode 100755 web/image/icon/application_side_list.png create mode 100755 web/image/icon/application_side_tree.png create mode 100755 web/image/icon/application_split.png create mode 100755 web/image/icon/application_tile_horizontal.png create mode 100755 web/image/icon/application_tile_vertical.png create mode 100755 web/image/icon/application_view_columns.png create mode 100755 web/image/icon/application_view_detail.png create mode 100755 web/image/icon/application_view_gallery.png create mode 100755 web/image/icon/application_view_icons.png create mode 100755 web/image/icon/application_view_list.png create mode 100755 web/image/icon/application_view_tile.png create mode 100755 web/image/icon/application_xp.png create mode 100755 web/image/icon/application_xp_terminal.png create mode 100755 web/image/icon/arrow_branch.png create mode 100755 web/image/icon/arrow_divide.png create mode 100755 web/image/icon/arrow_down.png create mode 100755 web/image/icon/arrow_in.png create mode 100755 web/image/icon/arrow_inout.png create mode 100755 web/image/icon/arrow_join.png create mode 100755 web/image/icon/arrow_left.png create mode 100755 web/image/icon/arrow_merge.png create mode 100755 web/image/icon/arrow_out.png create mode 100755 web/image/icon/arrow_redo.png create mode 100755 web/image/icon/arrow_refresh.png create mode 100755 web/image/icon/arrow_refresh_small.png create mode 100755 web/image/icon/arrow_right.png create mode 100755 web/image/icon/arrow_rotate_anticlockwise.png create mode 100755 web/image/icon/arrow_rotate_clockwise.png create mode 100755 web/image/icon/arrow_switch.png create mode 100755 web/image/icon/arrow_turn_left.png create mode 100755 web/image/icon/arrow_turn_right.png create mode 100755 web/image/icon/arrow_undo.png create mode 100755 web/image/icon/arrow_up.png create mode 100755 web/image/icon/asterisk_orange.png create mode 100755 web/image/icon/asterisk_yellow.png create mode 100755 web/image/icon/attach.png create mode 100755 web/image/icon/award_star_add.png create mode 100755 web/image/icon/award_star_bronze_1.png create mode 100755 web/image/icon/award_star_bronze_2.png create mode 100755 web/image/icon/award_star_bronze_3.png create mode 100755 web/image/icon/award_star_delete.png create mode 100755 web/image/icon/award_star_gold_1.png create mode 100755 web/image/icon/award_star_gold_2.png create mode 100755 web/image/icon/award_star_gold_3.png create mode 100755 web/image/icon/award_star_silver_1.png create mode 100755 web/image/icon/award_star_silver_2.png create mode 100755 web/image/icon/award_star_silver_3.png create mode 100755 web/image/icon/basket.png create mode 100755 web/image/icon/basket_add.png create mode 100755 web/image/icon/basket_delete.png create mode 100755 web/image/icon/basket_edit.png create mode 100755 web/image/icon/basket_error.png create mode 100755 web/image/icon/basket_go.png create mode 100755 web/image/icon/basket_put.png create mode 100755 web/image/icon/basket_remove.png create mode 100755 web/image/icon/bell.png create mode 100755 web/image/icon/bell_add.png create mode 100755 web/image/icon/bell_delete.png create mode 100755 web/image/icon/bell_error.png create mode 100755 web/image/icon/bell_go.png create mode 100755 web/image/icon/bell_link.png create mode 100755 web/image/icon/bin.png create mode 100755 web/image/icon/bin_closed.png create mode 100755 web/image/icon/bin_empty.png create mode 100755 web/image/icon/bomb.png create mode 100755 web/image/icon/book.png create mode 100755 web/image/icon/book_add.png create mode 100755 web/image/icon/book_addresses.png create mode 100755 web/image/icon/book_delete.png create mode 100755 web/image/icon/book_edit.png create mode 100755 web/image/icon/book_error.png create mode 100755 web/image/icon/book_go.png create mode 100755 web/image/icon/book_key.png create mode 100755 web/image/icon/book_link.png create mode 100755 web/image/icon/book_next.png create mode 100755 web/image/icon/book_open.png create mode 100755 web/image/icon/book_previous.png create mode 100755 web/image/icon/box.png create mode 100755 web/image/icon/brick.png create mode 100755 web/image/icon/brick_add.png create mode 100755 web/image/icon/brick_delete.png create mode 100755 web/image/icon/brick_edit.png create mode 100755 web/image/icon/brick_error.png create mode 100755 web/image/icon/brick_go.png create mode 100755 web/image/icon/brick_link.png create mode 100755 web/image/icon/bricks.png create mode 100755 web/image/icon/briefcase.png create mode 100755 web/image/icon/bug.png create mode 100755 web/image/icon/bug_add.png create mode 100755 web/image/icon/bug_delete.png create mode 100755 web/image/icon/bug_edit.png create mode 100755 web/image/icon/bug_error.png create mode 100755 web/image/icon/bug_go.png create mode 100755 web/image/icon/bug_link.png create mode 100755 web/image/icon/building.png create mode 100755 web/image/icon/building_add.png create mode 100755 web/image/icon/building_delete.png create mode 100755 web/image/icon/building_edit.png create mode 100755 web/image/icon/building_error.png create mode 100755 web/image/icon/building_go.png create mode 100755 web/image/icon/building_key.png create mode 100755 web/image/icon/building_link.png create mode 100755 web/image/icon/bullet_add.png create mode 100755 web/image/icon/bullet_arrow_bottom.png create mode 100755 web/image/icon/bullet_arrow_down.png create mode 100755 web/image/icon/bullet_arrow_top.png create mode 100755 web/image/icon/bullet_arrow_up.png create mode 100755 web/image/icon/bullet_black.png create mode 100755 web/image/icon/bullet_blue.png create mode 100755 web/image/icon/bullet_delete.png create mode 100755 web/image/icon/bullet_disk.png create mode 100755 web/image/icon/bullet_error.png create mode 100755 web/image/icon/bullet_feed.png create mode 100755 web/image/icon/bullet_go.png create mode 100755 web/image/icon/bullet_green.png create mode 100755 web/image/icon/bullet_key.png create mode 100755 web/image/icon/bullet_orange.png create mode 100755 web/image/icon/bullet_picture.png create mode 100755 web/image/icon/bullet_pink.png create mode 100755 web/image/icon/bullet_purple.png create mode 100755 web/image/icon/bullet_red.png create mode 100755 web/image/icon/bullet_star.png create mode 100755 web/image/icon/bullet_toggle_minus.png create mode 100755 web/image/icon/bullet_toggle_plus.png create mode 100755 web/image/icon/bullet_white.png create mode 100755 web/image/icon/bullet_wrench.png create mode 100755 web/image/icon/bullet_yellow.png create mode 100755 web/image/icon/cake.png create mode 100755 web/image/icon/calculator.png create mode 100755 web/image/icon/calculator_add.png create mode 100755 web/image/icon/calculator_delete.png create mode 100755 web/image/icon/calculator_edit.png create mode 100755 web/image/icon/calculator_error.png create mode 100755 web/image/icon/calculator_link.png create mode 100755 web/image/icon/calendar.png create mode 100755 web/image/icon/calendar_add.png create mode 100755 web/image/icon/calendar_delete.png create mode 100755 web/image/icon/calendar_edit.png create mode 100755 web/image/icon/calendar_link.png create mode 100755 web/image/icon/calendar_view_day.png create mode 100755 web/image/icon/calendar_view_month.png create mode 100755 web/image/icon/calendar_view_week.png create mode 100755 web/image/icon/camera.png create mode 100755 web/image/icon/camera_add.png create mode 100755 web/image/icon/camera_delete.png create mode 100755 web/image/icon/camera_edit.png create mode 100755 web/image/icon/camera_error.png create mode 100755 web/image/icon/camera_go.png create mode 100755 web/image/icon/camera_link.png create mode 100755 web/image/icon/camera_small.png create mode 100755 web/image/icon/cancel.png create mode 100755 web/image/icon/car.png create mode 100755 web/image/icon/car_add.png create mode 100755 web/image/icon/car_delete.png create mode 100755 web/image/icon/cart.png create mode 100755 web/image/icon/cart_add.png create mode 100755 web/image/icon/cart_delete.png create mode 100755 web/image/icon/cart_edit.png create mode 100755 web/image/icon/cart_error.png create mode 100755 web/image/icon/cart_go.png create mode 100755 web/image/icon/cart_put.png create mode 100755 web/image/icon/cart_remove.png create mode 100755 web/image/icon/cd.png create mode 100755 web/image/icon/cd_add.png create mode 100755 web/image/icon/cd_burn.png create mode 100755 web/image/icon/cd_delete.png create mode 100755 web/image/icon/cd_edit.png create mode 100755 web/image/icon/cd_eject.png create mode 100755 web/image/icon/cd_go.png create mode 100755 web/image/icon/chart_bar.png create mode 100755 web/image/icon/chart_bar_add.png create mode 100755 web/image/icon/chart_bar_delete.png create mode 100755 web/image/icon/chart_bar_edit.png create mode 100755 web/image/icon/chart_bar_error.png create mode 100755 web/image/icon/chart_bar_link.png create mode 100755 web/image/icon/chart_curve.png create mode 100755 web/image/icon/chart_curve_add.png create mode 100755 web/image/icon/chart_curve_delete.png create mode 100755 web/image/icon/chart_curve_edit.png create mode 100755 web/image/icon/chart_curve_error.png create mode 100755 web/image/icon/chart_curve_go.png create mode 100755 web/image/icon/chart_curve_link.png create mode 100755 web/image/icon/chart_line.png create mode 100755 web/image/icon/chart_line_add.png create mode 100755 web/image/icon/chart_line_delete.png create mode 100755 web/image/icon/chart_line_edit.png create mode 100755 web/image/icon/chart_line_error.png create mode 100755 web/image/icon/chart_line_link.png create mode 100755 web/image/icon/chart_organisation.png create mode 100755 web/image/icon/chart_organisation_add.png create mode 100755 web/image/icon/chart_organisation_delete.png create mode 100755 web/image/icon/chart_pie.png create mode 100755 web/image/icon/chart_pie_add.png create mode 100755 web/image/icon/chart_pie_delete.png create mode 100755 web/image/icon/chart_pie_edit.png create mode 100755 web/image/icon/chart_pie_error.png create mode 100755 web/image/icon/chart_pie_link.png create mode 100755 web/image/icon/clock.png create mode 100755 web/image/icon/clock_add.png create mode 100755 web/image/icon/clock_delete.png create mode 100755 web/image/icon/clock_edit.png create mode 100755 web/image/icon/clock_error.png create mode 100755 web/image/icon/clock_go.png create mode 100755 web/image/icon/clock_link.png create mode 100755 web/image/icon/clock_pause.png create mode 100755 web/image/icon/clock_play.png create mode 100755 web/image/icon/clock_red.png create mode 100755 web/image/icon/clock_stop.png create mode 100755 web/image/icon/cog.png create mode 100755 web/image/icon/cog_add.png create mode 100755 web/image/icon/cog_delete.png create mode 100755 web/image/icon/cog_edit.png create mode 100755 web/image/icon/cog_error.png create mode 100755 web/image/icon/cog_go.png create mode 100755 web/image/icon/coins.png create mode 100755 web/image/icon/coins_add.png create mode 100755 web/image/icon/coins_delete.png create mode 100755 web/image/icon/color_swatch.png create mode 100755 web/image/icon/color_wheel.png create mode 100755 web/image/icon/comment.png create mode 100755 web/image/icon/comment_add.png create mode 100755 web/image/icon/comment_delete.png create mode 100755 web/image/icon/comment_edit.png create mode 100755 web/image/icon/comments.png create mode 100755 web/image/icon/comments_add.png create mode 100755 web/image/icon/comments_delete.png create mode 100755 web/image/icon/compress.png create mode 100755 web/image/icon/computer.png create mode 100755 web/image/icon/computer_add.png create mode 100755 web/image/icon/computer_delete.png create mode 100755 web/image/icon/computer_edit.png create mode 100755 web/image/icon/computer_error.png create mode 100755 web/image/icon/computer_go.png create mode 100755 web/image/icon/computer_key.png create mode 100755 web/image/icon/computer_link.png create mode 100755 web/image/icon/connect.png create mode 100755 web/image/icon/contrast.png create mode 100755 web/image/icon/contrast_decrease.png create mode 100755 web/image/icon/contrast_high.png create mode 100755 web/image/icon/contrast_increase.png create mode 100755 web/image/icon/contrast_low.png create mode 100755 web/image/icon/control_eject.png create mode 100755 web/image/icon/control_eject_blue.png create mode 100755 web/image/icon/control_end.png create mode 100755 web/image/icon/control_end_blue.png create mode 100755 web/image/icon/control_equalizer.png create mode 100755 web/image/icon/control_equalizer_blue.png create mode 100755 web/image/icon/control_fastforward.png create mode 100755 web/image/icon/control_fastforward_blue.png create mode 100755 web/image/icon/control_pause.png create mode 100755 web/image/icon/control_pause_blue.png create mode 100755 web/image/icon/control_play.png create mode 100755 web/image/icon/control_play_blue.png create mode 100755 web/image/icon/control_repeat.png create mode 100755 web/image/icon/control_repeat_blue.png create mode 100755 web/image/icon/control_rewind.png create mode 100755 web/image/icon/control_rewind_blue.png create mode 100755 web/image/icon/control_start.png create mode 100755 web/image/icon/control_start_blue.png create mode 100755 web/image/icon/control_stop.png create mode 100755 web/image/icon/control_stop_blue.png create mode 100755 web/image/icon/controller.png create mode 100755 web/image/icon/controller_add.png create mode 100755 web/image/icon/controller_delete.png create mode 100755 web/image/icon/controller_error.png create mode 100755 web/image/icon/creditcards.png create mode 100755 web/image/icon/cross.png create mode 100755 web/image/icon/css.png create mode 100755 web/image/icon/css_add.png create mode 100755 web/image/icon/css_delete.png create mode 100755 web/image/icon/css_go.png create mode 100755 web/image/icon/css_valid.png create mode 100755 web/image/icon/cup.png create mode 100755 web/image/icon/cup_add.png create mode 100755 web/image/icon/cup_delete.png create mode 100755 web/image/icon/cup_edit.png create mode 100755 web/image/icon/cup_error.png create mode 100755 web/image/icon/cup_go.png create mode 100755 web/image/icon/cup_key.png create mode 100755 web/image/icon/cup_link.png create mode 100755 web/image/icon/cursor.png create mode 100755 web/image/icon/cut.png create mode 100755 web/image/icon/cut_red.png create mode 100755 web/image/icon/database.png create mode 100755 web/image/icon/database_add.png create mode 100755 web/image/icon/database_connect.png create mode 100755 web/image/icon/database_delete.png create mode 100755 web/image/icon/database_edit.png create mode 100755 web/image/icon/database_error.png create mode 100755 web/image/icon/database_gear.png create mode 100755 web/image/icon/database_go.png create mode 100755 web/image/icon/database_key.png create mode 100755 web/image/icon/database_lightning.png create mode 100755 web/image/icon/database_link.png create mode 100755 web/image/icon/database_refresh.png create mode 100755 web/image/icon/database_save.png create mode 100755 web/image/icon/database_table.png create mode 100755 web/image/icon/date.png create mode 100755 web/image/icon/date_add.png create mode 100755 web/image/icon/date_delete.png create mode 100755 web/image/icon/date_edit.png create mode 100755 web/image/icon/date_error.png create mode 100755 web/image/icon/date_go.png create mode 100755 web/image/icon/date_link.png create mode 100755 web/image/icon/date_magnify.png create mode 100755 web/image/icon/date_next.png create mode 100755 web/image/icon/date_previous.png create mode 100755 web/image/icon/delete.png create mode 100755 web/image/icon/disconnect.png create mode 100755 web/image/icon/disk.png create mode 100755 web/image/icon/disk_multiple.png create mode 100755 web/image/icon/door.png create mode 100755 web/image/icon/door_in.png create mode 100755 web/image/icon/door_open.png create mode 100755 web/image/icon/door_out.png create mode 100755 web/image/icon/drink.png create mode 100755 web/image/icon/drink_empty.png create mode 100755 web/image/icon/drive.png create mode 100755 web/image/icon/drive_add.png create mode 100755 web/image/icon/drive_burn.png create mode 100755 web/image/icon/drive_cd.png create mode 100755 web/image/icon/drive_cd_empty.png create mode 100755 web/image/icon/drive_delete.png create mode 100755 web/image/icon/drive_disk.png create mode 100755 web/image/icon/drive_edit.png create mode 100755 web/image/icon/drive_error.png create mode 100755 web/image/icon/drive_go.png create mode 100755 web/image/icon/drive_key.png create mode 100755 web/image/icon/drive_link.png create mode 100755 web/image/icon/drive_magnify.png create mode 100755 web/image/icon/drive_network.png create mode 100755 web/image/icon/drive_rename.png create mode 100755 web/image/icon/drive_user.png create mode 100755 web/image/icon/drive_web.png create mode 100755 web/image/icon/dvd.png create mode 100755 web/image/icon/dvd_add.png create mode 100755 web/image/icon/dvd_delete.png create mode 100755 web/image/icon/dvd_edit.png create mode 100755 web/image/icon/dvd_error.png create mode 100755 web/image/icon/dvd_go.png create mode 100755 web/image/icon/dvd_key.png create mode 100755 web/image/icon/dvd_link.png create mode 100755 web/image/icon/email.png create mode 100755 web/image/icon/email_add.png create mode 100755 web/image/icon/email_attach.png create mode 100755 web/image/icon/email_delete.png create mode 100755 web/image/icon/email_edit.png create mode 100755 web/image/icon/email_error.png create mode 100755 web/image/icon/email_go.png create mode 100755 web/image/icon/email_link.png create mode 100755 web/image/icon/email_open.png create mode 100755 web/image/icon/email_open_image.png create mode 100755 web/image/icon/emoticon_evilgrin.png create mode 100755 web/image/icon/emoticon_grin.png create mode 100755 web/image/icon/emoticon_happy.png create mode 100755 web/image/icon/emoticon_smile.png create mode 100755 web/image/icon/emoticon_surprised.png create mode 100755 web/image/icon/emoticon_tongue.png create mode 100755 web/image/icon/emoticon_unhappy.png create mode 100755 web/image/icon/emoticon_waii.png create mode 100755 web/image/icon/emoticon_wink.png create mode 100755 web/image/icon/error.png create mode 100755 web/image/icon/error_add.png create mode 100755 web/image/icon/error_delete.png create mode 100755 web/image/icon/error_go.png create mode 100755 web/image/icon/exclamation.png create mode 100755 web/image/icon/eye.png create mode 100755 web/image/icon/feed.png create mode 100755 web/image/icon/feed_add.png create mode 100755 web/image/icon/feed_delete.png create mode 100755 web/image/icon/feed_disk.png create mode 100755 web/image/icon/feed_edit.png create mode 100755 web/image/icon/feed_error.png create mode 100755 web/image/icon/feed_go.png create mode 100755 web/image/icon/feed_key.png create mode 100755 web/image/icon/feed_link.png create mode 100755 web/image/icon/feed_magnify.png create mode 100755 web/image/icon/female.png create mode 100755 web/image/icon/film.png create mode 100755 web/image/icon/film_add.png create mode 100755 web/image/icon/film_delete.png create mode 100755 web/image/icon/film_edit.png create mode 100755 web/image/icon/film_error.png create mode 100755 web/image/icon/film_go.png create mode 100755 web/image/icon/film_key.png create mode 100755 web/image/icon/film_link.png create mode 100755 web/image/icon/film_save.png create mode 100755 web/image/icon/find.png create mode 100755 web/image/icon/flag_blue.png create mode 100755 web/image/icon/flag_green.png create mode 100755 web/image/icon/flag_orange.png create mode 100755 web/image/icon/flag_pink.png create mode 100755 web/image/icon/flag_purple.png create mode 100755 web/image/icon/flag_red.png create mode 100755 web/image/icon/flag_yellow.png create mode 100755 web/image/icon/folder.png create mode 100755 web/image/icon/folder_add.png create mode 100755 web/image/icon/folder_bell.png create mode 100755 web/image/icon/folder_brick.png create mode 100755 web/image/icon/folder_bug.png create mode 100755 web/image/icon/folder_camera.png create mode 100755 web/image/icon/folder_database.png create mode 100755 web/image/icon/folder_delete.png create mode 100755 web/image/icon/folder_edit.png create mode 100755 web/image/icon/folder_error.png create mode 100755 web/image/icon/folder_explore.png create mode 100755 web/image/icon/folder_feed.png create mode 100755 web/image/icon/folder_find.png create mode 100755 web/image/icon/folder_go.png create mode 100755 web/image/icon/folder_heart.png create mode 100755 web/image/icon/folder_image.png create mode 100755 web/image/icon/folder_key.png create mode 100755 web/image/icon/folder_lightbulb.png create mode 100755 web/image/icon/folder_link.png create mode 100755 web/image/icon/folder_magnify.png create mode 100755 web/image/icon/folder_page.png create mode 100755 web/image/icon/folder_page_white.png create mode 100755 web/image/icon/folder_palette.png create mode 100755 web/image/icon/folder_picture.png create mode 100755 web/image/icon/folder_star.png create mode 100755 web/image/icon/folder_table.png create mode 100755 web/image/icon/folder_user.png create mode 100755 web/image/icon/folder_wrench.png create mode 100755 web/image/icon/font.png create mode 100755 web/image/icon/font_add.png create mode 100755 web/image/icon/font_delete.png create mode 100755 web/image/icon/font_go.png create mode 100755 web/image/icon/group.png create mode 100755 web/image/icon/group_add.png create mode 100755 web/image/icon/group_delete.png create mode 100755 web/image/icon/group_edit.png create mode 100755 web/image/icon/group_error.png create mode 100755 web/image/icon/group_gear.png create mode 100755 web/image/icon/group_go.png create mode 100755 web/image/icon/group_key.png create mode 100755 web/image/icon/group_link.png create mode 100755 web/image/icon/heart.png create mode 100755 web/image/icon/heart_add.png create mode 100755 web/image/icon/heart_delete.png create mode 100755 web/image/icon/help.png create mode 100755 web/image/icon/hourglass.png create mode 100755 web/image/icon/hourglass_add.png create mode 100755 web/image/icon/hourglass_delete.png create mode 100755 web/image/icon/hourglass_go.png create mode 100755 web/image/icon/hourglass_link.png create mode 100755 web/image/icon/house.png create mode 100755 web/image/icon/house_go.png create mode 100755 web/image/icon/house_link.png create mode 100755 web/image/icon/html.png create mode 100755 web/image/icon/html_add.png create mode 100755 web/image/icon/html_delete.png create mode 100755 web/image/icon/html_go.png create mode 100755 web/image/icon/html_valid.png create mode 100755 web/image/icon/image.png create mode 100755 web/image/icon/image_add.png create mode 100755 web/image/icon/image_delete.png create mode 100755 web/image/icon/image_edit.png create mode 100755 web/image/icon/image_link.png create mode 100755 web/image/icon/images.png create mode 100755 web/image/icon/information.png create mode 100755 web/image/icon/ipod.png create mode 100755 web/image/icon/ipod_cast.png create mode 100755 web/image/icon/ipod_cast_add.png create mode 100755 web/image/icon/ipod_cast_delete.png create mode 100755 web/image/icon/ipod_sound.png create mode 100755 web/image/icon/joystick.png create mode 100755 web/image/icon/joystick_add.png create mode 100755 web/image/icon/joystick_delete.png create mode 100755 web/image/icon/joystick_error.png create mode 100755 web/image/icon/key.png create mode 100755 web/image/icon/key_add.png create mode 100755 web/image/icon/key_delete.png create mode 100755 web/image/icon/key_go.png create mode 100755 web/image/icon/keyboard.png create mode 100755 web/image/icon/keyboard_add.png create mode 100755 web/image/icon/keyboard_delete.png create mode 100755 web/image/icon/keyboard_magnify.png create mode 100755 web/image/icon/layers.png create mode 100755 web/image/icon/layout.png create mode 100755 web/image/icon/layout_add.png create mode 100755 web/image/icon/layout_content.png create mode 100755 web/image/icon/layout_delete.png create mode 100755 web/image/icon/layout_edit.png create mode 100755 web/image/icon/layout_error.png create mode 100755 web/image/icon/layout_header.png create mode 100755 web/image/icon/layout_link.png create mode 100755 web/image/icon/layout_sidebar.png create mode 100755 web/image/icon/lightbulb.png create mode 100755 web/image/icon/lightbulb_add.png create mode 100755 web/image/icon/lightbulb_delete.png create mode 100755 web/image/icon/lightbulb_off.png create mode 100755 web/image/icon/lightning.png create mode 100755 web/image/icon/lightning_add.png create mode 100755 web/image/icon/lightning_delete.png create mode 100755 web/image/icon/lightning_go.png create mode 100755 web/image/icon/link.png create mode 100755 web/image/icon/link_add.png create mode 100755 web/image/icon/link_break.png create mode 100755 web/image/icon/link_delete.png create mode 100755 web/image/icon/link_edit.png create mode 100755 web/image/icon/link_error.png create mode 100755 web/image/icon/link_go.png create mode 100755 web/image/icon/lock.png create mode 100755 web/image/icon/lock_add.png create mode 100755 web/image/icon/lock_break.png create mode 100755 web/image/icon/lock_delete.png create mode 100755 web/image/icon/lock_edit.png create mode 100755 web/image/icon/lock_go.png create mode 100755 web/image/icon/lock_open.png create mode 100755 web/image/icon/lorry.png create mode 100755 web/image/icon/lorry_add.png create mode 100755 web/image/icon/lorry_delete.png create mode 100755 web/image/icon/lorry_error.png create mode 100755 web/image/icon/lorry_flatbed.png create mode 100755 web/image/icon/lorry_go.png create mode 100755 web/image/icon/lorry_link.png create mode 100755 web/image/icon/magifier_zoom_out.png create mode 100755 web/image/icon/magnifier.png create mode 100755 web/image/icon/magnifier_zoom_in.png create mode 100755 web/image/icon/male.png create mode 100755 web/image/icon/map.png create mode 100755 web/image/icon/map_add.png create mode 100755 web/image/icon/map_delete.png create mode 100755 web/image/icon/map_edit.png create mode 100755 web/image/icon/map_go.png create mode 100755 web/image/icon/map_magnify.png create mode 100755 web/image/icon/medal_bronze_1.png create mode 100755 web/image/icon/medal_bronze_2.png create mode 100755 web/image/icon/medal_bronze_3.png create mode 100755 web/image/icon/medal_bronze_add.png create mode 100755 web/image/icon/medal_bronze_delete.png create mode 100755 web/image/icon/medal_gold_1.png create mode 100755 web/image/icon/medal_gold_2.png create mode 100755 web/image/icon/medal_gold_3.png create mode 100755 web/image/icon/medal_gold_add.png create mode 100755 web/image/icon/medal_gold_delete.png create mode 100755 web/image/icon/medal_silver_1.png create mode 100755 web/image/icon/medal_silver_2.png create mode 100755 web/image/icon/medal_silver_3.png create mode 100755 web/image/icon/medal_silver_add.png create mode 100755 web/image/icon/medal_silver_delete.png create mode 100755 web/image/icon/money.png create mode 100755 web/image/icon/money_add.png create mode 100755 web/image/icon/money_delete.png create mode 100755 web/image/icon/money_dollar.png create mode 100755 web/image/icon/money_euro.png create mode 100755 web/image/icon/money_pound.png create mode 100755 web/image/icon/money_yen.png create mode 100755 web/image/icon/monitor.png create mode 100755 web/image/icon/monitor_add.png create mode 100755 web/image/icon/monitor_delete.png create mode 100755 web/image/icon/monitor_edit.png create mode 100755 web/image/icon/monitor_error.png create mode 100755 web/image/icon/monitor_go.png create mode 100755 web/image/icon/monitor_lightning.png create mode 100755 web/image/icon/monitor_link.png create mode 100755 web/image/icon/mouse.png create mode 100755 web/image/icon/mouse_add.png create mode 100755 web/image/icon/mouse_delete.png create mode 100755 web/image/icon/mouse_error.png create mode 100755 web/image/icon/music.png create mode 100755 web/image/icon/new.png create mode 100755 web/image/icon/newspaper.png create mode 100755 web/image/icon/newspaper_add.png create mode 100755 web/image/icon/newspaper_delete.png create mode 100755 web/image/icon/newspaper_go.png create mode 100755 web/image/icon/newspaper_link.png create mode 100755 web/image/icon/note.png create mode 100755 web/image/icon/note_add.png create mode 100755 web/image/icon/note_delete.png create mode 100755 web/image/icon/note_edit.png create mode 100755 web/image/icon/note_error.png create mode 100755 web/image/icon/note_go.png create mode 100755 web/image/icon/overlays.png create mode 100755 web/image/icon/package.png create mode 100755 web/image/icon/package_add.png create mode 100755 web/image/icon/package_delete.png create mode 100755 web/image/icon/package_go.png create mode 100755 web/image/icon/package_green.png create mode 100755 web/image/icon/package_link.png create mode 100755 web/image/icon/page.png create mode 100755 web/image/icon/page_add.png create mode 100755 web/image/icon/page_attach.png create mode 100755 web/image/icon/page_code.png create mode 100755 web/image/icon/page_copy.png create mode 100755 web/image/icon/page_delete.png create mode 100755 web/image/icon/page_edit.png create mode 100755 web/image/icon/page_error.png create mode 100755 web/image/icon/page_excel.png create mode 100755 web/image/icon/page_find.png create mode 100755 web/image/icon/page_gear.png create mode 100755 web/image/icon/page_go.png create mode 100755 web/image/icon/page_green.png create mode 100755 web/image/icon/page_key.png create mode 100755 web/image/icon/page_lightning.png create mode 100755 web/image/icon/page_link.png create mode 100755 web/image/icon/page_paintbrush.png create mode 100755 web/image/icon/page_paste.png create mode 100755 web/image/icon/page_red.png create mode 100755 web/image/icon/page_refresh.png create mode 100755 web/image/icon/page_save.png create mode 100755 web/image/icon/page_white.png create mode 100755 web/image/icon/page_white_acrobat.png create mode 100755 web/image/icon/page_white_actionscript.png create mode 100755 web/image/icon/page_white_add.png create mode 100755 web/image/icon/page_white_c.png create mode 100755 web/image/icon/page_white_camera.png create mode 100755 web/image/icon/page_white_cd.png create mode 100755 web/image/icon/page_white_code.png create mode 100755 web/image/icon/page_white_code_red.png create mode 100755 web/image/icon/page_white_coldfusion.png create mode 100755 web/image/icon/page_white_compressed.png create mode 100755 web/image/icon/page_white_copy.png create mode 100755 web/image/icon/page_white_cplusplus.png create mode 100755 web/image/icon/page_white_csharp.png create mode 100755 web/image/icon/page_white_cup.png create mode 100755 web/image/icon/page_white_database.png create mode 100755 web/image/icon/page_white_delete.png create mode 100755 web/image/icon/page_white_dvd.png create mode 100755 web/image/icon/page_white_edit.png create mode 100755 web/image/icon/page_white_error.png create mode 100755 web/image/icon/page_white_excel.png create mode 100755 web/image/icon/page_white_find.png create mode 100755 web/image/icon/page_white_flash.png create mode 100755 web/image/icon/page_white_freehand.png create mode 100755 web/image/icon/page_white_gear.png create mode 100755 web/image/icon/page_white_get.png create mode 100755 web/image/icon/page_white_go.png create mode 100755 web/image/icon/page_white_h.png create mode 100755 web/image/icon/page_white_horizontal.png create mode 100755 web/image/icon/page_white_key.png create mode 100755 web/image/icon/page_white_lightning.png create mode 100755 web/image/icon/page_white_link.png create mode 100755 web/image/icon/page_white_magnify.png create mode 100755 web/image/icon/page_white_medal.png create mode 100755 web/image/icon/page_white_office.png create mode 100755 web/image/icon/page_white_paint.png create mode 100755 web/image/icon/page_white_paintbrush.png create mode 100755 web/image/icon/page_white_paste.png create mode 100755 web/image/icon/page_white_php.png create mode 100755 web/image/icon/page_white_picture.png create mode 100755 web/image/icon/page_white_powerpoint.png create mode 100755 web/image/icon/page_white_put.png create mode 100755 web/image/icon/page_white_ruby.png create mode 100755 web/image/icon/page_white_stack.png create mode 100755 web/image/icon/page_white_star.png create mode 100755 web/image/icon/page_white_swoosh.png create mode 100755 web/image/icon/page_white_text.png create mode 100755 web/image/icon/page_white_text_width.png create mode 100755 web/image/icon/page_white_tux.png create mode 100755 web/image/icon/page_white_vector.png create mode 100755 web/image/icon/page_white_visualstudio.png create mode 100755 web/image/icon/page_white_width.png create mode 100755 web/image/icon/page_white_word.png create mode 100755 web/image/icon/page_white_world.png create mode 100755 web/image/icon/page_white_wrench.png create mode 100755 web/image/icon/page_white_zip.png create mode 100755 web/image/icon/page_word.png create mode 100755 web/image/icon/page_world.png create mode 100755 web/image/icon/paintbrush.png create mode 100755 web/image/icon/paintcan.png create mode 100755 web/image/icon/palette.png create mode 100755 web/image/icon/paste_plain.png create mode 100755 web/image/icon/paste_word.png create mode 100755 web/image/icon/pencil.png create mode 100755 web/image/icon/pencil_add.png create mode 100755 web/image/icon/pencil_delete.png create mode 100755 web/image/icon/pencil_go.png create mode 100755 web/image/icon/phone.png create mode 100755 web/image/icon/phone_add.png create mode 100755 web/image/icon/phone_delete.png create mode 100755 web/image/icon/phone_sound.png create mode 100755 web/image/icon/photo.png create mode 100755 web/image/icon/photo_add.png create mode 100755 web/image/icon/photo_delete.png create mode 100755 web/image/icon/photo_link.png create mode 100755 web/image/icon/photos.png create mode 100755 web/image/icon/picture.png create mode 100755 web/image/icon/picture_add.png create mode 100755 web/image/icon/picture_delete.png create mode 100755 web/image/icon/picture_edit.png create mode 100755 web/image/icon/picture_empty.png create mode 100755 web/image/icon/picture_error.png create mode 100755 web/image/icon/picture_go.png create mode 100755 web/image/icon/picture_key.png create mode 100755 web/image/icon/picture_link.png create mode 100755 web/image/icon/picture_save.png create mode 100755 web/image/icon/pictures.png create mode 100755 web/image/icon/pilcrow.png create mode 100755 web/image/icon/pill.png create mode 100755 web/image/icon/pill_add.png create mode 100755 web/image/icon/pill_delete.png create mode 100755 web/image/icon/pill_go.png create mode 100755 web/image/icon/plugin.png create mode 100755 web/image/icon/plugin_add.png create mode 100755 web/image/icon/plugin_delete.png create mode 100755 web/image/icon/plugin_disabled.png create mode 100755 web/image/icon/plugin_edit.png create mode 100755 web/image/icon/plugin_error.png create mode 100755 web/image/icon/plugin_go.png create mode 100755 web/image/icon/plugin_link.png create mode 100755 web/image/icon/printer.png create mode 100755 web/image/icon/printer_add.png create mode 100755 web/image/icon/printer_delete.png create mode 100755 web/image/icon/printer_empty.png create mode 100755 web/image/icon/printer_error.png create mode 100755 web/image/icon/rainbow.png create mode 100755 web/image/icon/report.png create mode 100755 web/image/icon/report_add.png create mode 100755 web/image/icon/report_delete.png create mode 100755 web/image/icon/report_disk.png create mode 100755 web/image/icon/report_edit.png create mode 100755 web/image/icon/report_go.png create mode 100755 web/image/icon/report_key.png create mode 100755 web/image/icon/report_link.png create mode 100755 web/image/icon/report_magnify.png create mode 100755 web/image/icon/report_picture.png create mode 100755 web/image/icon/report_user.png create mode 100755 web/image/icon/report_word.png create mode 100755 web/image/icon/resultset_first.png create mode 100755 web/image/icon/resultset_last.png create mode 100755 web/image/icon/resultset_next.png create mode 100755 web/image/icon/resultset_previous.png create mode 100755 web/image/icon/rosette.png create mode 100755 web/image/icon/rss.png create mode 100755 web/image/icon/rss_add.png create mode 100755 web/image/icon/rss_delete.png create mode 100755 web/image/icon/rss_go.png create mode 100755 web/image/icon/rss_valid.png create mode 100755 web/image/icon/ruby.png create mode 100755 web/image/icon/ruby_add.png create mode 100755 web/image/icon/ruby_delete.png create mode 100755 web/image/icon/ruby_gear.png create mode 100755 web/image/icon/ruby_get.png create mode 100755 web/image/icon/ruby_go.png create mode 100755 web/image/icon/ruby_key.png create mode 100755 web/image/icon/ruby_link.png create mode 100755 web/image/icon/ruby_put.png create mode 100755 web/image/icon/script.png create mode 100755 web/image/icon/script_add.png create mode 100755 web/image/icon/script_code.png create mode 100755 web/image/icon/script_code_red.png create mode 100755 web/image/icon/script_delete.png create mode 100755 web/image/icon/script_edit.png create mode 100755 web/image/icon/script_error.png create mode 100755 web/image/icon/script_gear.png create mode 100755 web/image/icon/script_go.png create mode 100755 web/image/icon/script_key.png create mode 100755 web/image/icon/script_lightning.png create mode 100755 web/image/icon/script_link.png create mode 100755 web/image/icon/script_palette.png create mode 100755 web/image/icon/script_save.png create mode 100755 web/image/icon/server.png create mode 100755 web/image/icon/server_add.png create mode 100755 web/image/icon/server_chart.png create mode 100755 web/image/icon/server_compressed.png create mode 100755 web/image/icon/server_connect.png create mode 100755 web/image/icon/server_database.png create mode 100755 web/image/icon/server_delete.png create mode 100755 web/image/icon/server_edit.png create mode 100755 web/image/icon/server_error.png create mode 100755 web/image/icon/server_go.png create mode 100755 web/image/icon/server_key.png create mode 100755 web/image/icon/server_lightning.png create mode 100755 web/image/icon/server_link.png create mode 100755 web/image/icon/server_uncompressed.png create mode 100755 web/image/icon/shading.png create mode 100755 web/image/icon/shape_align_bottom.png create mode 100755 web/image/icon/shape_align_center.png create mode 100755 web/image/icon/shape_align_left.png create mode 100755 web/image/icon/shape_align_middle.png create mode 100755 web/image/icon/shape_align_right.png create mode 100755 web/image/icon/shape_align_top.png create mode 100755 web/image/icon/shape_flip_horizontal.png create mode 100755 web/image/icon/shape_flip_vertical.png create mode 100755 web/image/icon/shape_group.png create mode 100755 web/image/icon/shape_handles.png create mode 100755 web/image/icon/shape_move_back.png create mode 100755 web/image/icon/shape_move_backwards.png create mode 100755 web/image/icon/shape_move_forwards.png create mode 100755 web/image/icon/shape_move_front.png create mode 100755 web/image/icon/shape_rotate_anticlockwise.png create mode 100755 web/image/icon/shape_rotate_clockwise.png create mode 100755 web/image/icon/shape_square.png create mode 100755 web/image/icon/shape_square_add.png create mode 100755 web/image/icon/shape_square_delete.png create mode 100755 web/image/icon/shape_square_edit.png create mode 100755 web/image/icon/shape_square_error.png create mode 100755 web/image/icon/shape_square_go.png create mode 100755 web/image/icon/shape_square_key.png create mode 100755 web/image/icon/shape_square_link.png create mode 100755 web/image/icon/shape_ungroup.png create mode 100755 web/image/icon/shield.png create mode 100755 web/image/icon/shield_add.png create mode 100755 web/image/icon/shield_delete.png create mode 100755 web/image/icon/shield_go.png create mode 100755 web/image/icon/sitemap.png create mode 100755 web/image/icon/sitemap_color.png create mode 100755 web/image/icon/sound.png create mode 100755 web/image/icon/sound_add.png create mode 100755 web/image/icon/sound_delete.png create mode 100755 web/image/icon/sound_low.png create mode 100755 web/image/icon/sound_mute.png create mode 100755 web/image/icon/sound_none.png create mode 100755 web/image/icon/spellcheck.png create mode 100755 web/image/icon/sport_8ball.png create mode 100755 web/image/icon/sport_basketball.png create mode 100755 web/image/icon/sport_football.png create mode 100755 web/image/icon/sport_golf.png create mode 100755 web/image/icon/sport_raquet.png create mode 100755 web/image/icon/sport_shuttlecock.png create mode 100755 web/image/icon/sport_soccer.png create mode 100755 web/image/icon/sport_tennis.png create mode 100755 web/image/icon/star.png create mode 100755 web/image/icon/status_away.png create mode 100755 web/image/icon/status_busy.png create mode 100755 web/image/icon/status_offline.png create mode 100755 web/image/icon/status_online.png create mode 100755 web/image/icon/stop.png create mode 100755 web/image/icon/style.png create mode 100755 web/image/icon/style_add.png create mode 100755 web/image/icon/style_delete.png create mode 100755 web/image/icon/style_edit.png create mode 100755 web/image/icon/style_go.png create mode 100755 web/image/icon/sum.png create mode 100755 web/image/icon/tab.png create mode 100755 web/image/icon/tab_add.png create mode 100755 web/image/icon/tab_delete.png create mode 100755 web/image/icon/tab_edit.png create mode 100755 web/image/icon/tab_go.png create mode 100755 web/image/icon/table.png create mode 100755 web/image/icon/table_add.png create mode 100755 web/image/icon/table_delete.png create mode 100755 web/image/icon/table_edit.png create mode 100755 web/image/icon/table_error.png create mode 100755 web/image/icon/table_gear.png create mode 100755 web/image/icon/table_go.png create mode 100755 web/image/icon/table_key.png create mode 100755 web/image/icon/table_lightning.png create mode 100755 web/image/icon/table_link.png create mode 100755 web/image/icon/table_multiple.png create mode 100755 web/image/icon/table_refresh.png create mode 100755 web/image/icon/table_relationship.png create mode 100755 web/image/icon/table_row_delete.png create mode 100755 web/image/icon/table_row_insert.png create mode 100755 web/image/icon/table_save.png create mode 100755 web/image/icon/table_sort.png create mode 100755 web/image/icon/tag.png create mode 100755 web/image/icon/tag_blue.png create mode 100755 web/image/icon/tag_blue_add.png create mode 100755 web/image/icon/tag_blue_delete.png create mode 100755 web/image/icon/tag_blue_edit.png create mode 100755 web/image/icon/tag_green.png create mode 100755 web/image/icon/tag_orange.png create mode 100755 web/image/icon/tag_pink.png create mode 100755 web/image/icon/tag_purple.png create mode 100755 web/image/icon/tag_red.png create mode 100755 web/image/icon/tag_yellow.png create mode 100755 web/image/icon/telephone.png create mode 100755 web/image/icon/telephone_add.png create mode 100755 web/image/icon/telephone_delete.png create mode 100755 web/image/icon/telephone_edit.png create mode 100755 web/image/icon/telephone_error.png create mode 100755 web/image/icon/telephone_go.png create mode 100755 web/image/icon/telephone_key.png create mode 100755 web/image/icon/telephone_link.png create mode 100755 web/image/icon/television.png create mode 100755 web/image/icon/television_add.png create mode 100755 web/image/icon/television_delete.png create mode 100755 web/image/icon/text_align_center.png create mode 100755 web/image/icon/text_align_justify.png create mode 100755 web/image/icon/text_align_left.png create mode 100755 web/image/icon/text_align_right.png create mode 100755 web/image/icon/text_allcaps.png create mode 100755 web/image/icon/text_bold.png create mode 100755 web/image/icon/text_columns.png create mode 100755 web/image/icon/text_dropcaps.png create mode 100755 web/image/icon/text_heading_1.png create mode 100755 web/image/icon/text_heading_2.png create mode 100755 web/image/icon/text_heading_3.png create mode 100755 web/image/icon/text_heading_4.png create mode 100755 web/image/icon/text_heading_5.png create mode 100755 web/image/icon/text_heading_6.png create mode 100755 web/image/icon/text_horizontalrule.png create mode 100755 web/image/icon/text_indent.png create mode 100755 web/image/icon/text_indent_remove.png create mode 100755 web/image/icon/text_italic.png create mode 100755 web/image/icon/text_kerning.png create mode 100755 web/image/icon/text_letter_omega.png create mode 100755 web/image/icon/text_letterspacing.png create mode 100755 web/image/icon/text_linespacing.png create mode 100755 web/image/icon/text_list_bullets.png create mode 100755 web/image/icon/text_list_numbers.png create mode 100755 web/image/icon/text_lowercase.png create mode 100755 web/image/icon/text_padding_bottom.png create mode 100755 web/image/icon/text_padding_left.png create mode 100755 web/image/icon/text_padding_right.png create mode 100755 web/image/icon/text_padding_top.png create mode 100755 web/image/icon/text_replace.png create mode 100755 web/image/icon/text_signature.png create mode 100755 web/image/icon/text_smallcaps.png create mode 100755 web/image/icon/text_strikethrough.png create mode 100755 web/image/icon/text_subscript.png create mode 100755 web/image/icon/text_superscript.png create mode 100755 web/image/icon/text_underline.png create mode 100755 web/image/icon/text_uppercase.png create mode 100755 web/image/icon/textfield.png create mode 100755 web/image/icon/textfield_add.png create mode 100755 web/image/icon/textfield_delete.png create mode 100755 web/image/icon/textfield_key.png create mode 100755 web/image/icon/textfield_rename.png create mode 100755 web/image/icon/thumb_down.png create mode 100755 web/image/icon/thumb_up.png create mode 100755 web/image/icon/tick.png create mode 100755 web/image/icon/time.png create mode 100755 web/image/icon/time_add.png create mode 100755 web/image/icon/time_delete.png create mode 100755 web/image/icon/time_go.png create mode 100755 web/image/icon/timeline_marker.png create mode 100755 web/image/icon/transmit.png create mode 100755 web/image/icon/transmit_add.png create mode 100755 web/image/icon/transmit_blue.png create mode 100755 web/image/icon/transmit_delete.png create mode 100755 web/image/icon/transmit_edit.png create mode 100755 web/image/icon/transmit_error.png create mode 100755 web/image/icon/transmit_go.png create mode 100755 web/image/icon/tux.png create mode 100755 web/image/icon/user.png create mode 100755 web/image/icon/user_add.png create mode 100755 web/image/icon/user_comment.png create mode 100755 web/image/icon/user_delete.png create mode 100755 web/image/icon/user_edit.png create mode 100755 web/image/icon/user_female.png create mode 100755 web/image/icon/user_go.png create mode 100755 web/image/icon/user_gray.png create mode 100755 web/image/icon/user_green.png create mode 100755 web/image/icon/user_orange.png create mode 100755 web/image/icon/user_red.png create mode 100755 web/image/icon/user_suit.png create mode 100755 web/image/icon/vcard.png create mode 100755 web/image/icon/vcard_add.png create mode 100755 web/image/icon/vcard_delete.png create mode 100755 web/image/icon/vcard_edit.png create mode 100755 web/image/icon/vector.png create mode 100755 web/image/icon/vector_add.png create mode 100755 web/image/icon/vector_delete.png create mode 100755 web/image/icon/wand.png create mode 100755 web/image/icon/weather_clouds.png create mode 100755 web/image/icon/weather_cloudy.png create mode 100755 web/image/icon/weather_lightning.png create mode 100755 web/image/icon/weather_rain.png create mode 100755 web/image/icon/weather_snow.png create mode 100755 web/image/icon/weather_sun.png create mode 100755 web/image/icon/webcam.png create mode 100755 web/image/icon/webcam_add.png create mode 100755 web/image/icon/webcam_delete.png create mode 100755 web/image/icon/webcam_error.png create mode 100755 web/image/icon/world.png create mode 100755 web/image/icon/world_add.png create mode 100755 web/image/icon/world_delete.png create mode 100755 web/image/icon/world_edit.png create mode 100755 web/image/icon/world_go.png create mode 100755 web/image/icon/world_link.png create mode 100755 web/image/icon/wrench.png create mode 100755 web/image/icon/wrench_orange.png create mode 100755 web/image/icon/xhtml.png create mode 100755 web/image/icon/xhtml_add.png create mode 100755 web/image/icon/xhtml_delete.png create mode 100755 web/image/icon/xhtml_go.png create mode 100755 web/image/icon/xhtml_valid.png create mode 100755 web/image/icon/zoom.png create mode 100755 web/image/icon/zoom_in.png create mode 100755 web/image/icon/zoom_out.png create mode 100755 web/image/tipsy-east.gif create mode 100755 web/image/tipsy-north.gif create mode 100755 web/image/tipsy-south.gif create mode 100755 web/image/tipsy-west.gif create mode 100755 web/image/ui-bg_diagonals-thick_18_b81900_40x40.png create mode 100755 web/image/ui-bg_diagonals-thick_20_666666_40x40.png create mode 100755 web/image/ui-bg_flat_10_000000_40x100.png create mode 100755 web/image/ui-bg_glass_100_f6f6f6_1x400.png create mode 100755 web/image/ui-bg_glass_100_fdf5ce_1x400.png create mode 100755 web/image/ui-bg_glass_65_ffffff_1x400.png create mode 100755 web/image/ui-bg_gloss-wave_35_f6a828_500x100.png create mode 100755 web/image/ui-bg_highlight-soft_100_eeeeee_1x100.png create mode 100755 web/image/ui-bg_highlight-soft_75_ffe45c_1x100.png create mode 100755 web/image/ui-icons_222222_256x240.png create mode 100755 web/image/ui-icons_228ef1_256x240.png create mode 100755 web/image/ui-icons_ef8c08_256x240.png create mode 100755 web/image/ui-icons_ffd27a_256x240.png create mode 100755 web/image/ui-icons_ffffff_256x240.png create mode 100755 web/index.php create mode 100755 web/javascript/forms.js create mode 100755 web/javascript/general.js create mode 100755 web/javascript/jquery/external_plugins/gritter.js create mode 100755 web/javascript/jquery/external_plugins/tipsy.js create mode 100755 web/javascript/jquery/jquery-1.3.2.min.js create mode 100755 web/javascript/jquery/jquery-ui-1.7.2.custom.min.js create mode 100755 web/javascript/pagination.js create mode 100755 web/myaccount.php create mode 100755 web/myhostings.php create mode 100755 web/style/gritter.css create mode 100755 web/style/jquery-ui-1.7.2.custom.css create mode 100755 web/style/tipsy.css create mode 100755 web/support.php create mode 100755 web/tests/apc_admin.php create mode 100755 web/tests/text_parse_ini_file.php create mode 100755 web/themes/underground/image/bg.gif create mode 100755 web/themes/underground/image/bullet.gif create mode 100755 web/themes/underground/image/footerbg.gif create mode 100755 web/themes/underground/image/headerbg.gif create mode 100755 web/themes/underground/image/quote.gif create mode 100755 web/themes/underground/image/tableft.gif create mode 100755 web/themes/underground/image/tabright.gif create mode 100755 web/themes/underground/javascript/myaccount.js create mode 100755 web/themes/underground/javascript/vhosts.js create mode 100755 web/themes/underground/style/crons.css create mode 100755 web/themes/underground/style/hosting.css create mode 100755 web/themes/underground/style/informations.css create mode 100755 web/themes/underground/style/main.css create mode 100755 web/themes/underground/template/_contentbegin.tpl create mode 100755 web/themes/underground/template/_contentend.tpl create mode 100755 web/themes/underground/template/admin/support/list.tpl create mode 100755 web/themes/underground/template/admin/support/show.tpl create mode 100755 web/themes/underground/template/error/not_in_offer.tpl create mode 100755 web/themes/underground/template/footer.tpl create mode 100755 web/themes/underground/template/header.tpl create mode 100755 web/themes/underground/template/history.tpl create mode 100755 web/themes/underground/template/hosting/crons/add.tpl create mode 100755 web/themes/underground/template/hosting/crons/list.tpl create mode 100755 web/themes/underground/template/hosting/hosting.tpl create mode 100755 web/themes/underground/template/hosting/informations.tpl create mode 100755 web/themes/underground/template/hosting/vhosts/add.tpl create mode 100755 web/themes/underground/template/hosting/vhosts/list.tpl create mode 100755 web/themes/underground/template/index.tpl create mode 100755 web/themes/underground/template/javascript_execution.tpl create mode 100755 web/themes/underground/template/myaccount.tpl create mode 100755 web/themes/underground/template/myhostings.tpl create mode 100755 web/themes/underground/template/sidebar.tpl create mode 100755 web/themes/underground/template/support/create.tpl create mode 100755 web/themes/underground/template/support/list.tpl create mode 100755 web/themes/underground/template/support/show.tpl create mode 100755 web/themes/underground/template/title.tpl diff --git a/system/api/action.api.php b/system/api/action.api.php new file mode 100755 index 0000000..4599906 --- /dev/null +++ b/system/api/action.api.php @@ -0,0 +1,137 @@ + id of action + * @param hosting_id-> id of the hosting, optionnaly + * @param is_parent_id -> bool(true) if the param 'action_id' is a 'parent_id' + * @return 0 : Action not found + * @return 1 : Action is in state 'added', it can be deleted + * @return 2 : Action is in execution or finished + */ + static private function checkBeforeDeleteAction($action_id, $is_parent_id = null) + { + $action_id = $_SESSION['database']->clearString($action_id); + $can_cancel = 1; + if ( !is_null($is_parent_id) ) { + $req = "SELECT id, parent_id, status FROM actions WHERE parent_id = '$action_id'"; + $actions = $_SESSION['database']->fetchObject($req); + foreach ( $actions as $action ) { + if ( $action->status != 'added' ) $can_cancel = 2; + } + return $can_cancel; + } + else { + $req = "SELECT id, parent_id,s tatus FROM actions WHERE id = '$action_id'"; + $action = $_SESSION['database']->fetchObject($req); + if ( !isset($action[0]) || !is_object($action[0]) ) return 0; + if ( $action[0]->status == 'added' ) return 1; + return 2; + } + } // End of checkBeforeDeleteAction + + /** + * @brief Model : Delete action + * @param action_id -> id of action + * @param is_parent_id -> bool(true) if the param 'action_id' is a 'parent_id' + * @return always bool(true) + */ + static private function deleteAction($action_id, $is_parent_id = null) + { + $action_id = $_SESSION['database']->clearString($action_id); + if( !is_null($is_parent_id) ) + $_SESSION['database']->execRequest("DELETE FROM actions WHERE parent_id = '$action_id' OR id = '$action_id'"); + else + $_SESSION['database']->execRequest("DELETE FROM actions WHERE id = '$action_id'"); + return true; + } // End of deleteAction + + /** + * @brief Controller : Cancel an action + * @param action_id -> id of action + * @param is_parent_id -> bool(true) if the param 'action_id' is a 'parent_id' + * @return 0 : Action not found or isn't related to hosting_id (if specified) + * @return 1 : Action has been cancelled (Ok) + * @return 2 : Action can't be cancelled because is in execution or finished + */ + static public function userCancelAction($action_id, $is_parent_id = null) + { + $return_check = self::checkBeforeDeleteAction($action_id, $is_parent_id); + + if ( $return_check == 0 || $return_check == 3) + return 0; + elseif ( $return_check == 2) + return 2; + else { + self::deleteAction($action_id, $is_parent_id); + return 1; + } + } // End of userCancelAction + + /** + * @brief Model : Add action + * @param servers_id -> id of service + * @param hosting_d -> id of the hosting + * @param data -> array, data about the task + * @param parent_id -> optionally, the id of the group + * @return last action id + */ + static private function addAction($service_id, $data, $hosting_id, $parent_id = null) + { + $data = $_SESSION['database']->clearString(json_encode($data)); + $service_id = $_SESSION['database']->clearString($service_id); + $parent_id = ( is_null($parent_id) ) ? 'null' : $parent_id = $_SESSION['database']->clearString($parent_id); + $req = "INSERT INTO actions + SET + parent_id = '$parent_id', + created_at = CURRENT_TIMESTAMP, + status = 'added', + hosting_id = '$hosting_id', + servers_id = '$service_id', + data = '$data'"; + $_SESSION['database']->execRequest($req); + return $_SESSION['database']->getInsertId(); + } // End of addAction + + /** + * @brief Controller : Add action on the tasklist + * @param servers_id -> id of service + * @param data -> array, data about the task + * @return + */ + static public function userAddAction($service_id, $data, $parent_id = null) + { + $hosting_id = $_SESSION['hosting']->information_hosting->id; + return self::addAction($service_id, $data, $hosting_id, $parent_id); + } // End of userAddAction + + + /** + * @brief Controller : Add a group of actions on the tasklist + * @param data -> array, the group of actions + * @return id of the group of actions + * @todo Delete this function + */ + /*static public function userAddGroupAction($data) + { + $parent_id = null; + $hosting_id = $_SESSION['hosting']->information_hosting->id; + + foreach( $data as $key => $value ) { + if ( is_null($parent_id) ) $parent_id = self::addAction($value['service_id'], $value['data'], $hosting_id); + else self::addAction($value['service_id'], $value['data'], $hosting_id, $parent_id); + } + return $parent_id; + } // End of userAddAction */ + +} // End of class + +?> \ No newline at end of file diff --git a/system/api/api.php b/system/api/api.php new file mode 100755 index 0000000..53f7133 --- /dev/null +++ b/system/api/api.php @@ -0,0 +1,22 @@ + name of module to redirect (not an url) +*/ +function redirect($url) +{ + header('Location: '.TPL_HOST.$url); + exit(); +} + diff --git a/system/api/cron.api.php b/system/api/cron.api.php new file mode 100755 index 0000000..8443552 --- /dev/null +++ b/system/api/cron.api.php @@ -0,0 +1,252 @@ +clearString($hosting_id); + + if ( !is_null($start) and !is_null($extract_number)) { + $start = $_SESSION['database']->clearString($start); + $extract_number = $_SESSION['database']->clearString($extract_number); + $limit = " LIMIT $start, $extract_number"; + } else $limit = null; + + $req = "SELECT id, address, UNIX_TIMESTAMP(created_at) AS created_at, execute_every, UNIX_TIMESTAMP(executed_at) AS executed_at, is_active + FROM service_cron WHERE hosting_id = '$hosting_id' ORDER BY created_at DESC$limit"; + $query = $_SESSION['database']->fetchObject($req); + return $query; + } + + /** + * @brief add a Cronjob for current user + * @param address Url of the script to call + * @param frequency Frequency of the task execution + * @param first_start Date/Time for the first execution + * @return 0 : Address is not openable + * @return 1 : Cronjob added + * @return 2 : Limit of cronjob for the current offer is reached + * + * @todo Manage the 'first_start' parameter + */ + public function userAddCron( $address, $frequency, $first_start, $active=true ) + { + // Check Time for executing + $frequency = intval($frequency); + if ( $frequency == CRON_NO_SPECIFIED_TIME ) { + $active=false; + } elseif ( $frequency < CRON_MIN_TIME ) { + $frequency = CRON_MIN_TIME; + } + // Check if address is openable + $address_test = $this->checkAddress($address); + if ( !$address_test ) return 0; + // Check quota + if ( $_SESSION['hosting']->information_hosting->offer_crons_number >= 0 ) { + $current_number_crons = $this->countCronjobs( $_SESSION['hosting']->information_hosting->id ); + if ( $current_number_crons >= $_SESSION['hosting']->information_hosting->offer_crons_number ) return 2; + } + // Get the ID of the current hosting + $hosting_id = $_SESSION['hosting']->information_hosting->id; + $this->addCron( $hosting_id, $address, $frequency, true); + return true; + } // End of userAddCron + + + /** + * @brief Active an deactivated cron + * @param cron_id ID of the cron + * @return : 0 Cron is not found + * @return : 1 Cron activated + * @return : 2 Cron is already activated + */ + public function userActiveCron( $cron_id ) + { + $cron = $_SESSION['database']->clearString($cron_id); + $req = "SELECT hosting_id, is_active FROM service_cron WHERE id = '$cron'"; + $query = $_SESSION['database']->fetchObject($req); + if ( count($query) == 0 ) return 0; + if( $query[0]->hosting_id != $_SESSION['hosting']->information_hosting->id ) + throw new myException('Hosting_id is not attribued for this cron'); + if ( $query[0]->is_active == 'true' ) return 2; + $req = "UPDATE service_cron SET is_active = 'true' WHERE id = '$cron'"; + $_SESSION['database']->execRequest($req); + return 1; + } + + /** + * @brief Deactivate a cron + * @param cron_id : ID of the cron + * @return : 0 Cron is not found + * @return : 1 Cron deactivated + * @return : 2 Cron is already deactivated + */ + public function userDeactiveCron( $cron_id ) + { + $cron = $_SESSION['database']->clearString($cron_id); + $req = "SELECT hosting_id, is_active FROM service_cron WHERE id = '$cron'"; + $query = $_SESSION['database']->fetchObject($req); + if ( count($query) == 0 ) return 0; + if( $query[0]->hosting_id != $_SESSION['hosting']->information_hosting->id ) + throw new myException('Hosting_id is not attribued for this cron'); + if ( $query[0]->is_active == 'false' ) return 2; + $req = "UPDATE service_cron SET is_active = 'false' WHERE id = '$cron'"; + $_SESSION['database']->execRequest($req); + return 1; + } + + /** + * @brief Delete a cron for the current hosting + * @param cron_id Id of the cron to delete + * @return True or false if not found + */ + public function userDeleteCron( $cron_id ) + { + $cron_id_s = $_SESSION['database']->clearString($cron_id); + $req = "SELECT hosting_id FROM service_cron WHERE id ='$cron_id_s'"; + $query = $_SESSION['database']->fetchObject($req); + if ( count($query) == 0 ) return false; + if ( $query[0]->hosting_id != $_SESSION['hosting']->information_hosting->id ) + throw new myException('Hosting_id is not attribued for this cron'); + $this->deleteCron( $cron_id ); + return true; + } // End of userDeleteCron + + /** + * @brief try to open an url by fsockopen. + * @param address web Address + * @return true Web respond + * @return false Web did not respond or not ready + */ + public function checkAddress( $address ) + { + if ( !textVerification::verifUrl($address) ) return false; + + $url_info = parse_url($address); + if ( $url_info['scheme'] == 'http' ) $port = 80; + elseif ( $url_info['scheme'] == 'https' ) $port = 443; + else $port = 80; + + $handle = fsockopen( $url_info['host'], $port, $errno, $errstr, CRON_TIMEOUT); + if ($handle !== false) { + fclose($handle); + return true; + } else { + return false; + } + } // End of checkAddress + + /** + * @brief Select all cronjob to execute. For server. + * @todo make this function when the daemons are dev. + */ + public function serverListToTestCrons() + { + } + + /** + * @brief Count total cronjobs for a user + * @param hosting_id : ID of the hosting to count + * @param (optionnal) active_cron : True of False, count only active jobs, or count total jobs + * @return Total of cronjobs + */ + private function countCronJobs( $hosting_id, $only_active = false ) + { + $hosting_id = $_SESSION['database']->clearString($hosting_id); + if ( $only_active ) $clause = " AND is_active = 'true'"; + else $clause = null; + $req = "SELECT COUNT(id) AS total FROM service_cron WHERE hosting_id = '$hosting_id'$clause"; + $query = $_SESSION['database']->fetchObject($req); + return $query[0]->total; + } + + /** + * @brief adding Cron + * @param hosting_id Id of the hosting + * @param address Address to cron + * @param time Time in seconds to re-execute + * @param is_active Activation of the cron (true/false) + */ + private function addCron( $hosting_id, $address, $time, $is_active) + { + $hosting_id = $_SESSION['database']->clearString($hosting_id); + $address = $_SESSION['database']->clearString($address); + $time = $_SESSION['database']->clearString($time); + + if ( $is_active ) $is_active = 'true'; + else $is_active = 'false'; + + $req = "INSERT INTO service_cron + SET + hosting_id = '$hosting_id', + address = '$address', + created_at = NOW(), + execute_every = '$time', + is_active = '$is_active'"; + $query = $_SESSION['database']->execRequest($req); + return true; + } + + /** + * @brief delete cron identified by id + * @param cron_id Id of the cron + * @return true + */ + private function deleteCron( $cron_id ) + { + $cron_id = $_SESSION['database']->clearString($cron_id); + $req = "DELETE FROM service_cron WHERE id = '$cron_id'"; + $_SESSION['database']->execRequest($req); + return true; + } + + /** + * @brief Get number of all crontab records for the current hosting + * @return number of history records registered for the user + */ + public function userCountCronRecords() + { + if( !is_null($this->cron_records) ) { + return $this->cron_records; + } + $hosting_id = $_SESSION['hosting']->information_hosting->id; + $req = "SELECT COUNT(id) AS total FROM service_cron WHERE hosting_id = '$hosting_id'"; + $result = $_SESSION['database']->fetchObject($req); + $this->cron_records = $result[0]->total; + return $this->cron_records; + } + + /** + * @brief Get number of crons records pages, regarding the total count of records and the count of items to be shown per page + * @return number of pages availables + */ + public function userCountTotalPages() + { + $items_count = $this->userCountCronRecords(); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + +} +?> \ No newline at end of file diff --git a/system/api/database.api.php b/system/api/database.api.php new file mode 100755 index 0000000..8b464a8 --- /dev/null +++ b/system/api/database.api.php @@ -0,0 +1,125 @@ +information_hosting->id; + $mysql_service = $_SESSION['hosting']->information_hosting->mysql_id; + + // Quota + if ( $_SESSION['hosting']->information_hosting->offer_domains_number >= 0 ) { + $current_number_mysql = $this->countDatabases( $_SESSION['hosting']->information_hosting->id ); + if ( $current_number_mysql >= $_SESSION['hosting']->information_hosting->offer_domains_number ) return -1; + } + + // Check syntax and with of db name + if ( !textVerification::verifDatabaseName($name) ) return -2; + if ( strlen($_SESSION['hosting']->information_hosting->id.'_'.$name) > 16 ) return -3; + + // Check existence of database + if ( $this->checkDatabaseExistence( $_SESSION['hosting']->information_hosting->id, $name ) ) return -4 + + $action_id = $this->createDatabase( $mysql_service, $name ) + $this->createUserForDatabase( + $mysql_service, + $name, + $password, + $_SESSION['hosting']->information_hosting->id, + $name, + 'normal', + $action_id + ); + + // inserer en db + + } + + public function userListDatabase() + { + } + + public function userDeleteDatabase() + { + } + + public function userChangePasswordForDatabase() + { + } + + /** + * @brief Create user for db + * @param service_id : Id of the mysql service + * @param name : Name of the user + * @param password : Password of the user + * @param db_hosting: Hosting_id of the DB + * @param db_name : Name of the database + * @param (optionnal) level : Level of the user. "normal" is for customer + * @param (optionnal) create_db_action : Id action of database creation if create_db in same time of create_user. + */ + private function createUserForDatabase( $service_id, $name, $password, $db_hosting, $db_name, $level = 'normal', $create_db_action = null ) + { + $data = array(); + $data['action'] = 'create_user'; + $data['name'] = $name; + $data['password'] = $password; + $data['db_hosting'] = $db_hosting; + $data['db_name'] = $db_name; + $data['level'] = $level; + $action = action::userAddAction($service_id, $data, $create_db_action); + return $action; + } + + /** + * @brief Create database + * @param service_id : Id of the mysql service + * @param name : Name of database + */ + private function createDatabase( $service_id, $name ) + { + $data = array(); + $data['action'] = 'create_database'; + $data['name'] = $name; + $action = action::userAddAction($service_id, $data); + return $action; + } + + private function checkDatabaseExistence() + { + } + + /** + * @brief Count databases for one hosting + * @param hosting_id : Id of the hosting + * @return Number of databases + */ + private function countDatabases( $hosting_id ) + { + $hosting_id = $_SESSION['database']->clearString($hosting_id); + $req = "SELECT COUNT(id) AS total FROM service_database WHERE hosting_id = '$hosting_id'"; + $query = $_SESSION['database']->fetchObject($req); + return $query[0]->total; + } + + +} +?> \ No newline at end of file diff --git a/system/api/history.api.php b/system/api/history.api.php new file mode 100755 index 0000000..1b06e63 --- /dev/null +++ b/system/api/history.api.php @@ -0,0 +1,161 @@ + message of action + * @param user_id -> the user id of action + * @return boolean + * + * Add an action record in the history list for a given user. + */ + public function add($message_key, $user_id) + { + + $message_key = $_SESSION['database']->clearString($message_key); + $user_id = $_SESSION['database']->clearString($user_id); + + // hosting_id à récuperer + $hosting_id = 1; + $ip = $_SERVER['REMOTE_ADDR']; + + $req = "INSERT INTO history + SET + date = NOW(), + user_id = '$user_id', + hosting_id = '$hosting_id', + ip = '$ip', + message_key = '$message_key'"; + $_SESSION['database']->execRequest($req); + // Update cache if needed + if ( !is_null($this->history_records) ) { + $this->history_records++; + } + return true; + + } // End of actiontoHistory + + + /** + * @brief List all history actions with a given clause + * @param start -> Record of starting listing + * @param extract -> Number of records to extract + * @param clause -> SQL clause for listing + * @return array with information (nul if empty) + */ + private function listHistoryByClause($start = NULL, $extract = NULL, $clause = NULL) + { + + $lang = new lang(); + + if ( !is_null($start) and !is_null($extract) ) { + $limit = "LIMIT $start, $extract"; + } else $limit = NULL; + + if ( !is_null($clause) ) { + $clause = "WHERE $clause"; + } + + $req = "SELECT + h.message_key AS action, + i.base_name AS hosting, + h.ip AS ip, + UNIX_TIMESTAMP(h.date) AS date + FROM history AS h + LEFT JOIN hostings AS i + ON i.id = h.hosting_id + $clause $limit"; + $result = $_SESSION['database']->fetchObject($req); + + foreach ( $result as $key => $value ) + { + $result[$key]->action = $lang->getWordFromLangFile($result[$key]->action); + } + return $result; + } // End of listHistoryByClause + + + /** + * @brief List all history actions for the current user + * @param start -> Record of starting listing + * @param extract -> Number of records to extract + * @return array with information (nul if empty) + */ + public function userListHistory($start = NULL, $extract = NULL) + { + + $lang = new lang(); + + if ( !is_null($start) and !is_null($extract) ) { + $limit = " LIMIT $start, $extract"; + } else $limit = NULL; + + $user_id = $_SESSION['user']->information_user->userid; + + $result = $this->listHistoryByClause($start,$extract, "h.user_id='$user_id'"); + + $time = $lang->userGetTimeFormat(); + $date = $lang->userGetDateFormat(); + + foreach ( $result as $key => $value ) + { + $result[$key]->date = date("$date $time" , $result[$key]->date); + } + return $result; + } // End of userListHistory + + /** + * @brief Get number of all history records for the current user + * @param None + * @return number of history records registered for the user + * + * Get the total of all actions recorded in the history list for the current user.
+ * This value is got the first time from the database (generating a SQL request) and is then stocked in a cache variable, so, other calls to this method won't generate another SQL request. + */ + public function userCountHistoryRecords() + { + // Try to get the value from the cache + if( !is_null($this->history_records) ) { + return $this->history_records; + } + + $user_id = $_SESSION['user']->information_user->userid; + $req = "SELECT COUNT(id) AS total FROM history WHERE user_id='$user_id'"; + $result = $_SESSION['database']->fetchObject($req); + $this->history_records = $result[0]->total; + + return $this->history_records; + } + + /** + * @brief Get number of history records pages, regarding the total count of records and the count of items to be shown per page + * @param None + * @return number of pages availables + * + * Calculate the total pages needed to show all the history actions records for the current user. + */ + public function userCountTotalPages() + { + $items_count = $this->userCountHistoryRecords(); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + +} // End of class diff --git a/system/api/hosting.api.php b/system/api/hosting.api.php new file mode 100755 index 0000000..81f9bb3 --- /dev/null +++ b/system/api/hosting.api.php @@ -0,0 +1,329 @@ +information_hosting) ) throw new myException('Session hosting_information is not initialized but hosting_information is not null'); + $this->result_test = 1; + return 1; + } else { + $hosting_infos = $_SESSION['database']->clearString($_SESSION['hosting_infos']); + $result = $this->listHostingsByClause(0, 1, "h.id = '$hosting_infos'"); + if ( count($result) == 0 ) throw new myException('Hosting_infos is defined but cannot find the hosting associated'); + if ( $result[0]->user_id != $_SESSION['user']->information_user->userid ) throw new myException('The hosting is not for the specified user'); + if ( $result[0]->hosting_active == 'false' ) { + $this->result_test = 0; + return 0; + } elseif ( ($result[0]->data_active == 'false') or ($result[0]->data_server_active == 'false') ){ + $this->result_test = 2; + return 2; + } elseif ( ($result[0]->mysql_active == 'false') or ($result[0]->mysql_server_active == 'false')) { + $this->result_test = 3; + return 3; + } elseif ( ($result[0]->dns1_active == 'false' or ($result[0]->dns1_server_active == 'false'))) { + $this->result_test = 4; + return 4; + } elseif ( ($result[0]->dns2_active == 'false') or ($result[0]->dns2_server_active == 'false')) { + $this->result_test = 4; + return 4; + } elseif ( ($result[0]->smtp_active == 'false') or ($result[0]->smtp_server_active == 'false')) { + $this->result_test = 5; + return 5; + } elseif ( ($result[0]->smtps_active == 'false') or ($result[0]->smtps_server_active == 'false')) { + $this->result_test = 5; + return 5; + } elseif ( ($result[0]->pop_active == 'false') or ($result[0]->pop_server_active == 'false')) { + $this->result_test = 5; + return 5; + } elseif ( ($result[0]->pops_active == 'false') or ($result[0]->pops_server_active == 'false')) { + $this->result_test = 5; + return 5; + } elseif ( ($result[0]->imap_active == 'false') or ($result[0]->imap_server_active == 'false')) { + $this->result_test = 5; + return 5; + } elseif ( ($result[0]->imaps_active == 'false') or ($result[0]->imaps_server_active == 'false')) { + $this->result_test = 5; + return 5; + } elseif ( ($result[0]->http_active == 'false') or ($result[0]->http_server_active == 'false')) { + $this->result_test = 6; + return 6; + } + + $this->information_hosting = $result[0]; + $this->result_test = 7; + $_SESSION['hosting_infos'] = $result[0]->id; + return 7; + } + + + } // End of initialiazeHosting + + + /** + * @brief Check autorization and redirect or make exception if is not correct. + * @return TRUE only, throw or redirect if not correct. + */ + public function userCheckAccess() + { + if ( is_null($this->result_test) ) throw new myException('Hosting initialization not initialized'); + if ( $this->result_test == 0 ) redirect('error-5.xhtml'); + elseif ( $this->result_test == 1 ) redirect('myhostings.xhtml'); + elseif ( ($this->result_test > 1) and ($this->result_test < 7) ) redirect ('error-6.xhtml'); + elseif ( $this->result_test == 7 ) return true; + else throw new myException('result_code is unknow'); + } // End of userCheckAccess + + /** + * @brief Initialize hosting by ID + * @brief ID of the hosting + * @return true : Hosting added + */ + public function userSetCurrentHosting($id) + { + $id = $_SESSION['database']->clearString($id); + $result = $this->listHostingsByClause(NULL, NULL, "h.id = '$id'"); + if ( count($result) == 0 ) throw new myException('Hosting selected is not found'); + elseif ( $result[0]->user_id != $_SESSION['user']->information_user->userid ) throw new myException('Hosting is not allowed to this user'); + $_SESSION['hosting_infos'] = $result[0]->id; + return true; + } + + /** + * @brief List all hostings of the current member + * @param start -> Record of starting listing + * @param extract -> Number of records to extract + * @return array with information (nul if empty) + */ + public function userListHostings($start = NULL, $extract = NULL) + { + $user_id=$_SESSION['user']->information_user->userid; + + return $this->listHostingsByClause($start, $extract, "h.user_id = $user_id"); + } // End of userListHostings + + /** + * @brief List all hostings with a given clause + * @param start -> Record of starting listing + * @param extract -> Number of records to extract + * @return array with information (nul if empty) + */ + private function listHostingsByClause($start = NULL, $extract = NULL, $clause = NULL) + { + if ( !is_null($start) and !is_null($extract) ) { + $limit = "LIMIT $start, $extract"; + } else $limit = NULL; + + if ( !is_null($clause) ) { + $clause = "WHERE $clause"; + } + + $req = "SELECT + h.id AS id, + h.base_name, + UNIX_TIMESTAMP(h.start_date) AS start_date, + UNIX_TIMESTAMP(h.end_date) AS end_date, + h.is_active AS hosting_active, + h.user_id, + h.offer_id, + dns1.id AS dns1_id, + dns1.web_ip AS dns1_ip, + dns1.port AS dns1_port, + dns1.is_active AS dns1_active, + dns1_s.is_active AS dns1_server_active, + dns2.id AS dns1_id, + dns2.web_ip AS dns2_ip, + dns2.port AS dns2_port, + dns2.is_active AS dns2_active, + dns2_s.is_active AS dns2_server_active, + data.id AS data_id, + data.web_ip AS data_ip, + data.port AS data_port, + data.is_active AS data_active, + data_s.is_active AS data_server_active, + http.id AS http_id, + http.web_ip AS http_ip, + http.port AS http_port, + http.is_active AS http_active, + http_s.is_active AS http_server_active, + smtp.id AS smtp_id, + smtp.web_ip AS smtp_ip, + smtp.port AS smtp_port, + smtp.is_active AS smtp_active, + smtp_s.is_active AS smtp_server_active, + smtps.id AS smtps_id, + smtps.web_ip AS smtps_ip, + smtps.port AS smtps_port, + smtps.is_active AS smtps_active, + smtps_s.is_active AS smtps_server_active, + pop.id AS pop_id, + pop.web_ip AS pop_ip, + pop.port AS pop_port, + pop.is_active AS pop_active, + pop_s.is_active AS pop_server_active, + pops.id AS pops_id, + pops.web_ip AS pops_ip, + pops.port AS pops_port, + pops.is_active AS pops_active, + pops_s.is_active AS pops_server_active, + imap.id AS imap_id, + imap.web_ip AS imap_ip, + imap.port AS imap_port, + imap.is_active AS imap_active, + imap_s.is_active AS imap_server_active, + imaps.id AS imaps_id, + imaps.web_ip AS imaps_ip, + imaps.port AS imaps_port, + imaps.is_active AS imaps_active, + imaps_s.is_active AS imaps_server_active, + mysql.id AS mysql_id, + mysql.web_ip AS mysql_ip, + mysql.port AS mysql_port, + mysql.is_active AS mysql_active, + mysql_s.is_active AS mysql_server_active, + o.name AS offer_name, + o.is_active AS offer_active, + o.databases_number AS offer_databases_number, + o.domains_number AS offer_domains_number, + o.crons_number AS offer_crons_number, + o.dns_domains_number AS offer_dns_domains_number, + o.virtualhosts_number AS offer_virtualhosts_number, + o.email_accounts_number AS offer_email_accounts_number, + o.email_accounts_space AS offer_email_accounts_space, + o.email_alias_number AS offer_email_alias_number, + o.space_limit AS offer_space_limit, + o.trafic_limit AS offer_trafic_limit, + o.service_smtp AS offer_service_smtp, + o.service_smtps AS offer_service_smtps, + o.service_pop AS offer_service_pop, + o.service_pops AS offer_service_pops, + o.service_imap AS offer_service_imap, + o.service_imaps AS offer_service_imaps, + o.service_mysql AS offer_service_mysql + FROM hostings AS h + LEFT JOIN services AS dns1 + ON dns1.id = h.service_dns1 + LEFT JOIN servers AS dns1_s + ON dns1_s.id = dns1.servers_id + LEFT JOIN services AS dns2 + ON dns2.id = h.service_dns2 + LEFT JOIN servers AS dns2_s + ON dns2_s.id = dns2.servers_id + LEFT JOIN services AS data + ON data.id = h.service_data + LEFT JOIN servers AS data_s + ON data_s.id = data.servers_id + LEFT JOIN services AS http + ON http.id = h.service_http + LEFT JOIN servers AS http_s + ON http_s.id = http.servers_id + LEFT JOIN services AS smtp + ON smtp.id = h.service_smtp + LEFT JOIN servers AS smtp_s + ON smtp_s.id = smtp.servers_id + LEFT JOIN services AS smtps + ON smtps.id = h.service_smtps + LEFT JOIN servers AS smtps_s + ON smtps_s.id = smtps.servers_id + LEFT JOIN services AS pop + ON pop.id = h.service_pop + LEFT JOIN servers AS pop_s + ON pop_s.id = pop.servers_id + LEFT JOIN services AS pops + ON pops.id = h.service_pops + LEFT JOIN servers AS pops_s + ON pops_s.id = pops.servers_id + LEFT JOIN services AS imap + ON imap.id = h.service_imap + LEFT JOIN servers AS imap_s + ON imap_s.id = imap.servers_id + LEFT JOIN services AS imaps + ON imaps.id = h.service_imaps + LEFT JOIN servers AS imaps_s + ON imaps_s.id = imaps.servers_id + LEFT JOIN services AS mysql + ON mysql.id = h.service_mysql + LEFT JOIN servers AS mysql_s + ON mysql_s.id = mysql.servers_id + LEFT JOIN offers AS o + ON h.offer_id = o.id + $clause $limit"; + $result = $_SESSION['database']->fetchObject($req); + return $result; + } // End of listHostingsByClause + + /** + * @brief Get number of hostings for the current user + * @return number of hostings for the user + */ + public function userCountHostings() + { + // Try to get the value from the cache + if( !is_null($this->user_hostings_count) ) { + return $this->user_hostings_count; + } + + $user_id = $_SESSION['user']->information_user->userid; + $req = "SELECT COUNT(id) AS total FROM hostings WHERE user_id='$user_id'"; + $result = $_SESSION['database']->fetchObject($req); + $this->user_hostings_count = $result[0]->total; + + return $this->user_hostings_count; + } + + /** + * @brief Get number of hosting pages, regarding the total count of records and the count of items to be shown per page + * @return number of pages availables + */ + public function userCountTotalPages() + { + $items_count = $this->userCountHostings(); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + + +} // End of class +?> diff --git a/system/api/html.api.php b/system/api/html.api.php new file mode 100755 index 0000000..6264bce --- /dev/null +++ b/system/api/html.api.php @@ -0,0 +1,159 @@ + + * Each web page using the JavaScript pagination engine has its own function in this class.
+ * For simple cells content, you don't need to call this class : you can directly generate the text from the ajax.php file +*/ +class html +{ + /** + * @brief Generate text / html for a MyHostings page cell + * @param cell_index : Zero-based cell index + * @param hosting_datas : Datas corresponding to the current hosting entry + * @return string with html code + * + * The first and the fifth column for the "MyHosting" page needs specials texts that have to be generated regarding to the corresponding hosting status. + * These links are generated with this method ($cell_index = 0 for the first, and $cell_index = 4 for the fifth).
+ * The function will check if the current hosting is active. If so, the first column will contain a link to the hosting details. If the hosting is suspended, the fifth column will have a link to the support ticket creation page. + */ + static public function makeHtmlForMyHostings( $cell_index, $hosting_datas ) + { + $result=null; + switch( $cell_index ) + { + case 0: // Hosting name + $cell_text = $hosting_datas->full_name; + if ( $hosting_datas->hosting_active == 'true' ) { + $result = ''; + $result .= $cell_text; + $result .= ''; + } else { + $result = $cell_text; + } + break; + case 4: // Hosting status + if ( $hosting_datas->hosting_active == 'true' ) { + $result = $hosting_datas->statusText; + } else { + $result = $hosting_datas->statusText . ' '; + $result .= 'Support'; + } + break; + } + return $result; + } // End of makeHtmlForMyHostings + + + + + /** + * @brief Generate text / html for a Support page cell + * @param cell_index : Zero-based cell index + * @param ticket_datas : Datas corresponding to the current ticket entry + * @return string with html code + * + * The first column for the "Support" page needs a link to get the ticket's detail page. + * This link can be generated with this method. + */ + static public function makeHtmlForSupport( $cell_index, $ticket_datas ) + { + $result=null; + switch( $cell_index ) + { + case 0: // Open date + $result = ''; + $result .= $ticket_datas->label_text . ''; + break; + } + return $result; + } + + /** + * @brief Generate text / html for a ticket details page cell + * @param cell_index : Zero-based cell index + * @param reply_datas : Datas corresponding to the current reply entry + * @return string with html code + * + * The first column for the "Ticket Details" page needs html code showing who made the current reply, and the date of this reply. + */ + static public function makeHtmlForTicketDetails( $cell_index, $reply_datas ) + { + $result=null; + switch( $cell_index ) + { + case 0: // Author / Date + $result = $reply_datas->msg_author . '
' . $reply_datas->msg_date; + break; + } + return $result; + } + + /** + * @brief Generate text / html for a Admin/Support page cell + * @param cell_index : Zero-based cell index + * @param ticket_datas : Datas corresponding to the current ticket entry + * @return string with html code + */ + static public function makeHtmlForAdminSupport( $cell_index, $ticket_datas ) + { + $result=null; + switch( $cell_index ) + { + case 0: // Open date + $result = ''; + $result .= $ticket_datas->open_date . ''; + break; + } + return $result; + } + + /** + * @brief Generate text / html for a Cron page cell + * @param cell_index : Zero-based cell index + * @param cron_datas : Datas corresponding to the current cron entry + * @return string with html code + * + */ + static public function makeHtmlForCron( $cell_index, $cron_datas ) + { + $result = null; + switch ( $cell_index ) + { + case 0: // Buttons + // Links for "Start/Stop" + $on_success="function(response){getPage('tbl_cron', ".$cron_datas->current_page.", ".$cron_datas->max_pages.", 1);}"; + $on_failure="function(){ alert(critical_error); }"; + if ( $cron_datas->is_active == 'true' ) { + $action = 'cronStopTask'; + $image = 'control_stop'; + } else { + $action = 'cronStartTask'; + $image = 'control_play'; + } + $start_stop="doSingleRequest('$action', $cron_datas->id, $on_success, $on_failure, 1);"; + $result = ''; + // Links for "Delete" + $delete="doSingleRequest('cronDeleteTask', $cron_datas->id, $on_success, $on_failure, 1);"; + $result .= ''; + break; + + case 1: // Address + $display_address = str_replace('http://', '', htmlentities($cron_datas)); + $display_address = str_replace('https://', '', $cron_datas); + if ( strlen($display_address) >= 60 ) $display_address = substr($display_address, 0, 60) . "..." ; + $result .= ''.$display_address.''; + break; + } + return $result; + } + + + +} +?> diff --git a/system/api/lang.api.php b/system/api/lang.api.php new file mode 100755 index 0000000..a95fc6b --- /dev/null +++ b/system/api/lang.api.php @@ -0,0 +1,102 @@ +object of differents countries + */ + public function listCountries() + { + $req = "SELECT + id, + flag, + countrie, + is_lang + FROM countries"; + $result = $_SESSION['database']->fetchObject($req); + return $result; + } // End of listCountries + + /** + * @brief Return lang of current user + * @return $lang -> code of the lang (fr/en/de/etc.) + */ + public function userGetLang() + { + if ( !LANG_USE_OTHERS ) { + return LANG_DEFAULT; + } + if( !is_null($_SESSION['user']->information_user) ) { + if( !$lang = $_SESSION['user']->userGetLang() ) { + throw new myException('The user is connected but userLang has returned false'); + } + $lang_allowed = unserialize(LANG_ALLOWED); + if ( !in_array($lang, $lang_allowed) ) { + throw new myException('Lang of the user is not allowed in configuration file'); + } + } else { + $lang = LANG_DEFAULT; + } + return $lang; + } // End of getLang + + /** + * @brief select word in lang file from key + * @param key -> 'msg_not_client' (exemple) + * @return -> 'Bienvenue sur votre futur espace membre...' + * @return false if key not found + */ + public function getWordFromLangFile( $key ) { + if ( !is_string($key) ) throw new myException('The key word is not an valid string'); + $lang_file = parse_ini_file(PATH_LANG.$this->userGetLang().'/lang'); + if ( !$lang_file ) throw new myException('Cannot open the lang file'); + if ( isset($lang_file[$key]) ) return $lang_file[$key]; + else return NULL; + } + + /** + * @brief return DATE format in lang of the current user + * @return date_format + */ + public function userGetDateFormat() + { + $lang = $_SESSION['user']->userGetLang(); + if ( isset($this->datetime_format[$lang]) ) return $this->datetime_format[$lang]['date']; + $req = "SELECT date_format,time_format FROM countries WHERE flag = '$lang' and is_lang = 'true'"; + $result = $_SESSION['database']->fetchObject($req); + if ( count($result) == 0 or count($result) > 1 ) throw new myException('Too many of not found record of lang'); + $this->datetime_format[$lang] = array('date' => $result[0]->date_format, 'time' => $result[0]->time_format); + return $result[0]->date_format; + } + + /** + * @brief return TIME format in lang of the current user + * @return time_format + */ + public function userGetTimeFormat() + { + $lang = $_SESSION['user']->userGetLang(); + if ( isset($this->datetime_format[$lang]) ) return $this->datetime_format[$lang]['time']; + $req = "SELECT date_format,time_format FROM countries WHERE flag = '$lang' and is_lang = 'true'"; + $result = $_SESSION['database']->fetchObject($req); + if ( count($result) == 0 or count($result) > 1 ) throw new myException('Too many of not found record of lang'); + $this->datetime_format[$lang] = array('date' => $result[0]->date_format, 'time' => $result[0]->time_format); + return $result[0]->time_format; + } + + +} // End of class + +?> diff --git a/system/api/myexception.api.php b/system/api/myexception.api.php new file mode 100755 index 0000000..748d7e8 --- /dev/null +++ b/system/api/myexception.api.php @@ -0,0 +1,152 @@ + Text generated by exception + */ + public function __construct($exception_message, $error_code = 0) + { + parent::__construct($exception_message); + $this->insertInLogFile($exception_message, $error_code); + } + + /** + * @brief Insert data from exceptions in logfile + */ + public function insertInLogFile($exception_message, $error_code) + { + $get = null; + $post = null; + $session = null; + $included_files = null; + foreach ( $_GET as $key => $value ) { + $get .= "\n -> ".escapeshellcmd($key).' : '.$value; + } + if ( is_null($get) ) $get = 'none'; + + foreach ( $_POST as $key => $value ) { + $post .= "\n -> ".escapeshellcmd($key).' : '.$value; + } + if ( is_null($post) ) $post = 'none'; + + $files = get_included_files(); + foreach ( $files as $key => $value ) { + $included_files .= "\n -> ".$key.' : '.$value; + } + if ( is_null($included_files) ) $included_files = 'none'; + + $message = "An error has been generated : \n"; + $message .= "Warning : The content is protected, is not the reel content (POST,GET) !\n"; + $message .= 'Date : '.date('Y-m-d H:i:s')."\n"; + $message .= 'Error : '.$exception_message."\n"; + $message .= 'File : '.$this->getFile()."\n"; + $message .= 'Line : '.$this->getLine()."\n"; + $message .= 'Code : '.$this->getCode()."\n"; + if ( isset($_SERVER['HTTP_USER_AGENT']) ) $message .= 'Browser : '.@escapeshellcmd($_SERVER['HTTP_USER_AGENT'])."\n"; + $message .= 'IP Address : '.$_SERVER['REMOTE_ADDR']."\n"; + $message .= 'Call Page : '.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].'?'.@escapeshellcmd($_SERVER['QUERY_STRING'])."\n"; + $message .= 'Request method : '.$_SERVER['REQUEST_METHOD']."\n"; + $message .= 'Request timer : '.$_SERVER['REQUEST_TIME']."\n"; + if ( isset($_SERVER['HTTP_REFERER']) ) $message .= 'Referer : '.@escapeshellcmd($_SERVER['HTTP_REFERER'])."\n"; + $message .= 'Script path : '.$_SERVER['SCRIPT_FILENAME']."\n"; + $message .= 'GET value : '.$get."\n"; + $message .= 'POST value : '.$post."\n"; + $message .= 'Included files : '.$included_files."\n"; + $message .= "Execution traces : \n".$this->getTraceAsString()."\n"; + $message .= "---------------------------------------------------\n"; + $message .= "\n\n"; + + + $file_handle = fopen (PATH_LOGS.date('Y-m-d').'.log', 'a+'); + if ( !$file_handle ) { + mail('root@kelio.org', 'CRITICAL ERROR !!', 'The logfile of exceptions can\'t be open !'); + } + + $file_writen = fwrite ( $file_handle, $message ) ; + if ( !$file_writen ) { + mail('root@kelio.org', 'CRITICAL ERROR !!', 'The logfile of exception can\'t be written !'); + } + + fclose($file_handle); + + if ( defined('DEBUG') and (preg_match('`ajax.php`i',$_SERVER['PHP_SELF']) == 0) ) { + $unique_id = mt_rand(0,2500); + $echo = "
"; + $echo .= "An error has been generated :
\n"; + $echo .= 'Error : '.nl2br($exception_message)."
\n"; + $echo .= 'File : '.$this->getFile()."
\n"; + $echo .= 'Line : '.$this->getLine()."
\n"; + $echo .= 'Code : '.$error_code."
\n"; + $echo .= "Trace :\n".nl2br($this->getTraceAsString())."

\n"; + $echo .= "For see complete rapport, clic here
\n"; + $echo .= "For quit this error, clic here
\n"; + $echo .= "
\n"; + $echo .= "
\n\n\n\n"; + echo $echo; + } + } // End of insertInLogFile + + /** + * @brief Display HTML error + */ + public function displayErrorMessage() + { + @$page = file_get_contents(PAGE_CRITICAL_ERROR); + if ( !$page ) { + die(NOLOG_ERROR); + } else { + echo $page; + } + die(); + } // End of displayErrorMessage + + /** + * @brief Display 'critical_error' for ajax + */ + public function displayCriticalError() + { + echo 'critical_error'; + die(); + } + +} +/** + * @brief Manage PHP error + */ +function myErrorHandler($type, $string, $file, $line, $context){ + try { + switch ($type) { + case E_USER_WARNING: + throw new MyException("An PHP error has been generated :\n -> Error : ".$string."\n -> File : ".$file."\n -> Line : ".$line."\n -> Context : ".$context, -999); + break; + case E_USER_NOTICE: + throw new MyException("An PHP error has been generated :\n -> Error : ".$string."\n -> File : ".$file."\n -> Line : ".$line."\n -> Context : ".$context, -998); + break; + case E_WARNING: + throw new MyException("An PHP error has been generated :\n -> Error : ".$string."\n -> File : ".$file."\n -> Line : ".$line."\n -> Context : ".$context, -899); + break; + case E_NOTICE: + throw new MyException("An PHP error has been generated :\n -> Error : ".$string."\n -> File : ".$file."\n -> Line : ".$line."\n -> Context : ".$context, -898); + break; + case E_ERROR: + throw new MyException("An PHP error has been generated :\n -> Error : ".$string."\n -> File : ".$file."\n -> Line : ".$line."\n -> Context : ".$context, -797); + break; + default: + throw new MyException("An PHP error has been generated :\n -> Error : ".$string."\n -> File : ".$file."\n -> Line : ".$line."\n -> Context : ".$context, -797); + } + } catch ( MyException $oException ) { + } +} +set_error_handler("myErrorHandler"); + +?> diff --git a/system/api/mysql.api.php b/system/api/mysql.api.php new file mode 100755 index 0000000..9ce1f02 --- /dev/null +++ b/system/api/mysql.api.php @@ -0,0 +1,140 @@ + Name of the mysql user + * @param mysql_passwors -> Password of the mysql user + * @param mysql_server -> MySQL server + * @param database -> Database of the website + * @return TRUE -> Connection to mysql has generated no error. + */ + public function connect($mysql_user, $mysql_password, $mysql_server, $database) + { + if ( !$this->link = mysqli_connect($mysql_server, $mysql_user, $mysql_password, $database) ) { + throw new myException('Error when connecting to MySQL :'.mysqli_connect_error()); + } else { + return TRUE; + } + } // End of connect + + /** + * @brief Execute an request + * @param Request in SQL format. + * @return TRUE -> Query has generated no error. + */ + public function execRequest($request) + { + if ( @mysqli_query($this->link, $request) ) { + $this->executed_req++; + return TRUE; + } else { + throw new myException("Error when query is executed : \n$request\n".mysqli_error($this->link)); + } + } // End of execRequest + + + /** + * @brief Execute an request and fetch array + * @param Request in SQL format + * @return Array of False -> FALSE: no record found + */ + public function fetchArray($request) + { + if ( !@$handle = mysqli_query($this->link, $request) ) { + throw new myException("Error when query is executed :\n$request\n".mysqli_error($this->link)); + } + $this->executed_req++; + $result = array(); + while( $row = mysqli_fetch_assoc($handle) ) + { + $result[] = $row; + } + + if ( is_null($result) ) { + return FALSE; + } else { + return $result; + } + } // End of fetchArray + + /** + * @brief Execute an request and return an object + * @param Request in SQL format + * @return Array of False -> FALSE: no record found + */ + public function fetchObject($request) + { + if ( !@$handle = mysqli_query($this->link, $request) ) { + throw new myException("Error when query is executed :\n$request\n".mysqli_error($this->link)); + } + $this->executed_req++; + $result = array(); + while( @$row = mysqli_fetch_object($handle) ) + { + $result[] = $row; + } + if ( is_null($result) ) { + return FALSE; + } else { + return $result; + } + } // End of fetchObject + + /** + * @brief Return the id of the last inserted object + * @return Id of the last inserted object FROM LAST REQUEST + * @modified Mogui + * @date 19/05/2009 - 15:41 + */ + public function getInsertId() + { + $result = mysqli_insert_id($this->link); + return $result; + } // End of getInsertId + + /** + * @brief return the number of affected entries + * @return number of affected entries FROM LAST REQUEST + * @modified Mogui + * @date 19/05/2009 - 15:38 + */ + public function getNumRows() + { + $result = mysqli_num_rows($this->link); + return $result; + + } // End of getId + + /** + * @brief Clear string before send in sql req. + * @param value -> Value to clear + * @return Value cleared + */ + public function clearString($string) + { + return mysqli_real_escape_string($this->link, $string); + } // End of clearString + + +} // End of mysql + + +?> diff --git a/system/api/pagination.api.php b/system/api/pagination.api.php new file mode 100755 index 0000000..fbeab40 --- /dev/null +++ b/system/api/pagination.api.php @@ -0,0 +1,155 @@ + + * It will also allow you to set lines or cells attributes as you would do in a classic html table +*/ +class pagination +{ + /** + * @brief Temporary created datas + */ + private $results = array(); + + /** + * @brief Add a new line to the results array + * @param None + * @return Zero-based index of this new line + * + * You will have to call this method for every line (<tr>) you want to add to the result table. + * It will create an empty line, and return the zero-based index of the new line in the table. + */ + public function addLine() + { + // Create the new entry + $tr = array(); + // Add the tr's options array to this entry + $tr[] = array(); + // Add the tr's data's array to this entry + $tr[] = array(); + // Add the entry to the results array + $this->results[] = $tr; + // Return the zero-based index of the new entry + return $this->getLinesCount()-1; + } + + /** + * @brief Set an attribute for a <tr> entry (such as id, class, style, ...) + * @param line_index Zero-based index of the line (returned by the addLine method) + * @param attr_name Name of the attribute to set + * @param attr_value Value of the attribute to set + * @return True if successfull, False otherwise + * + * Call this method to add properties to a <tr> entry of your table.
+ * For example, if you want to set the class name of a line, just call this method with $attr_name = "class" and $attr_value = "class_name". + */ + public function setLineAttribute( $line_index, $attr_name, $attr_value ) + { + if ( $line_index >= $this->getLinesCount() ) return false; + // Get the concerned line entry + $tr = & $this->results[$line_index]; + // Get the line's options array + $tr_opts = & $tr[0]; + // Create (or update) the line attribute + $tr_opts[$attr_name] = $attr_value; + // All is ok : we can return true + return true; + } + + /** + * @brief Get the number of lines already defined in the results array + * @param None + * @return Number of lines + * + * This method will return the total of lines added to the result array (total of calls to addLine ). + */ + public function getLinesCount() + { + return count($this->results); + } + + /** + * @brief Add a new cell to the given line + * @param cell_value Text / Html code to put in the cell + * @param line_index Zero-based index of the line (if ommitted, the last line added is used) + * @return Zero-based index of the cell in the line + * + * You will have to call this method for every cell (<td>) entry that you want to add to a line. + */ + public function addCell( $cell_value, $line_index=null ) + { + if ( is_null($line_index) ) $line_index = $this->getLinesCount()-1; + // Create the new cell datas + $new_cell = array( 'html' => $cell_value ); + // Get the line entry in the results array + $tr = & $this->results[$line_index]; + // Get the line's cells array + $tr_cells = & $tr[1]; + // Add the cell to the line + $tr_cells[] = $new_cell; + // Return the new cell index + return $this->getCellsCount($line_index)-1; + } + + /** + * @brief Set an attribute for a <td> entry (such as id, class, style, colspan, ...) + * @param line_index Zero-based index of the line + * @param cell_index Zero-based index of the cell in the line (the cell must be created before with addCell) + * @param attr_name Name of the attribute to set/modify + * @param attr_value Value of the attribute + * @return True if successfull, false otherwise + * + * Call this method to add properties to a <td> entry of your table.
+ * For example, if you want to set the class name of a cell, just call this method with $attr_name = "class" and $attr_value = "class_name". + */ + public function setCellAttribute( $line_index, $cell_index, $attr_name, $attr_value ) + { + // Check the $line_index and $cell_index values + if ( ($line_index < 0) || ($line_index >= $this->getLinesCount())) return false; + if ( ($cell_index < 0) || ($cell_index >= $this->getCellsCount($line_index)) ) return false; + // Get the line entry in the results array + $tr = & $this->results[$line_index]; + // Get the line's cells array + $tr_cells = & $tr[1]; + // Get the cell entry + $td = & $tr_cells[$cell_index]; + // Set/Modify the cell attribute + $td[$attr_name] = $attr_value; + + return true; + } + + + /** + * @brief Get the number of cells already defined in the given line + * @param line_index : Zero-based index of the line (if ommitted, the last line is used) + * @return Number of cells in the line + * + */ + public function getCellsCount( $line_index=null) + { + if ( is_null($line_index) ) $line_index = $this->getLinesCount()-1; + // Get the line entry in the results array + $tr = & $this->results[$line_index]; + // Return the number of cells + return count($tr[1]); + } + + /** + * @brief Get the created results array + * @param None + * @return json array of the result table datas + * + */ + public function getResult() + { + return json_encode($this->results); + } +} +?> \ No newline at end of file diff --git a/system/api/security.api.php b/system/api/security.api.php new file mode 100755 index 0000000..465d0a5 --- /dev/null +++ b/system/api/security.api.php @@ -0,0 +1,49 @@ +checkMagicQuotesGPC(); + + // Configuration + $this->initializeTimezone(); + } // End of construct + + + /** + * @brief Check magic_quote_gpc. If is activated, throwing exception. + * @return null + */ + private function checkMagicQuotesGPC() + { + if ( get_magic_quotes_gpc() == 1 ) { + throw new myException('PHP variable magic_quotes_gpc must be set on Off'); + } + } + + /** + * @brief Initialize the timezone if not set + * @return null + */ + private function initializeTimezone() + { + date_default_timezone_set(TIMEZONE); + } + +} // End of class + +?> diff --git a/system/api/support.api.php b/system/api/support.api.php new file mode 100755 index 0000000..180913b --- /dev/null +++ b/system/api/support.api.php @@ -0,0 +1,515 @@ + id of the user for witch we want the tickets list (must be specified) + * @param start -> First ticket to extract (can be NULL) + * @param extract -> Number of tickets to extract (can be NULL) + * @return array of tickets informations (NULL if empty) + */ + public function getUserTickets($user_id, $start = NULL, $extract = NULL) + { + $user_id = $_SESSION['database']->clearString($user_id); + // if paging informations are given, create the LIMIT clause + if ( !is_null($start) and !is_null($extract) ) { + $start = $_SESSION['database']->clearString($start); + $extract = $_SESSION['database']->clearString($extract); + $limit = "LIMIT $start, $extract"; + } else $limit = NULL; + + $req = "SELECT + t.id AS ticket_id, + t.subject, + UNIX_TIMESTAMP(t.open_date) AS open_date, + t.status, + h.base_name AS hosting_name + FROM tickets AS t + LEFT JOIN hostings AS h + ON h.id = t.hosting_id + WHERE t.user_id = '$user_id' + ORDER BY t.open_date DESC $limit"; + + $tickets_list = $_SESSION['database']->fetchObject($req); + foreach ($tickets_list as $item) { + $item->subject=stripslashes($item->subject); + } + + return $tickets_list; + } // End of getUserTickets + + /** + * @brief List all tickets of the current user + * @param start -> First ticket to extract (can be NULL) + * @param extract -> Number of tickets to extract (can be NULL) + * @return array of tickets informations (NULL if empty) + */ + public function userGetTickets($start = NULL, $extract = NULL) + { + $user_id=$_SESSION['user']->information_user->userid; + + return $this->getUserTickets($user_id, $start, $extract); + } // End of userGetTickets + + /** + * @brief List all "waiting for a reply" tickets, sorted by last message date, older in first position + * @param start -> First ticket to extract (can be NULL) + * @param extract -> Number of tickets to extract (can be NULL) + * @return array of tickets informations (NULL if empty) + */ + public function getWaitingTickets($start = NULL, $extract = NULL) + { + // if paging informations are given, create the LIMIT clause + if ( !is_null($start) and !is_null($extract) ) { + $start = $_SESSION['database']->clearString($start); + $extract = $_SESSION['database']->clearString($extract); + $limit = "LIMIT $start, $extract"; + } else $limit = NULL; + + $sql = "SELECT + t.id AS ticket_id, + t.subject, + UNIX_TIMESTAMP(t.open_date) AS open_date, + t.status, + UNIX_TIMESTAMP(t.last_msg_date) AS last_msg_date, + h.base_name AS hosting_name + FROM tickets AS t + LEFT JOIN hostings AS h + ON h.id = t.hosting_id + WHERE t.status = 'asked' + ORDER BY t.last_msg_date ASC $limit"; + + $tickets_list = $_SESSION['database']->fetchObject($sql); + // Check if tickets list is not empty + if ( !isset($tickets_list[0]) ) return NULL; + + foreach ($tickets_list as $item) { + $item->subject=stripslashes($item->subject); + } + return $tickets_list; + } + + /** + * @brief List all "replied but not closed" tickets, sorted by last message date, older in first position + * @param start -> First ticket to extract (can be NULL) + * @param extract -> Number of tickets to extract (can be NULL) + * @return array of tickets informations (NULL if empty) + */ + public function getRepliedTickets($start = NULL, $extract = NULL) + { + // if paging informations are given, create the LIMIT clause + if ( !is_null($start) and !is_null($extract) ) { + $start = $_SESSION['database']->clearString($start); + $extract = $_SESSION['database']->clearString($extract); + $limit = "LIMIT $start, $extract"; + } else $limit = NULL; + + $sql = "SELECT + t.id AS ticket_id, + t.subject, + UNIX_TIMESTAMP(t.open_date) AS open_date, + t.status, + UNIX_TIMESTAMP(t.last_msg_date) AS last_msg_date, + h.base_name AS hosting_name + FROM tickets AS t + LEFT JOIN hostings AS h + ON h.id = t.hosting_id + WHERE t.status = 'replied' + ORDER BY t.last_msg_date ASC $limit"; + + $tickets_list = $_SESSION['database']->fetchObject($sql); + // Check if tickets list is not empty + if ( !isset($tickets_list[0]) ) return NULL; + + foreach ($tickets_list as $item) { + $item->subject=stripslashes($item->subject); + } + return $tickets_list; + } + + /** + * @brief Extract messages related to a given ticket + * @param ticket_id -> id of the ticket for witch we want to see the messages + * @param start -> First message to extract + * @param extract -> Number of messages to extract + * @return an array (NULL if ticket_id was an invalid number) with first element = ticket summary, and others = messages + */ + public function getTicketDetails($ticket_id, $start = NULL, $extract = NULL) + { + $ticket_id = $_SESSION['database']->clearString($ticket_id); + + if ( !is_null($start) and !is_null($extract) ) { + $start = $_SESSION['database']->clearString($start); + $extract = $_SESSION['database']->clearString($extract); + $limit = "LIMIT $start, $extract"; + } else $limit = NULL; + + // Extract ticket's summary + $req = "SELECT + t.*, + h.base_name AS hosting_name, + u.username AS user_name + FROM tickets AS t + LEFT JOIN hostings AS h + ON h.id = t.hosting_id + LEFT JOIN users AS u + ON u.id = t.user_id + WHERE t.id = '$ticket_id'"; + $summary = $_SESSION['database']->fetchObject($req); + // Check if ticket id was a valid number + if ( !isset($summary[0]) ) return NULL; + $summary[0]->subject = stripslashes($summary[0]->subject); + $summary[0]->open_date = strtotime($summary[0]->open_date); + // Extract messages + $req = "SELECT + m.id AS msg_id, + UNIX_TIMESTAMP(m.posted) AS posted, + m.is_reply, + m.message + FROM tickets_msg AS m + WHERE m.ticket_id = '$ticket_id' + ORDER BY m.posted DESC + $limit"; + $messages = $_SESSION['database']->fetchObject($req); + foreach ($messages as $item) { + $item->message=stripslashes($item->message); + } + // if messages list is not empty, append it to results + if ( !is_null($messages) ) + $results = array_merge((array)$summary, $messages); + else + $results = (array)$summary; + + return $results; + } // End of getTicketDetails + + /** + * @brief Create a new ticket from a user request + * @param subject -> subject of the ticket + * @param message -> content of the ticket + * @param hosting_id -> id of the hosting entry to associate with this ticket (can be NULL) + * @return True if successfull, false otherwise + */ + public function userCreateTicket($subject, $message, $hosting_id=NULL) + { + $subject = $_SESSION['database']->clearString($subject); + $message = $_SESSION['database']->clearString($message); + $date_msg = time(); + $user_id=$_SESSION['user']->information_user->userid; + $ticket_id = 0; // we actually don't know this value + if ( is_null($hosting_id) ) { + $hosting_entry=''; + } else { + $hosting_id = $_SESSION['database']->clearString($hosting_id); + $hosting_entry="hosting_id = '$hosting_id',"; + } + + // Addind message into database + $sql1 = "INSERT INTO tickets_msg + SET + ticket_id = '$ticket_id', + posted = FROM_UNIXTIME($date_msg), + is_reply = 'false', + message = '$message'"; + $_SESSION['database']->execRequest($sql1); + $msg_id = $_SESSION['database']->getInsertId(); + + // Adding ticket infos in database + $sql2 = "INSERT INTO tickets + SET + user_id = '$user_id', + open_date = FROM_UNIXTIME($date_msg), + first_msg_id = '$msg_id', + last_msg_date = FROM_UNIXTIME($date_msg), + last_msg_id = '$msg_id', + status = 'asked', + $hosting_entry + subject = '$subject'"; + $_SESSION['database']->execRequest($sql2); + $ticket_id = $_SESSION['database']->getInsertId(); + + // Updating cache variable if needed + if ( !is_null($this->user_tickets) ) { + $this->user_tickets++; + } + + // Updating ticket id for the message + $sql3 = "UPDATE tickets_msg + SET + ticket_id = '$ticket_id' + WHERE + id = '$msg_id'"; + return $_SESSION['database']->execRequest($sql3); + } // End of userCreateTicket + + /** + * @brief Check if a ticket delong to the current user + * @param ticket_id -> id of the ticket to check + * @return true if ticket if current user's one, false otherwise + */ + public function userCheckTicketId($ticket_id) + { + $user_id = $_SESSION['user']->information_user->userid; + $ticket_id = $_SESSION['database']->clearString($ticket_id); + + $sql = "SELECT id FROM tickets + WHERE id = '$ticket_id' + AND user_id = '$user_id'"; + $result = $_SESSION['database']->fetchObject($sql); + return ( isset($result[0])); + } // End of userCheckTicketId + + /** + * @brief Add a response to a ticket (from the user) + * @param ticket_id -> id of the ticket to associate to the response + * @param message -> content of the response + * @return true if successfull, false otherwise + */ + public function userAddResponse($ticket_id, $message) + { + if ( !$this->userCheckTicketId($ticket_id) ) return false; + return $this->addResponse($ticket_id, $message, true); + } // end of userAddResponse + + /** + * @brief Add a response to a ticket + * @param ticket_id -> id of the ticket to associate to the response + * @param message -> content of the response + * @param from_user -> true if the response comes from the user, false otherwise + * @return true if successfull, false otherwise + */ + public function addResponse($ticket_id, $message, $from_user) + { + $ticket_id = $_SESSION['database']->clearString($ticket_id); + $message = $_SESSION['database']->clearString($message); + $from_user = $_SESSION['database']->clearString($from_user); + $is_reply=( $from_user==true ? 'false' : 'true' ); + $status = ( $is_reply=='true' ? 'replied' : 'asked' ); + $date_msg = time(); + + $sql = "INSERT INTO tickets_msg SET + ticket_id = '$ticket_id', + posted = FROM_UNIXTIME($date_msg), + is_reply = '$is_reply', + message = '$message'"; + $_SESSION['database']->execRequest($sql); + $msg_id = $_SESSION['database']->getInsertId(); + + if ( !$msg_id) return false; + $sql2 = "UPDATE tickets SET + last_msg_date = FROM_UNIXTIME($date_msg), + last_msg_id = '$msg_id', + status = '$status' + WHERE id='$ticket_id'"; + return $_SESSION['database']->execRequest($sql2); + } // end of addResponse + + /** + * @brief Close a support ticket + * @param ticket_id -> id of the ticket to close + * @param fromUser -> true if called from a user's page, false otherwise + * @return true if successfull, false otherwise + */ + public function closeTicket($ticket_id, $from_user) + { + $ticket_id = $_SESSION['database']->clearString($ticket_id); + $from_user = $_SESSION['database']->clearString($from_user); + $status = ( $from_user==true ? 'closed_by_user' : 'closed_by_support' ); + $close_date = time(); + + $sql = "UPDATE tickets SET + status = '$status', + closed_date = FROM_UNIXTIME($close_date) + WHERE id='$ticket_id'"; + return $_SESSION['database']->execRequest($sql); + } // end of closeTicket + + /** + * @brief Close a support ticket (from the user) + * @param ticket_id -> id of the ticket to close + * @return true if successfull, false otherwise + */ + public function userCloseTicket($ticket_id) + { + if ( !$this->userCheckTicketId($ticket_id) ) return false; + return $this->closeTicket($ticket_id, true); + } // end of userCloseTicket + + /** + * @brief Get number of tickets for the current user + * @param None + * @return number of tickets for the user + * + * Get the total of support tickets for the current user.
+ * This value is got the first time from the database (generating a SQL request) and is then stocked in a cache variable, so, other calls to this method won't generate another SQL request. + */ + public function userCountTickets() + { + // Try to get the value from the cache + if( !is_null($this->user_tickets) ) { + return $this->user_tickets; + } + + $user_id = $_SESSION['user']->information_user->userid; + $req = "SELECT COUNT(id) AS total FROM tickets WHERE user_id='$user_id'"; + $result = $_SESSION['database']->fetchObject($req); + $this->user_tickets = $result[0]->total; + + return $this->user_tickets; + } + + /** + * @brief Get number of tickets pages for the current user, regarding the total count of tickets and the count of items to be shown per page + * @param None + * @return number of pages availables + * + * Calculate the total pages needed to show all the support tickets for the current user. + */ + public function userCountTotalPages() + { + $items_count = $this->userCountTickets(); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + + /** + * @brief Get the total of messages for a given ticket + * @param ticket_id Id of the ticket for witch we want to count the messages + * @return number of messages + */ + public function countTicketMessages( $ticket_id ) + { + $ticket_id = $_SESSION['database']->clearString($ticket_id); + if ( isset($this->ticket_messages[$ticket_id]) ) { + return $this->ticket_messages[$ticket_id]; + } + $req = "SELECT COUNT(id) AS total FROM tickets_msg WHERE ticket_id='$ticket_id'"; + $result = $_SESSION['database']->fetchObject($req); + $this->ticket_messages[$ticket_id] = $result[0]->total; + + return $this->ticket_messages[$ticket_id]; + } + + /** + * @brief Get total of details pages for a given ticket, regarding the total count of messages and the count of items to be shown per page + * @param ticket_id Id of the ticket for witch we want the total of pages + * @return number of pages availables + */ + public function countTicketTotalPages( $ticket_id ) + { + $items_count = $this->countTicketMessages( $ticket_id ); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + + /** + * @brief Get total of tickets waiting for a support reply + * @param None + * @return number of tickets waiting for a support reply + * + * Get the total of support tickets waiting for a support reply.
+ * This value is got the first time from the database (generating a SQL request) and is then stocked in a cache variable, so, other calls to this method won't generate another SQL request. + */ + public function countWaitingTickets() + { + // Try to get the value from the cache + if( !is_null($this->waiting_tickets) ) { + return $this->waiting_tickets; + } + + $req = "SELECT COUNT(id) AS total FROM tickets WHERE status = 'asked'"; + $result = $_SESSION['database']->fetchObject($req); + $this->waiting_tickets = $result[0]->total; + + return $this->waiting_tickets; + } + + /** + * @brief Get total of pages for tickets waiting for a supoprt reply, regarding the total count of messages and the count of items to be shown per page + * @param None + * @return number of pages availables + */ + public function countWaitingTicketsTotalPages() + { + $items_count = $this->countWaitingTickets(); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + + /** + * @brief Get total of tickets for witch the support made a reply + * @param None + * @return number of tickets for witch the support made a reply + * + * Get the total of support tickets for witch the support made a reply.
+ * This value is got the first time from the database (generating a SQL request) and is then stocked in a cache variable, so, other calls to this method won't generate another SQL request. + */ + public function countRepliedTickets() + { + // Try to get the value from the cache + if( !is_null($this->replied_tickets) ) { + return $this->replied_tickets; + } + + $req = "SELECT COUNT(id) AS total FROM tickets WHERE status = 'replied'"; + $result = $_SESSION['database']->fetchObject($req); + $this->replied_tickets = $result[0]->total; + + return $this->replied_tickets; + } + + /** + * @brief Get total of pages for tickets for witch the support made a reply, regarding the total count of messages and the count of items to be shown per page + * @param None + * @return number of pages availables + */ + public function countRepliedTicketsTotalPages() + { + $items_count = $this->countRepliedTickets(); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + +} // End of class diff --git a/system/api/template.api.php b/system/api/template.api.php new file mode 100755 index 0000000..07743a8 --- /dev/null +++ b/system/api/template.api.php @@ -0,0 +1,187 @@ +_oSmarty = new Smarty(); + $this->_oSmarty->clear_compiled_tpl(); + $this->_oSmarty->template_dir = PATH_TPL.$this->userGetTemplate().'/template/'; + $this->_oSmarty->compile_dir = PATH_CACHE.'smarty/compiled/'; + $this->_oSmarty->cache_dir = PATH_CACHE.'smarty/cache/'; + $this->_oSmarty->config_dir = PATH_LANG.$lang->userGetLang().'/'; + $this->_oSmarty->load_filter('output','trimwhitespace'); + $this->_oSmarty->caching = false; + $this->_oSmarty->assign('HOST', TPL_HOST); + $this->_oSmarty->assign('IMAGE', 'image/'); + $this->_oSmarty->assign('TPL_IMAGE', 'theme/'.$this->userGetTemplate().'/image/'); + $this->_oSmarty->assign('JAVASCRIPT', 'javascript/'); + $this->_oSmarty->assign('TPL_JAVASCRIPT', 'themes/'.$this->userGetTemplate().'/javascript/'); + $this->_oSmarty->assign('TPL_STYLE', 'themes/'.$this->userGetTemplate().'/style/'); + $this->_oSmarty->assign('STYLE', 'style/'); + $this->_oSmarty->assign('CHARSET', WEBSITE_CHARSET); + $this->_oSmarty->assign('USER_INFOS', $_SESSION['user']->information_user); + $this->loadModifiers(); + } // End of __construct + + public function addMenu( $title, $list_menu ) + { + $lang = new lang(); + if ( !is_array($list_menu) ) throw new myException('list_menu is not an array'); + if ( empty($title) ) throw new myException('The title of the new menu can\'t be empty'); + if ( count($this->list_menu) != count($this->list_menu_title) ) throw new myException('Arrays white information is not equal'); + foreach ( $list_menu as $key => $value ) + { + $list_menu[$key] = $lang->getWordFromLangFile($value); + } + $this->list_menu[] = $list_menu; + $this->list_menu_title[] = $lang->getWordFromLangFile($title); + return TRUE; + + } + + + public function getWords($words) + { + $this->_oSmarty->assign($words); + return TRUE; + } // End of getWords + + public function loadCSS($css_files) + { + if ( is_array($css_files) ) { + foreach($css_files as $key => $value) + { + if ( in_array($value, $this->list_css ) ) throw new myException("CSS file '$value' is already loaded"); + $this->list_css[] = $value; + } + return TRUE; + } + if ( in_array($css_files, $this->list_css ) ) throw new myException("CSS file '$css_files' is already loaded"); + $this->list_css[] = $css_files; + return TRUE; + } + + public function loadJS($js_files) + { + if ( is_array($js_files) ) { + foreach($js_files as $key => $value) + { + if ( in_array($value, $this->list_js ) ) throw new myException("JS file '$value' is already loaded"); + $this->list_js[] = $value; + } + return TRUE; + } + if ( in_array($js_files, $this->list_js ) ) throw new myException("JS file '$css_files' is already loaded"); + $this->list_js[] = $js_files; + return TRUE; + } + + public function loadTemplate($module) + { + if ( in_array($module, $this->list_module) ) { + throw new myException("Module '$module' is already loaded"); + } + $this->list_module[] = $module; + return TRUE; + } // End of loadTemplate + + + public function parseTemplate() + { + if ( is_null($this->list_module) ) { + return FALSE; + } + $this->_oSmarty->assign('css_files', $this->list_css); + $this->_oSmarty->assign('js_files', $this->list_js); + foreach( $this->list_module as $key => $value ) + { + if ( !$this->_oSmarty->template_exists($value.'.tpl') ) { + throw new myException("Template file $value is not found"); + } + } + $this->_oSmarty->assign('list_menu_title', $this->list_menu_title); + $this->_oSmarty->assign('list_menu', $this->list_menu); + foreach( $this->list_module as $key => $value ) + { + $this->_oSmarty->display($value.'.tpl'); + } + } // End of parseTemplate + + + public function userGetTemplate() + { + if ( !TEMPLATE_USE_OTHERS ) { + return TEMPLATE_DEFAULT; + } + if( !$_SESSION['user']->user_not_logued ) { + if( !$template = $_SESSION['user']->userGetTemplate() ) { + throw new myException('The user is connected but getUserTemplate has returned false'); + } + $template_allowed = unserialize(TEMPLATE_ALLOWED); + if ( !in_array($template, $template_allowed) ) { + throw new myException('Template of the user is not allowed in configuration file'); + } + } else { + $template = TEMPLATE_DEFAULT; + } + return $template; + } // End of getTemplate + + /** + * @brief assign var when the right is autorised + * @return NULL + */ + public function userSetRightsDisplay() + { + + if ( !is_null($_SESSION['user']->information_user) ) { + $right = $_SESSION['user']->information_user->lvl; + if ( $right >= LEVEL_REGISTER ) $_SESSION['template']->getWords(array('is_connected' => 1)); + if ( $right >= LEVEL_CUSTOMER ) $_SESSION['template']->getWords(array('is_client' => 1)); + if ( $right >= LEVEL_MODERATOR ) $_SESSION['template']->getWords(array('is_moderator' => 1)); + if ( $right >= LEVEL_SUPPORT ) $_SESSION['template']->getWords(array('is_support' => 1)); + if ( $right >= LEVEL_ADMIN ) $_SESSION['template']->getWords(array('is_admin' => 1)); + if ( $right >= LEVEL_CUSTOMER and isset($_SESSION['hosting']->information_hosting->id) ) { + $_SESSION['template']->getWords(array('hosting_specified' => $_SESSION['hosting']->information_hosting->id)); + $_SESSION['template']->getWords(array('HOSTING_INFOS' => $_SESSION['hosting']->information_hosting)); + } + if ( $right > LEVEL_ADMIN or $right < LEVEL_REGISTER ) throw new myException("Right is not correct '$right'"); + } + } // End of displayMenus + + /** + * @brief Check template existance and syntax + * @param template -> Name of template + * @return True/False + */ + public function checkTemplateExistence($template) + { + $list_template = unserialize(TEMPLATE_ALLOWED); + if ( in_array($template, $list_template) ) return true; + else return false; + } + + /** + * @brief Load modifier at the startup of the script + * @brief If necessary, create a modifier for a custom modification of strings + * @brief For the exemple : {#test#|ucfirst} or {$test.test|ucfirst} + * @return null + */ + public function loadModifiers() + { + //$this->_oSmarty->register_modifier('ucfirst', 'ucfirst'); + } + + +} // End of class + +?> diff --git a/system/api/textverification.api.php b/system/api/textverification.api.php new file mode 100755 index 0000000..280eb17 --- /dev/null +++ b/system/api/textverification.api.php @@ -0,0 +1,199 @@ + $maxi ) return false; + } + // If all is ok, return true; + return true; + } + + static public function verifPassword( $value ) + { + $regex='`^[^\'"]{4,15}$`'; + if (preg_match($regex, $value == 1 )) return true; + else return false; + } + +} // End of class + +?> \ No newline at end of file diff --git a/system/api/user.api.php b/system/api/user.api.php new file mode 100755 index 0000000..278ba63 --- /dev/null +++ b/system/api/user.api.php @@ -0,0 +1,327 @@ +result_test; + if ( $user_statut == 1 ) { + throw new myException('SECURITY WARNING : The password of user is not the same in DB and session'); + } elseif ( $user_statut == 2 ) { + redirect('error-3.xhtml'); + } elseif ( $user_statut == 3 ) { + redirect('error-4.xhtml'); + } + + if ( is_null($this->information_user) and $access_min == 0 ) { + return TRUE; + } elseif ( is_null($this->information_user) ) { + redirect('connection.xhtml'); + } + + $user_lvl = $this->information_user->lvl; + if ( $user_lvl < $access_min ) { + redirect('error-1.xhtml'); + } elseif ( !is_null($access_max) and $user_lvl > $access_max ) { + redirect('error-2.xhtml'); + } else { + return TRUE; + } + } // End of checkaccess + + + + /** + * @brief Initialize information_user with all informations from the current user + * @return 0 : User not found + * @return 1 : Username & password is wrong + * @return 2 : User is not active + * @return 3 : Group is not active + * @return 4 : Evrythinks is okay :-) + * @returb 5 : User is not logued + */ + public function userInitialize() + { + + // The user informations is initialized ? + if ( !is_null($this->information_user) ) { + throw new myException('The var information_user is already initialized'); + } + // The sessions is existing ? No : User is not logged + if ( !isset($_SESSION['user_infos']) ) { + $this->result_test = 5; + return 5; + } + // Convert session in array + $informations = unserialize($_SESSION['user_infos']); + if ( !is_array($informations) ) { + throw new myException('the user_infos is not an array'); + } + // Check the information where user_id in session database + $user_info = $this->selectInformationsFromDB($informations['user_id']); + if ( !$user_info ) throw new myException("Not user found with id '$userid'"); + // User is found + + // Get user, password, userid from session + $password = $informations['hash']; + $userid = $informations['user_id']; + $user_info = $user_info[0]; + + // The password of session and DB are differents + if ( $user_info->password != $password ) { + $this->result_test = 1; + return 1; + } + // The user is not active + elseif ( $user_info->user_active == 'false' ) { + $this->result_test = 2; + return 2; + } + // The group is not active + elseif ( $user_info->group_active == 'false' ) { + $this->result_test = 3; + return 3; + } + // All tests are passed, the user is logged + else { + $this->information_user = $user_info; + $this->result_test = 4; + return 4; + } + } // End of initializeUser + + /** + * @brief Return the name of the user template + * @return Name/False : If name is empty, return false + */ + public function userGetTemplate() + { + if ( is_null($this->information_user) ) throw new myException('The user is not logued'); + $template_name = $this->information_user->template; + if ( empty($template_name) ) return false; + else return $template_name; + } // End of getUserTemplate + + /** + * @brief Return the lang of the user + * @return Lang/False : If lang is empty, return false + */ + public function userGetLang() + { + if ( is_null($this->information_user) ) throw new myException('The user is not logued'); + $lang = $this->information_user->lang; + if ( empty($lang) ) return false; + else return $lang; + } // End of getUserLang + + /** + * @brief Select informations from user in database + * @param user_id -> Id of a user, optionnaly + * @return Array with informations from user or FALSE is user is not found + */ + private function selectInformationsFromDB($user_id = NULL) + { + if ( is_null($user_id) ) { + $informations = unserialize($_SESSION['user_infos']); + if ( !is_array($informations) ) throw new myException('Need to get a user_id but informations session is not initialized'); + $user_id = $informations['user_id']; + } + + $req = "SELECT + u.username AS user, + u.password AS password, + u.id AS userid, + u.email AS email, + u.first_name AS first_name, + u.last_name AS last_name, + u.company AS company, + u.address AS address, + u.city AS city, + u.zipcode AS zipcode, + c.flag AS countrie, + u.template AS template, + u.is_active AS user_active, + g.is_active AS group_active, + g.name AS group_name, + g.id AS groupid, + g.lvl AS lvl, + l.flag AS lang, + l.is_lang AS lang_active + FROM users AS u + LEFT JOIN groups AS g + ON u.groups_id = g.id + LEFT JOIN countries AS c + ON u.countries_id = c.id + LEFT JOIN countries AS l + ON u.lang_id = l.id + WHERE + u.id = '$user_id'"; + $user_selected = $_SESSION['database']->fetchObject($req); + if ( is_array($user_selected) ) { + if ( is_null($user_selected[0]->countrie) ) throw new myException('The user selected has no countrie flag'); + elseif ( is_null($user_selected[0]->groupid) ) throw new myException('The user selected has no groupid'); + elseif ( is_null($user_selected[0]->lvl) ) throw new myException('The group has not a int right '.$user_selected[0]->lvl); + else { + if ( $user_selected[0]->lang_active == 'false' ) $user_selected[0]->lang = null; + return $user_selected; + } + } else { + return FALSE; + } + } // End of selectInformationsFromDB + + /** + * @brief Edit an user + * @param user_id -> ID of the user + * @param first_name -> First name of the user + * @param last_name -> Last name of the user + * @param company -> Name of the company + * @param address -> Address of the user + * @param city -> City of the user + * @param zipcode -> Zipcode of the user + * @param email -> Email of the user + * @param pseudo -> Pseudo of the user + * @param countrie_id -> Countrie of the user + * @param lang_id -> Lang of the user + * @param template -> Template of the user + * @return True : Member edited + */ + private function editMember($user_id, $first_name, $last_name, $company, $address, $city, $zipcode, $email, $pseudo, $countrie_id, $lang_id, $template) + { + $user_id = $_SESSION['database']->clearString($user_id); + $first_name = $_SESSION['database']->clearString($first_name); + $last_name = $_SESSION['database']->clearString($last_name); + $company = $_SESSION['database']->clearString($company); + $address = $_SESSION['database']->clearString($address); + $city = $_SESSION['database']->clearString($city); + $zipcode = $_SESSION['database']->clearString($zipcode); + $email = $_SESSION['database']->clearString($email); + $pseudo = $_SESSION['database']->clearString($pseudo); + $countrie_id = $_SESSION['database']->clearString($countrie_id); + $lang_id = $_SESSION['database']->clearString($lang_id); + $template = $_SESSION['database']->clearString($template); + + $req = "UPDATE users + SET + username = '$pseudo', + email = '$email', + template = '$template', + lang_id = '$lang_id', + first_name = '$first_name', + last_name = '$last_name', + company = '$company', + address = '$address', + city = '$city', + zipcode = '$zipcode', + countries_id = '$countrie_id', + template = '$template' + WHERE id = '$user_id'"; + $_SESSION['database']->execRequest($req); + + // save action to history + history::add("history_action_profile",$user_id); + + return true; + } // End of editMember + + /** + * @brief Edit user + * @see Description from editMember + */ + public function userEdit($first_name, $last_name, $company, $address, $city, $zipcode, $email, $pseudo, $countrie_id, $lang_id, $template) + { + if ( $this->editMember($this->information_user->userid, $first_name, $last_name, $company, $address, $city, $zipcode, $email, $pseudo, $countrie_id, $lang_id, $template) ) { + return true; + } else { + return false; + } + } // End of userEdit + + /** + * @brief Check existence of an username + * @param username -> Name of username + * @return True/False + */ + public function checkUsernameExistence ($username) + { + $username = $_SESSION['database']->clearString($username); + $req = "SELECT COUNT(id) AS total FROM users WHERE username='$username'"; + $number = $_SESSION['database']->fetchObject($req); + if ( $number[0]->total >= 1) { + return false; + } else return true; + } // End of checkUsernameExistence + + /** + * @brief Check Countrie existence and activation + * @param ID -> ID of the countrie + * @param clause -> Optionnal clause for the where + * @return True/False + */ + public function checkCountrieExistence ($countrie_id) + { + $countrie_id = $_SESSION['database']->clearString($countrie_id); + $req = "SELECT COUNT(id) AS total FROM countries WHERE id = '$countrie_id'"; + $result = $_SESSION['database']->fetchObject($req); + if ( $result[0]->total == 0 ) return false; + else return true; + } // End of checkCountrieExistence + + /** + * @brief Check Lang existence and activation + * @param lang_id -> ID of the lang + * @return True/False + */ + public function checkLangExistence($lang_id) + { + $land_id = $_SESSION['database']->clearString($lang_id); + $req = "SELECT COUNT(id) AS total FROM countries WHERE id = '$lang_id' AND is_lang = 'true'"; + $result = $_SESSION['database']->fetchObject($req); + if ( $result[0]->total == 0 ) return false; + else return true; + } // End of checkLangActivation + + /** + * @biref Get information about countrie + * @param countrie_id -> ID of the countrie + * @return False/Array with informations + */ + public function getCountrieInformations( $countrie_id, $clause = NULL ) + { + if ( !is_null($clause) ) $clause = " $clause"; + $countrie_id = $_SESSION['database']->clearString($countrie_id); + $req = "SELECT id,flag,countrie,date_format,time_format,is_lang FROM countries WHERE id = '$countrie_id'$clause"; + $result = $_SESSION['database']->fetchObject($req); + if ( count($result) == 0 ) return false; + else return $result[0]; + } + +} // End of class diff --git a/system/api/vhost.api.php b/system/api/vhost.api.php new file mode 100755 index 0000000..8f7c356 --- /dev/null +++ b/system/api/vhost.api.php @@ -0,0 +1,297 @@ +information_hosting->id; + $http_service = $_SESSION['hosting']->information_hosting->http_ip; + $server_admin = ( is_null($server_admin) ? APACHE_SERVER_ADMIN : $server_admin ); + $php_values = ( is_null($php_values) ) ? array() : $php_values; + + // Quota + if ( $_SESSION['hosting']->information_hosting->offer_virtualhosts_number >= 0 ) { + $current_number_vhosts = $this->countVhosts( $_SESSION['hosting']->information_hosting->id ); + if ( $current_number_vhosts >= $_SESSION['hosting']->information_hosting->offer_virtualhosts_number ) return -1; + } + + // Check existence of the VirtualHosts + if ( $this->checkVhostExistence($host) ) return -2; + + $this->createVhost( + $hosting_id, + $http_service, + $host, + $doc_root, + $active, + $server_admin, + $php_values + ); + + return true; + } + + /** + * @brief Create VirtualHosts + * @param hosting_id : Id of the hosting + * @param service_id : Id of the HTTP service + * @param host : Host related to the virtualhost + * @param doc_root : The root of the virtualhost + * @param active : boolean for activation at creation time + * @param server_admin : the e-mail address of the member + * @param php_values : array of additionnal options related to the vhost (optionnal) + * @return true if successfull, false otherwise + */ + private function createVhost( $hosting_id, $service_id, $host, $doc_root, $active, $server_admin, $php_values) + { + // First, try to add the VHost in database + $hosting_id = $_SESSION['database']->clearString($hosting_id); + $host = $_SESSION['database']->clearString($host); + $doc_root = $_SESSION['database']->clearString($doc_root); + $active = $_SESSION['database']->clearString( strtolower($active)); + $server_admin = $_SESSION['database']->clearString($server_admin); + $clean_php_values=array(); + foreach ( $php_values as $key=>$value) + { + $key = $_SESSION['database']->clearString($key); + $value = $_SESSION['database']->clearString($value); + $clean_php_values[$key] = $value; + } + $values = serialize( $clean_php_values); + $req = "INSERT INTO service_vhost + SET + created_at = CURRENT_TIMESTAMP, + hosting_id = '$hosting_id', + host = '$host', + doc_root = '$doc_root', + is_active = '$active', + server_admin = '$server_admin', + php_values = '$values'"; + + $_SESSION['database']->execRequest($req); + $vhost = $_SESSION['database']->getInsertId(); + + if ( $active == 'true' ) + { + // Add action + $data = array(); + $data['action'] = 'create_vhost'; + $data['host'] = $host; + $data['vhost_id'] = $vhost; + $data['doc_root'] = $doc_root; + $data['server_admin'] = $server_admin; + $data['php_values'] = $values; + // $action = action::userAddAction($service_id, $data); + } + + // save action to history + history::add("history_action_new_domain",$_SESSION['user']->information_user->userid); + + return true; + } + + /** + * @brief Delete a VirtualHost + * @param host : Host which is related to the virtualhost + */ + public function userDeleteVhost( $host ) + { + $hosting_id = $_SESSION['hosting']->information_hosting->id; + $http_service = $_SESSION['hosting']->information_hosting->http_ip; + + return $this->deleteVhost( + $hosting_id, + $http_service, + $host + ); + } + + + /* @brief Delete VirtualHosts + * @param hosting_id : Id of the hosting + * @param service_id : Id of the HTTP service + * @param host : Host which is related to the virtualhost + * @return -1 : Host not found + */ + private function deleteVhost( $hosting_id, $service_id, $host) + { + // Check if the hosts exists + $hosting_id = $_SESSION['database']->clearString($hosting_id); + if ( !$this->checkVhostExistence($host, false, "AND hosting_id = '$hosting_id'") ) return -1; + + // Add action + $data = array(); + $data['action'] = 'delete_vhost'; + $data['host'] = $host; + $action = action::userAddAction($service_id, $data); + + // Add Vhost to the table service_vhost + $host = $_SESSION['database']->clearString($host); + $req = "DELETE FROM service_vhost + WHERE + host = '$host'"; + $_SESSION['database']->execRequest($req); + } + + + /** + * @brief Active a deactivated VirtualHost + * @param host : Host which is related to the virtualhost + * @param is_vhost_id : optional, if the 'host' is the id of the vhost (default false) + * @return -1 : Host not found + * @return true : Ok + */ + public function userActiveVhost( $host, $is_vhost_id = false ) + { + // Check if the VirtualHost exists + $hosting_id = $_SESSION['hosting']->information_hosting->id; + $http_service = $_SESSION['hosting']->information_hosting->http_ip; + if ( !$this->checkVhostExistence($host, $is_vhost_id, "AND hosting_id = '$hosting_id'") ) return -1; + + // Active the Virtualhost + $this->activeOrNotVhost($host, true, $is_vhost_id); + } + + /** + * @brief Desactive an actived VirtualHost + * @param host : Host which is related to the virtualhost + * @param is_vhost_id : optional, if the 'host' is the id of the vhost (default false) + * @return -1 : Host not found + * @return true : Ok + */ + public function userDesactiveVhost( $host, $is_vhost_id = false ) + { + // Check if the VirtualHost exists + $hosting_id = $_SESSION['hosting']->information_hosting->id; + $http_service = $_SESSION['hosting']->information_hosting->http_ip; + if ( !$this->checkVhostExistence($host, $is_vhost_id, "AND hosting_id = '$hosting_id'") ) return -1; + + // Active the Virtualhost + $this->activeOrNotVhost($host, false, $is_vhost_id); + } + + + /** + * @brief Active a VirtualHost + * @param host : VirtualHost to active + * @param active : bool(true) : Active the VirtualHost / bool(false) : Desactive the VirtualHost + * @param is_vhost_id : optional, if the 'host' is the id of the vhost (default true) + * @return always true + */ + private function activeOrNotVhost( $host , $active, $is_vhost_id = true ) + { + $active = $_SESSION['database']->clearString($active); + $host = $_SESSION['database']->clearString($host); + if ( $is_vhost_id == true ) + $req = "UPDATE service_vhost + SET + is_active = '$active' + WHERE id = '$host'"; + else + $req = "UPDATE service_vhost + SET + is_active = '$active' + WHERE host = '$host'"; + return true; + } + + + /** + * @brief Count VirtualHosts for one hosting + * @param hosting_id : Id of the hosting + * @return Number of vhsost + */ + private function countVhosts( $hosting_id ) + { + if( !is_null($this->vhost_records) ) { + return $this->vhost_records; + } + $hosting_id = $_SESSION['database']->clearString($hosting_id); + $req = "SELECT COUNT(id) AS total FROM service_vhost WHERE hosting_id = '$hosting_id'"; + $query = $_SESSION['database']->fetchObject($req); + $this->vhost_records = $query[0]->total; + return $query[0]->total; + } + + + /** + * @brief Check if the Vhost exists + * @param host : Host is checking + * @param is_vhost_id : optional, if the 'host' is the id of the vhost (default false) + * @param additionnal_param : optional, add a WHERE clause + * @return true if the vhosts exists + * @return false if the vhost doesn't exists + */ + private function checkVhostExistence( $host, $is_vhost_id = false, $additionnal_param = null ) + { + $host = $_SESSION['database']->clearString($host); + if( $is_vhost_id == true ) + $req = "SELECT COUNT(id) AS exist FROM service_vhost WHERE id = '$host' " . $additionnal_param; + else + $req = "SELECT COUNT(id) AS exist FROM service_vhost WHERE host = '$host' " . $additionnal_param; + $query = $_SESSION['database']->fetchObject($req); + if( $query[0]->exist > 0 ) return true; + else return false; + } + + /** + * @brief Get number of vhosts for the current hosting (and the current user), regarding the total count of records and the count of items to be shown per page + * @return number of pages availables + */ + public function userCountTotalPages() + { + $hosting_id = $_SESSION['hosting']->information_hosting->id; + $items_count = $this->countVhosts( $hosting_id ); + $pages_count = intval($items_count / RECORD_BY_PAGE); + if ( ($items_count % RECORD_BY_PAGE) != 0 ) { + $pages_count++; + } + return $pages_count; + } + + /** + * @brief List all vhosts related to the current hosting (and the current user) + * @param hosting_id ID of the current hosting + * @param start First record to extract (optional) + * @param extract_number Number of record to extract (optional) + * @return array or null if empty + */ + public function userListVHosts( $hosting_id, $start = null, $extract_number = null ) + { + $hosting_id = $_SESSION['database']->clearString($hosting_id); + + if ( !is_null($start) and !is_null($extract_number)) { + $start = $_SESSION['database']->clearString($start); + $extract_number = $_SESSION['database']->clearString($extract_number); + $limit = " LIMIT $start, $extract_number"; + } else $limit = null; + + $req = "SELECT id, UNIX_TIMESTAMP(created_at) AS created_at, host, doc_root, is_active, server_admin + FROM service_vhost WHERE hosting_id = '$hosting_id' ORDER BY created_at$limit"; + $query = $_SESSION['database']->fetchObject($req); + return $query; + } +} +?> \ No newline at end of file diff --git a/system/configuration.php b/system/configuration.php new file mode 100755 index 0000000..b4485bd --- /dev/null +++ b/system/configuration.php @@ -0,0 +1,106 @@ + diff --git a/system/core.php b/system/core.php new file mode 100755 index 0000000..416bcca --- /dev/null +++ b/system/core.php @@ -0,0 +1,50 @@ + 1, 'login' => 'mogui', 'hash' => '5d9f71b71b207b9e665820c0dce67bdb')); +error_reporting(E_ALL); +ini_set('display_errors', 'On'); +// DEV + +// Open configuration +// Open autoload api +require_once(PATH_API.'api.php'); +try +{ + // Initialize Error system + require_once(PATH_API.'myexception.api.php'); + + // Initialize mysql class + $_SESSION['database'] = new mysql(); + $_SESSION['database']->connect(MYSQL_USER, MYSQL_PASSWORD, MYSQL_SERVER, MYSQL_DATABASE); + + // Inclusion of libs + require_once(PATH_LIB.'smarty/Smarty.class.php'); + + // Initialize user class + $_SESSION['user'] = new user(); + + // Initialize information user + $_SESSION['user']->userInitialize(); + + // Initialize security class + $_SESSION['security'] = new security(); + + // Initialize the hosting class + $_SESSION['hosting'] = new hosting(); + + // Initialize the informatin hosting + $_SESSION['hosting']->userInitializeHosting(); + + // Initialize template class + $_SESSION['template'] = new template(); + + // Rights display + $_SESSION['template']->userSetRightsDisplay(); + +} catch (myException $error) +{ + $error->displayErrorMessage(); +} +?> diff --git a/system/lang/en/lang b/system/lang/en/lang new file mode 100755 index 0000000..58cc577 --- /dev/null +++ b/system/lang/en/lang @@ -0,0 +1,260 @@ +[general] +hosting_address = "kelio.org" +faq_address = "doc.kelio.org" +hosting_title = "KelioPanel Translate By GOOGLE" +hosting_slogan = "Manage your account" +activated = "on" +deactivated = "disabled" +the = "the" +at = "at" +functional = "functional" +suspended = "suspended" +renew = "repeat" +offer = "offer" +unlimited = "unlimited" +minutes = "minutes" +hours = "hours" +days = "days" +weeks = "weeks" +_yes = "yes" +_no = "no" + +[underground] +home = "Home" +my_account = "My Account" +go_kelio = "Kelio.org" +msg_no_incident = "No incidents on the network at this time. In case of failure, it will be posted at this site on the home page." +design_by = "Design by" +icons_by = "icons by" +powered_by = "Powered by" +admin = "Admin" + +[sidebar] +Big title +mainmenu_title = "Main Menu" +mainmenu_hosting = "hosting" +mainmenu_admin = "Administration" +; Small title +support = "Support" +history = "History" +action = "Action Pending" +incidents = "Incidents" +my_hostings = "My hosting" +deconnection = "Disconnect" +summary = "Summary" +databases = "database" +virtualhosts = "Virtual Servers" +dns = "DNS Zones" +ftpaccounts = "FTP" +emails = "Email Accounts and Alias" +installer = "Automated Systems" +cron = "Cron job" + +[index] +msg_welcome = "Welcome to your member"s area" +msg_welcome2 = "You can manage your hosting from here." +msg_not_client = "Welcome to your new member"s area. In order to have access to all sections and to manage your account, please get in touch with our customer service." +msg_not_client2 = "Please contact our customer service" +msg_not_client3 = "You can do this by calling XX.XX.XX.XX.XX , by email to notsend@vzprovider.com or by mail following:
VzProvider
1 avenue des Champs Elysées 75001 Paris
" +msg_not_client4 = "We remain at your disposal for any questions or problems. And hope you enjoy using our services." +msg_client1 = "Welcome to your member area. To perform actions on your hosting" +msg_client2 = "In case of any other concerns or questions, please contact us via the Support section." +clic_here = "click here" + +[myaccount] +manage_my_account = "Edit My Personal Information" +msg_pseudo = "The nickname is used in your dealings with the media. It can also be used in place of your email address when connecting." +msg_company = "If the account belongs to a company, please enter your name here. This field is optional." +msg_template = "The theme of the panel consists of the graphic and layout elements on the member"s area. If the choice has been disabled by the administrative team, it can be applied." +msg_email = "If you change your email address, you will be disconnected immediately. It will take you again to continue using the panel." +msg_info_help = "You can get details on some fields by running your mouse over the name of it." +result_manage_account = "Change your data" +result_manage_account_ok = "Your data has been modified" +missing_first_name = "You have not entered your name." +format_first_name = "Please check the syntax of the name." +missing_last_name = "You did not enter your last name." +format_last_name = "Please check the syntax of the family name." +format_company = "The syntax of the company name does not fit." +missing_address = "You did not address before." +format_address = "The syntax of the address is not appropriate." +missing_city = "You have not entered the city." +format_city = "The syntax of the city can be taken into account." +missing_zipcode = "You have not entered a zip code." +format_zipcode = "The syntax of the postcode is not appropriate." +missing_email = "You did not enter your email." +format_email = "The syntax of the email address is not appropriate." +missing_pseudo = "You have not chosen a name." +format_pseudo = "The syntax of pseudo inappropriate." +pseudo_already_used = "The username is already used by another person." +lang_not_autorized = "The language of the panel could not be taken into account. The administrative team has not authorized the change." +template_not_autorized = "The theme of the panel could not be taken into account. The administrative team has not authorized the change." +missing_old_password = "You have not entered your old password." +format_old_password = "The syntax of the old password can not be taken into account." +missing_new_password1 = "You have not entered a new password." +format_new_password1 = "The syntax of the new password can not be taken into account." +missing_new_password2 = "You did not confirm the new password." +format_new_password2 = "The syntax of the confirmation of the new password can not be taken into account." +incorrect_password = "Your old password does not match in the database." +password_changed = "Your password has been changed." + +[myhostings] +list_hostings = "List of my hosting" +hosting_base_name = "Account name" +hosting_begin = "Start Date" +hosting_end = "End Date" +hosting_statut = "Account Status" + +[hosting] +title_hosting = "Summary of your hosting +action_for_hosting = "Choose an action to do on your hosting" +info_db = "Databases" +info_virtualhost = "Virtual Servers" +info_dns = "DNS Zones" +info_ftp = "FTP" +info_mail = "Email Accounts & Alias" +info_installer = "Automated Systems" +info_information = "Information" +info_quota = "Limitations" +info_cron = "cron job" +info_basename = "Change the name of the hosting" +info_faq = "Knowledge Base (FAQ)" +info_delete_hosting = "Delete this hosting" + +[informations] +infos_briefing = "Information about your offer of hosting" +infos_customer = "Owner of the hosting" +infos_offer = "Current Offering" +infos_disk = "Disk Space" +infos_trafic = "Monthly Traffic" +infos_database = "Databases" +infos_dns = "DNS Zones" +infos_virtualhost = "Virtual Servers" +infos_mail = "Mailboxes" +infos_mail_space = "Size of mailboxes" +infos_mail_alias = "Alias emails" +infos_address = "The address to use in your scripts" +port = "Port" + +[history] +list_history = "History of your account" +history_description = "History of all actions performed on your account" +history_empty = "No action in your history" +history_date = "Date" +history_action = "Action performed" +history_hosting = "hosting" +history_IP = "IP Address" +history_action_password = "Change Password" +history_action_login = "Connection Panel" +history_action_new_ftp = "Adding an FTP account" +history_action_new_domain = "Adding a domain name +history_action_profile = "Changing personal information" + +[support] +mnu_tickets_list = "List of tickets" +mnu_new_ticket = "Create ticket" +mnu_reply_ticket = "Post Reply" +mnu_close_ticket = "Close this ticket" +support_list = "Summary of your tickets in progress and past" +support_list_intro = "Here is the list of tickets that you open. Click on the opening date to see the detail." +support_nolist_intro = "You have any open ticket." +support_close_intro = "You"re about to close a ticket-holder. It will not be possible to answer after you complete this action." +support_admin_list1 = "List of tickets waiting for treatment" +support_admin_list_intro1 = "Here is the list of tickets awaiting reply. Click on the opening date to see the detail and be able to respond." +support_admin_nolist_intro1 = "There are currently no ticket waiting for reply." +support_admin_list2 = "List of tickets that can be closed" +support_admin_list_intro2 = "Here is the list of tickets that a reply has been made. They can be closed manually." +support_admin_nolist_intro2 = "There are currently no ticket can be closed manually." +ticket_date = "Opening Date" +ticket_last_date = "Last message" +ticket_subject = "Subject of the application" +ticket_status = "Application Status" +ticket_status_asked = "We will respond within the next few days" +ticket_status_asked_full = "Your message has been recorded. We do our best to answer you as soon as possible" +ticket_status_replied = "We have responded to your request" +ticket_status_replied_full = "We have responded to your message. If our answer for you, you can close the ticket. You can also make certain clarifications if necessary. In that case the ticket will automatically be closed one week after our response." +ticket_status_closed_user = "Ticket closed by you" +ticket_status_closed_user_full = "You have closed this ticket. It is no longer possible to add a response. To do this you must open a new ticket." +ticket_status_closed_support = "Ticket closed by us" +ticket_status_closed_support_full = "We have closed this ticket because we felt it was not necessary to provide more details. If so, thank you to open a new ticket." +ticket_status_auto_closed = "Ticket closed automatically for inactivity" +ticket_status_auto_closed_full = "This ticket was closed automatically because there was no activity on the for more than a week." +support_show = "Details of the ticket" +support_show_intro = "Here is a chronological list of the messages exchanged within the selected ticket." +contact_support = "Request Assistance" +no_hosting_associated = "None" +ticket_date_legend = "Opening Date" +ticket_subject_legend = "Purpose of Request" +ticket_subject_title = "Enter a subject to explicit ticket. This value must contain between 5 and 100 characters, and begin with an alphanumeric character." +ticket_status_legend = "Current status of the ticket" +ticket_avail_actions = "Actions available" +ticket_msg_legend = "Message / Question" +ticket_reply_legend = "Your answer" +button_new_legend = "OK and send the request" +button_reply_legend = "OK and send the answer" +button_cancel_legend = "Cancel" +ticket_msg_title = "Be as specific as possible when drafting your message. It should contain between 5 and 500 characters, and begin with an alphanumeric character." +ticket_hosting_legend = "hosting concerned +ticket_hosting_title = "If you want to associate an hosting to this ticket, select it from the list below against" +ticket_msg_author_you = "You" +ticket_msg_author_us = "We" +support_create_result = "Registration of the new ticket" +support_create = "Open a new ticket" +support_create_intro = "Please fill all the form fields below." +support_create_helpmsg = "You can get details on some fields by running your mouse over the name thereof." +result_support_create_ok = "The new ticket data were recorded successfully. We will respond as soon as possible." +error_hosting_id = "Error with the ID of the hosting." +error_subject_missing = "You did not enter the subject of your request." +error_subject_format = "Check the format of the subject of the request." +error_message_missing = "You did not enter the content of your message." +error_message_format = "Check the format of the message." +error_database_query = "There was an error while updating the database. We apologize for this inconvenience." +error_ticket_id_not_valid = "The ID of the ticket does not match." +support_action_result = "Validation of your action" +result_support_reply_ok = "Your answer has been saved successfully. We will learn as soon as possible." +result_support_admin_reply_ok = "Your answer has been saved successfully." +result_support_close_ok = "The ticket was closed successfully." + +[error] +msg_inadequate_right1 = "Law Invalid" +msg_inadequate_right2 = "You do not have the right to view this page.
This is probably because you try to access a page that does is for e.
If you have any questions You can contact our customer service. " + +[crons] +mnu_list_crons = "Tasks list" +mnu_add_cron = "Add a task" +btn_new_cron = "Validate and create the task" +crons = "Cron jobs" +crons_list_title = "List of your cron jobs" +crons_list_notask = "You don't have any cron job yet." +cron_task_description = "Une tâche cron est une tâche lancée à intervalle régulier. Cela vous permet d'automatiser certains de vos scripts, comme par exemple la sauvegarde de vos bases de données, ou l'envoi de mails à une heure fixe.
Vous pouvez stopper momentanément ou supprimer vos tâches en cliquant sur les icônes appropriés.
Si le serveur ne peut être joint au moment d'exécuter le script, la tache est mise en pause. Dans ce cas, vous devrez la ré-activer après vous êtres assuré que celle-ci fonctionne correctement." +cron_task_url = "Full url" +cron_task_lastexec = "Last execution" +cron_task_frequency = "Frequency" +cron_frequency_title = "Enter the frequency at witch the task has to be executed. This value can't be lower than" +cron_task_action = "Action" +cron_task_activation = "Activation" +cron_create_result = "Validation of the new task" +result_cron_create_ok = "The new task has been created successfully" +cron_create = "Adding a cron task" +cron_create_intro = "Please fill all the form fields below." +cron_create_helpmsg = "You can get details on some fields by running your mouse over the name thereof." +cron_task_first_exec = "First execution in" +result_cron_create_ok = "The new task has been successfully added." +error_cron_address_missing = "You didn't specified the script url." +error_cron_address_format = "Check the script url format." +error_cron_freq_missing = "You didn't specified the frequency for the execution of the script." +error_cron_freq_format = "Check the script execution frequency format." +error_cron_first_start_format = "Check the first execution delay format." +error_cron_url_unreacheable = "The cron script is unreacheable." +error_cron_max_reached = "Maxinum cron tasks reached." +error_cron_freq_too_small = "Execution frequency is lower than the allowed value." +cron_start_title = "Click here to enable this task." +cron_stop_title = "Click here to disable this task." +cron_delete_title = "Click here to delete this task." +cron_goto_confirm = "Do you really want to go to this address ?" + +[vhosts] +vhosts = "Virtuals servers" +mnu_list_vhosts = "Virtuals Servers list" +mnu_add_vhost = "Add a virtual server" +vhosts_list_title = "List of your virtual servers" +vhost_description = "Virtual Host description : this have to be written..." \ No newline at end of file diff --git a/system/lang/fr/lang b/system/lang/fr/lang new file mode 100755 index 0000000..dcca383 --- /dev/null +++ b/system/lang/fr/lang @@ -0,0 +1,288 @@ +; ############################### +; !! WARNING !! +; Do not use same key !! +; NE PAS UTILISER LA MEME CLE POUR LES VARIABLES ! +; CHAQUE PHRASE DOIT AVOIR UNE CLE DIFFERENTE ! +; (au sein du fichier, pas du module) +; ############################### + +lang = fr + +; General is charged at start of the script. +; Is for general word (at, the, server, mysql, etc.) +; General word must start with lower caracter.(use {#activated|capitalize#} if necessary) +[general] +hosting_address = "kelio.org" +faq_address = "doc.kelio.org" +hosting_title = "KP" +hosting_slogan = "Administrez votre compte" +activated = "activé" +deactivated = "désactivé" +the = "le" +at = "à" +functional = "fonctionnel" +suspended = "suspendu" +renew = "renouveler" +offer = "offre" +unlimited = "illimité" +minutes = "minutes" +hours = "heures" +days = "jours" +weeks = "semaines" +_yes = "oui" +_no = "non" + +[underground] +home = "Accueil" +my_account = "Mon compte" +go_kelio = "Kelio.org" +msg_no_incident = "Aucun incident sur le réseau à cet instant. En cas de panne, celle-ci sera affiché à cet emplacement sur la page d'accueil." +design_by = "Design par" +icons_by = "Icones par" +powered_by = "Propulsé par" +admin = "Admin" + + +[sidebar] +; Big title +mainmenu_title = "Menu principal" +mainmenu_hosting = "Hébergements" +mainmenu_admin = "Administration" +; Small title +support = "Support" +history = "Historique" +actions = "Actions en attente" +incidents = "Incidents" +my_hostings = "Mes hébergements" +deconnection = "Déconnexion" +summary = "Récapitulatif" +databases = "Bases de données" +virtualhosts = "Serveurs virtuel" +dns = "Zones DNS" +ftpaccounts = "Comptes FTP" +emails = "Alias et Comptes email" +installer = "Installations automatisés" +cron = "Tâches CRON" + + +[index] +msg_welcome = "Bienvenue sur votre espace membre" +msg_welcome2 = "Vous pouvez gérer votre hébergement à partir d'ici." +msg_not_client = "Bienvenue sur votre futur espace membre. Afin d'avoir accès a toutes les sections et de pouvoir gérer votre compte, veuillez vous mettre en relation avec notre service client." +msg_not_client2 = "Pour cela, contactez notre service client" +msg_not_client3 = "Vous pouvez faire cette démarche par téléphone au XX.XX.XX.XX.XX, par email a notsend@vzprovider.com ou par courrier a l'adresse suivante :
VzProvider
1 avenue des champs Elysées
75001 Paris" +msg_not_client4 = "Nous restons à votre écoute pour toutes vos questions ou problèmes. Et vous souhaitons une agréable utilisation de nos services." +msg_client1 = "Bienvenue sur votre espace membre. Pour effectuer des actions sur vos hébergements" +msg_client2 = "En cas de soucis ou toute autres question, vous pouvez nous joindre via la section Support." +clic_here = "cliquez ici" + +[myaccount] +manage_my_account = "Modifier mes informations personnelles" +msg_pseudo = "Le pseudonyme est utilisé lors de vos échanges avec le support. Celui-ci peut aussi être utilisé à la place de votre adresse email lors de la connexion." +msg_company = "Si le compte appartient à une entreprise, veuillez entrer son nom commercial ici. Ce champs n'est pas obligatoire." +msg_template = "Le theme du panel consiste en la charte graphique et la disposition des éléments sur l'espace membre. Si le choix a été désactivé par l'équipe administrative, celui-ci ne pourra être appliqué." +msg_email = "Si vous modifiez votre adresse email, vous serez déconnecté immédiatement après. Il faudra vous reconnecter pour continuer à utiliser le panel." +msg_info_help = "Vous pouvez obtenir des détails sur certains champs en passant votre souris sur le nom de celui-ci." +result_manage_account = "Modification des données de votre compte" +result_manage_account_ok = "Vos données ont bien été modifiées" + +missing_first_name = "Vous n'avez pas entré votre prénom." +format_first_name = "Veuillez vérifier la syntaxe du prénom." +missing_last_name = "Vous n'avez pas entré votre nom de famille." +format_last_name = "Veuillez vérifier la syntaxe du nom de famille." +format_company = "La syntaxe du nom de l'entreprise ne convient pas." +missing_address = "Vous n'avez pas saisi d'adresse." +format_address = "La syntaxe de l'adresse ne convient pas." +missing_city = "Vous n'avez pas entré la ville." +format_city = "La syntaxe de la ville ne peut être prise en compte." +missing_zipcode = "Vous n'avez pas saisi de code postal." +format_zipcode = "La syntaxe du code postal ne convient pas." +missing_email = "Vous n'avez pas entré votre email." +format_email = "La syntaxe de l'adresse email ne convient pas." +missing_pseudo = "Vous n'avez pas choisi de pseudo." +format_pseudo = "La syntaxe du pseudo ne convient pas." +pseudo_already_used = "Le pseudo est déjà  utilisé par une autre personne." +lang_not_autorized = "La langue du panel n'a pu être prise en compte. L'équipe administrative n'a pas autorisé le changement." +template_not_autorized = "Le thème du panel n'a pu être pris en compte. L'équipe administrative n'a pas autorisé le changement." +missing_old_password = "Vous n'avez pas entré votre ancien mot de passe." +format_old_password = "La syntaxe de l'ancien mot de passe ne peut être prise en compte." +missing_new_password1 = "Vous n'avez pas saisi de nouveau mot de passe." +format_new_password1 = "La syntaxe du nouveau mot de passe ne peut être prise en compte." +missing_new_password2 = "Vous n'avez pas confirmé le nouveau mot de passe." +format_new_password2 = "La syntaxe de la confirmation du nouveau mot de passe ne peut être prise en compte." + +incorrect_password = "Votre ancien mot de passe ne correspond pas à celui en base de données.'" +password_changed = "Votre mot de passe a bien été changé." + +[myhostings] +list_hostings = "Liste de mes hébergements" +hosting_base_name = "Nom du compte" +hosting_begin = "Date de début" +hosting_end = "Date de fin" +hosting_statut = "Etat du compte" + +[hosting] +title_hosting = "Récapitulatif de votre hébergement" +action_for_hosting = "Veuillez choisir une action à faire sur votre hébergement" +info_db = "Bases de données" +info_virtualhost = "Serveurs Virtuel" +info_dns = "Zones DNS" +info_ftp = "Comptes FTP" +info_mail = "Comptes et Alias email" +info_installer = "Installations automatisés" +info_information = "Informations" +info_quota = "Limitations" +info_cron = "Tâches CRON" +info_basename = "Changer le nom de l'hébergement" +info_faq = "Base de connaissances (FAQ)" +info_delete_hosting = "Supprimer cet hébergement" + +[informations] +infos_briefing = "Informations à propos de votre offre d'hébergement" +infos_customer = "Propriétaire de l'hébergement" +infos_offer = "Offre actuelle" +infos_disk = "Espace disque" +infos_trafic = "Trafic mensuel" +infos_database = "Bases de données" +infos_dns = "Zones DNS" +infos_virtualhost = "Serveurs Virtuels" +infos_mail = "Boites emails" +infos_mail_space = "Taille des boites emails" +infos_mail_alias = "Alias emails" +infos_address = "Les adresses à utiliser dans vos scripts" +port = "Port" + +[history] +list_history = "Historique de votre compte" +history_description = "Historique de toutes les actions effectuées sur votre compte" +history_empty = "Aucune action dans votre historique" +history_date = "Date" +history_action = "Action effectuée" +history_hosting = "Hébergement" +history_IP = "Adresse IP" +history_action_password = "Modification du mot de passe" +history_action_login = "Connexion au panel" +history_action_new_ftp = "Ajout d'un compte FTP" +history_action_new_domain = "Ajout d'un nom de domaine" +history_action_profile = "Modification des informations personnelles" + +[support] +; Sub-menu entries +mnu_tickets_list = "Liste des tickets" +mnu_new_ticket = "Créer un ticket" +mnu_reply_ticket = "Poster une réponse" +mnu_close_ticket = "Fermer ce ticket" +; Titles +support_list = "Récapitulatif de vos tickets en-cours et passés" +support_list_intro = "Voici la liste des tickets que vous avez ouvert. Cliquez sur la date d'ouverture pour en voir le détail." +support_nolist_intro = "Vous n'avez encore ouvert aucun ticket." +support_close_intro = "Vous vous apprêtez à fermer un ticket-support. Il ne sera plus possible d'y répondre après avoir effectué cette action." +support_admin_list1 = "Liste des tickets en attente de traitement" +support_admin_list_intro1 = "Voici la liste des tickets en attente de réponse. Cliquez sur la date d'ouverture pour en voir le détail et ainsi être en mesure de répondre." +support_admin_nolist_intro1 = "Il n'y a actuellement aucun ticket en attente de réponse." +support_admin_list2 = "Liste des tickets pouvant être fermés" +support_admin_list_intro2 = "Voici la liste des tickets auxquels une réponse a été apportée. Ils peuvent désormais être fermés manuellement." +support_admin_nolist_intro2 = "Il n'y a actuellement aucun ticket pouvant être fermé manuellement." +; Tickets list Headers +ticket_date = "Date d'ouverture" +ticket_last_date = "Dernier message" +ticket_subject = "Sujet de la demande" +ticket_status = "Etat de la demande" +; Tickets status +ticket_status_asked = "Nous allons vous répondre dans les prochains jours" +ticket_status_asked_full = "Votre message a bien été enregistré. Nous faisons tout notre possible pour vous répondre dans les plus brefs délais" +ticket_status_replied = "Nous avons répondu à votre demande" +ticket_status_replied_full = "Nous avons répondu à votre message. Si notre réponse vous convient, vous pouvez fermer le ticket. Vous pouvez également apporter certaines précisions si vous le jugez nécessaire. Le cas échéant, le ticket sera automatiquement fermé une semaine après notre réponse." +ticket_status_closed_user = "Ticket fermé par vos soins" +ticket_status_closed_user_full = "Vous avez fermé ce ticket. Il n'est désormais plus possible d'y ajouter une réponse. Vous devrez pour cela ouvrir un nouveau ticket." +ticket_status_closed_support = "Ticket fermé par nos soins" +ticket_status_closed_support_full = "Nous avons fermé ce ticket car nous avons jugé qu'il n'était pas nécessaire d'y apporter plus de précision. Le cas échéant, merci d'ouvrir un nouveau ticket." +ticket_status_auto_closed = "Ticket fermé automatiquement pour inactivité" +ticket_status_auto_closed_full = "Ce ticket a été fermé automatiquement car il n'y a pas eut d'activité le concernant pendant plus d'une semaine." +; Ticket details +support_show = "Détails du ticket" +support_show_intro = "Voici la liste chronologique des messages échangés dans le cadre du ticket sélectionné." +contact_support = "Demander une assistance" +no_hosting_associated = "Aucun" +; forms and table legends +ticket_date_legend = "Date d'ouverture" +ticket_subject_legend = "Objet de la demande" +ticket_subject_title = "Donnez un sujet explicite à ce ticket. Cette valeur doit contenir entre 5 et 100 caractères, et commencer par un caractère alphanumérique." +ticket_status_legend = "Etat actuel du ticket" +ticket_avail_actions = "Actions disponibles" +ticket_msg_legend = "Message / Question" +ticket_reply_legend = "Votre réponse" +button_new_legend = "Valider et envoyer la demande" +button_reply_legend = "Valider et envoyer la réponse" +button_cancel_legend = "Annuler" +ticket_msg_title = "Soyez le plus précis possible lors de la rédaction de votre message. Il doit contenir entre 5 et 500 caractères, et commencer par un caractère alphanumérique." +ticket_hosting_legend = "Hébergement concerné" +ticket_hosting_title = "Si vous désirez associer un hébergement à ce ticket, sélectionnez-le dans la liste ci-contre" +ticket_msg_author_you = "Vous" +ticket_msg_author_us = "Nous" +; New ticket +support_create_result = "Enregistrement du nouveau ticket" +support_create = "Ouvrir un nouveau ticket" +support_create_intro = "Merci de remplir tous les champs du formulaire ci-dessous." +support_create_helpmsg = "Vous pouvez obtenir des détails sur certains champs en passant votre souris sur le nom de ceux-ci." +result_support_create_ok = "Les données du nouveau ticket on été enregistrées avec succès. Nous allons vous répondre dans les plus brefs délais." +error_hosting_id = "Erreur avec l'ID de l'hébergement." +error_subject_missing = "Vous n'avez pas entré le sujet de votre demande." +error_subject_format = "Vérifiez le format du sujet de la demande." +error_message_missing = "Vous n'avez pas entré le contenu de votre message." +error_message_format = "Vérifiez le format du message." +error_database_query = "Il y a eut une erreur lors de la mise à jour de la base de données. Nous sommes désolés pour ce contretemps." +error_ticket_id_not_valid = "L'identifiant du ticket ne correspond pas." +; reply +support_action_result = "Validation de votre action" +result_support_reply_ok = "Votre réponse a été enregistrée avec succès. Nous allons en prendre connaissance dans les plus brefs délais." +result_support_admin_reply_ok = "Votre réponse a été enregistrée avec succès." +result_support_close_ok = "Le ticket a été fermé avec succès." + +[error] +msg_inadequate_right1 = "Droit non valide" +msg_inadequate_right2 = "Vous n'avez pas les droit requis pour visionner cette page.
Cela vient probablement du fait que vous essayez d'acceder a une page qui ne vous est destinée.
En cas de questions, vous pouvez contacter notre service client." +error_title = "Une erreur a eu lieu" +error_not_in_offer = "Votre offre actuelle ne vous permet pas de disposer de cette fonctionnalité.
Vous ne pouvez donc pas accéder à cette page." +error_clichere_for_summary = "Cliquez ici pour revenir au récapitulatif des actions." + +[crons] +mnu_list_crons = "Liste des tâches" +mnu_add_cron = "Ajouter une tâche" +btn_new_cron = "Valider et créer la tâche" +crons = "Tâches CRON" +crons_list_title = "Liste de vos tâches cron" +crons_list_notask = "Vous ne disposez d'aucune tache actuellement." +cron_task_description = "Une tâche cron est une tâche lancée à intervalle régulier. Cela vous permet d'automatiser certains de vos scripts, comme par exemple la sauvegarde de vos bases de données, ou l'envoi de mails à une heure fixe.
Vous pouvez stopper momentanément ou supprimer vos tâches en cliquant sur les icônes appropriés.
Si le serveur ne peut être joint au moment d'exécuter le script, la tache est mise en pause. Dans ce cas, vous devrez la ré-activer après vous êtres assuré que celle-ci fonctionne correctement." +cron_task_url = "Adresse complète" +cron_task_lastexec = "Dernière exécution" +cron_task_frequency = "Fréquence" +cron_frequency_title = "Entrez la fréquence à laquelle la tâche doit être exécutée. Cette valeur ne peut être inférieure à" +cron_task_action = "Action" +cron_task_activation = "Activation" +cron_create_result = "Validation de la nouvelle tâche" +result_cron_create_ok = "La nouvelle tâche a été créée avec succès" +cron_create = "Ajouter une tâche cron" +cron_create_intro = "Merci de remplir tous les champs du formulaire ci-dessous." +cron_create_helpmsg = "Vous pouvez obtenir des détails sur certains champs en passant votre souris sur le nom de ceux-ci." +cron_task_first_exec = "Première exécution dans" +result_cron_create_ok = "La nouvelle tâche a été ajoutée avec succès." +error_cron_address_missing = "Vous n'avez pas entré l'adresse du script à exécuter." +error_cron_address_format = "Vérifiez le format de l'adresse du script à exécuter." +error_cron_freq_missing = "Vous n'avez pas entré la fréquence à laquelle le script doit être exécuté." +error_cron_freq_format = "Vérifiez le format de la fréquence d'exécution du script." +error_cron_first_start_format = "Vérifiez le format du délai avant la première exécution." +error_cron_url_unreacheable = "Le script à exécuter n'est pas atteignable." +error_cron_max_reached = "Nombre maximum de tâches cron atteind." +error_cron_freq_too_small = "La fréquence d'exécution est inférieure à la valeur minimale acceptée." +cron_start_title = "Cliquez ici pour activer la tâche." +cron_stop_title = "Cliquez ici pour désactiver la tâche." +cron_delete_title = "Cliquez ici pour supprimer la tâche." +cron_goto_confirm = "Souhaitez vous vraiment vous rendre à cette adresse ?" + +[vhosts] +vhosts = "Serveurs virtuels" +mnu_list_vhosts = "Liste des serveurs virtuels" +mnu_add_vhost = "Ajouter un serveur virtuel" +vhosts_list_title = "Liste de vos serveurs virtuels" +vhost_description = "Description d'un serveur virtuel : à rédiger..." \ No newline at end of file diff --git a/system/libs/smarty/Config_File.class.php b/system/libs/smarty/Config_File.class.php new file mode 100755 index 0000000..9dc5b3e --- /dev/null +++ b/system/libs/smarty/Config_File.class.php @@ -0,0 +1,393 @@ + + * @access public + * @package Smarty + */ + +/* $Id: Config_File.class.php 2786 2008-09-18 21:04:38Z Uwe.Tews $ */ + +/** + * Config file reading class + * @package Smarty + */ +class Config_File { + /**#@+ + * Options + * @var boolean + */ + /** + * Controls whether variables with the same name overwrite each other. + */ + var $overwrite = true; + + /** + * Controls whether config values of on/true/yes and off/false/no get + * converted to boolean values automatically. + */ + var $booleanize = true; + + /** + * Controls whether hidden config sections/vars are read from the file. + */ + var $read_hidden = true; + + /** + * Controls whether or not to fix mac or dos formatted newlines. + * If set to true, \r or \r\n will be changed to \n. + */ + var $fix_newlines = true; + /**#@-*/ + + /** @access private */ + var $_config_path = ""; + var $_config_data = array(); + /**#@-*/ + + /** + * Constructs a new config file class. + * + * @param string $config_path (optional) path to the config files + */ + function Config_File($config_path = NULL) + { + if (isset($config_path)) + $this->set_path($config_path); + } + + + /** + * Set the path where configuration files can be found. + * + * @param string $config_path path to the config files + */ + function set_path($config_path) + { + if (!empty($config_path)) { + if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) { + $this->_trigger_error_msg("Bad config file path '$config_path'"); + return; + } + if(substr($config_path, -1) != DIRECTORY_SEPARATOR) { + $config_path .= DIRECTORY_SEPARATOR; + } + + $this->_config_path = $config_path; + } + } + + + /** + * Retrieves config info based on the file, section, and variable name. + * + * @param string $file_name config file to get info for + * @param string $section_name (optional) section to get info for + * @param string $var_name (optional) variable to get info for + * @return string|array a value or array of values + */ + function get($file_name, $section_name = NULL, $var_name = NULL) + { + if (empty($file_name)) { + $this->_trigger_error_msg('Empty config file name'); + return; + } else { + $file_name = $this->_config_path . $file_name; + if (!isset($this->_config_data[$file_name])) + $this->load_file($file_name, false); + } + + if (!empty($var_name)) { + if (empty($section_name)) { + return $this->_config_data[$file_name]["vars"][$var_name]; + } else { + if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name])) + return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]; + else + return array(); + } + } else { + if (empty($section_name)) { + return (array)$this->_config_data[$file_name]["vars"]; + } else { + if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"])) + return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"]; + else + return array(); + } + } + } + + + /** + * Retrieves config info based on the key. + * + * @param $file_name string config key (filename/section/var) + * @return string|array same as get() + * @uses get() retrieves information from config file and returns it + */ + function &get_key($config_key) + { + list($file_name, $section_name, $var_name) = explode('/', $config_key, 3); + $result = &$this->get($file_name, $section_name, $var_name); + return $result; + } + + /** + * Get all loaded config file names. + * + * @return array an array of loaded config file names + */ + function get_file_names() + { + return array_keys($this->_config_data); + } + + + /** + * Get all section names from a loaded file. + * + * @param string $file_name config file to get section names from + * @return array an array of section names from the specified file + */ + function get_section_names($file_name) + { + $file_name = $this->_config_path . $file_name; + if (!isset($this->_config_data[$file_name])) { + $this->_trigger_error_msg("Unknown config file '$file_name'"); + return; + } + + return array_keys($this->_config_data[$file_name]["sections"]); + } + + + /** + * Get all global or section variable names. + * + * @param string $file_name config file to get info for + * @param string $section_name (optional) section to get info for + * @return array an array of variables names from the specified file/section + */ + function get_var_names($file_name, $section = NULL) + { + if (empty($file_name)) { + $this->_trigger_error_msg('Empty config file name'); + return; + } else if (!isset($this->_config_data[$file_name])) { + $this->_trigger_error_msg("Unknown config file '$file_name'"); + return; + } + + if (empty($section)) + return array_keys($this->_config_data[$file_name]["vars"]); + else + return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]); + } + + + /** + * Clear loaded config data for a certain file or all files. + * + * @param string $file_name file to clear config data for + */ + function clear($file_name = NULL) + { + if ($file_name === NULL) + $this->_config_data = array(); + else if (isset($this->_config_data[$file_name])) + $this->_config_data[$file_name] = array(); + } + + + /** + * Load a configuration file manually. + * + * @param string $file_name file name to load + * @param boolean $prepend_path whether current config path should be + * prepended to the filename + */ + function load_file($file_name, $prepend_path = true) + { + if ($prepend_path && $this->_config_path != "") + $config_file = $this->_config_path . $file_name; + else + $config_file = $file_name; + + ini_set('track_errors', true); + $fp = @fopen($config_file, "r"); + if (!is_resource($fp)) { + $this->_trigger_error_msg("Could not open config file '$config_file'"); + return false; + } + + $contents = ($size = filesize($config_file)) ? fread($fp, $size) : ''; + fclose($fp); + + $this->_config_data[$config_file] = $this->parse_contents($contents); + return true; + } + + /** + * Store the contents of a file manually. + * + * @param string $config_file file name of the related contents + * @param string $contents the file-contents to parse + */ + function set_file_contents($config_file, $contents) + { + $this->_config_data[$config_file] = $this->parse_contents($contents); + return true; + } + + /** + * parse the source of a configuration file manually. + * + * @param string $contents the file-contents to parse + */ + function parse_contents($contents) + { + if($this->fix_newlines) { + // fix mac/dos formatted newlines + $contents = preg_replace('!\r\n?!', "\n", $contents); + } + + $config_data = array(); + $config_data['sections'] = array(); + $config_data['vars'] = array(); + + /* reference to fill with data */ + $vars =& $config_data['vars']; + + /* parse file line by line */ + preg_match_all('!^.*\r?\n?!m', $contents, $match); + $lines = $match[0]; + for ($i=0, $count=count($lines); $i<$count; $i++) { + $line = $lines[$i]; + if (empty($line)) continue; + + if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) { + /* section found */ + if (substr($match[1], 0, 1) == '.') { + /* hidden section */ + if ($this->read_hidden) { + $section_name = substr($match[1], 1); + } else { + /* break reference to $vars to ignore hidden section */ + unset($vars); + $vars = array(); + continue; + } + } else { + $section_name = $match[1]; + } + if (!isset($config_data['sections'][$section_name])) + $config_data['sections'][$section_name] = array('vars' => array()); + $vars =& $config_data['sections'][$section_name]['vars']; + continue; + } + + if (preg_match('/^\s*(\.?\w+)\s*=\s*(.*)/s', $line, $match)) { + /* variable found */ + $var_name = rtrim($match[1]); + if (strpos($match[2], '"""') === 0) { + /* handle multiline-value */ + $lines[$i] = substr($match[2], 3); + $var_value = ''; + while ($i<$count) { + if (($pos = strpos($lines[$i], '"""')) === false) { + $var_value .= $lines[$i++]; + } else { + /* end of multiline-value */ + $var_value .= substr($lines[$i], 0, $pos); + break; + } + } + $booleanize = false; + + } else { + /* handle simple value */ + $var_value = preg_replace('/^([\'"])(.*)\1$/', '\2', rtrim($match[2])); + $booleanize = $this->booleanize; + + } + $this->_set_config_var($vars, $var_name, $var_value, $booleanize); + } + /* else unparsable line / means it is a comment / means ignore it */ + } + return $config_data; + } + + /**#@+ @access private */ + /** + * @param array &$container + * @param string $var_name + * @param mixed $var_value + * @param boolean $booleanize determines whether $var_value is converted to + * to true/false + */ + function _set_config_var(&$container, $var_name, $var_value, $booleanize) + { + if (substr($var_name, 0, 1) == '.') { + if (!$this->read_hidden) + return; + else + $var_name = substr($var_name, 1); + } + + if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) { + $this->_trigger_error_msg("Bad variable name '$var_name'"); + return; + } + + if ($booleanize) { + if (preg_match("/^(on|true|yes)$/i", $var_value)) + $var_value = true; + else if (preg_match("/^(off|false|no)$/i", $var_value)) + $var_value = false; + } + + if (!isset($container[$var_name]) || $this->overwrite) + $container[$var_name] = $var_value; + else { + settype($container[$var_name], 'array'); + $container[$var_name][] = $var_value; + } + } + + /** + * @uses trigger_error() creates a PHP warning/error + * @param string $error_msg + * @param integer $error_type one of + */ + function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING) + { + trigger_error("Config_File error: $error_msg", $error_type); + } + /**#@-*/ +} + +?> diff --git a/system/libs/smarty/Smarty.class.php b/system/libs/smarty/Smarty.class.php new file mode 100755 index 0000000..c1f56b2 --- /dev/null +++ b/system/libs/smarty/Smarty.class.php @@ -0,0 +1,1960 @@ + + * @author Andrei Zmievski + * @package Smarty + * @version 2.6.21 + */ + +/* $Id: Smarty.class.php 2785 2008-09-18 21:04:12Z Uwe.Tews $ */ + +/** + * DIR_SEP isn't used anymore, but third party apps might + */ +if(!defined('DIR_SEP')) { + define('DIR_SEP', DIRECTORY_SEPARATOR); +} + +/** + * set SMARTY_DIR to absolute path to Smarty library files. + * if not defined, include_path will be used. Sets SMARTY_DIR only if user + * application has not already defined it. + */ + +if (!defined('SMARTY_DIR')) { + define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); +} + +if (!defined('SMARTY_CORE_DIR')) { + define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR); +} + +define('SMARTY_PHP_PASSTHRU', 0); +define('SMARTY_PHP_QUOTE', 1); +define('SMARTY_PHP_REMOVE', 2); +define('SMARTY_PHP_ALLOW', 3); + +/** + * @package Smarty + */ +class Smarty +{ + /**#@+ + * Smarty Configuration Section + */ + + /** + * The name of the directory where templates are located. + * + * @var string + */ + var $template_dir = 'templates'; + + /** + * The directory where compiled templates are located. + * + * @var string + */ + var $compile_dir = 'templates_c'; + + /** + * The directory where config files are located. + * + * @var string + */ + var $config_dir = 'configs'; + + /** + * An array of directories searched for plugins. + * + * @var array + */ + var $plugins_dir = array('plugins'); + + /** + * If debugging is enabled, a debug console window will display + * when the page loads (make sure your browser allows unrequested + * popup windows) + * + * @var boolean + */ + var $debugging = false; + + /** + * When set, smarty does uses this value as error_reporting-level. + * + * @var boolean + */ + var $error_reporting = null; + + /** + * This is the path to the debug console template. If not set, + * the default one will be used. + * + * @var string + */ + var $debug_tpl = ''; + + /** + * This determines if debugging is enable-able from the browser. + *
    + *
  • NONE => no debugging control allowed
  • + *
  • URL => enable debugging when SMARTY_DEBUG is found in the URL.
  • + *
+ * @link http://www.foo.dom/index.php?SMARTY_DEBUG + * @var string + */ + var $debugging_ctrl = 'NONE'; + + /** + * This tells Smarty whether to check for recompiling or not. Recompiling + * does not need to happen unless a template or config file is changed. + * Typically you enable this during development, and disable for + * production. + * + * @var boolean + */ + var $compile_check = true; + + /** + * This forces templates to compile every time. Useful for development + * or debugging. + * + * @var boolean + */ + var $force_compile = false; + + /** + * This enables template caching. + *
    + *
  • 0 = no caching
  • + *
  • 1 = use class cache_lifetime value
  • + *
  • 2 = use cache_lifetime in cache file
  • + *
+ * @var integer + */ + var $caching = 0; + + /** + * The name of the directory for cache files. + * + * @var string + */ + var $cache_dir = 'cache'; + + /** + * This is the number of seconds cached content will persist. + *
    + *
  • 0 = always regenerate cache
  • + *
  • -1 = never expires
  • + *
+ * + * @var integer + */ + var $cache_lifetime = 0; // 3600 in production + + /** + * Only used when $caching is enabled. If true, then If-Modified-Since headers + * are respected with cached content, and appropriate HTTP headers are sent. + * This way repeated hits to a cached page do not send the entire page to the + * client every time. + * + * @var boolean + */ + var $cache_modified_check = false; + + /** + * This determines how Smarty handles "" tags in templates. + * possible values: + *
    + *
  • SMARTY_PHP_PASSTHRU -> print tags as plain text
  • + *
  • SMARTY_PHP_QUOTE -> escape tags as entities
  • + *
  • SMARTY_PHP_REMOVE -> remove php tags
  • + *
  • SMARTY_PHP_ALLOW -> execute php tags
  • + *
+ * + * @var integer + */ + var $php_handling = SMARTY_PHP_PASSTHRU; + + /** + * This enables template security. When enabled, many things are restricted + * in the templates that normally would go unchecked. This is useful when + * untrusted parties are editing templates and you want a reasonable level + * of security. (no direct execution of PHP in templates for example) + * + * @var boolean + */ + var $security = false; + + /** + * This is the list of template directories that are considered secure. This + * is used only if {@link $security} is enabled. One directory per array + * element. {@link $template_dir} is in this list implicitly. + * + * @var array + */ + var $secure_dir = array(); + + /** + * These are the security settings for Smarty. They are used only when + * {@link $security} is enabled. + * + * @var array + */ + var $security_settings = array( + 'PHP_HANDLING' => false, + 'IF_FUNCS' => array('array', 'list', + 'isset', 'empty', + 'count', 'sizeof', + 'in_array', 'is_array', + 'true', 'false', 'null'), + 'INCLUDE_ANY' => false, + 'PHP_TAGS' => false, + 'MODIFIER_FUNCS' => array('count'), + 'ALLOW_CONSTANTS' => false + ); + + /** + * This is an array of directories where trusted php scripts reside. + * {@link $security} is disabled during their inclusion/execution. + * + * @var array + */ + var $trusted_dir = array(); + + /** + * The left delimiter used for the template tags. + * + * @var string + */ + var $left_delimiter = '{'; + + /** + * The right delimiter used for the template tags. + * + * @var string + */ + var $right_delimiter = '}'; + + /** + * The order in which request variables are registered, similar to + * variables_order in php.ini E = Environment, G = GET, P = POST, + * C = Cookies, S = Server + * + * @var string + */ + var $request_vars_order = 'EGPCS'; + + /** + * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false) + * are uses as request-vars or $_*[]-vars. note: if + * request_use_auto_globals is true, then $request_vars_order has + * no effect, but the php-ini-value "gpc_order" + * + * @var boolean + */ + var $request_use_auto_globals = true; + + /** + * Set this if you want different sets of compiled files for the same + * templates. This is useful for things like different languages. + * Instead of creating separate sets of templates per language, you + * set different compile_ids like 'en' and 'de'. + * + * @var string + */ + var $compile_id = null; + + /** + * This tells Smarty whether or not to use sub dirs in the cache/ and + * templates_c/ directories. sub directories better organized, but + * may not work well with PHP safe mode enabled. + * + * @var boolean + * + */ + var $use_sub_dirs = false; + + /** + * This is a list of the modifiers to apply to all template variables. + * Put each modifier in a separate array element in the order you want + * them applied. example: array('escape:"htmlall"'); + * + * @var array + */ + var $default_modifiers = array(); + + /** + * This is the resource type to be used when not specified + * at the beginning of the resource path. examples: + * $smarty->display('file:index.tpl'); + * $smarty->display('db:index.tpl'); + * $smarty->display('index.tpl'); // will use default resource type + * {include file="file:index.tpl"} + * {include file="db:index.tpl"} + * {include file="index.tpl"} {* will use default resource type *} + * + * @var array + */ + var $default_resource_type = 'file'; + + /** + * The function used for cache file handling. If not set, built-in caching is used. + * + * @var null|string function name + */ + var $cache_handler_func = null; + + /** + * This indicates which filters are automatically loaded into Smarty. + * + * @var array array of filter names + */ + var $autoload_filters = array(); + + /**#@+ + * @var boolean + */ + /** + * This tells if config file vars of the same name overwrite each other or not. + * if disabled, same name variables are accumulated in an array. + */ + var $config_overwrite = true; + + /** + * This tells whether or not to automatically booleanize config file variables. + * If enabled, then the strings "on", "true", and "yes" are treated as boolean + * true, and "off", "false" and "no" are treated as boolean false. + */ + var $config_booleanize = true; + + /** + * This tells whether hidden sections [.foobar] are readable from the + * tempalates or not. Normally you would never allow this since that is + * the point behind hidden sections: the application can access them, but + * the templates cannot. + */ + var $config_read_hidden = false; + + /** + * This tells whether or not automatically fix newlines in config files. + * It basically converts \r (mac) or \r\n (dos) to \n + */ + var $config_fix_newlines = true; + /**#@-*/ + + /** + * If a template cannot be found, this PHP function will be executed. + * Useful for creating templates on-the-fly or other special action. + * + * @var string function name + */ + var $default_template_handler_func = ''; + + /** + * The file that contains the compiler class. This can a full + * pathname, or relative to the php_include path. + * + * @var string + */ + var $compiler_file = 'Smarty_Compiler.class.php'; + + /** + * The class used for compiling templates. + * + * @var string + */ + var $compiler_class = 'Smarty_Compiler'; + + /** + * The class used to load config vars. + * + * @var string + */ + var $config_class = 'Config_File'; + +/**#@+ + * END Smarty Configuration Section + * There should be no need to touch anything below this line. + * @access private + */ + /** + * where assigned template vars are kept + * + * @var array + */ + var $_tpl_vars = array(); + + /** + * stores run-time $smarty.* vars + * + * @var null|array + */ + var $_smarty_vars = null; + + /** + * keeps track of sections + * + * @var array + */ + var $_sections = array(); + + /** + * keeps track of foreach blocks + * + * @var array + */ + var $_foreach = array(); + + /** + * keeps track of tag hierarchy + * + * @var array + */ + var $_tag_stack = array(); + + /** + * configuration object + * + * @var Config_file + */ + var $_conf_obj = null; + + /** + * loaded configuration settings + * + * @var array + */ + var $_config = array(array('vars' => array(), 'files' => array())); + + /** + * md5 checksum of the string 'Smarty' + * + * @var string + */ + var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; + + /** + * Smarty version number + * + * @var string + */ + var $_version = '2.6.21'; + + /** + * current template inclusion depth + * + * @var integer + */ + var $_inclusion_depth = 0; + + /** + * for different compiled templates + * + * @var string + */ + var $_compile_id = null; + + /** + * text in URL to enable debug mode + * + * @var string + */ + var $_smarty_debug_id = 'SMARTY_DEBUG'; + + /** + * debugging information for debug console + * + * @var array + */ + var $_smarty_debug_info = array(); + + /** + * info that makes up a cache file + * + * @var array + */ + var $_cache_info = array(); + + /** + * default file permissions + * + * @var integer + */ + var $_file_perms = 0644; + + /** + * default dir permissions + * + * @var integer + */ + var $_dir_perms = 0771; + + /** + * registered objects + * + * @var array + */ + var $_reg_objects = array(); + + /** + * table keeping track of plugins + * + * @var array + */ + var $_plugins = array( + 'modifier' => array(), + 'function' => array(), + 'block' => array(), + 'compiler' => array(), + 'prefilter' => array(), + 'postfilter' => array(), + 'outputfilter' => array(), + 'resource' => array(), + 'insert' => array()); + + + /** + * cache serials + * + * @var array + */ + var $_cache_serials = array(); + + /** + * name of optional cache include file + * + * @var string + */ + var $_cache_include = null; + + /** + * indicate if the current code is used in a compiled + * include + * + * @var string + */ + var $_cache_including = false; + + /**#@-* + /** + * The class constructor. + */ + function Smarty() + { + $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] + : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); + } + + /** + * assigns values to template variables + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to assign + */ + function assign($tpl_var, $value = null) + { + if (is_array($tpl_var)){ + foreach ($tpl_var as $key => $val) { + if ($key != '') { + $this->_tpl_vars[$key] = $val; + } + } + } else { + if ($tpl_var != '') + $this->_tpl_vars[$tpl_var] = $value; + } + } + + /** + * assigns values to template variables by reference + * + * @param string $tpl_var the template variable name + * @param mixed $value the referenced value to assign + */ + function assign_by_ref($tpl_var, &$value) + { + if ($tpl_var != '') + $this->_tpl_vars[$tpl_var] = &$value; + } + + /** + * appends values to template variables + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to append + */ + function append($tpl_var, $value=null, $merge=false) + { + if (is_array($tpl_var)) { + // $tpl_var is an array, ignore $value + foreach ($tpl_var as $_key => $_val) { + if ($_key != '') { + if(!@is_array($this->_tpl_vars[$_key])) { + settype($this->_tpl_vars[$_key],'array'); + } + if($merge && is_array($_val)) { + foreach($_val as $_mkey => $_mval) { + $this->_tpl_vars[$_key][$_mkey] = $_mval; + } + } else { + $this->_tpl_vars[$_key][] = $_val; + } + } + } + } else { + if ($tpl_var != '' && isset($value)) { + if(!@is_array($this->_tpl_vars[$tpl_var])) { + settype($this->_tpl_vars[$tpl_var],'array'); + } + if($merge && is_array($value)) { + foreach($value as $_mkey => $_mval) { + $this->_tpl_vars[$tpl_var][$_mkey] = $_mval; + } + } else { + $this->_tpl_vars[$tpl_var][] = $value; + } + } + } + } + + /** + * appends values to template variables by reference + * + * @param string $tpl_var the template variable name + * @param mixed $value the referenced value to append + */ + function append_by_ref($tpl_var, &$value, $merge=false) + { + if ($tpl_var != '' && isset($value)) { + if(!@is_array($this->_tpl_vars[$tpl_var])) { + settype($this->_tpl_vars[$tpl_var],'array'); + } + if ($merge && is_array($value)) { + foreach($value as $_key => $_val) { + $this->_tpl_vars[$tpl_var][$_key] = &$value[$_key]; + } + } else { + $this->_tpl_vars[$tpl_var][] = &$value; + } + } + } + + + /** + * clear the given assigned template variable. + * + * @param string $tpl_var the template variable to clear + */ + function clear_assign($tpl_var) + { + if (is_array($tpl_var)) + foreach ($tpl_var as $curr_var) + unset($this->_tpl_vars[$curr_var]); + else + unset($this->_tpl_vars[$tpl_var]); + } + + + /** + * Registers custom function to be used in templates + * + * @param string $function the name of the template function + * @param string $function_impl the name of the PHP function to register + */ + function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null) + { + $this->_plugins['function'][$function] = + array($function_impl, null, null, false, $cacheable, $cache_attrs); + + } + + /** + * Unregisters custom function + * + * @param string $function name of template function + */ + function unregister_function($function) + { + unset($this->_plugins['function'][$function]); + } + + /** + * Registers object to be used in templates + * + * @param string $object name of template object + * @param object &$object_impl the referenced PHP object to register + * @param null|array $allowed list of allowed methods (empty = all) + * @param boolean $smarty_args smarty argument format, else traditional + * @param null|array $block_functs list of methods that are block format + */ + function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) + { + settype($allowed, 'array'); + settype($smarty_args, 'boolean'); + $this->_reg_objects[$object] = + array(&$object_impl, $allowed, $smarty_args, $block_methods); + } + + /** + * Unregisters object + * + * @param string $object name of template object + */ + function unregister_object($object) + { + unset($this->_reg_objects[$object]); + } + + + /** + * Registers block function to be used in templates + * + * @param string $block name of template block + * @param string $block_impl PHP function to register + */ + function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null) + { + $this->_plugins['block'][$block] = + array($block_impl, null, null, false, $cacheable, $cache_attrs); + } + + /** + * Unregisters block function + * + * @param string $block name of template function + */ + function unregister_block($block) + { + unset($this->_plugins['block'][$block]); + } + + /** + * Registers compiler function + * + * @param string $function name of template function + * @param string $function_impl name of PHP function to register + */ + function register_compiler_function($function, $function_impl, $cacheable=true) + { + $this->_plugins['compiler'][$function] = + array($function_impl, null, null, false, $cacheable); + } + + /** + * Unregisters compiler function + * + * @param string $function name of template function + */ + function unregister_compiler_function($function) + { + unset($this->_plugins['compiler'][$function]); + } + + /** + * Registers modifier to be used in templates + * + * @param string $modifier name of template modifier + * @param string $modifier_impl name of PHP function to register + */ + function register_modifier($modifier, $modifier_impl) + { + $this->_plugins['modifier'][$modifier] = + array($modifier_impl, null, null, false); + } + + /** + * Unregisters modifier + * + * @param string $modifier name of template modifier + */ + function unregister_modifier($modifier) + { + unset($this->_plugins['modifier'][$modifier]); + } + + /** + * Registers a resource to fetch a template + * + * @param string $type name of resource + * @param array $functions array of functions to handle resource + */ + function register_resource($type, $functions) + { + if (count($functions)==4) { + $this->_plugins['resource'][$type] = + array($functions, false); + + } elseif (count($functions)==5) { + $this->_plugins['resource'][$type] = + array(array(array(&$functions[0], $functions[1]) + ,array(&$functions[0], $functions[2]) + ,array(&$functions[0], $functions[3]) + ,array(&$functions[0], $functions[4])) + ,false); + + } else { + $this->trigger_error("malformed function-list for '$type' in register_resource"); + + } + } + + /** + * Unregisters a resource + * + * @param string $type name of resource + */ + function unregister_resource($type) + { + unset($this->_plugins['resource'][$type]); + } + + /** + * Registers a prefilter function to apply + * to a template before compiling + * + * @param callback $function + */ + function register_prefilter($function) + { + $this->_plugins['prefilter'][$this->_get_filter_name($function)] + = array($function, null, null, false); + } + + /** + * Unregisters a prefilter function + * + * @param callback $function + */ + function unregister_prefilter($function) + { + unset($this->_plugins['prefilter'][$this->_get_filter_name($function)]); + } + + /** + * Registers a postfilter function to apply + * to a compiled template after compilation + * + * @param callback $function + */ + function register_postfilter($function) + { + $this->_plugins['postfilter'][$this->_get_filter_name($function)] + = array($function, null, null, false); + } + + /** + * Unregisters a postfilter function + * + * @param callback $function + */ + function unregister_postfilter($function) + { + unset($this->_plugins['postfilter'][$this->_get_filter_name($function)]); + } + + /** + * Registers an output filter function to apply + * to a template output + * + * @param callback $function + */ + function register_outputfilter($function) + { + $this->_plugins['outputfilter'][$this->_get_filter_name($function)] + = array($function, null, null, false); + } + + /** + * Unregisters an outputfilter function + * + * @param callback $function + */ + function unregister_outputfilter($function) + { + unset($this->_plugins['outputfilter'][$this->_get_filter_name($function)]); + } + + /** + * load a filter of specified type and name + * + * @param string $type filter type + * @param string $name filter name + */ + function load_filter($type, $name) + { + switch ($type) { + case 'output': + $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false))); + require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); + smarty_core_load_plugins($_params, $this); + break; + + case 'pre': + case 'post': + if (!isset($this->_plugins[$type . 'filter'][$name])) + $this->_plugins[$type . 'filter'][$name] = false; + break; + } + } + + /** + * clear cached content for the given template and cache id + * + * @param string $tpl_file name of template file + * @param string $cache_id name of cache_id + * @param string $compile_id name of compile_id + * @param string $exp_time expiration time + * @return boolean + */ + function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) + { + + if (!isset($compile_id)) + $compile_id = $this->compile_id; + + if (!isset($tpl_file)) + $compile_id = null; + + $_auto_id = $this->_get_auto_id($cache_id, $compile_id); + + if (!empty($this->cache_handler_func)) { + return call_user_func_array($this->cache_handler_func, + array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time)); + } else { + $_params = array('auto_base' => $this->cache_dir, + 'auto_source' => $tpl_file, + 'auto_id' => $_auto_id, + 'exp_time' => $exp_time); + require_once(SMARTY_CORE_DIR . 'core.rm_auto.php'); + return smarty_core_rm_auto($_params, $this); + } + + } + + + /** + * clear the entire contents of cache (all templates) + * + * @param string $exp_time expire time + * @return boolean results of {@link smarty_core_rm_auto()} + */ + function clear_all_cache($exp_time = null) + { + return $this->clear_cache(null, null, null, $exp_time); + } + + + /** + * test to see if valid cache exists for this template + * + * @param string $tpl_file name of template file + * @param string $cache_id + * @param string $compile_id + * @return string|false results of {@link _read_cache_file()} + */ + function is_cached($tpl_file, $cache_id = null, $compile_id = null) + { + if (!$this->caching) + return false; + + if (!isset($compile_id)) + $compile_id = $this->compile_id; + + $_params = array( + 'tpl_file' => $tpl_file, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id + ); + require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php'); + return smarty_core_read_cache_file($_params, $this); + } + + + /** + * clear all the assigned template variables. + * + */ + function clear_all_assign() + { + $this->_tpl_vars = array(); + } + + /** + * clears compiled version of specified template resource, + * or all compiled template files if one is not specified. + * This function is for advanced use only, not normally needed. + * + * @param string $tpl_file + * @param string $compile_id + * @param string $exp_time + * @return boolean results of {@link smarty_core_rm_auto()} + */ + function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) + { + if (!isset($compile_id)) { + $compile_id = $this->compile_id; + } + $_params = array('auto_base' => $this->compile_dir, + 'auto_source' => $tpl_file, + 'auto_id' => $compile_id, + 'exp_time' => $exp_time, + 'extensions' => array('.inc', '.php')); + require_once(SMARTY_CORE_DIR . 'core.rm_auto.php'); + return smarty_core_rm_auto($_params, $this); + } + + /** + * Checks whether requested template exists. + * + * @param string $tpl_file + * @return boolean + */ + function template_exists($tpl_file) + { + $_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false); + return $this->_fetch_resource_info($_params); + } + + /** + * Returns an array containing template variables + * + * @param string $name + * @param string $type + * @return array + */ + function &get_template_vars($name=null) + { + if(!isset($name)) { + return $this->_tpl_vars; + } elseif(isset($this->_tpl_vars[$name])) { + return $this->_tpl_vars[$name]; + } else { + // var non-existant, return valid reference + $_tmp = null; + return $_tmp; + } + } + + /** + * Returns an array containing config variables + * + * @param string $name + * @param string $type + * @return array + */ + function &get_config_vars($name=null) + { + if(!isset($name) && is_array($this->_config[0])) { + return $this->_config[0]['vars']; + } else if(isset($this->_config[0]['vars'][$name])) { + return $this->_config[0]['vars'][$name]; + } else { + // var non-existant, return valid reference + $_tmp = null; + return $_tmp; + } + } + + /** + * trigger Smarty error + * + * @param string $error_msg + * @param integer $error_type + */ + function trigger_error($error_msg, $error_type = E_USER_WARNING) + { + trigger_error("Smarty error: $error_msg", $error_type); + } + + + /** + * executes & displays the template results + * + * @param string $resource_name + * @param string $cache_id + * @param string $compile_id + */ + function display($resource_name, $cache_id = null, $compile_id = null) + { + $this->fetch($resource_name, $cache_id, $compile_id, true); + } + + /** + * executes & returns or displays the template results + * + * @param string $resource_name + * @param string $cache_id + * @param string $compile_id + * @param boolean $display + */ + function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false) + { + static $_cache_info = array(); + + $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting) + ? $this->error_reporting : error_reporting() & ~E_NOTICE); + + if (!$this->debugging && $this->debugging_ctrl == 'URL') { + $_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']; + if (@strstr($_query_string, $this->_smarty_debug_id)) { + if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) { + // enable debugging for this browser session + @setcookie('SMARTY_DEBUG', true); + $this->debugging = true; + } elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) { + // disable debugging for this browser session + @setcookie('SMARTY_DEBUG', false); + $this->debugging = false; + } else { + // enable debugging for this page + $this->debugging = true; + } + } else { + $this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']); + } + } + + if ($this->debugging) { + // capture time for debugging info + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $_debug_start_time = smarty_core_get_microtime($_params, $this); + $this->_smarty_debug_info[] = array('type' => 'template', + 'filename' => $resource_name, + 'depth' => 0); + $_included_tpls_idx = count($this->_smarty_debug_info) - 1; + } + + if (!isset($compile_id)) { + $compile_id = $this->compile_id; + } + + $this->_compile_id = $compile_id; + $this->_inclusion_depth = 0; + + if ($this->caching) { + // save old cache_info, initialize cache_info + array_push($_cache_info, $this->_cache_info); + $this->_cache_info = array(); + $_params = array( + 'tpl_file' => $resource_name, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id, + 'results' => null + ); + require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php'); + if (smarty_core_read_cache_file($_params, $this)) { + $_smarty_results = $_params['results']; + if (!empty($this->_cache_info['insert_tags'])) { + $_params = array('plugins' => $this->_cache_info['insert_tags']); + require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); + smarty_core_load_plugins($_params, $this); + $_params = array('results' => $_smarty_results); + require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php'); + $_smarty_results = smarty_core_process_cached_inserts($_params, $this); + } + if (!empty($this->_cache_info['cache_serials'])) { + $_params = array('results' => $_smarty_results); + require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php'); + $_smarty_results = smarty_core_process_compiled_include($_params, $this); + } + + + if ($display) { + if ($this->debugging) + { + // capture time for debugging info + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time; + require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); + $_smarty_results .= smarty_core_display_debug_console($_params, $this); + } + if ($this->cache_modified_check) { + $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); + $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT'; + if (@count($this->_cache_info['insert_tags']) == 0 + && !$this->_cache_serials + && $_gmt_mtime == $_last_modified_date) { + if (php_sapi_name()=='cgi') + header('Status: 304 Not Modified'); + else + header('HTTP/1.1 304 Not Modified'); + + } else { + header('Last-Modified: '.$_gmt_mtime); + echo $_smarty_results; + } + } else { + echo $_smarty_results; + } + error_reporting($_smarty_old_error_level); + // restore initial cache_info + $this->_cache_info = array_pop($_cache_info); + return true; + } else { + error_reporting($_smarty_old_error_level); + // restore initial cache_info + $this->_cache_info = array_pop($_cache_info); + return $_smarty_results; + } + } else { + $this->_cache_info['template'][$resource_name] = true; + if ($this->cache_modified_check && $display) { + header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); + } + } + } + + // load filters that are marked as autoload + if (count($this->autoload_filters)) { + foreach ($this->autoload_filters as $_filter_type => $_filters) { + foreach ($_filters as $_filter) { + $this->load_filter($_filter_type, $_filter); + } + } + } + + $_smarty_compile_path = $this->_get_compile_path($resource_name); + + // if we just need to display the results, don't perform output + // buffering - for speed + $_cache_including = $this->_cache_including; + $this->_cache_including = false; + if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) { + if ($this->_is_compiled($resource_name, $_smarty_compile_path) + || $this->_compile_resource($resource_name, $_smarty_compile_path)) + { + include($_smarty_compile_path); + } + } else { + ob_start(); + if ($this->_is_compiled($resource_name, $_smarty_compile_path) + || $this->_compile_resource($resource_name, $_smarty_compile_path)) + { + include($_smarty_compile_path); + } + $_smarty_results = ob_get_contents(); + ob_end_clean(); + + foreach ((array)$this->_plugins['outputfilter'] as $_output_filter) { + $_smarty_results = call_user_func_array($_output_filter[0], array($_smarty_results, &$this)); + } + } + + if ($this->caching) { + $_params = array('tpl_file' => $resource_name, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id, + 'results' => $_smarty_results); + require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php'); + smarty_core_write_cache_file($_params, $this); + require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php'); + $_smarty_results = smarty_core_process_cached_inserts($_params, $this); + + if ($this->_cache_serials) { + // strip nocache-tags from output + $_smarty_results = preg_replace('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s' + ,'' + ,$_smarty_results); + } + // restore initial cache_info + $this->_cache_info = array_pop($_cache_info); + } + $this->_cache_including = $_cache_including; + + if ($display) { + if (isset($_smarty_results)) { echo $_smarty_results; } + if ($this->debugging) { + // capture time for debugging info + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time); + require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); + echo smarty_core_display_debug_console($_params, $this); + } + error_reporting($_smarty_old_error_level); + return; + } else { + error_reporting($_smarty_old_error_level); + if (isset($_smarty_results)) { return $_smarty_results; } + } + } + + /** + * load configuration values + * + * @param string $file + * @param string $section + * @param string $scope + */ + function config_load($file, $section = null, $scope = 'global') + { + require_once($this->_get_plugin_filepath('function', 'config_load')); + smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this); + } + + /** + * return a reference to a registered object + * + * @param string $name + * @return object + */ + function &get_registered_object($name) { + if (!isset($this->_reg_objects[$name])) + $this->_trigger_fatal_error("'$name' is not a registered object"); + + if (!is_object($this->_reg_objects[$name][0])) + $this->_trigger_fatal_error("registered '$name' is not an object"); + + return $this->_reg_objects[$name][0]; + } + + /** + * clear configuration values + * + * @param string $var + */ + function clear_config($var = null) + { + if(!isset($var)) { + // clear all values + $this->_config = array(array('vars' => array(), + 'files' => array())); + } else { + unset($this->_config[0]['vars'][$var]); + } + } + + /** + * get filepath of requested plugin + * + * @param string $type + * @param string $name + * @return string|false + */ + function _get_plugin_filepath($type, $name) + { + $_params = array('type' => $type, 'name' => $name); + require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php'); + return smarty_core_assemble_plugin_filepath($_params, $this); + } + + /** + * test if resource needs compiling + * + * @param string $resource_name + * @param string $compile_path + * @return boolean + */ + function _is_compiled($resource_name, $compile_path) + { + if (!$this->force_compile && file_exists($compile_path)) { + if (!$this->compile_check) { + // no need to check compiled file + return true; + } else { + // get file source and timestamp + $_params = array('resource_name' => $resource_name, 'get_source'=>false); + if (!$this->_fetch_resource_info($_params)) { + return false; + } + if ($_params['resource_timestamp'] <= filemtime($compile_path)) { + // template not expired, no recompile + return true; + } else { + // compile template + return false; + } + } + } else { + // compiled template does not exist, or forced compile + return false; + } + } + + /** + * compile the template + * + * @param string $resource_name + * @param string $compile_path + * @return boolean + */ + function _compile_resource($resource_name, $compile_path) + { + + $_params = array('resource_name' => $resource_name); + if (!$this->_fetch_resource_info($_params)) { + return false; + } + + $_source_content = $_params['source_content']; + $_cache_include = substr($compile_path, 0, -4).'.inc'; + + if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) { + // if a _cache_serial was set, we also have to write an include-file: + if ($this->_cache_include_info) { + require_once(SMARTY_CORE_DIR . 'core.write_compiled_include.php'); + smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content, 'resource_name'=>$resource_name)), $this); + } + + $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content); + require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php'); + smarty_core_write_compiled_resource($_params, $this); + + return true; + } else { + return false; + } + + } + + /** + * compile the given source + * + * @param string $resource_name + * @param string $source_content + * @param string $compiled_content + * @return boolean + */ + function _compile_source($resource_name, &$source_content, &$compiled_content, $cache_include_path=null) + { + if (file_exists(SMARTY_DIR . $this->compiler_file)) { + require_once(SMARTY_DIR . $this->compiler_file); + } else { + // use include_path + require_once($this->compiler_file); + } + + + $smarty_compiler = new $this->compiler_class; + + $smarty_compiler->template_dir = $this->template_dir; + $smarty_compiler->compile_dir = $this->compile_dir; + $smarty_compiler->plugins_dir = $this->plugins_dir; + $smarty_compiler->config_dir = $this->config_dir; + $smarty_compiler->force_compile = $this->force_compile; + $smarty_compiler->caching = $this->caching; + $smarty_compiler->php_handling = $this->php_handling; + $smarty_compiler->left_delimiter = $this->left_delimiter; + $smarty_compiler->right_delimiter = $this->right_delimiter; + $smarty_compiler->_version = $this->_version; + $smarty_compiler->security = $this->security; + $smarty_compiler->secure_dir = $this->secure_dir; + $smarty_compiler->security_settings = $this->security_settings; + $smarty_compiler->trusted_dir = $this->trusted_dir; + $smarty_compiler->use_sub_dirs = $this->use_sub_dirs; + $smarty_compiler->_reg_objects = &$this->_reg_objects; + $smarty_compiler->_plugins = &$this->_plugins; + $smarty_compiler->_tpl_vars = &$this->_tpl_vars; + $smarty_compiler->default_modifiers = $this->default_modifiers; + $smarty_compiler->compile_id = $this->_compile_id; + $smarty_compiler->_config = $this->_config; + $smarty_compiler->request_use_auto_globals = $this->request_use_auto_globals; + + if (isset($cache_include_path) && isset($this->_cache_serials[$cache_include_path])) { + $smarty_compiler->_cache_serial = $this->_cache_serials[$cache_include_path]; + } + $smarty_compiler->_cache_include = $cache_include_path; + + + $_results = $smarty_compiler->_compile_file($resource_name, $source_content, $compiled_content); + + if ($smarty_compiler->_cache_serial) { + $this->_cache_include_info = array( + 'cache_serial'=>$smarty_compiler->_cache_serial + ,'plugins_code'=>$smarty_compiler->_plugins_code + ,'include_file_path' => $cache_include_path); + + } else { + $this->_cache_include_info = null; + + } + + return $_results; + } + + /** + * Get the compile path for this resource + * + * @param string $resource_name + * @return string results of {@link _get_auto_filename()} + */ + function _get_compile_path($resource_name) + { + return $this->_get_auto_filename($this->compile_dir, $resource_name, + $this->_compile_id) . '.php'; + } + + /** + * fetch the template info. Gets timestamp, and source + * if get_source is true + * + * sets $source_content to the source of the template, and + * $resource_timestamp to its time stamp + * @param string $resource_name + * @param string $source_content + * @param integer $resource_timestamp + * @param boolean $get_source + * @param boolean $quiet + * @return boolean + */ + + function _fetch_resource_info(&$params) + { + if(!isset($params['get_source'])) { $params['get_source'] = true; } + if(!isset($params['quiet'])) { $params['quiet'] = false; } + + $_return = false; + $_params = array('resource_name' => $params['resource_name']) ; + if (isset($params['resource_base_path'])) + $_params['resource_base_path'] = $params['resource_base_path']; + else + $_params['resource_base_path'] = $this->template_dir; + + if ($this->_parse_resource_name($_params)) { + $_resource_type = $_params['resource_type']; + $_resource_name = $_params['resource_name']; + switch ($_resource_type) { + case 'file': + if ($params['get_source']) { + $params['source_content'] = $this->_read_file($_resource_name); + } + $params['resource_timestamp'] = filemtime($_resource_name); + $_return = is_file($_resource_name); + break; + + default: + // call resource functions to fetch the template source and timestamp + if ($params['get_source']) { + $_source_return = isset($this->_plugins['resource'][$_resource_type]) && + call_user_func_array($this->_plugins['resource'][$_resource_type][0][0], + array($_resource_name, &$params['source_content'], &$this)); + } else { + $_source_return = true; + } + + $_timestamp_return = isset($this->_plugins['resource'][$_resource_type]) && + call_user_func_array($this->_plugins['resource'][$_resource_type][0][1], + array($_resource_name, &$params['resource_timestamp'], &$this)); + + $_return = $_source_return && $_timestamp_return; + break; + } + } + + if (!$_return) { + // see if we can get a template with the default template handler + if (!empty($this->default_template_handler_func)) { + if (!is_callable($this->default_template_handler_func)) { + $this->trigger_error("default template handler function \"$this->default_template_handler_func\" doesn't exist."); + } else { + $_return = call_user_func_array( + $this->default_template_handler_func, + array($_params['resource_type'], $_params['resource_name'], &$params['source_content'], &$params['resource_timestamp'], &$this)); + } + } + } + + if (!$_return) { + if (!$params['quiet']) { + $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"'); + } + } else if ($_return && $this->security) { + require_once(SMARTY_CORE_DIR . 'core.is_secure.php'); + if (!smarty_core_is_secure($_params, $this)) { + if (!$params['quiet']) + $this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed'); + $params['source_content'] = null; + $params['resource_timestamp'] = null; + return false; + } + } + return $_return; + } + + + /** + * parse out the type and name from the resource + * + * @param string $resource_base_path + * @param string $resource_name + * @param string $resource_type + * @param string $resource_name + * @return boolean + */ + + function _parse_resource_name(&$params) + { + + // split tpl_path by the first colon + $_resource_name_parts = explode(':', $params['resource_name'], 2); + + if (count($_resource_name_parts) == 1) { + // no resource type given + $params['resource_type'] = $this->default_resource_type; + $params['resource_name'] = $_resource_name_parts[0]; + } else { + if(strlen($_resource_name_parts[0]) == 1) { + // 1 char is not resource type, but part of filepath + $params['resource_type'] = $this->default_resource_type; + $params['resource_name'] = $params['resource_name']; + } else { + $params['resource_type'] = $_resource_name_parts[0]; + $params['resource_name'] = $_resource_name_parts[1]; + } + } + + if ($params['resource_type'] == 'file') { + if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $params['resource_name'])) { + // relative pathname to $params['resource_base_path'] + // use the first directory where the file is found + foreach ((array)$params['resource_base_path'] as $_curr_path) { + $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name']; + if (file_exists($_fullpath) && is_file($_fullpath)) { + $params['resource_name'] = $_fullpath; + return true; + } + // didn't find the file, try include_path + $_params = array('file_path' => $_fullpath); + require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); + if(smarty_core_get_include_path($_params, $this)) { + $params['resource_name'] = $_params['new_file_path']; + return true; + } + } + return false; + } else { + /* absolute path */ + return file_exists($params['resource_name']); + } + } elseif (empty($this->_plugins['resource'][$params['resource_type']])) { + $_params = array('type' => $params['resource_type']); + require_once(SMARTY_CORE_DIR . 'core.load_resource_plugin.php'); + smarty_core_load_resource_plugin($_params, $this); + } + + return true; + } + + + /** + * Handle modifiers + * + * @param string|null $modifier_name + * @param array|null $map_array + * @return string result of modifiers + */ + function _run_mod_handler() + { + $_args = func_get_args(); + list($_modifier_name, $_map_array) = array_splice($_args, 0, 2); + list($_func_name, $_tpl_file, $_tpl_line) = + $this->_plugins['modifier'][$_modifier_name]; + + $_var = $_args[0]; + foreach ($_var as $_key => $_val) { + $_args[0] = $_val; + $_var[$_key] = call_user_func_array($_func_name, $_args); + } + return $_var; + } + + /** + * Remove starting and ending quotes from the string + * + * @param string $string + * @return string + */ + function _dequote($string) + { + if ((substr($string, 0, 1) == "'" || substr($string, 0, 1) == '"') && + substr($string, -1) == substr($string, 0, 1)) + return substr($string, 1, -1); + else + return $string; + } + + + /** + * read in a file + * + * @param string $filename + * @return string + */ + function _read_file($filename) + { + if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) { + $contents = ''; + while (!feof($fd)) { + $contents .= fread($fd, 8192); + } + fclose($fd); + return $contents; + } else { + return false; + } + } + + /** + * get a concrete filename for automagically created content + * + * @param string $auto_base + * @param string $auto_source + * @param string $auto_id + * @return string + * @staticvar string|null + * @staticvar string|null + */ + function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null) + { + $_compile_dir_sep = $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^'; + $_return = $auto_base . DIRECTORY_SEPARATOR; + + if(isset($auto_id)) { + // make auto_id safe for directory names + $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id))); + // split into separate directories + $_return .= $auto_id . $_compile_dir_sep; + } + + if(isset($auto_source)) { + // make source name safe for filename + $_filename = urlencode(basename($auto_source)); + $_crc32 = sprintf('%08X', crc32($auto_source)); + // prepend %% to avoid name conflicts with + // with $params['auto_id'] names + $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep . + substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32; + $_return .= '%%' . $_crc32 . '%%' . $_filename; + } + + return $_return; + } + + /** + * unlink a file, possibly using expiration time + * + * @param string $resource + * @param integer $exp_time + */ + function _unlink($resource, $exp_time = null) + { + if(isset($exp_time)) { + if(time() - @filemtime($resource) >= $exp_time) { + return @unlink($resource); + } + } else { + return @unlink($resource); + } + } + + /** + * returns an auto_id for auto-file-functions + * + * @param string $cache_id + * @param string $compile_id + * @return string|null + */ + function _get_auto_id($cache_id=null, $compile_id=null) { + if (isset($cache_id)) + return (isset($compile_id)) ? $cache_id . '|' . $compile_id : $cache_id; + elseif(isset($compile_id)) + return $compile_id; + else + return null; + } + + /** + * trigger Smarty plugin error + * + * @param string $error_msg + * @param string $tpl_file + * @param integer $tpl_line + * @param string $file + * @param integer $line + * @param integer $error_type + */ + function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null, + $file = null, $line = null, $error_type = E_USER_ERROR) + { + if(isset($file) && isset($line)) { + $info = ' ('.basename($file).", line $line)"; + } else { + $info = ''; + } + if (isset($tpl_line) && isset($tpl_file)) { + $this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type); + } else { + $this->trigger_error($error_msg . $info, $error_type); + } + } + + + /** + * callback function for preg_replace, to call a non-cacheable block + * @return string + */ + function _process_compiled_include_callback($match) { + $_func = '_smarty_tplfunc_'.$match[2].'_'.$match[3]; + ob_start(); + $_func($this); + $_ret = ob_get_contents(); + ob_end_clean(); + return $_ret; + } + + + /** + * called for included templates + * + * @param string $_smarty_include_tpl_file + * @param string $_smarty_include_vars + */ + + // $_smarty_include_tpl_file, $_smarty_include_vars + + function _smarty_include($params) + { + if ($this->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $debug_start_time = smarty_core_get_microtime($_params, $this); + $this->_smarty_debug_info[] = array('type' => 'template', + 'filename' => $params['smarty_include_tpl_file'], + 'depth' => ++$this->_inclusion_depth); + $included_tpls_idx = count($this->_smarty_debug_info) - 1; + } + + $this->_tpl_vars = array_merge($this->_tpl_vars, $params['smarty_include_vars']); + + // config vars are treated as local, so push a copy of the + // current ones onto the front of the stack + array_unshift($this->_config, $this->_config[0]); + + $_smarty_compile_path = $this->_get_compile_path($params['smarty_include_tpl_file']); + + + if ($this->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path) + || $this->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path)) + { + include($_smarty_compile_path); + } + + // pop the local vars off the front of the stack + array_shift($this->_config); + + $this->_inclusion_depth--; + + if ($this->debugging) { + // capture time for debugging info + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time; + } + + if ($this->caching) { + $this->_cache_info['template'][$params['smarty_include_tpl_file']] = true; + } + } + + + /** + * get or set an array of cached attributes for function that is + * not cacheable + * @return array + */ + function &_smarty_cache_attrs($cache_serial, $count) { + $_cache_attrs =& $this->_cache_info['cache_attrs'][$cache_serial][$count]; + + if ($this->_cache_including) { + /* return next set of cache_attrs */ + $_return = current($_cache_attrs); + next($_cache_attrs); + return $_return; + + } else { + /* add a reference to a new set of cache_attrs */ + $_cache_attrs[] = array(); + return $_cache_attrs[count($_cache_attrs)-1]; + + } + + } + + + /** + * wrapper for include() retaining $this + * @return mixed + */ + function _include($filename, $once=false, $params=null) + { + if ($once) { + return include_once($filename); + } else { + return include($filename); + } + } + + + /** + * wrapper for eval() retaining $this + * @return mixed + */ + function _eval($code, $params=null) + { + return eval($code); + } + + /** + * Extracts the filter name from the given callback + * + * @param callback $function + * @return string + */ + function _get_filter_name($function) + { + if (is_array($function)) { + $_class_name = (is_object($function[0]) ? + get_class($function[0]) : $function[0]); + return $_class_name . '_' . $function[1]; + } + else { + return $function; + } + } + + /**#@-*/ + +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/Smarty_Compiler.class.php b/system/libs/smarty/Smarty_Compiler.class.php new file mode 100755 index 0000000..d950b34 --- /dev/null +++ b/system/libs/smarty/Smarty_Compiler.class.php @@ -0,0 +1,2351 @@ + + * @author Andrei Zmievski + * @version 2.6.21 + * @copyright 2001-2005 New Digital Group, Inc. + * @package Smarty + */ + +/* $Id: Smarty_Compiler.class.php 2797 2008-09-22 19:26:32Z monte.ohrt $ */ + +/** + * Template compiling class + * @package Smarty + */ +class Smarty_Compiler extends Smarty { + + // internal vars + /**#@+ + * @access private + */ + var $_folded_blocks = array(); // keeps folded template blocks + var $_current_file = null; // the current template being compiled + var $_current_line_no = 1; // line number for error messages + var $_capture_stack = array(); // keeps track of nested capture buffers + var $_plugin_info = array(); // keeps track of plugins to load + var $_init_smarty_vars = false; + var $_permitted_tokens = array('true','false','yes','no','on','off','null'); + var $_db_qstr_regexp = null; // regexps are setup in the constructor + var $_si_qstr_regexp = null; + var $_qstr_regexp = null; + var $_func_regexp = null; + var $_reg_obj_regexp = null; + var $_var_bracket_regexp = null; + var $_num_const_regexp = null; + var $_dvar_guts_regexp = null; + var $_dvar_regexp = null; + var $_cvar_regexp = null; + var $_svar_regexp = null; + var $_avar_regexp = null; + var $_mod_regexp = null; + var $_var_regexp = null; + var $_parenth_param_regexp = null; + var $_func_call_regexp = null; + var $_obj_ext_regexp = null; + var $_obj_start_regexp = null; + var $_obj_params_regexp = null; + var $_obj_call_regexp = null; + var $_cacheable_state = 0; + var $_cache_attrs_count = 0; + var $_nocache_count = 0; + var $_cache_serial = null; + var $_cache_include = null; + + var $_strip_depth = 0; + var $_additional_newline = "\n"; + + var $_phpversion = 0; + + + /**#@-*/ + /** + * The class constructor. + */ + function Smarty_Compiler() + { + $this->_phpversion = substr(phpversion(),0,1); + + // matches double quoted strings: + // "foobar" + // "foo\"bar" + $this->_db_qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"'; + + // matches single quoted strings: + // 'foobar' + // 'foo\'bar' + $this->_si_qstr_regexp = '\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\''; + + // matches single or double quoted strings + $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')'; + + // matches bracket portion of vars + // [0] + // [foo] + // [$bar] + $this->_var_bracket_regexp = '\[\$?[\w\.]+\]'; + + // matches numerical constants + // 30 + // -12 + // 13.22 + $this->_num_const_regexp = '(?:\-?\d+(?:\.\d+)?)'; + + // matches $ vars (not objects): + // $foo + // $foo.bar + // $foo.bar.foobar + // $foo[0] + // $foo[$bar] + // $foo[5][blah] + // $foo[5].bar[$foobar][4] + $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))'; + $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]'; + $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp + . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?'; + $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp; + + // matches config vars: + // #foo# + // #foobar123_foo# + $this->_cvar_regexp = '\#\w+\#'; + + // matches section vars: + // %foo.bar% + $this->_svar_regexp = '\%\w+\.\w+\%'; + + // matches all valid variables (no quotes, no modifiers) + $this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|' + . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')'; + + // matches valid variable syntax: + // $foo + // $foo + // #foo# + // #foo# + // "text" + // "text" + $this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')'; + + // matches valid object call (one level of object nesting allowed in parameters): + // $foo->bar + // $foo->bar() + // $foo->bar("text") + // $foo->bar($foo, $bar, "text") + // $foo->bar($foo, "foo") + // $foo->bar->foo() + // $foo->bar->foo->bar() + // $foo->bar($foo->bar) + // $foo->bar($foo->bar()) + // $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar)) + // $foo->getBar()->getFoo() + // $foo->getBar()->foo + $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')'; + $this->_obj_restricted_param_regexp = '(?:' + . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')' + . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)'; + + $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|' + . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)'; + + $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp + . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)'; + $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)'; + $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . '(?:' . $this->_obj_ext_regexp . '(?:'.$this->_obj_params_regexp . ')?)*' . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)'; + + // matches valid modifier syntax: + // |foo + // |@foo + // |foo:"bar" + // |foo:$bar + // |foo:"bar":$foobar + // |foo|bar + // |foo:$foo->bar + $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|' + . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)'; + + // matches valid function name: + // foo123 + // _foo_bar + $this->_func_regexp = '[a-zA-Z_]\w*'; + + // matches valid registered object: + // foo->bar + $this->_reg_obj_regexp = '[a-zA-Z_]\w*->[a-zA-Z_]\w*'; + + // matches valid parameter values: + // true + // $foo + // $foo|bar + // #foo# + // #foo#|bar + // "text" + // "text"|bar + // $foo->bar + $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|' + . $this->_var_regexp . '|' . $this->_num_const_regexp . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)'; + + // matches valid parenthesised function parameters: + // + // "text" + // $foo, $bar, "text" + // $foo|bar, "foo"|bar, $foo->bar($foo)|bar + $this->_parenth_param_regexp = '(?:\((?:\w+|' + . $this->_param_regexp . '(?:\s*,\s*(?:(?:\w+|' + . $this->_param_regexp . ')))*)?\))'; + + // matches valid function call: + // foo() + // foo_bar($foo) + // _foo_bar($foo,"bar") + // foo123($foo,$foo->bar(),"foo") + $this->_func_call_regexp = '(?:' . $this->_func_regexp . '\s*(?:' + . $this->_parenth_param_regexp . '))'; + } + + /** + * compile a resource + * + * sets $compiled_content to the compiled source + * @param string $resource_name + * @param string $source_content + * @param string $compiled_content + * @return true + */ + function _compile_file($resource_name, $source_content, &$compiled_content) + { + + if ($this->security) { + // do not allow php syntax to be executed unless specified + if ($this->php_handling == SMARTY_PHP_ALLOW && + !$this->security_settings['PHP_HANDLING']) { + $this->php_handling = SMARTY_PHP_PASSTHRU; + } + } + + $this->_load_filters(); + + $this->_current_file = $resource_name; + $this->_current_line_no = 1; + $ldq = preg_quote($this->left_delimiter, '~'); + $rdq = preg_quote($this->right_delimiter, '~'); + + // run template source through prefilter functions + if (count($this->_plugins['prefilter']) > 0) { + foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) { + if ($prefilter === false) continue; + if ($prefilter[3] || is_callable($prefilter[0])) { + $source_content = call_user_func_array($prefilter[0], + array($source_content, &$this)); + $this->_plugins['prefilter'][$filter_name][3] = true; + } else { + $this->_trigger_fatal_error("[plugin] prefilter '$filter_name' is not implemented"); + } + } + } + + /* fetch all special blocks */ + $search = "~{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}~s"; + + preg_match_all($search, $source_content, $match, PREG_SET_ORDER); + $this->_folded_blocks = $match; + reset($this->_folded_blocks); + + /* replace special blocks by "{php}" */ + $source_content = preg_replace($search.'e', "'" + . $this->_quote_replace($this->left_delimiter) . 'php' + . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'" + . $this->_quote_replace($this->right_delimiter) + . "'" + , $source_content); + + /* Gather all template tags. */ + preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match); + $template_tags = $_match[1]; + /* Split content by template tags to obtain non-template content. */ + $text_blocks = preg_split("~{$ldq}.*?{$rdq}~s", $source_content); + + /* loop through text blocks */ + for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) { + /* match anything resembling php tags */ + if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?\s*php\s*[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) { + /* replace tags with placeholders to prevent recursive replacements */ + $sp_match[1] = array_unique($sp_match[1]); + usort($sp_match[1], '_smarty_sort_length'); + for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) { + $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]); + } + /* process each one */ + for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) { + if ($this->php_handling == SMARTY_PHP_PASSTHRU) { + /* echo php contents */ + $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', ''."\n", $text_blocks[$curr_tb]); + } else if ($this->php_handling == SMARTY_PHP_QUOTE) { + /* quote php tags */ + $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', htmlspecialchars($sp_match[1][$curr_sp]), $text_blocks[$curr_tb]); + } else if ($this->php_handling == SMARTY_PHP_REMOVE) { + /* remove php tags */ + $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', '', $text_blocks[$curr_tb]); + } else { + /* SMARTY_PHP_ALLOW, but echo non php starting tags */ + $sp_match[1][$curr_sp] = preg_replace('~(<\?(?!php|=|$))~i', ''."\n", $sp_match[1][$curr_sp]); + $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', $sp_match[1][$curr_sp], $text_blocks[$curr_tb]); + } + } + } + } + + /* Compile the template tags into PHP code. */ + $compiled_tags = array(); + for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) { + $this->_current_line_no += substr_count($text_blocks[$i], "\n"); + $compiled_tags[] = $this->_compile_tag($template_tags[$i]); + $this->_current_line_no += substr_count($template_tags[$i], "\n"); + } + if (count($this->_tag_stack)>0) { + list($_open_tag, $_line_no) = end($this->_tag_stack); + $this->_syntax_error("unclosed tag \{$_open_tag} (opened line $_line_no).", E_USER_ERROR, __FILE__, __LINE__); + return; + } + + /* Reformat $text_blocks between 'strip' and '/strip' tags, + removing spaces, tabs and newlines. */ + $strip = false; + for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) { + if ($compiled_tags[$i] == '{strip}') { + $compiled_tags[$i] = ''; + $strip = true; + /* remove leading whitespaces */ + $text_blocks[$i + 1] = ltrim($text_blocks[$i + 1]); + } + if ($strip) { + /* strip all $text_blocks before the next '/strip' */ + for ($j = $i + 1; $j < $for_max; $j++) { + /* remove leading and trailing whitespaces of each line */ + $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]); + if ($compiled_tags[$j] == '{/strip}') { + /* remove trailing whitespaces from the last text_block */ + $text_blocks[$j] = rtrim($text_blocks[$j]); + } + $text_blocks[$j] = ""\'", "\\"=>"\\\\")) . "'; ?>"; + if ($compiled_tags[$j] == '{/strip}') { + $compiled_tags[$j] = "\n"; /* slurped by php, but necessary + if a newline is following the closing strip-tag */ + $strip = false; + $i = $j; + break; + } + } + } + } + $compiled_content = ''; + + $tag_guard = '%%%SMARTYOTG' . md5(uniqid(rand(), true)) . '%%%'; + + /* Interleave the compiled contents and text blocks to get the final result. */ + for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) { + if ($compiled_tags[$i] == '') { + // tag result empty, remove first newline from following text block + $text_blocks[$i+1] = preg_replace('~^(\r\n|\r|\n)~', '', $text_blocks[$i+1]); + } + // replace legit PHP tags with placeholder + $text_blocks[$i] = str_replace('\n", $compiled_content); + $compiled_content = preg_replace("~(?\n", $compiled_content); + + // recover legit tags + $compiled_content = str_replace($tag_guard, '_cache_serial)) { + $compiled_content = "_cache_serials['".$this->_cache_include."'] = '".$this->_cache_serial."'; ?>" . $compiled_content; + } + + // run compiled template through postfilter functions + if (count($this->_plugins['postfilter']) > 0) { + foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) { + if ($postfilter === false) continue; + if ($postfilter[3] || is_callable($postfilter[0])) { + $compiled_content = call_user_func_array($postfilter[0], + array($compiled_content, &$this)); + $this->_plugins['postfilter'][$filter_name][3] = true; + } else { + $this->_trigger_fatal_error("Smarty plugin error: postfilter '$filter_name' is not implemented"); + } + } + } + + // put header at the top of the compiled template + $template_header = "_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n"; + $template_header .= " compiled from ".strtr(urlencode($resource_name), array('%2F'=>'/', '%3A'=>':'))." */ ?>\n"; + + /* Emit code to load needed plugins. */ + $this->_plugins_code = ''; + if (count($this->_plugin_info)) { + $_plugins_params = "array('plugins' => array("; + foreach ($this->_plugin_info as $plugin_type => $plugins) { + foreach ($plugins as $plugin_name => $plugin_info) { + $_plugins_params .= "array('$plugin_type', '$plugin_name', '" . strtr($plugin_info[0], array("'" => "\\'", "\\" => "\\\\")) . "', $plugin_info[1], "; + $_plugins_params .= $plugin_info[2] ? 'true),' : 'false),'; + } + } + $_plugins_params .= '))'; + $plugins_code = "\n"; + $template_header .= $plugins_code; + $this->_plugin_info = array(); + $this->_plugins_code = $plugins_code; + } + + if ($this->_init_smarty_vars) { + $template_header .= "\n"; + $this->_init_smarty_vars = false; + } + + $compiled_content = $template_header . $compiled_content; + return true; + } + + /** + * Compile a template tag + * + * @param string $template_tag + * @return string + */ + function _compile_tag($template_tag) + { + /* Matched comment. */ + if (substr($template_tag, 0, 1) == '*' && substr($template_tag, -1) == '*') + return ''; + + /* Split tag into two three parts: command, command modifiers and the arguments. */ + if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp + . '|\/?' . $this->_reg_obj_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*)) + (?:\s+(.*))?$ + ~xs', $template_tag, $match)) { + $this->_syntax_error("unrecognized tag: $template_tag", E_USER_ERROR, __FILE__, __LINE__); + } + + $tag_command = $match[1]; + $tag_modifier = isset($match[2]) ? $match[2] : null; + $tag_args = isset($match[3]) ? $match[3] : null; + + if (preg_match('~^' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '$~', $tag_command)) { + /* tag name is a variable or object */ + $_return = $this->_parse_var_props($tag_command . $tag_modifier); + return "" . $this->_additional_newline; + } + + /* If the tag name is a registered object, we process it. */ + if (preg_match('~^\/?' . $this->_reg_obj_regexp . '$~', $tag_command)) { + return $this->_compile_registered_object_tag($tag_command, $this->_parse_attrs($tag_args), $tag_modifier); + } + + switch ($tag_command) { + case 'include': + return $this->_compile_include_tag($tag_args); + + case 'include_php': + return $this->_compile_include_php_tag($tag_args); + + case 'if': + $this->_push_tag('if'); + return $this->_compile_if_tag($tag_args); + + case 'else': + list($_open_tag) = end($this->_tag_stack); + if ($_open_tag != 'if' && $_open_tag != 'elseif') + $this->_syntax_error('unexpected {else}', E_USER_ERROR, __FILE__, __LINE__); + else + $this->_push_tag('else'); + return ''; + + case 'elseif': + list($_open_tag) = end($this->_tag_stack); + if ($_open_tag != 'if' && $_open_tag != 'elseif') + $this->_syntax_error('unexpected {elseif}', E_USER_ERROR, __FILE__, __LINE__); + if ($_open_tag == 'if') + $this->_push_tag('elseif'); + return $this->_compile_if_tag($tag_args, true); + + case '/if': + $this->_pop_tag('if'); + return ''; + + case 'capture': + return $this->_compile_capture_tag(true, $tag_args); + + case '/capture': + return $this->_compile_capture_tag(false); + + case 'ldelim': + return $this->left_delimiter; + + case 'rdelim': + return $this->right_delimiter; + + case 'section': + $this->_push_tag('section'); + return $this->_compile_section_start($tag_args); + + case 'sectionelse': + $this->_push_tag('sectionelse'); + return ""; + break; + + case '/section': + $_open_tag = $this->_pop_tag('section'); + if ($_open_tag == 'sectionelse') + return ""; + else + return ""; + + case 'foreach': + $this->_push_tag('foreach'); + return $this->_compile_foreach_start($tag_args); + break; + + case 'foreachelse': + $this->_push_tag('foreachelse'); + return ""; + + case '/foreach': + $_open_tag = $this->_pop_tag('foreach'); + if ($_open_tag == 'foreachelse') + return ""; + else + return ""; + break; + + case 'strip': + case '/strip': + if (substr($tag_command, 0, 1)=='/') { + $this->_pop_tag('strip'); + if (--$this->_strip_depth==0) { /* outermost closing {/strip} */ + $this->_additional_newline = "\n"; + return '{' . $tag_command . '}'; + } + } else { + $this->_push_tag('strip'); + if ($this->_strip_depth++==0) { /* outermost opening {strip} */ + $this->_additional_newline = ""; + return '{' . $tag_command . '}'; + } + } + return ''; + + case 'php': + /* handle folded tags replaced by {php} */ + list(, $block) = each($this->_folded_blocks); + $this->_current_line_no += substr_count($block[0], "\n"); + /* the number of matched elements in the regexp in _compile_file() + determins the type of folded tag that was found */ + switch (count($block)) { + case 2: /* comment */ + return ''; + + case 3: /* literal */ + return ""\'", "\\"=>"\\\\")) . "'; ?>" . $this->_additional_newline; + + case 4: /* php */ + if ($this->security && !$this->security_settings['PHP_TAGS']) { + $this->_syntax_error("(secure mode) php tags not permitted", E_USER_WARNING, __FILE__, __LINE__); + return; + } + return ''; + } + break; + + case 'insert': + return $this->_compile_insert_tag($tag_args); + + default: + if ($this->_compile_compiler_tag($tag_command, $tag_args, $output)) { + return $output; + } else if ($this->_compile_block_tag($tag_command, $tag_args, $tag_modifier, $output)) { + return $output; + } else if ($this->_compile_custom_tag($tag_command, $tag_args, $tag_modifier, $output)) { + return $output; + } else { + $this->_syntax_error("unrecognized tag '$tag_command'", E_USER_ERROR, __FILE__, __LINE__); + } + + } + } + + + /** + * compile the custom compiler tag + * + * sets $output to the compiled custom compiler tag + * @param string $tag_command + * @param string $tag_args + * @param string $output + * @return boolean + */ + function _compile_compiler_tag($tag_command, $tag_args, &$output) + { + $found = false; + $have_function = true; + + /* + * First we check if the compiler function has already been registered + * or loaded from a plugin file. + */ + if (isset($this->_plugins['compiler'][$tag_command])) { + $found = true; + $plugin_func = $this->_plugins['compiler'][$tag_command][0]; + if (!is_callable($plugin_func)) { + $message = "compiler function '$tag_command' is not implemented"; + $have_function = false; + } + } + /* + * Otherwise we need to load plugin file and look for the function + * inside it. + */ + else if ($plugin_file = $this->_get_plugin_filepath('compiler', $tag_command)) { + $found = true; + + include_once $plugin_file; + + $plugin_func = 'smarty_compiler_' . $tag_command; + if (!is_callable($plugin_func)) { + $message = "plugin function $plugin_func() not found in $plugin_file\n"; + $have_function = false; + } else { + $this->_plugins['compiler'][$tag_command] = array($plugin_func, null, null, null, true); + } + } + + /* + * True return value means that we either found a plugin or a + * dynamically registered function. False means that we didn't and the + * compiler should now emit code to load custom function plugin for this + * tag. + */ + if ($found) { + if ($have_function) { + $output = call_user_func_array($plugin_func, array($tag_args, &$this)); + if($output != '') { + $output = '_push_cacheable_state('compiler', $tag_command) + . $output + . $this->_pop_cacheable_state('compiler', $tag_command) . ' ?>'; + } + } else { + $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__); + } + return true; + } else { + return false; + } + } + + + /** + * compile block function tag + * + * sets $output to compiled block function tag + * @param string $tag_command + * @param string $tag_args + * @param string $tag_modifier + * @param string $output + * @return boolean + */ + function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output) + { + if (substr($tag_command, 0, 1) == '/') { + $start_tag = false; + $tag_command = substr($tag_command, 1); + } else + $start_tag = true; + + $found = false; + $have_function = true; + + /* + * First we check if the block function has already been registered + * or loaded from a plugin file. + */ + if (isset($this->_plugins['block'][$tag_command])) { + $found = true; + $plugin_func = $this->_plugins['block'][$tag_command][0]; + if (!is_callable($plugin_func)) { + $message = "block function '$tag_command' is not implemented"; + $have_function = false; + } + } + /* + * Otherwise we need to load plugin file and look for the function + * inside it. + */ + else if ($plugin_file = $this->_get_plugin_filepath('block', $tag_command)) { + $found = true; + + include_once $plugin_file; + + $plugin_func = 'smarty_block_' . $tag_command; + if (!function_exists($plugin_func)) { + $message = "plugin function $plugin_func() not found in $plugin_file\n"; + $have_function = false; + } else { + $this->_plugins['block'][$tag_command] = array($plugin_func, null, null, null, true); + + } + } + + if (!$found) { + return false; + } else if (!$have_function) { + $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__); + return true; + } + + /* + * Even though we've located the plugin function, compilation + * happens only once, so the plugin will still need to be loaded + * at runtime for future requests. + */ + $this->_add_plugin('block', $tag_command); + + if ($start_tag) + $this->_push_tag($tag_command); + else + $this->_pop_tag($tag_command); + + if ($start_tag) { + $output = '_push_cacheable_state('block', $tag_command); + $attrs = $this->_parse_attrs($tag_args); + $_cache_attrs=''; + $arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs); + $output .= "$_cache_attrs\$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); '; + $output .= '$_block_repeat=true;' . $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);'; + $output .= 'while ($_block_repeat) { ob_start(); ?>'; + } else { + $output = '_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat)'; + if ($tag_modifier != '') { + $this->_parse_modifiers($_out_tag_text, $tag_modifier); + } + $output .= '$_block_repeat=false;echo ' . $_out_tag_text . '; } '; + $output .= " array_pop(\$this->_tag_stack); " . $this->_pop_cacheable_state('block', $tag_command) . '?>'; + } + + return true; + } + + + /** + * compile custom function tag + * + * @param string $tag_command + * @param string $tag_args + * @param string $tag_modifier + * @return string + */ + function _compile_custom_tag($tag_command, $tag_args, $tag_modifier, &$output) + { + $found = false; + $have_function = true; + + /* + * First we check if the custom function has already been registered + * or loaded from a plugin file. + */ + if (isset($this->_plugins['function'][$tag_command])) { + $found = true; + $plugin_func = $this->_plugins['function'][$tag_command][0]; + if (!is_callable($plugin_func)) { + $message = "custom function '$tag_command' is not implemented"; + $have_function = false; + } + } + /* + * Otherwise we need to load plugin file and look for the function + * inside it. + */ + else if ($plugin_file = $this->_get_plugin_filepath('function', $tag_command)) { + $found = true; + + include_once $plugin_file; + + $plugin_func = 'smarty_function_' . $tag_command; + if (!function_exists($plugin_func)) { + $message = "plugin function $plugin_func() not found in $plugin_file\n"; + $have_function = false; + } else { + $this->_plugins['function'][$tag_command] = array($plugin_func, null, null, null, true); + + } + } + + if (!$found) { + return false; + } else if (!$have_function) { + $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__); + return true; + } + + /* declare plugin to be loaded on display of the template that + we compile right now */ + $this->_add_plugin('function', $tag_command); + + $_cacheable_state = $this->_push_cacheable_state('function', $tag_command); + $attrs = $this->_parse_attrs($tag_args); + $_cache_attrs = ''; + $arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs); + + $output = $this->_compile_plugin_call('function', $tag_command).'(array('.implode(',', $arg_list)."), \$this)"; + if($tag_modifier != '') { + $this->_parse_modifiers($output, $tag_modifier); + } + + if($output != '') { + $output = '_pop_cacheable_state('function', $tag_command) . "?>" . $this->_additional_newline; + } + + return true; + } + + /** + * compile a registered object tag + * + * @param string $tag_command + * @param array $attrs + * @param string $tag_modifier + * @return string + */ + function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier) + { + if (substr($tag_command, 0, 1) == '/') { + $start_tag = false; + $tag_command = substr($tag_command, 1); + } else { + $start_tag = true; + } + + list($object, $obj_comp) = explode('->', $tag_command); + + $arg_list = array(); + if(count($attrs)) { + $_assign_var = false; + foreach ($attrs as $arg_name => $arg_value) { + if($arg_name == 'assign') { + $_assign_var = $arg_value; + unset($attrs['assign']); + continue; + } + if (is_bool($arg_value)) + $arg_value = $arg_value ? 'true' : 'false'; + $arg_list[] = "'$arg_name' => $arg_value"; + } + } + + if($this->_reg_objects[$object][2]) { + // smarty object argument format + $args = "array(".implode(',', (array)$arg_list)."), \$this"; + } else { + // traditional argument format + $args = implode(',', array_values($attrs)); + if (empty($args)) { + $args = ''; + } + } + + $prefix = ''; + $postfix = ''; + $newline = ''; + if(!is_object($this->_reg_objects[$object][0])) { + $this->_trigger_fatal_error("registered '$object' is not an object" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__); + } elseif(!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) { + $this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__); + } elseif(method_exists($this->_reg_objects[$object][0], $obj_comp)) { + // method + if(in_array($obj_comp, $this->_reg_objects[$object][3])) { + // block method + if ($start_tag) { + $prefix = "\$this->_tag_stack[] = array('$obj_comp', $args); "; + $prefix .= "\$_block_repeat=true; \$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], null, \$this, \$_block_repeat); "; + $prefix .= "while (\$_block_repeat) { ob_start();"; + $return = null; + $postfix = ''; + } else { + $prefix = "\$_obj_block_content = ob_get_contents(); ob_end_clean(); \$_block_repeat=false;"; + $return = "\$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$_obj_block_content, \$this, \$_block_repeat)"; + $postfix = "} array_pop(\$this->_tag_stack);"; + } + } else { + // non-block method + $return = "\$this->_reg_objects['$object'][0]->$obj_comp($args)"; + } + } else { + // property + $return = "\$this->_reg_objects['$object'][0]->$obj_comp"; + } + + if($return != null) { + if($tag_modifier != '') { + $this->_parse_modifiers($return, $tag_modifier); + } + + if(!empty($_assign_var)) { + $output = "\$this->assign('" . $this->_dequote($_assign_var) ."', $return);"; + } else { + $output = 'echo ' . $return . ';'; + $newline = $this->_additional_newline; + } + } else { + $output = ''; + } + + return '" . $newline; + } + + /** + * Compile {insert ...} tag + * + * @param string $tag_args + * @return string + */ + function _compile_insert_tag($tag_args) + { + $attrs = $this->_parse_attrs($tag_args); + $name = $this->_dequote($attrs['name']); + + if (empty($name)) { + return $this->_syntax_error("missing insert name", E_USER_ERROR, __FILE__, __LINE__); + } + + if (!preg_match('~^\w+$~', $name)) { + return $this->_syntax_error("'insert: 'name' must be an insert function name", E_USER_ERROR, __FILE__, __LINE__); + } + + if (!empty($attrs['script'])) { + $delayed_loading = true; + } else { + $delayed_loading = false; + } + + foreach ($attrs as $arg_name => $arg_value) { + if (is_bool($arg_value)) + $arg_value = $arg_value ? 'true' : 'false'; + $arg_list[] = "'$arg_name' => $arg_value"; + } + + $this->_add_plugin('insert', $name, $delayed_loading); + + $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))"; + + return "" . $this->_additional_newline; + } + + /** + * Compile {include ...} tag + * + * @param string $tag_args + * @return string + */ + function _compile_include_tag($tag_args) + { + $attrs = $this->_parse_attrs($tag_args); + $arg_list = array(); + + if (empty($attrs['file'])) { + $this->_syntax_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__); + } + + foreach ($attrs as $arg_name => $arg_value) { + if ($arg_name == 'file') { + $include_file = $arg_value; + continue; + } else if ($arg_name == 'assign') { + $assign_var = $arg_value; + continue; + } + if (is_bool($arg_value)) + $arg_value = $arg_value ? 'true' : 'false'; + $arg_list[] = "'$arg_name' => $arg_value"; + } + + $output = '_tpl_vars;\n"; + + + $_params = "array('smarty_include_tpl_file' => " . $include_file . ", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))"; + $output .= "\$this->_smarty_include($_params);\n" . + "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" . + "unset(\$_smarty_tpl_vars);\n"; + + if (isset($assign_var)) { + $output .= "\$this->assign(" . $assign_var . ", ob_get_contents()); ob_end_clean();\n"; + } + + $output .= ' ?>'; + + return $output; + + } + + /** + * Compile {include ...} tag + * + * @param string $tag_args + * @return string + */ + function _compile_include_php_tag($tag_args) + { + $attrs = $this->_parse_attrs($tag_args); + + if (empty($attrs['file'])) { + $this->_syntax_error("missing 'file' attribute in include_php tag", E_USER_ERROR, __FILE__, __LINE__); + } + + $assign_var = (empty($attrs['assign'])) ? '' : $this->_dequote($attrs['assign']); + $once_var = (empty($attrs['once']) || $attrs['once']=='false') ? 'false' : 'true'; + + $arg_list = array(); + foreach($attrs as $arg_name => $arg_value) { + if($arg_name != 'file' AND $arg_name != 'once' AND $arg_name != 'assign') { + if(is_bool($arg_value)) + $arg_value = $arg_value ? 'true' : 'false'; + $arg_list[] = "'$arg_name' => $arg_value"; + } + } + + $_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))"; + + return "" . $this->_additional_newline; + } + + + /** + * Compile {section ...} tag + * + * @param string $tag_args + * @return string + */ + function _compile_section_start($tag_args) + { + $attrs = $this->_parse_attrs($tag_args); + $arg_list = array(); + + $output = '_syntax_error("missing section name", E_USER_ERROR, __FILE__, __LINE__); + } + + $output .= "unset(\$this->_sections[$section_name]);\n"; + $section_props = "\$this->_sections[$section_name]"; + + foreach ($attrs as $attr_name => $attr_value) { + switch ($attr_name) { + case 'loop': + $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n"; + break; + + case 'show': + if (is_bool($attr_value)) + $show_attr_value = $attr_value ? 'true' : 'false'; + else + $show_attr_value = "(bool)$attr_value"; + $output .= "{$section_props}['show'] = $show_attr_value;\n"; + break; + + case 'name': + $output .= "{$section_props}['$attr_name'] = $attr_value;\n"; + break; + + case 'max': + case 'start': + $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n"; + break; + + case 'step': + $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n"; + break; + + default: + $this->_syntax_error("unknown section attribute - '$attr_name'", E_USER_ERROR, __FILE__, __LINE__); + break; + } + } + + if (!isset($attrs['show'])) + $output .= "{$section_props}['show'] = true;\n"; + + if (!isset($attrs['loop'])) + $output .= "{$section_props}['loop'] = 1;\n"; + + if (!isset($attrs['max'])) + $output .= "{$section_props}['max'] = {$section_props}['loop'];\n"; + else + $output .= "if ({$section_props}['max'] < 0)\n" . + " {$section_props}['max'] = {$section_props}['loop'];\n"; + + if (!isset($attrs['step'])) + $output .= "{$section_props}['step'] = 1;\n"; + + if (!isset($attrs['start'])) + $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n"; + else { + $output .= "if ({$section_props}['start'] < 0)\n" . + " {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" . + "else\n" . + " {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n"; + } + + $output .= "if ({$section_props}['show']) {\n"; + if (!isset($attrs['start']) && !isset($attrs['step']) && !isset($attrs['max'])) { + $output .= " {$section_props}['total'] = {$section_props}['loop'];\n"; + } else { + $output .= " {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n"; + } + $output .= " if ({$section_props}['total'] == 0)\n" . + " {$section_props}['show'] = false;\n" . + "} else\n" . + " {$section_props}['total'] = 0;\n"; + + $output .= "if ({$section_props}['show']):\n"; + $output .= " + for ({$section_props}['index'] = {$section_props}['start'], {$section_props}['iteration'] = 1; + {$section_props}['iteration'] <= {$section_props}['total']; + {$section_props}['index'] += {$section_props}['step'], {$section_props}['iteration']++):\n"; + $output .= "{$section_props}['rownum'] = {$section_props}['iteration'];\n"; + $output .= "{$section_props}['index_prev'] = {$section_props}['index'] - {$section_props}['step'];\n"; + $output .= "{$section_props}['index_next'] = {$section_props}['index'] + {$section_props}['step'];\n"; + $output .= "{$section_props}['first'] = ({$section_props}['iteration'] == 1);\n"; + $output .= "{$section_props}['last'] = ({$section_props}['iteration'] == {$section_props}['total']);\n"; + + $output .= "?>"; + + return $output; + } + + + /** + * Compile {foreach ...} tag. + * + * @param string $tag_args + * @return string + */ + function _compile_foreach_start($tag_args) + { + $attrs = $this->_parse_attrs($tag_args); + $arg_list = array(); + + if (empty($attrs['from'])) { + return $this->_syntax_error("foreach: missing 'from' attribute", E_USER_ERROR, __FILE__, __LINE__); + } + $from = $attrs['from']; + + if (empty($attrs['item'])) { + return $this->_syntax_error("foreach: missing 'item' attribute", E_USER_ERROR, __FILE__, __LINE__); + } + $item = $this->_dequote($attrs['item']); + if (!preg_match('~^\w+$~', $item)) { + return $this->_syntax_error("foreach: 'item' must be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__); + } + + if (isset($attrs['key'])) { + $key = $this->_dequote($attrs['key']); + if (!preg_match('~^\w+$~', $key)) { + return $this->_syntax_error("foreach: 'key' must to be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__); + } + $key_part = "\$this->_tpl_vars['$key'] => "; + } else { + $key = null; + $key_part = ''; + } + + if (isset($attrs['name'])) { + $name = $attrs['name']; + } else { + $name = null; + } + + $output = '_foreach[$name]"; + $output .= "{$foreach_props} = array('total' => count(\$_from), 'iteration' => 0);\n"; + $output .= "if ({$foreach_props}['total'] > 0):\n"; + $output .= " foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n"; + $output .= " {$foreach_props}['iteration']++;\n"; + } else { + $output .= "if (count(\$_from)):\n"; + $output .= " foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n"; + } + $output .= '?>'; + + return $output; + } + + + /** + * Compile {capture} .. {/capture} tags + * + * @param boolean $start true if this is the {capture} tag + * @param string $tag_args + * @return string + */ + + function _compile_capture_tag($start, $tag_args = '') + { + $attrs = $this->_parse_attrs($tag_args); + + if ($start) { + $buffer = isset($attrs['name']) ? $attrs['name'] : "'default'"; + $assign = isset($attrs['assign']) ? $attrs['assign'] : null; + $append = isset($attrs['append']) ? $attrs['append'] : null; + + $output = ""; + $this->_capture_stack[] = array($buffer, $assign, $append); + } else { + list($buffer, $assign, $append) = array_pop($this->_capture_stack); + $output = "_smarty_vars['capture'][$buffer] = ob_get_contents(); "; + if (isset($assign)) { + $output .= " \$this->assign($assign, ob_get_contents());"; + } + if (isset($append)) { + $output .= " \$this->append($append, ob_get_contents());"; + } + $output .= "ob_end_clean(); ?>"; + } + + return $output; + } + + /** + * Compile {if ...} tag + * + * @param string $tag_args + * @param boolean $elseif if true, uses elseif instead of if + * @return string + */ + function _compile_if_tag($tag_args, $elseif = false) + { + + /* Tokenize args for 'if' tag. */ + preg_match_all('~(?> + ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*)? | # valid object call + ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)? | # var or quoted string + \-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\||\%|\+|\-|\/|\*|\@ | # valid non-word token + \b\w+\b | # valid word token + \S+ # anything else + )~x', $tag_args, $match); + + $tokens = $match[0]; + + if(empty($tokens)) { + $_error_msg = $elseif ? "'elseif'" : "'if'"; + $_error_msg .= ' statement requires arguments'; + $this->_syntax_error($_error_msg, E_USER_ERROR, __FILE__, __LINE__); + } + + + // make sure we have balanced parenthesis + $token_count = array_count_values($tokens); + if(isset($token_count['(']) && $token_count['('] != $token_count[')']) { + $this->_syntax_error("unbalanced parenthesis in if statement", E_USER_ERROR, __FILE__, __LINE__); + } + + $is_arg_stack = array(); + + for ($i = 0; $i < count($tokens); $i++) { + + $token = &$tokens[$i]; + + switch (strtolower($token)) { + case '!': + case '%': + case '!==': + case '==': + case '===': + case '>': + case '<': + case '!=': + case '<>': + case '<<': + case '>>': + case '<=': + case '>=': + case '&&': + case '||': + case '|': + case '^': + case '&': + case '~': + case ')': + case ',': + case '+': + case '-': + case '*': + case '/': + case '@': + break; + + case 'eq': + $token = '=='; + break; + + case 'ne': + case 'neq': + $token = '!='; + break; + + case 'lt': + $token = '<'; + break; + + case 'le': + case 'lte': + $token = '<='; + break; + + case 'gt': + $token = '>'; + break; + + case 'ge': + case 'gte': + $token = '>='; + break; + + case 'and': + $token = '&&'; + break; + + case 'or': + $token = '||'; + break; + + case 'not': + $token = '!'; + break; + + case 'mod': + $token = '%'; + break; + + case '(': + array_push($is_arg_stack, $i); + break; + + case 'is': + /* If last token was a ')', we operate on the parenthesized + expression. The start of the expression is on the stack. + Otherwise, we operate on the last encountered token. */ + if ($tokens[$i-1] == ')') { + $is_arg_start = array_pop($is_arg_stack); + if ($is_arg_start != 0) { + if (preg_match('~^' . $this->_func_regexp . '$~', $tokens[$is_arg_start-1])) { + $is_arg_start--; + } + } + } else + $is_arg_start = $i-1; + /* Construct the argument for 'is' expression, so it knows + what to operate on. */ + $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start)); + + /* Pass all tokens from next one until the end to the + 'is' expression parsing function. The function will + return modified tokens, where the first one is the result + of the 'is' expression and the rest are the tokens it + didn't touch. */ + $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1)); + + /* Replace the old tokens with the new ones. */ + array_splice($tokens, $is_arg_start, count($tokens), $new_tokens); + + /* Adjust argument start so that it won't change from the + current position for the next iteration. */ + $i = $is_arg_start; + break; + + default: + if(preg_match('~^' . $this->_func_regexp . '$~', $token) ) { + // function call + if($this->security && + !in_array($token, $this->security_settings['IF_FUNCS'])) { + $this->_syntax_error("(secure mode) '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__); + } + } elseif(preg_match('~^' . $this->_var_regexp . '$~', $token) && (strpos('+-*/^%&|', substr($token, -1)) === false) && isset($tokens[$i+1]) && $tokens[$i+1] == '(') { + // variable function call + $this->_syntax_error("variable function call '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__); + } elseif(preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)$~', $token)) { + // object or variable + $token = $this->_parse_var_props($token); + } elseif(is_numeric($token)) { + // number, skip it + } else { + $this->_syntax_error("unidentified token '$token'", E_USER_ERROR, __FILE__, __LINE__); + } + break; + } + } + + if ($elseif) + return ''; + else + return ''; + } + + + function _compile_arg_list($type, $name, $attrs, &$cache_code) { + $arg_list = array(); + + if (isset($type) && isset($name) + && isset($this->_plugins[$type]) + && isset($this->_plugins[$type][$name]) + && empty($this->_plugins[$type][$name][4]) + && is_array($this->_plugins[$type][$name][5]) + ) { + /* we have a list of parameters that should be cached */ + $_cache_attrs = $this->_plugins[$type][$name][5]; + $_count = $this->_cache_attrs_count++; + $cache_code = "\$_cache_attrs =& \$this->_smarty_cache_attrs('$this->_cache_serial','$_count');"; + + } else { + /* no parameters are cached */ + $_cache_attrs = null; + } + + foreach ($attrs as $arg_name => $arg_value) { + if (is_bool($arg_value)) + $arg_value = $arg_value ? 'true' : 'false'; + if (is_null($arg_value)) + $arg_value = 'null'; + if ($_cache_attrs && in_array($arg_name, $_cache_attrs)) { + $arg_list[] = "'$arg_name' => (\$this->_cache_including) ? \$_cache_attrs['$arg_name'] : (\$_cache_attrs['$arg_name']=$arg_value)"; + } else { + $arg_list[] = "'$arg_name' => $arg_value"; + } + } + return $arg_list; + } + + /** + * Parse is expression + * + * @param string $is_arg + * @param array $tokens + * @return array + */ + function _parse_is_expr($is_arg, $tokens) + { + $expr_end = 0; + $negate_expr = false; + + if (($first_token = array_shift($tokens)) == 'not') { + $negate_expr = true; + $expr_type = array_shift($tokens); + } else + $expr_type = $first_token; + + switch ($expr_type) { + case 'even': + if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { + $expr_end++; + $expr_arg = $tokens[$expr_end++]; + $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; + } else + $expr = "!(1 & $is_arg)"; + break; + + case 'odd': + if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { + $expr_end++; + $expr_arg = $tokens[$expr_end++]; + $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; + } else + $expr = "(1 & $is_arg)"; + break; + + case 'div': + if (@$tokens[$expr_end] == 'by') { + $expr_end++; + $expr_arg = $tokens[$expr_end++]; + $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")"; + } else { + $this->_syntax_error("expecting 'by' after 'div'", E_USER_ERROR, __FILE__, __LINE__); + } + break; + + default: + $this->_syntax_error("unknown 'is' expression - '$expr_type'", E_USER_ERROR, __FILE__, __LINE__); + break; + } + + if ($negate_expr) { + $expr = "!($expr)"; + } + + array_splice($tokens, 0, $expr_end, $expr); + + return $tokens; + } + + + /** + * Parse attribute string + * + * @param string $tag_args + * @return array + */ + function _parse_attrs($tag_args) + { + + /* Tokenize tag attributes. */ + preg_match_all('~(?:' . $this->_obj_call_regexp . '|' . $this->_qstr_regexp . ' | (?>[^"\'=\s]+) + )+ | + [=] + ~x', $tag_args, $match); + $tokens = $match[0]; + + $attrs = array(); + /* Parse state: + 0 - expecting attribute name + 1 - expecting '=' + 2 - expecting attribute value (not '=') */ + $state = 0; + + foreach ($tokens as $token) { + switch ($state) { + case 0: + /* If the token is a valid identifier, we set attribute name + and go to state 1. */ + if (preg_match('~^\w+$~', $token)) { + $attr_name = $token; + $state = 1; + } else + $this->_syntax_error("invalid attribute name: '$token'", E_USER_ERROR, __FILE__, __LINE__); + break; + + case 1: + /* If the token is '=', then we go to state 2. */ + if ($token == '=') { + $state = 2; + } else + $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__); + break; + + case 2: + /* If token is not '=', we set the attribute value and go to + state 0. */ + if ($token != '=') { + /* We booleanize the token if it's a non-quoted possible + boolean value. */ + if (preg_match('~^(on|yes|true)$~', $token)) { + $token = 'true'; + } else if (preg_match('~^(off|no|false)$~', $token)) { + $token = 'false'; + } else if ($token == 'null') { + $token = 'null'; + } else if (preg_match('~^' . $this->_num_const_regexp . '|0[xX][0-9a-fA-F]+$~', $token)) { + /* treat integer literally */ + } else if (!preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . ')*$~', $token)) { + /* treat as a string, double-quote it escaping quotes */ + $token = '"'.addslashes($token).'"'; + } + + $attrs[$attr_name] = $token; + $state = 0; + } else + $this->_syntax_error("'=' cannot be an attribute value", E_USER_ERROR, __FILE__, __LINE__); + break; + } + $last_token = $token; + } + + if($state != 0) { + if($state == 1) { + $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__); + } else { + $this->_syntax_error("missing attribute value", E_USER_ERROR, __FILE__, __LINE__); + } + } + + $this->_parse_vars_props($attrs); + + return $attrs; + } + + /** + * compile multiple variables and section properties tokens into + * PHP code + * + * @param array $tokens + */ + function _parse_vars_props(&$tokens) + { + foreach($tokens as $key => $val) { + $tokens[$key] = $this->_parse_var_props($val); + } + } + + /** + * compile single variable and section properties token into + * PHP code + * + * @param string $val + * @param string $tag_attrs + * @return string + */ + function _parse_var_props($val) + { + $val = trim($val); + + if(preg_match('~^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$~', $val, $match)) { + // $ variable or object + $return = $this->_parse_var($match[1]); + $modifiers = $match[2]; + if (!empty($this->default_modifiers) && !preg_match('~(^|\|)smarty:nodefaults($|\|)~',$modifiers)) { + $_default_mod_string = implode('|',(array)$this->default_modifiers); + $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers; + } + $this->_parse_modifiers($return, $modifiers); + return $return; + } elseif (preg_match('~^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { + // double quoted text + preg_match('~^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match); + $return = $this->_expand_quoted_text($match[1]); + if($match[2] != '') { + $this->_parse_modifiers($return, $match[2]); + } + return $return; + } + elseif(preg_match('~^' . $this->_num_const_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { + // numerical constant + preg_match('~^(' . $this->_num_const_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match); + if($match[2] != '') { + $this->_parse_modifiers($match[1], $match[2]); + return $match[1]; + } + } + elseif(preg_match('~^' . $this->_si_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { + // single quoted text + preg_match('~^(' . $this->_si_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match); + if($match[2] != '') { + $this->_parse_modifiers($match[1], $match[2]); + return $match[1]; + } + } + elseif(preg_match('~^' . $this->_cvar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { + // config var + return $this->_parse_conf_var($val); + } + elseif(preg_match('~^' . $this->_svar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { + // section var + return $this->_parse_section_prop($val); + } + elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) { + // literal string + return $this->_expand_quoted_text('"' . strtr($val, array('\\' => '\\\\', '"' => '\\"')) .'"'); + } + return $val; + } + + /** + * expand quoted text with embedded variables + * + * @param string $var_expr + * @return string + */ + function _expand_quoted_text($var_expr) + { + // if contains unescaped $, expand it + if(preg_match_all('~(?:\`(?_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?_parse_var(str_replace('`','',$_var)) . ')."'; + } + $var_expr = strtr($var_expr, $_replace); + $_return = preg_replace('~\.""|(?_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_SPLIT_DELIM_CAPTURE); + + if(count($_math_vars) > 1) { + $_first_var = ""; + $_complete_var = ""; + $_output = ""; + // simple check if there is any math, to stop recursion (due to modifiers with "xx % yy" as parameter) + foreach($_math_vars as $_k => $_math_var) { + $_math_var = $_math_vars[$_k]; + + if(!empty($_math_var) || is_numeric($_math_var)) { + // hit a math operator, so process the stuff which came before it + if(preg_match('~^' . $this->_dvar_math_regexp . '$~', $_math_var)) { + $_has_math = true; + if(!empty($_complete_var) || is_numeric($_complete_var)) { + $_output .= $this->_parse_var($_complete_var); + } + + // just output the math operator to php + $_output .= $_math_var; + + if(empty($_first_var)) + $_first_var = $_complete_var; + + $_complete_var = ""; + } else { + $_complete_var .= $_math_var; + } + } + } + if($_has_math) { + if(!empty($_complete_var) || is_numeric($_complete_var)) + $_output .= $this->_parse_var($_complete_var); + + // get the modifiers working (only the last var from math + modifier is left) + $var_expr = $_complete_var; + } + } + + // prevent cutting of first digit in the number (we _definitly_ got a number if the first char is a digit) + if(is_numeric(substr($var_expr, 0, 1))) + $_var_ref = $var_expr; + else + $_var_ref = substr($var_expr, 1); + + if(!$_has_math) { + + // get [foo] and .foo and ->foo and (...) pieces + preg_match_all('~(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+~', $_var_ref, $match); + + $_indexes = $match[0]; + $_var_name = array_shift($_indexes); + + /* Handle $smarty.* variable references as a special case. */ + if ($_var_name == 'smarty') { + /* + * If the reference could be compiled, use the compiled output; + * otherwise, fall back on the $smarty variable generated at + * run-time. + */ + if (($smarty_ref = $this->_compile_smarty_ref($_indexes)) !== null) { + $_output = $smarty_ref; + } else { + $_var_name = substr(array_shift($_indexes), 1); + $_output = "\$this->_smarty_vars['$_var_name']"; + } + } elseif(is_numeric($_var_name) && is_numeric(substr($var_expr, 0, 1))) { + // because . is the operator for accessing arrays thru inidizes we need to put it together again for floating point numbers + if(count($_indexes) > 0) + { + $_var_name .= implode("", $_indexes); + $_indexes = array(); + } + $_output = $_var_name; + } else { + $_output = "\$this->_tpl_vars['$_var_name']"; + } + + foreach ($_indexes as $_index) { + if (substr($_index, 0, 1) == '[') { + $_index = substr($_index, 1, -1); + if (is_numeric($_index)) { + $_output .= "[$_index]"; + } elseif (substr($_index, 0, 1) == '$') { + if (strpos($_index, '.') !== false) { + $_output .= '[' . $this->_parse_var($_index) . ']'; + } else { + $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]"; + } + } else { + $_var_parts = explode('.', $_index); + $_var_section = $_var_parts[0]; + $_var_section_prop = isset($_var_parts[1]) ? $_var_parts[1] : 'index'; + $_output .= "[\$this->_sections['$_var_section']['$_var_section_prop']]"; + } + } else if (substr($_index, 0, 1) == '.') { + if (substr($_index, 1, 1) == '$') + $_output .= "[\$this->_tpl_vars['" . substr($_index, 2) . "']]"; + else + $_output .= "['" . substr($_index, 1) . "']"; + } else if (substr($_index,0,2) == '->') { + if(substr($_index,2,2) == '__') { + $this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__); + } elseif($this->security && substr($_index, 2, 1) == '_') { + $this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__); + } elseif (substr($_index, 2, 1) == '$') { + if ($this->security) { + $this->_syntax_error('(secure) call to dynamic object member is not allowed', E_USER_ERROR, __FILE__, __LINE__); + } else { + $_output .= '->{(($_var=$this->_tpl_vars[\''.substr($_index,3).'\']) && substr($_var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$_var\\"")}'; + } + } else { + if ($this->_phpversion < 5) { + $_has_php4_method_chaining = true; + $_output .= "; \$_foo = \$_foo"; + } + $_output .= $_index; + } + } elseif (substr($_index, 0, 1) == '(') { + $_index = $this->_parse_parenth_args($_index); + $_output .= $_index; + } else { + $_output .= $_index; + } + } + } + + if ($_has_php4_method_chaining) { + $_tmp = str_replace("'","\'",'$_foo = '.$_output.'; return $_foo;'); + return "eval('".$_tmp."')"; + } else { + return $_output; + } + } + + /** + * parse arguments in function call parenthesis + * + * @param string $parenth_args + * @return string + */ + function _parse_parenth_args($parenth_args) + { + preg_match_all('~' . $this->_param_regexp . '~',$parenth_args, $match); + $orig_vals = $match = $match[0]; + $this->_parse_vars_props($match); + $replace = array(); + for ($i = 0, $count = count($match); $i < $count; $i++) { + $replace[$orig_vals[$i]] = $match[$i]; + } + return strtr($parenth_args, $replace); + } + + /** + * parse configuration variable expression into PHP code + * + * @param string $conf_var_expr + */ + function _parse_conf_var($conf_var_expr) + { + $parts = explode('|', $conf_var_expr, 2); + $var_ref = $parts[0]; + $modifiers = isset($parts[1]) ? $parts[1] : ''; + + $var_name = substr($var_ref, 1, -1); + + $output = "\$this->_config[0]['vars']['$var_name']"; + + $this->_parse_modifiers($output, $modifiers); + + return $output; + } + + /** + * parse section property expression into PHP code + * + * @param string $section_prop_expr + * @return string + */ + function _parse_section_prop($section_prop_expr) + { + $parts = explode('|', $section_prop_expr, 2); + $var_ref = $parts[0]; + $modifiers = isset($parts[1]) ? $parts[1] : ''; + + preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match); + $section_name = $match[1]; + $prop_name = $match[2]; + + $output = "\$this->_sections['$section_name']['$prop_name']"; + + $this->_parse_modifiers($output, $modifiers); + + return $output; + } + + + /** + * parse modifier chain into PHP code + * + * sets $output to parsed modified chain + * @param string $output + * @param string $modifier_string + */ + function _parse_modifiers(&$output, $modifier_string) + { + preg_match_all('~\|(@?\w+)((?>:(?:'. $this->_qstr_regexp . '|[^|]+))*)~', '|' . $modifier_string, $_match); + list(, $_modifiers, $modifier_arg_strings) = $_match; + + for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) { + $_modifier_name = $_modifiers[$_i]; + + if($_modifier_name == 'smarty') { + // skip smarty modifier + continue; + } + + preg_match_all('~:(' . $this->_qstr_regexp . '|[^:]+)~', $modifier_arg_strings[$_i], $_match); + $_modifier_args = $_match[1]; + + if (substr($_modifier_name, 0, 1) == '@') { + $_map_array = false; + $_modifier_name = substr($_modifier_name, 1); + } else { + $_map_array = true; + } + + if (empty($this->_plugins['modifier'][$_modifier_name]) + && !$this->_get_plugin_filepath('modifier', $_modifier_name) + && function_exists($_modifier_name)) { + if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) { + $this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__); + } else { + $this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false); + } + } + $this->_add_plugin('modifier', $_modifier_name); + + $this->_parse_vars_props($_modifier_args); + + if($_modifier_name == 'default') { + // supress notifications of default modifier vars and args + if(substr($output, 0, 1) == '$') { + $output = '@' . $output; + } + if(isset($_modifier_args[0]) && substr($_modifier_args[0], 0, 1) == '$') { + $_modifier_args[0] = '@' . $_modifier_args[0]; + } + } + if (count($_modifier_args) > 0) + $_modifier_args = ', '.implode(', ', $_modifier_args); + else + $_modifier_args = ''; + + if ($_map_array) { + $output = "((is_array(\$_tmp=$output)) ? \$this->_run_mod_handler('$_modifier_name', true, \$_tmp$_modifier_args) : " . $this->_compile_plugin_call('modifier', $_modifier_name) . "(\$_tmp$_modifier_args))"; + + } else { + + $output = $this->_compile_plugin_call('modifier', $_modifier_name)."($output$_modifier_args)"; + + } + } + } + + + /** + * add plugin + * + * @param string $type + * @param string $name + * @param boolean? $delayed_loading + */ + function _add_plugin($type, $name, $delayed_loading = null) + { + if (!isset($this->_plugin_info[$type])) { + $this->_plugin_info[$type] = array(); + } + if (!isset($this->_plugin_info[$type][$name])) { + $this->_plugin_info[$type][$name] = array($this->_current_file, + $this->_current_line_no, + $delayed_loading); + } + } + + + /** + * Compiles references of type $smarty.foo + * + * @param string $indexes + * @return string + */ + function _compile_smarty_ref(&$indexes) + { + /* Extract the reference name. */ + $_ref = substr($indexes[0], 1); + foreach($indexes as $_index_no=>$_index) { + if (substr($_index, 0, 1) != '.' && $_index_no<2 || !preg_match('~^(\.|\[|->)~', $_index)) { + $this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__); + } + } + + switch ($_ref) { + case 'now': + $compiled_ref = 'time()'; + $_max_index = 1; + break; + + case 'foreach': + array_shift($indexes); + $_var = $this->_parse_var_props(substr($indexes[0], 1)); + $_propname = substr($indexes[1], 1); + $_max_index = 1; + switch ($_propname) { + case 'index': + array_shift($indexes); + $compiled_ref = "(\$this->_foreach[$_var]['iteration']-1)"; + break; + + case 'first': + array_shift($indexes); + $compiled_ref = "(\$this->_foreach[$_var]['iteration'] <= 1)"; + break; + + case 'last': + array_shift($indexes); + $compiled_ref = "(\$this->_foreach[$_var]['iteration'] == \$this->_foreach[$_var]['total'])"; + break; + + case 'show': + array_shift($indexes); + $compiled_ref = "(\$this->_foreach[$_var]['total'] > 0)"; + break; + + default: + unset($_max_index); + $compiled_ref = "\$this->_foreach[$_var]"; + } + break; + + case 'section': + array_shift($indexes); + $_var = $this->_parse_var_props(substr($indexes[0], 1)); + $compiled_ref = "\$this->_sections[$_var]"; + break; + + case 'get': + $compiled_ref = ($this->request_use_auto_globals) ? '$_GET' : "\$GLOBALS['HTTP_GET_VARS']"; + break; + + case 'post': + $compiled_ref = ($this->request_use_auto_globals) ? '$_POST' : "\$GLOBALS['HTTP_POST_VARS']"; + break; + + case 'cookies': + $compiled_ref = ($this->request_use_auto_globals) ? '$_COOKIE' : "\$GLOBALS['HTTP_COOKIE_VARS']"; + break; + + case 'env': + $compiled_ref = ($this->request_use_auto_globals) ? '$_ENV' : "\$GLOBALS['HTTP_ENV_VARS']"; + break; + + case 'server': + $compiled_ref = ($this->request_use_auto_globals) ? '$_SERVER' : "\$GLOBALS['HTTP_SERVER_VARS']"; + break; + + case 'session': + $compiled_ref = ($this->request_use_auto_globals) ? '$_SESSION' : "\$GLOBALS['HTTP_SESSION_VARS']"; + break; + + /* + * These cases are handled either at run-time or elsewhere in the + * compiler. + */ + case 'request': + if ($this->request_use_auto_globals) { + $compiled_ref = '$_REQUEST'; + break; + } else { + $this->_init_smarty_vars = true; + } + return null; + + case 'capture': + return null; + + case 'template': + $compiled_ref = "'$this->_current_file'"; + $_max_index = 1; + break; + + case 'version': + $compiled_ref = "'$this->_version'"; + $_max_index = 1; + break; + + case 'const': + if ($this->security && !$this->security_settings['ALLOW_CONSTANTS']) { + $this->_syntax_error("(secure mode) constants not permitted", + E_USER_WARNING, __FILE__, __LINE__); + return; + } + array_shift($indexes); + if (preg_match('!^\.\w+$!', $indexes[0])) { + $compiled_ref = '@' . substr($indexes[0], 1); + } else { + $_val = $this->_parse_var_props(substr($indexes[0], 1)); + $compiled_ref = '@constant(' . $_val . ')'; + } + $_max_index = 1; + break; + + case 'config': + $compiled_ref = "\$this->_config[0]['vars']"; + $_max_index = 3; + break; + + case 'ldelim': + $compiled_ref = "'$this->left_delimiter'"; + break; + + case 'rdelim': + $compiled_ref = "'$this->right_delimiter'"; + break; + + default: + $this->_syntax_error('$smarty.' . $_ref . ' is an unknown reference', E_USER_ERROR, __FILE__, __LINE__); + break; + } + + if (isset($_max_index) && count($indexes) > $_max_index) { + $this->_syntax_error('$smarty' . implode('', $indexes) .' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__); + } + + array_shift($indexes); + return $compiled_ref; + } + + /** + * compiles call to plugin of type $type with name $name + * returns a string containing the function-name or method call + * without the paramter-list that would have follow to make the + * call valid php-syntax + * + * @param string $type + * @param string $name + * @return string + */ + function _compile_plugin_call($type, $name) { + if (isset($this->_plugins[$type][$name])) { + /* plugin loaded */ + if (is_array($this->_plugins[$type][$name][0])) { + return ((is_object($this->_plugins[$type][$name][0][0])) ? + "\$this->_plugins['$type']['$name'][0][0]->" /* method callback */ + : (string)($this->_plugins[$type][$name][0][0]).'::' /* class callback */ + ). $this->_plugins[$type][$name][0][1]; + + } else { + /* function callback */ + return $this->_plugins[$type][$name][0]; + + } + } else { + /* plugin not loaded -> auto-loadable-plugin */ + return 'smarty_'.$type.'_'.$name; + + } + } + + /** + * load pre- and post-filters + */ + function _load_filters() + { + if (count($this->_plugins['prefilter']) > 0) { + foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) { + if ($prefilter === false) { + unset($this->_plugins['prefilter'][$filter_name]); + $_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false))); + require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); + smarty_core_load_plugins($_params, $this); + } + } + } + if (count($this->_plugins['postfilter']) > 0) { + foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) { + if ($postfilter === false) { + unset($this->_plugins['postfilter'][$filter_name]); + $_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false))); + require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); + smarty_core_load_plugins($_params, $this); + } + } + } + } + + + /** + * Quote subpattern references + * + * @param string $string + * @return string + */ + function _quote_replace($string) + { + return strtr($string, array('\\' => '\\\\', '$' => '\\$')); + } + + /** + * display Smarty syntax error + * + * @param string $error_msg + * @param integer $error_type + * @param string $file + * @param integer $line + */ + function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null) + { + $this->_trigger_fatal_error("syntax error: $error_msg", $this->_current_file, $this->_current_line_no, $file, $line, $error_type); + } + + + /** + * check if the compilation changes from cacheable to + * non-cacheable state with the beginning of the current + * plugin. return php-code to reflect the transition. + * @return string + */ + function _push_cacheable_state($type, $name) { + $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4]; + if ($_cacheable + || 0<$this->_cacheable_state++) return ''; + if (!isset($this->_cache_serial)) $this->_cache_serial = md5(uniqid('Smarty')); + $_ret = 'if ($this->caching && !$this->_cache_including): echo \'{nocache:' + . $this->_cache_serial . '#' . $this->_nocache_count + . '}\'; endif;'; + return $_ret; + } + + + /** + * check if the compilation changes from non-cacheable to + * cacheable state with the end of the current plugin return + * php-code to reflect the transition. + * @return string + */ + function _pop_cacheable_state($type, $name) { + $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4]; + if ($_cacheable + || --$this->_cacheable_state>0) return ''; + return 'if ($this->caching && !$this->_cache_including): echo \'{/nocache:' + . $this->_cache_serial . '#' . ($this->_nocache_count++) + . '}\'; endif;'; + } + + + /** + * push opening tag-name, file-name and line-number on the tag-stack + * @param string the opening tag's name + */ + function _push_tag($open_tag) + { + array_push($this->_tag_stack, array($open_tag, $this->_current_line_no)); + } + + /** + * pop closing tag-name + * raise an error if this stack-top doesn't match with the closing tag + * @param string the closing tag's name + * @return string the opening tag's name + */ + function _pop_tag($close_tag) + { + $message = ''; + if (count($this->_tag_stack)>0) { + list($_open_tag, $_line_no) = array_pop($this->_tag_stack); + if ($close_tag == $_open_tag) { + return $_open_tag; + } + if ($close_tag == 'if' && ($_open_tag == 'else' || $_open_tag == 'elseif' )) { + return $this->_pop_tag($close_tag); + } + if ($close_tag == 'section' && $_open_tag == 'sectionelse') { + $this->_pop_tag($close_tag); + return $_open_tag; + } + if ($close_tag == 'foreach' && $_open_tag == 'foreachelse') { + $this->_pop_tag($close_tag); + return $_open_tag; + } + if ($_open_tag == 'else' || $_open_tag == 'elseif') { + $_open_tag = 'if'; + } elseif ($_open_tag == 'sectionelse') { + $_open_tag = 'section'; + } elseif ($_open_tag == 'foreachelse') { + $_open_tag = 'foreach'; + } + $message = " expected {/$_open_tag} (opened line $_line_no)."; + } + $this->_syntax_error("mismatched tag {/$close_tag}.$message", + E_USER_ERROR, __FILE__, __LINE__); + } + +} + +/** + * compare to values by their string length + * + * @access private + * @param string $a + * @param string $b + * @return 0|-1|1 + */ +function _smarty_sort_length($a, $b) +{ + if($a == $b) + return 0; + + if(strlen($a) == strlen($b)) + return ($a > $b) ? -1 : 1; + + return (strlen($a) > strlen($b)) ? -1 : 1; +} + + +/* vim: set et: */ + +?> diff --git a/system/libs/smarty/debug.tpl b/system/libs/smarty/debug.tpl new file mode 100755 index 0000000..c05ef5d --- /dev/null +++ b/system/libs/smarty/debug.tpl @@ -0,0 +1,157 @@ +{* Smarty *} +{* debug.tpl, last updated version 2.1.0 *} +{assign_debug_info} +{capture assign=debug_output} + + + + Smarty Debug Console +{literal} + +{/literal} + + + +

Smarty Debug Console

+ +

included templates & config files (load time in seconds)

+ +
+{section name=templates loop=$_debug_tpls} + {section name=indent loop=$_debug_tpls[templates].depth}   {/section} + + {$_debug_tpls[templates].filename|escape:html} + {if isset($_debug_tpls[templates].exec_time)} + + ({$_debug_tpls[templates].exec_time|string_format:"%.5f"}) + {if %templates.index% eq 0}(total){/if} + + {/if} +
+{sectionelse} +

no templates included

+{/section} +
+ +

assigned template variables

+ + + {section name=vars loop=$_debug_keys} + + + + {sectionelse} + + {/section} +
{ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}{$_debug_vals[vars]|@debug_print_var}

no template variables assigned

+ +

assigned config file variables (outer template scope)

+ + + {section name=config_vars loop=$_debug_config_keys} + + + + {sectionelse} + + {/section} +
{ldelim}#{$_debug_config_keys[config_vars]|escape:'html'}#{rdelim}{$_debug_config_vals[config_vars]|@debug_print_var}

no config vars assigned

+ + +{/capture} +{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"} + {$debug_output} +{else} + +{/if} \ No newline at end of file diff --git a/system/libs/smarty/demo/configs/test.conf b/system/libs/smarty/demo/configs/test.conf new file mode 100755 index 0000000..5eac748 --- /dev/null +++ b/system/libs/smarty/demo/configs/test.conf @@ -0,0 +1,5 @@ +title = Welcome to Smarty! +cutoff_size = 40 + +[setup] +bold = true diff --git a/system/libs/smarty/demo/index.php b/system/libs/smarty/demo/index.php new file mode 100755 index 0000000..fee202f --- /dev/null +++ b/system/libs/smarty/demo/index.php @@ -0,0 +1,25 @@ +compile_check = true; +$smarty->debugging = true; + +$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill"); +$smarty->assign("FirstName",array("John","Mary","James","Henry")); +$smarty->assign("LastName",array("Doe","Smith","Johnson","Case")); +$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"), + array("I", "J", "K", "L"), array("M", "N", "O", "P"))); + +$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), + array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); + +$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX")); +$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas")); +$smarty->assign("option_selected", "NE"); + +$smarty->display('index.tpl'); + +?> diff --git a/system/libs/smarty/demo/templates/footer.tpl b/system/libs/smarty/demo/templates/footer.tpl new file mode 100755 index 0000000..e04310f --- /dev/null +++ b/system/libs/smarty/demo/templates/footer.tpl @@ -0,0 +1,2 @@ + + diff --git a/system/libs/smarty/demo/templates/header.tpl b/system/libs/smarty/demo/templates/header.tpl new file mode 100755 index 0000000..af8f613 --- /dev/null +++ b/system/libs/smarty/demo/templates/header.tpl @@ -0,0 +1,6 @@ + + +{popup_init src="/javascripts/overlib.js"} +{$title} - {$Name} + + diff --git a/system/libs/smarty/demo/templates/index.tpl b/system/libs/smarty/demo/templates/index.tpl new file mode 100755 index 0000000..39b0cea --- /dev/null +++ b/system/libs/smarty/demo/templates/index.tpl @@ -0,0 +1,81 @@ +{config_load file=test.conf section="setup"} +{include file="header.tpl" title=foo} + +
+
+{* bold and title are read from the config file *}
+{if #bold#}{/if}
+{* capitalize the first letters of each word of the title *}
+Title: {#title#|capitalize}
+{if #bold#}{/if}
+
+The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
+
+The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
+
+Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
+
+The value of {ldelim}$Name{rdelim} is {$Name}
+
+variable modifier example of {ldelim}$Name|upper{rdelim}
+
+{$Name|upper}
+
+
+An example of a section loop:
+
+{section name=outer loop=$FirstName}
+{if $smarty.section.outer.index is odd by 2}
+	{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
+{else}
+	{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
+{/if}
+{sectionelse}
+	none
+{/section}
+
+An example of section looped key values:
+
+{section name=sec1 loop=$contacts}
+	phone: {$contacts[sec1].phone}
+ fax: {$contacts[sec1].fax}
+ cell: {$contacts[sec1].cell}
+{/section} +

+ +testing strip tags +{strip} + + + + +
+ + This is a test + +
+{/strip} + +

+ +This is an example of the html_select_date function: + +
+{html_select_date start_year=1998 end_year=2010} +
+ +This is an example of the html_select_time function: + +
+{html_select_time use_24_hours=true} +
+ +This is an example of the html_options function: + +
+ +
+ +{include file="footer.tpl"} diff --git a/system/libs/smarty/demo/templates_c/%%0E^0E4^0E407559%%footer.tpl.php b/system/libs/smarty/demo/templates_c/%%0E^0E4^0E407559%%footer.tpl.php new file mode 100755 index 0000000..486fb6f --- /dev/null +++ b/system/libs/smarty/demo/templates_c/%%0E^0E4^0E407559%%footer.tpl.php @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/system/libs/smarty/demo/templates_c/%%15^15C^15C1795C%%test.conf%7Csetup.php b/system/libs/smarty/demo/templates_c/%%15^15C^15C1795C%%test.conf%7Csetup.php new file mode 100755 index 0000000..f7d0eb0 --- /dev/null +++ b/system/libs/smarty/demo/templates_c/%%15^15C^15C1795C%%test.conf%7Csetup.php @@ -0,0 +1,5 @@ + 'Welcome to Smarty!', + 'cutoff_size' => '40', + 'bold' => true, +); ?> \ No newline at end of file diff --git a/system/libs/smarty/demo/templates_c/%%45^45E^45E480CD%%index.tpl.php b/system/libs/smarty/demo/templates_c/%%45^45E^45E480CD%%index.tpl.php new file mode 100755 index 0000000..84414da --- /dev/null +++ b/system/libs/smarty/demo/templates_c/%%45^45E^45E480CD%%index.tpl.php @@ -0,0 +1,147 @@ + + array(array('function', 'config_load', 'index.tpl', 1, false),array('function', 'html_select_date', 'index.tpl', 64, false),array('function', 'html_select_time', 'index.tpl', 70, false),array('function', 'html_options', 'index.tpl', 77, false),array('modifier', 'capitalize', 'index.tpl', 9, false),array('modifier', 'date_format', 'index.tpl', 12, false),array('modifier', 'upper', 'index.tpl', 22, false),)), $this); ?> + "test.conf",'section' => 'setup'), $this);?> + +_tpl_vars; +$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array('title' => 'foo'))); +$this->_tpl_vars = $_smarty_tpl_vars; +unset($_smarty_tpl_vars); + ?> + +
+
+_config[0]['vars']['bold']): ?>
+Title: _config[0]['vars']['title'])) ? $this->_run_mod_handler('capitalize', true, $_tmp) : smarty_modifier_capitalize($_tmp)); ?>
+
+_config[0]['vars']['bold']): ?>
+
+The current date and time is _run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
+
+
+The value of global assigned variable $SCRIPT_NAME is _tpl_vars['SCRIPT_NAME']; ?>
+
+
+Example of accessing server environment variable SERVER_NAME: 
+
+
+The value of {$Name} is _tpl_vars['Name']; ?>
+
+
+variable modifier example of {$Name|upper}
+
+_tpl_vars['Name'])) ? $this->_run_mod_handler('upper', true, $_tmp) : smarty_modifier_upper($_tmp)); ?>
+
+
+
+An example of a section loop:
+
+_sections['outer']);
+$this->_sections['outer']['name'] = 'outer';
+$this->_sections['outer']['loop'] = is_array($_loop=$this->_tpl_vars['FirstName']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['outer']['show'] = true;
+$this->_sections['outer']['max'] = $this->_sections['outer']['loop'];
+$this->_sections['outer']['step'] = 1;
+$this->_sections['outer']['start'] = $this->_sections['outer']['step'] > 0 ? 0 : $this->_sections['outer']['loop']-1;
+if ($this->_sections['outer']['show']) {
+    $this->_sections['outer']['total'] = $this->_sections['outer']['loop'];
+    if ($this->_sections['outer']['total'] == 0)
+        $this->_sections['outer']['show'] = false;
+} else
+    $this->_sections['outer']['total'] = 0;
+if ($this->_sections['outer']['show']):
+
+            for ($this->_sections['outer']['index'] = $this->_sections['outer']['start'], $this->_sections['outer']['iteration'] = 1;
+                 $this->_sections['outer']['iteration'] <= $this->_sections['outer']['total'];
+                 $this->_sections['outer']['index'] += $this->_sections['outer']['step'], $this->_sections['outer']['iteration']++):
+$this->_sections['outer']['rownum'] = $this->_sections['outer']['iteration'];
+$this->_sections['outer']['index_prev'] = $this->_sections['outer']['index'] - $this->_sections['outer']['step'];
+$this->_sections['outer']['index_next'] = $this->_sections['outer']['index'] + $this->_sections['outer']['step'];
+$this->_sections['outer']['first']      = ($this->_sections['outer']['iteration'] == 1);
+$this->_sections['outer']['last']       = ($this->_sections['outer']['iteration'] == $this->_sections['outer']['total']);
+?>
+_sections['outer']['index'] / 2))): ?>
+	_sections['outer']['rownum']; ?>
+ . _tpl_vars['FirstName'][$this->_sections['outer']['index']]; ?>
+ _tpl_vars['LastName'][$this->_sections['outer']['index']]; ?>
+
+
+	_sections['outer']['rownum']; ?>
+ * _tpl_vars['FirstName'][$this->_sections['outer']['index']]; ?>
+ _tpl_vars['LastName'][$this->_sections['outer']['index']]; ?>
+
+
+
+	none
+
+
+An example of section looped key values:
+
+_sections['sec1']);
+$this->_sections['sec1']['name'] = 'sec1';
+$this->_sections['sec1']['loop'] = is_array($_loop=$this->_tpl_vars['contacts']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['sec1']['show'] = true;
+$this->_sections['sec1']['max'] = $this->_sections['sec1']['loop'];
+$this->_sections['sec1']['step'] = 1;
+$this->_sections['sec1']['start'] = $this->_sections['sec1']['step'] > 0 ? 0 : $this->_sections['sec1']['loop']-1;
+if ($this->_sections['sec1']['show']) {
+    $this->_sections['sec1']['total'] = $this->_sections['sec1']['loop'];
+    if ($this->_sections['sec1']['total'] == 0)
+        $this->_sections['sec1']['show'] = false;
+} else
+    $this->_sections['sec1']['total'] = 0;
+if ($this->_sections['sec1']['show']):
+
+            for ($this->_sections['sec1']['index'] = $this->_sections['sec1']['start'], $this->_sections['sec1']['iteration'] = 1;
+                 $this->_sections['sec1']['iteration'] <= $this->_sections['sec1']['total'];
+                 $this->_sections['sec1']['index'] += $this->_sections['sec1']['step'], $this->_sections['sec1']['iteration']++):
+$this->_sections['sec1']['rownum'] = $this->_sections['sec1']['iteration'];
+$this->_sections['sec1']['index_prev'] = $this->_sections['sec1']['index'] - $this->_sections['sec1']['step'];
+$this->_sections['sec1']['index_next'] = $this->_sections['sec1']['index'] + $this->_sections['sec1']['step'];
+$this->_sections['sec1']['first']      = ($this->_sections['sec1']['iteration'] == 1);
+$this->_sections['sec1']['last']       = ($this->_sections['sec1']['iteration'] == $this->_sections['sec1']['total']);
+?>
+	phone: _tpl_vars['contacts'][$this->_sections['sec1']['index']]['phone']; ?>
+
+ fax: _tpl_vars['contacts'][$this->_sections['sec1']['index']]['fax']; ?> +
+ cell: _tpl_vars['contacts'][$this->_sections['sec1']['index']]['cell']; ?> +
+ +

+ +testing strip tags +This is a test '; ?> + + +

+ +This is an example of the html_select_date function: + +
+ 1998,'end_year' => 2010), $this);?> + +
+ +This is an example of the html_select_time function: + +
+ true), $this);?> + +
+ +This is an example of the html_options function: + +
+ +
+ +_tpl_vars; +$this->_smarty_include(array('smarty_include_tpl_file' => "footer.tpl", 'smarty_include_vars' => array())); +$this->_tpl_vars = $_smarty_tpl_vars; +unset($_smarty_tpl_vars); + ?> \ No newline at end of file diff --git a/system/libs/smarty/demo/templates_c/%%5A^5AE^5AE3C49A%%debug.tpl.php b/system/libs/smarty/demo/templates_c/%%5A^5AE^5AE3C49A%%debug.tpl.php new file mode 100755 index 0000000..881aa5c --- /dev/null +++ b/system/libs/smarty/demo/templates_c/%%5A^5AE^5AE3C49A%%debug.tpl.php @@ -0,0 +1,263 @@ + + array(array('function', 'assign_debug_info', 'file:/data/www/dev.verygames.net/htdocs/lib/smarty/libs/debug.tpl', 3, false),array('function', 'cycle', 'file:/data/www/dev.verygames.net/htdocs/lib/smarty/libs/debug.tpl', 119, false),array('modifier', 'escape', 'file:/data/www/dev.verygames.net/htdocs/lib/smarty/libs/debug.tpl', 102, false),array('modifier', 'string_format', 'file:/data/www/dev.verygames.net/htdocs/lib/smarty/libs/debug.tpl', 105, false),array('modifier', 'debug_print_var', 'file:/data/www/dev.verygames.net/htdocs/lib/smarty/libs/debug.tpl', 121, false),)), $this); ?> + + + + + + + Smarty Debug Console + +/* */ + +'; ?> + + + + +

Smarty Debug Console

+ +

included templates & config files (load time in seconds)

+ +
+_sections['templates']); +$this->_sections['templates']['name'] = 'templates'; +$this->_sections['templates']['loop'] = is_array($_loop=$this->_tpl_vars['_debug_tpls']) ? count($_loop) : max(0, (int)$_loop); unset($_loop); +$this->_sections['templates']['show'] = true; +$this->_sections['templates']['max'] = $this->_sections['templates']['loop']; +$this->_sections['templates']['step'] = 1; +$this->_sections['templates']['start'] = $this->_sections['templates']['step'] > 0 ? 0 : $this->_sections['templates']['loop']-1; +if ($this->_sections['templates']['show']) { + $this->_sections['templates']['total'] = $this->_sections['templates']['loop']; + if ($this->_sections['templates']['total'] == 0) + $this->_sections['templates']['show'] = false; +} else + $this->_sections['templates']['total'] = 0; +if ($this->_sections['templates']['show']): + + for ($this->_sections['templates']['index'] = $this->_sections['templates']['start'], $this->_sections['templates']['iteration'] = 1; + $this->_sections['templates']['iteration'] <= $this->_sections['templates']['total']; + $this->_sections['templates']['index'] += $this->_sections['templates']['step'], $this->_sections['templates']['iteration']++): +$this->_sections['templates']['rownum'] = $this->_sections['templates']['iteration']; +$this->_sections['templates']['index_prev'] = $this->_sections['templates']['index'] - $this->_sections['templates']['step']; +$this->_sections['templates']['index_next'] = $this->_sections['templates']['index'] + $this->_sections['templates']['step']; +$this->_sections['templates']['first'] = ($this->_sections['templates']['iteration'] == 1); +$this->_sections['templates']['last'] = ($this->_sections['templates']['iteration'] == $this->_sections['templates']['total']); +?> + _sections['indent']); +$this->_sections['indent']['name'] = 'indent'; +$this->_sections['indent']['loop'] = is_array($_loop=$this->_tpl_vars['_debug_tpls'][$this->_sections['templates']['index']]['depth']) ? count($_loop) : max(0, (int)$_loop); unset($_loop); +$this->_sections['indent']['show'] = true; +$this->_sections['indent']['max'] = $this->_sections['indent']['loop']; +$this->_sections['indent']['step'] = 1; +$this->_sections['indent']['start'] = $this->_sections['indent']['step'] > 0 ? 0 : $this->_sections['indent']['loop']-1; +if ($this->_sections['indent']['show']) { + $this->_sections['indent']['total'] = $this->_sections['indent']['loop']; + if ($this->_sections['indent']['total'] == 0) + $this->_sections['indent']['show'] = false; +} else + $this->_sections['indent']['total'] = 0; +if ($this->_sections['indent']['show']): + + for ($this->_sections['indent']['index'] = $this->_sections['indent']['start'], $this->_sections['indent']['iteration'] = 1; + $this->_sections['indent']['iteration'] <= $this->_sections['indent']['total']; + $this->_sections['indent']['index'] += $this->_sections['indent']['step'], $this->_sections['indent']['iteration']++): +$this->_sections['indent']['rownum'] = $this->_sections['indent']['iteration']; +$this->_sections['indent']['index_prev'] = $this->_sections['indent']['index'] - $this->_sections['indent']['step']; +$this->_sections['indent']['index_next'] = $this->_sections['indent']['index'] + $this->_sections['indent']['step']; +$this->_sections['indent']['first'] = ($this->_sections['indent']['iteration'] == 1); +$this->_sections['indent']['last'] = ($this->_sections['indent']['iteration'] == $this->_sections['indent']['total']); +?>    + _tpl_vars['_debug_tpls'][$this->_sections['templates']['index']]['type'] == 'template'): ?>brown_tpl_vars['_debug_tpls'][$this->_sections['templates']['index']]['type'] == 'insert'): ?>blackgreen> + _tpl_vars['_debug_tpls'][$this->_sections['templates']['index']]['filename'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> + + _tpl_vars['_debug_tpls'][$this->_sections['templates']['index']]['exec_time'] )): ?> + + (_tpl_vars['_debug_tpls'][$this->_sections['templates']['index']]['exec_time'])) ? $this->_run_mod_handler('string_format', true, $_tmp, "%.5f") : smarty_modifier_string_format($_tmp, "%.5f")); ?> +) + _sections['templates']['index'] == 0): ?>(total) + + +
+ +

no templates included

+ +
+ +

assigned template variables

+ + + _sections['vars']); +$this->_sections['vars']['name'] = 'vars'; +$this->_sections['vars']['loop'] = is_array($_loop=$this->_tpl_vars['_debug_keys']) ? count($_loop) : max(0, (int)$_loop); unset($_loop); +$this->_sections['vars']['show'] = true; +$this->_sections['vars']['max'] = $this->_sections['vars']['loop']; +$this->_sections['vars']['step'] = 1; +$this->_sections['vars']['start'] = $this->_sections['vars']['step'] > 0 ? 0 : $this->_sections['vars']['loop']-1; +if ($this->_sections['vars']['show']) { + $this->_sections['vars']['total'] = $this->_sections['vars']['loop']; + if ($this->_sections['vars']['total'] == 0) + $this->_sections['vars']['show'] = false; +} else + $this->_sections['vars']['total'] = 0; +if ($this->_sections['vars']['show']): + + for ($this->_sections['vars']['index'] = $this->_sections['vars']['start'], $this->_sections['vars']['iteration'] = 1; + $this->_sections['vars']['iteration'] <= $this->_sections['vars']['total']; + $this->_sections['vars']['index'] += $this->_sections['vars']['step'], $this->_sections['vars']['iteration']++): +$this->_sections['vars']['rownum'] = $this->_sections['vars']['iteration']; +$this->_sections['vars']['index_prev'] = $this->_sections['vars']['index'] - $this->_sections['vars']['step']; +$this->_sections['vars']['index_next'] = $this->_sections['vars']['index'] + $this->_sections['vars']['step']; +$this->_sections['vars']['first'] = ($this->_sections['vars']['iteration'] == 1); +$this->_sections['vars']['last'] = ($this->_sections['vars']['iteration'] == $this->_sections['vars']['total']); +?> + +"> + + + + + +
{$_tpl_vars['_debug_keys'][$this->_sections['vars']['index']])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> +}_tpl_vars['_debug_vals'][$this->_sections['vars']['index']]); ?> +

no template variables assigned

+ +

assigned config file variables (outer template scope)

+ + + _sections['config_vars']); +$this->_sections['config_vars']['name'] = 'config_vars'; +$this->_sections['config_vars']['loop'] = is_array($_loop=$this->_tpl_vars['_debug_config_keys']) ? count($_loop) : max(0, (int)$_loop); unset($_loop); +$this->_sections['config_vars']['show'] = true; +$this->_sections['config_vars']['max'] = $this->_sections['config_vars']['loop']; +$this->_sections['config_vars']['step'] = 1; +$this->_sections['config_vars']['start'] = $this->_sections['config_vars']['step'] > 0 ? 0 : $this->_sections['config_vars']['loop']-1; +if ($this->_sections['config_vars']['show']) { + $this->_sections['config_vars']['total'] = $this->_sections['config_vars']['loop']; + if ($this->_sections['config_vars']['total'] == 0) + $this->_sections['config_vars']['show'] = false; +} else + $this->_sections['config_vars']['total'] = 0; +if ($this->_sections['config_vars']['show']): + + for ($this->_sections['config_vars']['index'] = $this->_sections['config_vars']['start'], $this->_sections['config_vars']['iteration'] = 1; + $this->_sections['config_vars']['iteration'] <= $this->_sections['config_vars']['total']; + $this->_sections['config_vars']['index'] += $this->_sections['config_vars']['step'], $this->_sections['config_vars']['iteration']++): +$this->_sections['config_vars']['rownum'] = $this->_sections['config_vars']['iteration']; +$this->_sections['config_vars']['index_prev'] = $this->_sections['config_vars']['index'] - $this->_sections['config_vars']['step']; +$this->_sections['config_vars']['index_next'] = $this->_sections['config_vars']['index'] + $this->_sections['config_vars']['step']; +$this->_sections['config_vars']['first'] = ($this->_sections['config_vars']['iteration'] == 1); +$this->_sections['config_vars']['last'] = ($this->_sections['config_vars']['iteration'] == $this->_sections['config_vars']['total']); +?> + +"> + + + + + +
{#_tpl_vars['_debug_config_keys'][$this->_sections['config_vars']['index']])) ? $this->_run_mod_handler('escape', true, $_tmp, 'html') : smarty_modifier_escape($_tmp, 'html')); ?> +#}_tpl_vars['_debug_config_vals'][$this->_sections['config_vars']['index']]); ?> +

no config vars assigned

+ + +_smarty_vars['capture']['default'] = ob_get_contents(); $this->assign('debug_output', ob_get_contents());ob_end_clean(); ?> +_tpl_vars['_smarty_debug_output'] ) && $this->_tpl_vars['_smarty_debug_output'] == 'html'): ?> + _tpl_vars['debug_output']; ?> + + + + \ No newline at end of file diff --git a/system/libs/smarty/demo/templates_c/%%F7^F7F^F7F34188%%header.tpl.php b/system/libs/smarty/demo/templates_c/%%F7^F7F^F7F34188%%header.tpl.php new file mode 100755 index 0000000..11d0021 --- /dev/null +++ b/system/libs/smarty/demo/templates_c/%%F7^F7F^F7F34188%%header.tpl.php @@ -0,0 +1,13 @@ + + array(array('function', 'popup_init', 'header.tpl', 3, false),)), $this); ?> + + + "/javascripts/overlib.js"), $this);?> + +<?php echo $this->_tpl_vars['title']; ?> + - <?php echo $this->_tpl_vars['Name']; ?> + + + \ No newline at end of file diff --git a/system/libs/smarty/internals/core.assemble_plugin_filepath.php b/system/libs/smarty/internals/core.assemble_plugin_filepath.php new file mode 100755 index 0000000..690d3dd --- /dev/null +++ b/system/libs/smarty/internals/core.assemble_plugin_filepath.php @@ -0,0 +1,67 @@ +plugins_dir as $_plugin_dir) { + + $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; + + // see if path is relative + if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { + $_relative_paths[] = $_plugin_dir; + // relative path, see if it is in the SMARTY_DIR + if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { + $_return = SMARTY_DIR . $_plugin_filepath; + break; + } + } + // try relative to cwd (or absolute) + if (@is_readable($_plugin_filepath)) { + $_return = $_plugin_filepath; + break; + } + } + + if($_return === false) { + // still not found, try PHP include_path + if(isset($_relative_paths)) { + foreach ((array)$_relative_paths as $_plugin_dir) { + + $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; + + $_params = array('file_path' => $_plugin_filepath); + require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); + if(smarty_core_get_include_path($_params, $smarty)) { + $_return = $_params['new_file_path']; + break; + } + } + } + } + $_filepaths_cache[$_plugin_filename] = $_return; + return $_return; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.assign_smarty_interface.php b/system/libs/smarty/internals/core.assign_smarty_interface.php new file mode 100755 index 0000000..7e65a73 --- /dev/null +++ b/system/libs/smarty/internals/core.assign_smarty_interface.php @@ -0,0 +1,43 @@ + + * Name: assign_smarty_interface
+ * Purpose: assign the $smarty interface variable + * @param array Format: null + * @param Smarty + */ +function smarty_core_assign_smarty_interface($params, &$smarty) +{ + if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) { + return; + } + + $_globals_map = array('g' => 'HTTP_GET_VARS', + 'p' => 'HTTP_POST_VARS', + 'c' => 'HTTP_COOKIE_VARS', + 's' => 'HTTP_SERVER_VARS', + 'e' => 'HTTP_ENV_VARS'); + + $_smarty_vars_request = array(); + + foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) { + if (isset($_globals_map[$_c])) { + $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]); + } + } + $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']); + + $smarty->_smarty_vars['request'] = $_smarty_vars_request; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.create_dir_structure.php b/system/libs/smarty/internals/core.create_dir_structure.php new file mode 100755 index 0000000..3eecc49 --- /dev/null +++ b/system/libs/smarty/internals/core.create_dir_structure.php @@ -0,0 +1,79 @@ +_dir_perms) && !is_dir($_new_dir)) { + $smarty->trigger_error("problem creating directory '" . $_new_dir . "'"); + return false; + } + $_new_dir .= '/'; + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.display_debug_console.php b/system/libs/smarty/internals/core.display_debug_console.php new file mode 100755 index 0000000..1a80f39 --- /dev/null +++ b/system/libs/smarty/internals/core.display_debug_console.php @@ -0,0 +1,61 @@ + + * Name: display_debug_console
+ * Purpose: display the javascript debug console window + * @param array Format: null + * @param Smarty + */ +function smarty_core_display_debug_console($params, &$smarty) +{ + // we must force compile the debug template in case the environment + // changed between separate applications. + + if(empty($smarty->debug_tpl)) { + // set path to debug template from SMARTY_DIR + $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl'; + if($smarty->security && is_file($smarty->debug_tpl)) { + $smarty->secure_dir[] = realpath($smarty->debug_tpl); + } + $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl'; + } + + $_ldelim_orig = $smarty->left_delimiter; + $_rdelim_orig = $smarty->right_delimiter; + + $smarty->left_delimiter = '{'; + $smarty->right_delimiter = '}'; + + $_compile_id_orig = $smarty->_compile_id; + $smarty->_compile_id = null; + + $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl); + if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path)) + { + ob_start(); + $smarty->_include($_compile_path); + $_results = ob_get_contents(); + ob_end_clean(); + } else { + $_results = ''; + } + + $smarty->_compile_id = $_compile_id_orig; + + $smarty->left_delimiter = $_ldelim_orig; + $smarty->right_delimiter = $_rdelim_orig; + + return $_results; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.get_include_path.php b/system/libs/smarty/internals/core.get_include_path.php new file mode 100755 index 0000000..4343241 --- /dev/null +++ b/system/libs/smarty/internals/core.get_include_path.php @@ -0,0 +1,44 @@ + diff --git a/system/libs/smarty/internals/core.get_microtime.php b/system/libs/smarty/internals/core.get_microtime.php new file mode 100755 index 0000000..f1a28e0 --- /dev/null +++ b/system/libs/smarty/internals/core.get_microtime.php @@ -0,0 +1,23 @@ + diff --git a/system/libs/smarty/internals/core.get_php_resource.php b/system/libs/smarty/internals/core.get_php_resource.php new file mode 100755 index 0000000..786d4e7 --- /dev/null +++ b/system/libs/smarty/internals/core.get_php_resource.php @@ -0,0 +1,80 @@ +trusted_dir; + $smarty->_parse_resource_name($params, $smarty); + + /* + * Find out if the resource exists. + */ + + if ($params['resource_type'] == 'file') { + $_readable = false; + if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) { + $_readable = true; + } else { + // test for file in include_path + $_params = array('file_path' => $params['resource_name']); + require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); + if(smarty_core_get_include_path($_params, $smarty)) { + $_include_path = $_params['new_file_path']; + $_readable = true; + } + } + } else if ($params['resource_type'] != 'file') { + $_template_source = null; + $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0]) + && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0], + array($params['resource_name'], &$_template_source, &$smarty)); + } + + /* + * Set the error function, depending on which class calls us. + */ + if (method_exists($smarty, '_syntax_error')) { + $_error_funcc = '_syntax_error'; + } else { + $_error_funcc = 'trigger_error'; + } + + if ($_readable) { + if ($smarty->security) { + require_once(SMARTY_CORE_DIR . 'core.is_trusted.php'); + if (!smarty_core_is_trusted($params, $smarty)) { + $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted'); + return false; + } + } + } else { + $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable'); + return false; + } + + if ($params['resource_type'] == 'file') { + $params['php_resource'] = $params['resource_name']; + } else { + $params['php_resource'] = $_template_source; + } + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.is_secure.php b/system/libs/smarty/internals/core.is_secure.php new file mode 100755 index 0000000..d54abd4 --- /dev/null +++ b/system/libs/smarty/internals/core.is_secure.php @@ -0,0 +1,59 @@ +security || $smarty->security_settings['INCLUDE_ANY']) { + return true; + } + + if ($params['resource_type'] == 'file') { + $_rp = realpath($params['resource_name']); + if (isset($params['resource_base_path'])) { + foreach ((array)$params['resource_base_path'] as $curr_dir) { + if ( ($_cd = realpath($curr_dir)) !== false && + strncmp($_rp, $_cd, strlen($_cd)) == 0 && + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { + return true; + } + } + } + if (!empty($smarty->secure_dir)) { + foreach ((array)$smarty->secure_dir as $curr_dir) { + if ( ($_cd = realpath($curr_dir)) !== false) { + if($_cd == $_rp) { + return true; + } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 && + substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) { + return true; + } + } + } + } + } else { + // resource is not on local file system + return call_user_func_array( + $smarty->_plugins['resource'][$params['resource_type']][0][2], + array($params['resource_name'], &$smarty)); + } + + return false; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.is_trusted.php b/system/libs/smarty/internals/core.is_trusted.php new file mode 100755 index 0000000..4299731 --- /dev/null +++ b/system/libs/smarty/internals/core.is_trusted.php @@ -0,0 +1,47 @@ +trusted_dir)) { + $_rp = realpath($params['resource_name']); + foreach ((array)$smarty->trusted_dir as $curr_dir) { + if (!empty($curr_dir) && is_readable ($curr_dir)) { + $_cd = realpath($curr_dir); + if (strncmp($_rp, $_cd, strlen($_cd)) == 0 + && substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) { + $_smarty_trusted = true; + break; + } + } + } + } + + } else { + // resource is not on local file system + $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3], + array($params['resource_name'], $smarty)); + } + + return $_smarty_trusted; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.load_plugins.php b/system/libs/smarty/internals/core.load_plugins.php new file mode 100755 index 0000000..6db1dc5 --- /dev/null +++ b/system/libs/smarty/internals/core.load_plugins.php @@ -0,0 +1,125 @@ +_plugins[$_type][$_name]; + + /* + * We do not load plugin more than once for each instance of Smarty. + * The following code checks for that. The plugin can also be + * registered dynamically at runtime, in which case template file + * and line number will be unknown, so we fill them in. + * + * The final element of the info array is a flag that indicates + * whether the dynamically registered plugin function has been + * checked for existence yet or not. + */ + if (isset($_plugin)) { + if (empty($_plugin[3])) { + if (!is_callable($_plugin[0])) { + $smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__); + } else { + $_plugin[1] = $_tpl_file; + $_plugin[2] = $_tpl_line; + $_plugin[3] = true; + if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */ + } + } + continue; + } else if ($_type == 'insert') { + /* + * For backwards compatibility, we check for insert functions in + * the symbol table before trying to load them as a plugin. + */ + $_plugin_func = 'insert_' . $_name; + if (function_exists($_plugin_func)) { + $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false); + continue; + } + } + + $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name); + + if (! $_found = ($_plugin_file != false)) { + $_message = "could not load plugin file '$_type.$_name.php'\n"; + } + + /* + * If plugin file is found, it -must- provide the properly named + * plugin function. In case it doesn't, simply output the error and + * do not fall back on any other method. + */ + if ($_found) { + include_once $_plugin_file; + + $_plugin_func = 'smarty_' . $_type . '_' . $_name; + if (!function_exists($_plugin_func)) { + $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__); + continue; + } + } + /* + * In case of insert plugins, their code may be loaded later via + * 'script' attribute. + */ + else if ($_type == 'insert' && $_delayed_loading) { + $_plugin_func = 'smarty_' . $_type . '_' . $_name; + $_found = true; + } + + /* + * Plugin specific processing and error checking. + */ + if (!$_found) { + if ($_type == 'modifier') { + /* + * In case modifier falls back on using PHP functions + * directly, we only allow those specified in the security + * context. + */ + if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) { + $_message = "(secure mode) modifier '$_name' is not allowed"; + } else { + if (!function_exists($_name)) { + $_message = "modifier '$_name' is not implemented"; + } else { + $_plugin_func = $_name; + $_found = true; + } + } + } else if ($_type == 'function') { + /* + * This is a catch-all situation. + */ + $_message = "unknown tag - '$_name'"; + } + } + + if ($_found) { + $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true); + } else { + // output error + $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__); + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.load_resource_plugin.php b/system/libs/smarty/internals/core.load_resource_plugin.php new file mode 100755 index 0000000..a7d37d1 --- /dev/null +++ b/system/libs/smarty/internals/core.load_resource_plugin.php @@ -0,0 +1,74 @@ +_plugins['resource'][$params['type']]; + if (isset($_plugin)) { + if (!$_plugin[1] && count($_plugin[0])) { + $_plugin[1] = true; + foreach ($_plugin[0] as $_plugin_func) { + if (!is_callable($_plugin_func)) { + $_plugin[1] = false; + break; + } + } + } + + if (!$_plugin[1]) { + $smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__); + } + + return; + } + + $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']); + $_found = ($_plugin_file != false); + + if ($_found) { /* + * If the plugin file is found, it -must- provide the properly named + * plugin functions. + */ + include_once($_plugin_file); + + /* + * Locate functions that we require the plugin to provide. + */ + $_resource_ops = array('source', 'timestamp', 'secure', 'trusted'); + $_resource_funcs = array(); + foreach ($_resource_ops as $_op) { + $_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op; + if (!function_exists($_plugin_func)) { + $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__); + return; + } else { + $_resource_funcs[] = $_plugin_func; + } + } + + $smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true); + } +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.process_cached_inserts.php b/system/libs/smarty/internals/core.process_cached_inserts.php new file mode 100755 index 0000000..1d78edd --- /dev/null +++ b/system/libs/smarty/internals/core.process_cached_inserts.php @@ -0,0 +1,71 @@ +_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis', + $params['results'], $match); + list($cached_inserts, $insert_args) = $match; + + for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) { + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + $args = unserialize($insert_args[$i]); + $name = $args['name']; + + if (isset($args['script'])) { + $_params = array('resource_name' => $smarty->_dequote($args['script'])); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + if(!smarty_core_get_php_resource($_params, $smarty)) { + return false; + } + $resource_type = $_params['resource_type']; + $php_resource = $_params['php_resource']; + + + if ($resource_type == 'file') { + $smarty->_include($php_resource, true); + } else { + $smarty->_eval($php_resource); + } + } + + $function_name = $smarty->_plugins['insert'][$name][0]; + if (empty($args['assign'])) { + $replace = $function_name($args, $smarty); + } else { + $smarty->assign($args['assign'], $function_name($args, $smarty)); + $replace = ''; + } + + $params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i])); + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'insert', + 'filename' => 'insert_'.$name, + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time); + } + } + + return $params['results']; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.process_compiled_include.php b/system/libs/smarty/internals/core.process_compiled_include.php new file mode 100755 index 0000000..904d597 --- /dev/null +++ b/system/libs/smarty/internals/core.process_compiled_include.php @@ -0,0 +1,37 @@ +_cache_including; + $smarty->_cache_including = true; + + $_return = $params['results']; + + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + $smarty->_include($_include_file_path, true); + } + + foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { + $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s', + array(&$smarty, '_process_compiled_include_callback'), + $_return); + } + $smarty->_cache_including = $_cache_including; + return $_return; +} + +?> diff --git a/system/libs/smarty/internals/core.read_cache_file.php b/system/libs/smarty/internals/core.read_cache_file.php new file mode 100755 index 0000000..c60e113 --- /dev/null +++ b/system/libs/smarty/internals/core.read_cache_file.php @@ -0,0 +1,101 @@ +force_compile) { + // force compile enabled, always regenerate + return false; + } + + if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) { + list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']]; + return true; + } + + if (!empty($smarty->cache_handler_func)) { + // use cache_handler function + call_user_func_array($smarty->cache_handler_func, + array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null)); + } else { + // use local cache file + $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); + $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); + $params['results'] = $smarty->_read_file($_cache_file); + } + + if (empty($params['results'])) { + // nothing to parse (error?), regenerate cache + return false; + } + + $_contents = $params['results']; + $_info_start = strpos($_contents, "\n") + 1; + $_info_len = (int)substr($_contents, 0, $_info_start - 1); + $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len)); + $params['results'] = substr($_contents, $_info_start + $_info_len); + + if ($smarty->caching == 2 && isset ($_cache_info['expires'])){ + // caching by expiration time + if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) { + // cache expired, regenerate + return false; + } + } else { + // caching by lifetime + if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) { + // cache expired, regenerate + return false; + } + } + + if ($smarty->compile_check) { + $_params = array('get_source' => false, 'quiet'=>true); + foreach (array_keys($_cache_info['template']) as $_template_dep) { + $_params['resource_name'] = $_template_dep; + if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { + // template file has changed, regenerate cache + return false; + } + } + + if (isset($_cache_info['config'])) { + $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true); + foreach (array_keys($_cache_info['config']) as $_config_dep) { + $_params['resource_name'] = $_config_dep; + if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { + // config file has changed, regenerate cache + return false; + } + } + } + } + + $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info); + + $smarty->_cache_info = $_cache_info; + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.rm_auto.php b/system/libs/smarty/internals/core.rm_auto.php new file mode 100755 index 0000000..b251f64 --- /dev/null +++ b/system/libs/smarty/internals/core.rm_auto.php @@ -0,0 +1,71 @@ + $params['auto_base'], + 'level' => 0, + 'exp_time' => $params['exp_time'] + ); + require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); + $_res = smarty_core_rmdir($_params, $smarty); + } else { + $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']); + + if(isset($params['auto_source'])) { + if (isset($params['extensions'])) { + $_res = false; + foreach ((array)$params['extensions'] as $_extension) + $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']); + } else { + $_res = $smarty->_unlink($_tname, $params['exp_time']); + } + } elseif ($smarty->use_sub_dirs) { + $_params = array( + 'dirname' => $_tname, + 'level' => 1, + 'exp_time' => $params['exp_time'] + ); + require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); + $_res = smarty_core_rmdir($_params, $smarty); + } else { + // remove matching file names + $_handle = opendir($params['auto_base']); + $_res = true; + while (false !== ($_filename = readdir($_handle))) { + if($_filename == '.' || $_filename == '..') { + continue; + } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) { + $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']); + } + } + } + } + + return $_res; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.rmdir.php b/system/libs/smarty/internals/core.rmdir.php new file mode 100755 index 0000000..2166c44 --- /dev/null +++ b/system/libs/smarty/internals/core.rmdir.php @@ -0,0 +1,54 @@ + keep root) + * WARNING: no tests, it will try to remove what you tell it! + * + * @param string $dirname + * @param integer $level + * @param integer $exp_time + * @return boolean + */ + +// $dirname, $level = 1, $exp_time = null + +function smarty_core_rmdir($params, &$smarty) +{ + if(!isset($params['level'])) { $params['level'] = 1; } + if(!isset($params['exp_time'])) { $params['exp_time'] = null; } + + if($_handle = @opendir($params['dirname'])) { + + while (false !== ($_entry = readdir($_handle))) { + if ($_entry != '.' && $_entry != '..') { + if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) { + $_params = array( + 'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry, + 'level' => $params['level'] + 1, + 'exp_time' => $params['exp_time'] + ); + smarty_core_rmdir($_params, $smarty); + } + else { + $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']); + } + } + } + closedir($_handle); + } + + if ($params['level']) { + return @rmdir($params['dirname']); + } + return (bool)$_handle; + +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.run_insert_handler.php b/system/libs/smarty/internals/core.run_insert_handler.php new file mode 100755 index 0000000..71c3845 --- /dev/null +++ b/system/libs/smarty/internals/core.run_insert_handler.php @@ -0,0 +1,71 @@ +debugging) { + $_params = array(); + $_debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + if ($smarty->caching) { + $_arg_string = serialize($params['args']); + $_name = $params['args']['name']; + if (!isset($smarty->_cache_info['insert_tags'][$_name])) { + $smarty->_cache_info['insert_tags'][$_name] = array('insert', + $_name, + $smarty->_plugins['insert'][$_name][1], + $smarty->_plugins['insert'][$_name][2], + !empty($params['args']['script']) ? true : false); + } + return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5; + } else { + if (isset($params['args']['script'])) { + $_params = array('resource_name' => $smarty->_dequote($params['args']['script'])); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + if(!smarty_core_get_php_resource($_params, $smarty)) { + return false; + } + + if ($_params['resource_type'] == 'file') { + $smarty->_include($_params['php_resource'], true); + } else { + $smarty->_eval($_params['php_resource']); + } + unset($params['args']['script']); + } + + $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0]; + $_content = $_funcname($params['args'], $smarty); + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'insert', + 'filename' => 'insert_'.$params['args']['name'], + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); + } + + if (!empty($params['args']["assign"])) { + $smarty->assign($params['args']["assign"], $_content); + } else { + return $_content; + } + } +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.smarty_include_php.php b/system/libs/smarty/internals/core.smarty_include_php.php new file mode 100755 index 0000000..30c6e76 --- /dev/null +++ b/system/libs/smarty/internals/core.smarty_include_php.php @@ -0,0 +1,50 @@ + $params['smarty_file']); + require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); + smarty_core_get_php_resource($_params, $smarty); + $_smarty_resource_type = $_params['resource_type']; + $_smarty_php_resource = $_params['php_resource']; + + if (!empty($params['smarty_assign'])) { + ob_start(); + if ($_smarty_resource_type == 'file') { + $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); + } else { + $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); + } + $smarty->assign($params['smarty_assign'], ob_get_contents()); + ob_end_clean(); + } else { + if ($_smarty_resource_type == 'file') { + $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); + } else { + $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); + } + } +} + + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.write_cache_file.php b/system/libs/smarty/internals/core.write_cache_file.php new file mode 100755 index 0000000..fa3cdd7 --- /dev/null +++ b/system/libs/smarty/internals/core.write_cache_file.php @@ -0,0 +1,96 @@ +_cache_info['timestamp'] = time(); + if ($smarty->cache_lifetime > -1){ + // expiration set + $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime; + } else { + // cache will never expire + $smarty->_cache_info['expires'] = -1; + } + + // collapse nocache.../nocache-tags + if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) { + // remove everything between every pair of outermost noache.../nocache-tags + // and replace it by a single nocache-tag + // this new nocache-tag will be replaced by dynamic contents in + // smarty_core_process_compiled_includes() on a cache-read + + $match_count = count($match[0]); + $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE); + + $level = 0; + $j = 0; + for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) { + if ($results[$i] == $match[0][$j]) { + // nocache tag + if ($match[1][$j]) { // closing tag + $level--; + unset($results[$i]); + } else { // opening tag + if ($level++ > 0) unset($results[$i]); + } + $j++; + } elseif ($level > 0) { + unset($results[$i]); + } + } + $params['results'] = implode('', $results); + } + $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials; + + // prepend the cache header info into cache file + $_cache_info = serialize($smarty->_cache_info); + $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results']; + + if (!empty($smarty->cache_handler_func)) { + // use cache_handler function + call_user_func_array($smarty->cache_handler_func, + array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], $smarty->_cache_info['expires'])); + } else { + // use local cache file + + if(!@is_writable($smarty->cache_dir)) { + // cache_dir not writable, see if it exists + if(!@is_dir($smarty->cache_dir)) { + $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); + return false; + } + $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR); + return false; + } + + $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); + $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); + $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true); + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.write_compiled_include.php b/system/libs/smarty/internals/core.write_compiled_include.php new file mode 100755 index 0000000..c14adb5 --- /dev/null +++ b/system/libs/smarty/internals/core.write_compiled_include.php @@ -0,0 +1,91 @@ +caching && \!\$this->_cache_including\)\: echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; endif;'; + $_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{/nocache\:(\\2)#(\\3)\}\'; endif;'; + + preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us', + $params['compiled_content'], $_match_source, PREG_SET_ORDER); + + // no nocache-parts found: done + if (count($_match_source)==0) return; + + // convert the matched php-code to functions + $_include_compiled = "_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n"; + $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n"; + + $_compile_path = $params['include_file_path']; + + $smarty->_cache_serials[$_compile_path] = $params['cache_serial']; + $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>"; + + $_include_compiled .= $params['plugins_code']; + $_include_compiled .= "= 5.0) ? '_smarty' : 'this'; + for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) { + $_match =& $_match_source[$_i]; + $source = $_match[4]; + if ($this_varname == '_smarty') { + /* rename $this to $_smarty in the sourcecode */ + $tokens = token_get_all('\n"; + + $_params = array('filename' => $_compile_path, + 'contents' => $_include_compiled, 'create_dirs' => true); + + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; +} + + +?> diff --git a/system/libs/smarty/internals/core.write_compiled_resource.php b/system/libs/smarty/internals/core.write_compiled_resource.php new file mode 100755 index 0000000..b902eff --- /dev/null +++ b/system/libs/smarty/internals/core.write_compiled_resource.php @@ -0,0 +1,35 @@ +compile_dir)) { + // compile_dir not writable, see if it exists + if(!@is_dir($smarty->compile_dir)) { + $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); + return false; + } + $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR); + return false; + } + + $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); + require_once(SMARTY_CORE_DIR . 'core.write_file.php'); + smarty_core_write_file($_params, $smarty); + return true; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/internals/core.write_file.php b/system/libs/smarty/internals/core.write_file.php new file mode 100755 index 0000000..8a3a3b3 --- /dev/null +++ b/system/libs/smarty/internals/core.write_file.php @@ -0,0 +1,54 @@ + $_dirname); + require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php'); + smarty_core_create_dir_structure($_params, $smarty); + } + + // write to tmp file, then rename it to avoid file locking race condition + $_tmp_file = tempnam($_dirname, 'wrt'); + + if (!($fd = @fopen($_tmp_file, 'wb'))) { + $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt'); + if (!($fd = @fopen($_tmp_file, 'wb'))) { + $smarty->trigger_error("problem writing temporary file '$_tmp_file'"); + return false; + } + } + + fwrite($fd, $params['contents']); + fclose($fd); + + if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) { + // On platforms and filesystems that cannot overwrite with rename() + // delete the file before renaming it -- because windows always suffers + // this, it is short-circuited to avoid the initial rename() attempt + @unlink($params['filename']); + @rename($_tmp_file, $params['filename']); + } + @chmod($params['filename'], $smarty->_file_perms); + + return true; +} + +/* vim: set expandtab: */ + +?> \ No newline at end of file diff --git a/system/libs/smarty/plugins/block.textformat.php b/system/libs/smarty/plugins/block.textformat.php new file mode 100755 index 0000000..8cd010a --- /dev/null +++ b/system/libs/smarty/plugins/block.textformat.php @@ -0,0 +1,103 @@ + + * Name: textformat
+ * Purpose: format text a certain way with preset styles + * or custom wrap/indent settings
+ * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) + * @param array + *
+ * Params:   style: string (email)
+ *           indent: integer (0)
+ *           wrap: integer (80)
+ *           wrap_char string ("\n")
+ *           indent_char: string (" ")
+ *           wrap_boundary: boolean (true)
+ * 
+ * @author Monte Ohrt + * @param string contents of the block + * @param Smarty clever simulation of a method + * @return string string $content re-formatted + */ +function smarty_block_textformat($params, $content, &$smarty) +{ + if (is_null($content)) { + return; + } + + $style = null; + $indent = 0; + $indent_first = 0; + $indent_char = ' '; + $wrap = 80; + $wrap_char = "\n"; + $wrap_cut = false; + $assign = null; + + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'style': + case 'indent_char': + case 'wrap_char': + case 'assign': + $$_key = (string)$_val; + break; + + case 'indent': + case 'indent_first': + case 'wrap': + $$_key = (int)$_val; + break; + + case 'wrap_cut': + $$_key = (bool)$_val; + break; + + default: + $smarty->trigger_error("textformat: unknown attribute '$_key'"); + } + } + + if ($style == 'email') { + $wrap = 72; + } + + // split into paragraphs + $_paragraphs = preg_split('![\r\n][\r\n]!',$content); + $_output = ''; + + for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) { + if ($_paragraphs[$_x] == '') { + continue; + } + // convert mult. spaces & special chars to single space + $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]); + // indent first line + if($indent_first > 0) { + $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x]; + } + // wordwrap sentences + $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut); + // indent lines + if($indent > 0) { + $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]); + } + } + $_output = implode($wrap_char . $wrap_char, $_paragraphs); + + return $assign ? $smarty->assign($assign, $_output) : $_output; + +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/compiler.assign.php b/system/libs/smarty/plugins/compiler.assign.php new file mode 100755 index 0000000..abef377 --- /dev/null +++ b/system/libs/smarty/plugins/compiler.assign.php @@ -0,0 +1,40 @@ + + * Name: assign
+ * Purpose: assign a value to a template variable + * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign} + * (Smarty online manual) + * @author Monte Ohrt (initial author) + * @author messju mohr (conversion to compiler function) + * @param string containing var-attribute and value-attribute + * @param Smarty_Compiler + */ +function smarty_compiler_assign($tag_attrs, &$compiler) +{ + $_params = $compiler->_parse_attrs($tag_attrs); + + if (!isset($_params['var'])) { + $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING); + return; + } + + if (!isset($_params['value'])) { + $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING); + return; + } + + return "\$this->assign({$_params['var']}, {$_params['value']});"; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/compiler.defun.php b/system/libs/smarty/plugins/compiler.defun.php new file mode 100755 index 0000000..c506f55 --- /dev/null +++ b/system/libs/smarty/plugins/compiler.defun.php @@ -0,0 +1,122 @@ +array(array("name" => "test1","id" => "1", +// "element" => array(array("name" => "test1.1","id" => "2"), +// array("name" => "test1.2","id" => "3", +// "element" => array(array("name" => "test1.2.1","id" => "4"), +// array("name" => "test1.2.2","id" => "5"))))))); +// +// +// {defun name="recursion" list=$element} +//
    +// {if isset($element.name)}
  • {$element.name}
  • {/if} +// {if isset($element.element)} +// {foreach from=$element.element item=element} +// {fun name="recursion" list=$element} +// {/foreach} +// {/if} +//
+// {/defun} +// +// +// + + +/* create code for a function call */ +function smarty_compiler_fun($tag_args, &$compiler) { + $_attrs = $compiler->_parse_attrs($tag_args); + + if (!isset($_attrs['name'])) $compiler->_syntax_error("fun: missing name parameter"); + $_func_name = $compiler->_dequote($_attrs['name']); + $_func = 'smarty_fun_'.$_func_name; + $_params = 'array('; + $_sep = ''; + unset($_attrs['name']); + foreach ($_attrs as $_key=>$_value) { + $_params .= "$_sep'$_key'=>$_value"; + $_sep = ','; + } + $_params .= ')'; + return "$_func(\$this, $_params); "; + +} +$this->register_compiler_function('fun', 'smarty_compiler_fun'); + + +/* create code for a function declaration */ +function smarty_compiler_defun($tag_args, &$compiler) { + $attrs = $compiler->_parse_attrs($tag_args); + $func_key = '"' . md5('php-5') . '[[' . md5(uniqid('sucks')) . '";'; + array_push($compiler->_tag_stack, array('defun', $attrs, $tag_args, $func_key)); + if (!isset($attrs['name'])) $compiler->_syntax_error("defun: missing name parameter"); + + $func_name = $compiler->_dequote($attrs['name']); + $func = 'smarty_fun_'.$func_name; + return $func_key . "if (!function_exists('$func')) { function $func(&\$this, \$params) { \$_fun_tpl_vars = \$this->_tpl_vars; \$this->assign(\$params); "; + +} + + +/* create code for closing a function definition and calling said function */ +function smarty_compiler_defun_close($tag_args, &$compiler) { + list($name, $attrs, $open_tag_args, $func_key) = array_pop($compiler->_tag_stack); + if ($name!='defun') $compiler->_syntax_error("unexpected {/defun}"); + return " \$this->_tpl_vars = \$_fun_tpl_vars; }} " . $func_key . smarty_compiler_fun($open_tag_args, $compiler); +} +$this->register_compiler_function('/defun', 'smarty_compiler_defun_close'); + + +/* callback to replace all $this with $smarty */ +function smarty_replace_fun($match) { + $tokens = token_get_all('=5.0) { + /* filter sourcecode. look for func_keys and replace all $this + in-between with $smarty */ + while (1) { + $new_source = preg_replace_callback('/' . $search . '(.*)\\1/Us', 'smarty_replace_fun', $source); + if (strcmp($new_source, $source)==0) break; + $source = $new_source; + } + } else { + /* remove func_keys */ + $source = preg_replace('/' . $search . '/', '', $source); + } + return $source; +} +$this->register_postfilter('smarty_postfilter_defun'); + + +?> diff --git a/system/libs/smarty/plugins/compiler.endwhile.php b/system/libs/smarty/plugins/compiler.endwhile.php new file mode 100755 index 0000000..d62dae6 --- /dev/null +++ b/system/libs/smarty/plugins/compiler.endwhile.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/system/libs/smarty/plugins/compiler.while.php b/system/libs/smarty/plugins/compiler.while.php new file mode 100755 index 0000000..9cbedea --- /dev/null +++ b/system/libs/smarty/plugins/compiler.while.php @@ -0,0 +1,22 @@ +_compile_if_tag($tag_arg); + preg_match("/<\?php if (.*): \?>/",$res,$token); + return "while " . $token[1] . " {"; +} + +?> \ No newline at end of file diff --git a/system/libs/smarty/plugins/function.assign_debug_info.php b/system/libs/smarty/plugins/function.assign_debug_info.php new file mode 100755 index 0000000..6540498 --- /dev/null +++ b/system/libs/smarty/plugins/function.assign_debug_info.php @@ -0,0 +1,40 @@ + + * Name: assign_debug_info
+ * Purpose: assign debug info to the template
+ * @author Monte Ohrt + * @param array unused in this plugin, this plugin uses {@link Smarty::$_config}, + * {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info} + * @param Smarty + */ +function smarty_function_assign_debug_info($params, &$smarty) +{ + $assigned_vars = $smarty->_tpl_vars; + ksort($assigned_vars); + if (@is_array($smarty->_config[0])) { + $config_vars = $smarty->_config[0]; + ksort($config_vars); + $smarty->assign("_debug_config_keys", array_keys($config_vars)); + $smarty->assign("_debug_config_vals", array_values($config_vars)); + } + + $included_templates = $smarty->_smarty_debug_info; + + $smarty->assign("_debug_keys", array_keys($assigned_vars)); + $smarty->assign("_debug_vals", array_values($assigned_vars)); + + $smarty->assign("_debug_tpls", $included_templates); +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.bitwise.php b/system/libs/smarty/plugins/function.bitwise.php new file mode 100755 index 0000000..1f1f2b1 --- /dev/null +++ b/system/libs/smarty/plugins/function.bitwise.php @@ -0,0 +1,25 @@ +>': return $params['var1'] >> $params['var2']; break; + default: return $params['var1'] & $params['var2']; break; + } + } + else + { + return false; + } +} + + +?> \ No newline at end of file diff --git a/system/libs/smarty/plugins/function.config_load.php b/system/libs/smarty/plugins/function.config_load.php new file mode 100755 index 0000000..db89f63 --- /dev/null +++ b/system/libs/smarty/plugins/function.config_load.php @@ -0,0 +1,142 @@ + + * Name: config_load
+ * Purpose: load config file vars + * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load} + * (Smarty online manual) + * @author Monte Ohrt + * @author messju mohr (added use of resources) + * @param array Format: + *
+ * array('file' => required config file name,
+ *       'section' => optional config file section to load
+ *       'scope' => local/parent/global
+ *       'global' => overrides scope, setting to parent if true)
+ * 
+ * @param Smarty + */ +function smarty_function_config_load($params, &$smarty) +{ + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $_debug_start_time = smarty_core_get_microtime($_params, $smarty); + } + + $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null; + $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null; + $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global'; + $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false; + + if (!isset($_file) || strlen($_file) == 0) { + $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__); + } + + if (isset($_scope)) { + if ($_scope != 'local' && + $_scope != 'parent' && + $_scope != 'global') { + $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__); + } + } else { + if ($_global) { + $_scope = 'parent'; + } else { + $_scope = 'local'; + } + } + + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + 'get_source' => false); + $smarty->_parse_resource_name($_params); + $_file_path = $_params['resource_type'] . ':' . $_params['resource_name']; + if (isset($_section)) + $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section); + else + $_compile_file = $smarty->_get_compile_path($_file_path); + + if($smarty->force_compile || !file_exists($_compile_file)) { + $_compile = true; + } elseif ($smarty->compile_check) { + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + 'get_source' => false); + $_compile = $smarty->_fetch_resource_info($_params) && + $_params['resource_timestamp'] > filemtime($_compile_file); + } else { + $_compile = false; + } + + if($_compile) { + // compile config file + if(!is_object($smarty->_conf_obj)) { + require_once SMARTY_DIR . $smarty->config_class . '.class.php'; + $smarty->_conf_obj = new $smarty->config_class(); + $smarty->_conf_obj->overwrite = $smarty->config_overwrite; + $smarty->_conf_obj->booleanize = $smarty->config_booleanize; + $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden; + $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines; + } + + $_params = array('resource_name' => $_file, + 'resource_base_path' => $smarty->config_dir, + $_params['get_source'] = true); + if (!$smarty->_fetch_resource_info($_params)) { + return; + } + $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']); + $_config_vars = array_merge($smarty->_conf_obj->get($_file), + $smarty->_conf_obj->get($_file, $_section)); + if(function_exists('var_export')) { + $_output = ''; + } else { + $_output = ''\\\'', '\\'=>'\\\\')) . '\'); ?>'; + } + $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp'])); + require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php'); + smarty_core_write_compiled_resource($_params, $smarty); + } else { + include($_compile_file); + } + + if ($smarty->caching) { + $smarty->_cache_info['config'][$_file] = true; + } + + $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars); + $smarty->_config[0]['files'][$_file] = true; + + if ($_scope == 'parent') { + $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars); + $smarty->_config[1]['files'][$_file] = true; + } else if ($_scope == 'global') { + for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) { + $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars); + $smarty->_config[$i]['files'][$_file] = true; + } + } + + if ($smarty->debugging) { + $_params = array(); + require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); + $smarty->_smarty_debug_info[] = array('type' => 'config', + 'filename' => $_file.' ['.$_section.'] '.$_scope, + 'depth' => $smarty->_inclusion_depth, + 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); + } + +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.counter.php b/system/libs/smarty/plugins/function.counter.php new file mode 100755 index 0000000..1f26db5 --- /dev/null +++ b/system/libs/smarty/plugins/function.counter.php @@ -0,0 +1,80 @@ + + * Name: counter
+ * Purpose: print out a counter value + * @author Monte Ohrt + * @link http://smarty.php.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * @param array parameters + * @param Smarty + * @return string|null + */ +function smarty_function_counter($params, &$smarty) +{ + static $counters = array(); + + $name = (isset($params['name'])) ? $params['name'] : 'default'; + if (!isset($counters[$name])) { + $counters[$name] = array( + 'start'=>1, + 'skip'=>1, + 'direction'=>'up', + 'count'=>1 + ); + } + $counter =& $counters[$name]; + + if (isset($params['start'])) { + $counter['start'] = $counter['count'] = (int)$params['start']; + } + + if (!empty($params['assign'])) { + $counter['assign'] = $params['assign']; + } + + if (isset($counter['assign'])) { + $smarty->assign($counter['assign'], $counter['count']); + } + + if (isset($params['print'])) { + $print = (bool)$params['print']; + } else { + $print = empty($counter['assign']); + } + + if ($print) { + $retval = $counter['count']; + } else { + $retval = null; + } + + if (isset($params['skip'])) { + $counter['skip'] = $params['skip']; + } + + if (isset($params['direction'])) { + $counter['direction'] = $params['direction']; + } + + if ($counter['direction'] == "down") + $counter['count'] -= $counter['skip']; + else + $counter['count'] += $counter['skip']; + + return $retval; + +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.cycle.php b/system/libs/smarty/plugins/function.cycle.php new file mode 100755 index 0000000..fe78bb8 --- /dev/null +++ b/system/libs/smarty/plugins/function.cycle.php @@ -0,0 +1,102 @@ + + * Name: cycle
+ * Date: May 3, 2002
+ * Purpose: cycle through given values
+ * Input: + * - name = name of cycle (optional) + * - values = comma separated list of values to cycle, + * or an array of values to cycle + * (this can be left out for subsequent calls) + * - reset = boolean - resets given var to true + * - print = boolean - print var or not. default is true + * - advance = boolean - whether or not to advance the cycle + * - delimiter = the value delimiter, default is "," + * - assign = boolean, assigns to template var instead of + * printed. + * + * Examples:
+ *
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * 
+ * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle} + * (Smarty online manual) + * @author Monte Ohrt + * @author credit to Mark Priatel + * @author credit to Gerard + * @author credit to Jason Sweat + * @version 1.3 + * @param array + * @param Smarty + * @return string|null + */ +function smarty_function_cycle($params, &$smarty) +{ + static $cycle_vars; + + $name = (empty($params['name'])) ? 'default' : $params['name']; + $print = (isset($params['print'])) ? (bool)$params['print'] : true; + $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true; + $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false; + + if (!in_array('values', array_keys($params))) { + if(!isset($cycle_vars[$name]['values'])) { + $smarty->trigger_error("cycle: missing 'values' parameter"); + return; + } + } else { + if(isset($cycle_vars[$name]['values']) + && $cycle_vars[$name]['values'] != $params['values'] ) { + $cycle_vars[$name]['index'] = 0; + } + $cycle_vars[$name]['values'] = $params['values']; + } + + $cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ','; + + if(is_array($cycle_vars[$name]['values'])) { + $cycle_array = $cycle_vars[$name]['values']; + } else { + $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']); + } + + if(!isset($cycle_vars[$name]['index']) || $reset ) { + $cycle_vars[$name]['index'] = 0; + } + + if (isset($params['assign'])) { + $print = false; + $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); + } + + if($print) { + $retval = $cycle_array[$cycle_vars[$name]['index']]; + } else { + $retval = null; + } + + if($advance) { + if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) { + $cycle_vars[$name]['index'] = 0; + } else { + $cycle_vars[$name]['index']++; + } + } + + return $retval; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.date_diff.php b/system/libs/smarty/plugins/function.date_diff.php new file mode 100755 index 0000000..46182ff --- /dev/null +++ b/system/libs/smarty/plugins/function.date_diff.php @@ -0,0 +1,44 @@ +assign($assign,floor(($date2 - $date1)*$i)); + } else { + return floor(($date2 - $date1)*$i); + } +} +?> \ No newline at end of file diff --git a/system/libs/smarty/plugins/function.debug.php b/system/libs/smarty/plugins/function.debug.php new file mode 100755 index 0000000..4345230 --- /dev/null +++ b/system/libs/smarty/plugins/function.debug.php @@ -0,0 +1,35 @@ + + * Name: debug
+ * Date: July 1, 2002
+ * Purpose: popup debug window + * @link http://smarty.php.net/manual/en/language.function.debug.php {debug} + * (Smarty online manual) + * @author Monte Ohrt + * @version 1.0 + * @param array + * @param Smarty + * @return string output from {@link Smarty::_generate_debug_output()} + */ +function smarty_function_debug($params, &$smarty) +{ + if (isset($params['output'])) { + $smarty->assign('_smarty_debug_output', $params['output']); + } + require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); + return smarty_core_display_debug_console(null, $smarty); +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.eval.php b/system/libs/smarty/plugins/function.eval.php new file mode 100755 index 0000000..ff0472d --- /dev/null +++ b/system/libs/smarty/plugins/function.eval.php @@ -0,0 +1,49 @@ + + * Name: eval
+ * Purpose: evaluate a template variable as a template
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval} + * (Smarty online manual) + * @author Monte Ohrt + * @param array + * @param Smarty + */ +function smarty_function_eval($params, &$smarty) +{ + + if (!isset($params['var'])) { + $smarty->trigger_error("eval: missing 'var' parameter"); + return; + } + + if($params['var'] == '') { + return; + } + + $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled); + + ob_start(); + $smarty->_eval('?>' . $_var_compiled); + $_contents = ob_get_contents(); + ob_end_clean(); + + if (!empty($params['assign'])) { + $smarty->assign($params['assign'], $_contents); + } else { + return $_contents; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.fetch.php b/system/libs/smarty/plugins/function.fetch.php new file mode 100755 index 0000000..81b1bfc --- /dev/null +++ b/system/libs/smarty/plugins/function.fetch.php @@ -0,0 +1,221 @@ + + * Name: fetch
+ * Purpose: fetch file, web or ftp data and display results + * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch} + * (Smarty online manual) + * @author Monte Ohrt + * @param array + * @param Smarty + * @return string|null if the assign parameter is passed, Smarty assigns the + * result to a template variable + */ +function smarty_function_fetch($params, &$smarty) +{ + if (empty($params['file'])) { + $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty"); + return; + } + + $content = ''; + if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) { + $_params = array('resource_type' => 'file', 'resource_name' => $params['file']); + require_once(SMARTY_CORE_DIR . 'core.is_secure.php'); + if(!smarty_core_is_secure($_params, $smarty)) { + $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed'); + return; + } + + // fetch the file + if($fp = @fopen($params['file'],'r')) { + while(!feof($fp)) { + $content .= fgets ($fp,4096); + } + fclose($fp); + } else { + $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\''); + return; + } + } else { + // not a local file + if(preg_match('!^http://!i',$params['file'])) { + // http fetch + if($uri_parts = parse_url($params['file'])) { + // set defaults + $host = $server_name = $uri_parts['host']; + $timeout = 30; + $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; + $agent = "Smarty Template Engine ".$smarty->_version; + $referer = ""; + $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; + $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; + $_is_proxy = false; + if(empty($uri_parts['port'])) { + $port = 80; + } else { + $port = $uri_parts['port']; + } + if(!empty($uri_parts['user'])) { + $user = $uri_parts['user']; + } + if(!empty($uri_parts['pass'])) { + $pass = $uri_parts['pass']; + } + // loop through parameters, setup headers + foreach($params as $param_key => $param_value) { + switch($param_key) { + case "file": + case "assign": + case "assign_headers": + break; + case "user": + if(!empty($param_value)) { + $user = $param_value; + } + break; + case "pass": + if(!empty($param_value)) { + $pass = $param_value; + } + break; + case "accept": + if(!empty($param_value)) { + $accept = $param_value; + } + break; + case "header": + if(!empty($param_value)) { + if(!preg_match('![\w\d-]+: .+!',$param_value)) { + $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'"); + return; + } else { + $extra_headers[] = $param_value; + } + } + break; + case "proxy_host": + if(!empty($param_value)) { + $proxy_host = $param_value; + } + break; + case "proxy_port": + if(!preg_match('!\D!', $param_value)) { + $proxy_port = (int) $param_value; + } else { + $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); + return; + } + break; + case "agent": + if(!empty($param_value)) { + $agent = $param_value; + } + break; + case "referer": + if(!empty($param_value)) { + $referer = $param_value; + } + break; + case "timeout": + if(!preg_match('!\D!', $param_value)) { + $timeout = (int) $param_value; + } else { + $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); + return; + } + break; + default: + $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'"); + return; + } + } + if(!empty($proxy_host) && !empty($proxy_port)) { + $_is_proxy = true; + $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout); + } else { + $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout); + } + + if(!$fp) { + $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)"); + return; + } else { + if($_is_proxy) { + fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); + } else { + fputs($fp, "GET $uri HTTP/1.0\r\n"); + } + if(!empty($host)) { + fputs($fp, "Host: $host\r\n"); + } + if(!empty($accept)) { + fputs($fp, "Accept: $accept\r\n"); + } + if(!empty($agent)) { + fputs($fp, "User-Agent: $agent\r\n"); + } + if(!empty($referer)) { + fputs($fp, "Referer: $referer\r\n"); + } + if(isset($extra_headers) && is_array($extra_headers)) { + foreach($extra_headers as $curr_header) { + fputs($fp, $curr_header."\r\n"); + } + } + if(!empty($user) && !empty($pass)) { + fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); + } + + fputs($fp, "\r\n"); + while(!feof($fp)) { + $content .= fgets($fp,4096); + } + fclose($fp); + $csplit = split("\r\n\r\n",$content,2); + + $content = $csplit[1]; + + if(!empty($params['assign_headers'])) { + $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0])); + } + } + } else { + $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax"); + return; + } + } else { + // ftp fetch + if($fp = @fopen($params['file'],'r')) { + while(!feof($fp)) { + $content .= fgets ($fp,4096); + } + fclose($fp); + } else { + $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\''); + return; + } + } + + } + + + if (!empty($params['assign'])) { + $smarty->assign($params['assign'],$content); + } else { + return $content; + } +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.html_checkboxes.php b/system/libs/smarty/plugins/function.html_checkboxes.php new file mode 100755 index 0000000..ed8ad7f --- /dev/null +++ b/system/libs/smarty/plugins/function.html_checkboxes.php @@ -0,0 +1,143 @@ + + * Type: function
+ * Name: html_checkboxes
+ * Date: 24.Feb.2003
+ * Purpose: Prints out a list of checkbox input types
+ * Input:
+ * - name (optional) - string default "checkbox" + * - values (required) - array + * - options (optional) - associative array + * - checked (optional) - array default not set + * - separator (optional) - ie
or   + * - output (optional) - the output next to each checkbox + * - assign (optional) - assign the output as an array to this variable + * Examples: + *
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='
' output=$names} + * {html_checkboxes values=$ids checked=$checked separator='
' output=$names} + *
+ * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * (Smarty online manual) + * @author Christopher Kvarme + * @author credits to Monte Ohrt + * @version 1.0 + * @param array + * @param Smarty + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_checkboxes($params, &$smarty) +{ + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $name = 'checkbox'; + $values = null; + $options = null; + $selected = null; + $separator = ''; + $labels = true; + $output = null; + + $extra = ''; + + foreach($params as $_key => $_val) { + switch($_key) { + case 'name': + case 'separator': + $$_key = $_val; + break; + + case 'labels': + $$_key = (bool)$_val; + break; + + case 'options': + $$_key = (array)$_val; + break; + + case 'values': + case 'output': + $$_key = array_values((array)$_val); + break; + + case 'checked': + case 'selected': + $selected = array_map('strval', array_values((array)$_val)); + break; + + case 'checkboxes': + $smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); + $options = (array)$_val; + break; + + case 'assign': + break; + + default: + if(!is_array($_val)) { + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + } else { + $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (!isset($options) && !isset($values)) + return ''; /* raise error here? */ + + settype($selected, 'array'); + $_html_result = array(); + + if (isset($options)) { + + foreach ($options as $_key=>$_val) + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + + + } else { + foreach ($values as $_i=>$_key) { + $_val = isset($output[$_i]) ? $output[$_i] : ''; + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); + } + + } + + if(!empty($params['assign'])) { + $smarty->assign($params['assign'], $_html_result); + } else { + return implode("\n",$_html_result); + } + +} + +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) { + $_output = ''; + if ($labels) $_output .= ''; + $_output .= $separator; + + return $_output; +} + +?> diff --git a/system/libs/smarty/plugins/function.html_image.php b/system/libs/smarty/plugins/function.html_image.php new file mode 100755 index 0000000..9abae72 --- /dev/null +++ b/system/libs/smarty/plugins/function.html_image.php @@ -0,0 +1,142 @@ + + * Name: html_image
+ * Date: Feb 24, 2003
+ * Purpose: format HTML tags for the image
+ * Input:
+ * - file = file (and path) of image (required) + * - height = image height (optional, default actual height) + * - width = image width (optional, default actual width) + * - basedir = base directory for absolute paths, default + * is environment variable DOCUMENT_ROOT + * - path_prefix = prefix for path output (optional, default empty) + * + * Examples: {html_image file="/images/masthead.gif"} + * Output: + * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image} + * (Smarty online manual) + * @author Monte Ohrt + * @author credits to Duda - wrote first image function + * in repository, helped with lots of functionality + * @version 1.0 + * @param array + * @param Smarty + * @return string + * @uses smarty_function_escape_special_chars() + */ +function smarty_function_html_image($params, &$smarty) +{ + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); + + $alt = ''; + $file = ''; + $height = ''; + $width = ''; + $extra = ''; + $prefix = ''; + $suffix = ''; + $path_prefix = ''; + $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : ''; + foreach($params as $_key => $_val) { + switch($_key) { + case 'file': + case 'height': + case 'width': + case 'dpi': + case 'path_prefix': + case 'basedir': + $$_key = $_val; + break; + + case 'alt': + if(!is_array($_val)) { + $$_key = smarty_function_escape_special_chars($_val); + } else { + $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + + case 'link': + case 'href': + $prefix = ''; + $suffix = ''; + break; + + default: + if(!is_array($_val)) { + $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; + } else { + $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); + } + break; + } + } + + if (empty($file)) { + $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE); + return; + } + + if (substr($file,0,1) == '/') { + $_image_path = $basedir . $file; + } else { + $_image_path = $file; + } + + if(!isset($params['width']) || !isset($params['height'])) { + if(!$_image_data = @getimagesize($_image_path)) { + if(!file_exists($_image_path)) { + $smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE); + return; + } else if(!is_readable($_image_path)) { + $smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE); + return; + } else { + $smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE); + return; + } + } + if ($smarty->security && + ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) && + (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) && + (!smarty_core_is_secure($_params, $smarty)) ) { + $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE); + } + + if(!isset($params['width'])) { + $width = $_image_data[0]; + } + if(!isset($params['height'])) { + $height = $_image_data[1]; + } + + } + + if(isset($params['dpi'])) { + if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) { + $dpi_default = 72; + } else { + $dpi_default = 96; + } + $_resize = $dpi_default/$params['dpi']; + $width = round($width * $_resize); + $height = round($height * $_resize); + } + + return $prefix . ''.$alt.'' . $suffix; +} + +/* vim: set expandtab: */ + +?> diff --git a/system/libs/smarty/plugins/function.html_options.php b/system/libs/smarty/plugins/function.html_options.php new file mode 100755 index 0000000..cebadde --- /dev/null +++ b/system/libs/smarty/plugins/function.html_options.php @@ -0,0 +1,122 @@ + + * Name: html_options
+ * Input:
+ * - name (optional) - string default "select" + * - values (required if no options supplied) - array + * - options (required if no values supplied) - associative array + * - selected (optional) - string default not set + * - output (required if not options supplied) - array + * Purpose: Prints the list of