From 4daaa67710175652895474789ad0c5461434ad0a Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 16 Oct 2017 16:49:35 +0200 Subject: [PATCH] * new account.login view for tibiacom template * added new indicator icons for create account, create character and change character name * attempt to fix incorrect views counter behavior (its resetting to 0 in some cases) * moved check_* functions to class Validator * from now all validators ajax requests will fire onblur instead of onkeyup * ajax requests returns now json instead of xml * added 404 response when file is not found * fixed gallery --- images/global/general/blank.gif | Bin 0 -> 71 bytes images/global/general/box-bottom.gif | Bin 0 -> 2015 bytes images/global/general/box-top.gif | Bin 0 -> 2017 bytes images/global/general/chain.gif | Bin 0 -> 845 bytes images/global/general/favicon.ico | Bin 0 -> 3638 bytes images/global/general/hide.gif | Bin 0 -> 469 bytes images/global/general/minus.gif | Bin 0 -> 224 bytes images/global/general/nok.gif | Bin 0 -> 117 bytes images/global/general/ok.gif | Bin 0 -> 113 bytes images/global/general/plus.gif | Bin 0 -> 224 bytes images/global/general/show.gif | Bin 0 -> 681 bytes index.php | 18 +- install/steps/database.php | 5 +- system/counter.php | 9 +- system/functions.php | 301 +------------- system/init.php | 2 +- system/libs/pot/OTS_Player.php | 4 +- system/libs/spells.php | 5 +- system/libs/validator.php | 384 +++++++++++++++++- system/pages/accountmanagement.php | 58 ++- system/pages/admin/players.php | 14 +- system/pages/characters.php | 5 +- system/pages/createaccount.php | 39 +- system/pages/gallery.php | 6 +- system/pages/guilds.php | 92 ++--- system/pages/houses.php | 2 +- system/pages/lostaccount.php | 22 +- .../templates/account.change_name.html.twig | 6 +- system/templates/account.create.html.twig | 51 +-- system/templates/account.create.js.html.twig | 140 ++++++- .../account.create_character.html.twig | 8 +- system/templates/gallery.get.html.twig | 4 +- system/templates/gallery.html.twig | 20 +- .../kathrine/account.change_name.html.twig | 2 +- templates/tibiacom/account.login.html.twig | 144 +++++++ .../global/buttons/_sbutton_accountlost.gif | Bin 0 -> 352 bytes .../images/global/buttons/_sbutton_back.gif | Bin 0 -> 228 bytes .../images/global/buttons/_sbutton_buynow.gif | Bin 0 -> 1458 bytes .../images/global/buttons/_sbutton_cancel.gif | Bin 0 -> 247 bytes .../global/buttons/_sbutton_changeemail.gif | Bin 0 -> 394 bytes .../global/buttons/_sbutton_changename.gif | Bin 0 -> 369 bytes .../buttons/_sbutton_changepassword.gif | Bin 0 -> 458 bytes .../global/buttons/_sbutton_changesex.gif | Bin 0 -> 378 bytes .../global/buttons/_sbutton_confirm.gif | Bin 0 -> 1381 bytes .../global/buttons/_sbutton_continue.gif | Bin 0 -> 285 bytes .../global/buttons/_sbutton_createaccount.gif | Bin 0 -> 1488 bytes .../buttons/_sbutton_createcharacter.gif | Bin 0 -> 390 bytes .../global/buttons/_sbutton_declarewar.gif | Bin 0 -> 339 bytes .../images/global/buttons/_sbutton_delete.gif | Bin 0 -> 415 bytes .../global/buttons/_sbutton_disbandguild.gif | Bin 0 -> 1487 bytes .../images/global/buttons/_sbutton_edit.gif | Bin 0 -> 217 bytes .../buttons/_sbutton_editdescription.gif | Bin 0 -> 1552 bytes .../global/buttons/_sbutton_editmembers.gif | Bin 0 -> 1476 bytes .../global/buttons/_sbutton_editranks.gif | Bin 0 -> 1439 bytes .../global/buttons/_sbutton_foundguild.gif | Bin 0 -> 1457 bytes .../buttons/_sbutton_getextraservice.gif | Bin 0 -> 1521 bytes .../global/buttons/_sbutton_getmount.gif | Bin 0 -> 1437 bytes .../global/buttons/_sbutton_getoutfit.gif | Bin 0 -> 1434 bytes .../global/buttons/_sbutton_getpremium.gif | Bin 0 -> 345 bytes .../buttons/_sbutton_getpremiumscroll.gif | Bin 0 -> 1542 bytes .../buttons/_sbutton_getpremiumtime.gif | Bin 0 -> 1527 bytes .../global/buttons/_sbutton_gettibiacoins.gif | Bin 0 -> 295 bytes .../global/buttons/_sbutton_guildevents.gif | Bin 0 -> 1464 bytes .../global/buttons/_sbutton_guildwars.gif | Bin 0 -> 324 bytes .../images/global/buttons/_sbutton_iagree.gif | Bin 0 -> 304 bytes .../buttons/_sbutton_invitecharacter.gif | Bin 0 -> 1506 bytes .../global/buttons/_sbutton_joinguild.gif | Bin 0 -> 1419 bytes .../global/buttons/_sbutton_leaveguild.gif | Bin 0 -> 1448 bytes .../images/global/buttons/_sbutton_login.gif | Bin 0 -> 265 bytes .../images/global/buttons/_sbutton_logout.gif | Bin 0 -> 291 bytes .../global/buttons/_sbutton_manageaccount.gif | Bin 0 -> 1534 bytes .../images/global/buttons/_sbutton_next.gif | Bin 0 -> 1345 bytes .../global/buttons/_sbutton_overview.gif | Bin 0 -> 1404 bytes .../images/global/buttons/_sbutton_painel.gif | Bin 0 -> 781 bytes .../global/buttons/_sbutton_previous.gif | Bin 0 -> 1388 bytes .../buttons/_sbutton_registeraccount.gif | Bin 0 -> 443 bytes .../global/buttons/_sbutton_renameaccount.gif | Bin 0 -> 379 bytes .../buttons/_sbutton_resignleadership.gif | Bin 0 -> 1578 bytes .../global/buttons/_sbutton_showall.gif | Bin 0 -> 1407 bytes .../global/buttons/_sbutton_showonline.gif | Bin 0 -> 1458 bytes .../images/global/buttons/_sbutton_submit.gif | Bin 0 -> 267 bytes .../buttons/_sbutton_terminateaccount.gif | Bin 0 -> 1525 bytes .../global/buttons/_sbutton_usegamecode.gif | Bin 0 -> 1488 bytes .../global/buttons/_sbutton_vermais.gif | Bin 0 -> 484 bytes .../images/global/buttons/_sbutton_view.gif | Bin 0 -> 1333 bytes .../buttons/_sbutton_viewallfansites.gif | Bin 0 -> 405 bytes .../global/buttons/_sbutton_viewhistory.gif | Bin 0 -> 383 bytes .../global/buttons/_sbutton_votenow.gif | Bin 0 -> 299 bytes .../global/buttons/mediumbutton-over.gif | Bin 0 -> 4918 bytes .../images/global/buttons/mediumbutton.gif | Bin 0 -> 3728 bytes .../buttons/mediumbutton_createaccount.png | Bin 0 -> 4196 bytes .../global/buttons/mediumbutton_download.png | Bin 0 -> 3677 bytes .../global/buttons/mediumbutton_myaccount.png | Bin 0 -> 3864 bytes .../global/buttons/mediumbutton_playnow.png | Bin 0 -> 3659 bytes .../images/global/buttons/sbutton.gif | Bin 0 -> 1356 bytes .../images/global/buttons/sbutton_back.gif | Bin 0 -> 1971 bytes .../images/global/buttons/sbutton_green.gif | Bin 0 -> 2518 bytes .../global/buttons/sbutton_green_over.gif | Bin 0 -> 1679 bytes .../images/global/buttons/sbutton_login.gif | Bin 0 -> 1959 bytes .../images/global/buttons/sbutton_over.gif | Bin 0 -> 443 bytes .../images/global/buttons/sbutton_red.gif | Bin 0 -> 2535 bytes .../global/buttons/sbutton_red_over.gif | Bin 0 -> 1679 bytes .../images/global/buttons/sbutton_submit.gif | Bin 0 -> 1974 bytes .../images/global/buttons/sbutton_view.gif | Bin 0 -> 1997 bytes .../images/global/content/attentionsign.gif | Bin 0 -> 201 bytes .../images/global/content/back-to-top.gif | Bin 0 -> 1067 bytes .../images/global/content/border-1.gif | Bin 0 -> 133 bytes .../images/global/content/box-frame-edge.gif | Bin 0 -> 95 bytes .../global/content/box-frame-horizontal.gif | Bin 0 -> 390 bytes .../global/content/box-frame-vertical.gif | Bin 0 -> 104 bytes .../tibiacom/images/global/content/bullet.gif | Bin 0 -> 943 bytes .../images/global/content/corner-bl.gif | Bin 0 -> 204 bytes .../images/global/content/corner-br.gif | Bin 0 -> 204 bytes .../images/global/content/corner-tl.gif | Bin 0 -> 208 bytes .../images/global/content/corner-tr.gif | Bin 0 -> 205 bytes .../global/content/headline-bracer-left.gif | Bin 0 -> 1913 bytes .../global/content/headline-bracer-right.gif | Bin 0 -> 1921 bytes .../global/content/helper-div-arrow.png | Bin 0 -> 1028 bytes .../tibiacom/images/global/content/info.gif | Bin 0 -> 1795 bytes .../content/newsheadline_background.gif | Bin 0 -> 1205 bytes .../global/content/newsicon_cipsoft_small.gif | Bin 0 -> 1690 bytes .../global/content/newsicon_community_big.gif | Bin 0 -> 459 bytes .../content/newsicon_community_small.gif | Bin 0 -> 223 bytes .../content/newsicon_development_big.gif | Bin 0 -> 321 bytes .../content/newsicon_development_small.gif | Bin 0 -> 202 bytes .../global/content/newsicon_support_small.gif | Bin 0 -> 200 bytes .../global/content/newsicon_technical_big.gif | Bin 0 -> 216 bytes .../content/newsicon_technical_small.gif | Bin 0 -> 201 bytes .../images/global/content/order_asc.gif | Bin 0 -> 56 bytes .../images/global/content/order_desc.gif | Bin 0 -> 56 bytes .../images/global/content/ornament.gif | Bin 0 -> 5279 bytes .../content/progressbar/payment_accepted.gif | Bin 0 -> 2792 bytes .../progressbar/progress-bar-icon-0-blue.gif | Bin 0 -> 2110 bytes .../progressbar/progress-bar-icon-0-green.gif | Bin 0 -> 1515 bytes .../progressbar/progress-bar-icon-1-blue.gif | Bin 0 -> 1620 bytes .../progressbar/progress-bar-icon-1-green.gif | Bin 0 -> 1607 bytes .../progressbar/progress-bar-icon-2-blue.gif | Bin 0 -> 1617 bytes .../progressbar/progress-bar-icon-2-green.gif | Bin 0 -> 1617 bytes .../progressbar/progress-bar-icon-3-blue.gif | Bin 0 -> 1587 bytes .../progressbar/progress-bar-icon-3-green.gif | Bin 0 -> 1588 bytes .../progressbar/progress-bar-icon-4-blue.gif | Bin 0 -> 2126 bytes .../progressbar/progress-bar-icon-4-green.gif | Bin 0 -> 1529 bytes .../progressbar/progress-bar-tube-blue.gif | Bin 0 -> 609 bytes .../progress-bar-tube-green-blue.gif | Bin 0 -> 750 bytes .../progressbar/progress-bar-tube-green.gif | Bin 0 -> 609 bytes .../progress-bar-tube-left-blue.gif | Bin 0 -> 556 bytes .../progress-bar-tube-left-green.gif | Bin 0 -> 551 bytes .../progress-bar-tube-right-blue.gif | Bin 0 -> 572 bytes .../progress-bar-tube-right-green.gif | Bin 0 -> 573 bytes .../content/progressbar/stonebar-center.gif | Bin 0 -> 1872 bytes .../content/progressbar/stonebar-left-end.gif | Bin 0 -> 771 bytes .../progressbar/stonebar-right-end.gif | Bin 0 -> 782 bytes .../tibiacom/images/global/content/scroll.gif | Bin 0 -> 8201 bytes .../images/global/content/stonebar-center.gif | Bin 0 -> 1872 bytes .../global/content/stonebar-left-end.gif | Bin 0 -> 771 bytes .../global/content/stonebar-right-end.gif | Bin 0 -> 782 bytes .../global/content/table-headline-border.gif | Bin 0 -> 390 bytes .../images/global/content/table-shadow-bl.gif | Bin 0 -> 98 bytes .../images/global/content/table-shadow-bm.gif | Bin 0 -> 63 bytes .../images/global/content/table-shadow-br.gif | Bin 0 -> 98 bytes .../images/global/content/table-shadow-rm.gif | Bin 0 -> 50 bytes .../images/global/content/table-shadow-rt.gif | Bin 0 -> 97 bytes .../global/content/title-background-green.gif | Bin 0 -> 1204 bytes .../global/forum/button_newtopic_off.gif | Bin 0 -> 1660 bytes .../images/global/forum/cip_post_border_h.jpg | Bin 0 -> 4297 bytes .../global/forum/cip_post_border_ll.jpg | Bin 0 -> 354 bytes .../global/forum/cip_post_border_lu.jpg | Bin 0 -> 370 bytes .../global/forum/cip_post_border_rl.jpg | Bin 0 -> 379 bytes .../global/forum/cip_post_border_ru.jpg | Bin 0 -> 372 bytes .../images/global/forum/cip_post_border_v.jpg | Bin 0 -> 1680 bytes .../images/global/forum/cip_post_icon.gif | Bin 0 -> 4475 bytes .../tibiacom/images/global/forum/icons/11.gif | Bin 0 -> 981 bytes .../tibiacom/images/global/forum/icons/12.gif | Bin 0 -> 970 bytes .../tibiacom/images/global/forum/icons/13.gif | Bin 0 -> 963 bytes .../tibiacom/images/global/forum/icons/14.gif | Bin 0 -> 954 bytes .../tibiacom/images/global/forum/icons/15.gif | Bin 0 -> 960 bytes .../tibiacom/images/global/forum/icons/16.gif | Bin 0 -> 979 bytes .../tibiacom/images/global/forum/icons/17.gif | Bin 0 -> 974 bytes .../tibiacom/images/global/forum/icons/18.gif | Bin 0 -> 948 bytes .../tibiacom/images/global/forum/icons/19.gif | Bin 0 -> 983 bytes .../tibiacom/images/global/forum/icons/20.gif | Bin 0 -> 979 bytes .../tibiacom/images/global/forum/icons/21.gif | Bin 0 -> 979 bytes .../tibiacom/images/global/forum/icons/22.gif | Bin 0 -> 975 bytes .../tibiacom/images/global/forum/icons/23.gif | Bin 0 -> 965 bytes .../tibiacom/images/global/forum/icons/24.gif | Bin 0 -> 920 bytes .../tibiacom/images/global/forum/icons/25.gif | Bin 0 -> 152 bytes .../tibiacom/images/global/forum/icons/26.gif | Bin 0 -> 141 bytes .../tibiacom/images/global/forum/icons/27.gif | Bin 0 -> 925 bytes .../images/global/forum/logo_closed.gif | Bin 0 -> 1057 bytes .../tibiacom/images/global/forum/logo_hot.gif | Bin 0 -> 891 bytes .../images/global/forum/logo_hotnew.gif | Bin 0 -> 993 bytes .../images/global/forum/logo_multipage.gif | Bin 0 -> 196 bytes .../tibiacom/images/global/forum/logo_new.gif | Bin 0 -> 951 bytes .../images/global/forum/logo_oldpost.gif | Bin 0 -> 135 bytes .../images/global/forum/logo_sticky.gif | Bin 0 -> 1267 bytes .../tibiacom/images/global/forum/smile/1.gif | Bin 0 -> 981 bytes .../tibiacom/images/global/forum/smile/10.gif | Bin 0 -> 975 bytes .../tibiacom/images/global/forum/smile/2.gif | Bin 0 -> 970 bytes .../tibiacom/images/global/forum/smile/3.gif | Bin 0 -> 963 bytes .../tibiacom/images/global/forum/smile/4.gif | Bin 0 -> 979 bytes .../tibiacom/images/global/forum/smile/5.gif | Bin 0 -> 974 bytes .../tibiacom/images/global/forum/smile/6.gif | Bin 0 -> 948 bytes .../tibiacom/images/global/forum/smile/7.gif | Bin 0 -> 983 bytes .../tibiacom/images/global/forum/smile/8.gif | Bin 0 -> 979 bytes .../tibiacom/images/global/forum/smile/9.gif | Bin 0 -> 979 bytes .../general/apple-touch-icon-114x114.png | Bin 0 -> 31970 bytes .../general/apple-touch-icon-120x120.png | Bin 0 -> 34996 bytes .../general/apple-touch-icon-144x144.png | Bin 0 -> 48308 bytes .../general/apple-touch-icon-152x152.png | Bin 0 -> 52549 bytes .../global/general/apple-touch-icon-72x72.png | Bin 0 -> 13879 bytes .../global/general/apple-touch-icon-76x76.png | Bin 0 -> 15312 bytes .../general/apple-touch-icon-precomposed.png | Bin 0 -> 9186 bytes .../global/general/apple-touch-icon.png | Bin 0 -> 9186 bytes .../tibiacom/images/global/general/blank.gif | Bin 807 -> 71 bytes .../images/global/general/box-bottom.gif | Bin .../images/global/general/box-top.gif | Bin .../tibiacom/images/global/general/chain.gif | Bin .../images/global/general/favicon.ico | Bin 0 -> 3638 bytes .../tibiacom/images/global/general/hide.gif | Bin 0 -> 469 bytes .../tibiacom/images/global/general/minus.gif | Bin .../tibiacom/images/global/general/nok.gif | Bin 0 -> 117 bytes .../tibiacom/images/global/general/ok.gif | Bin 0 -> 113 bytes .../tibiacom/images/global/general/plus.gif | Bin .../tibiacom/images/global/general/show.gif | Bin 0 -> 681 bytes .../global/header/background-artwork.jpg | Bin 0 -> 359154 bytes .../images/global/header/dragonlord.gif | Bin 0 -> 1123 bytes .../global/header/pedestal-and-online.gif | Bin 0 -> 7998 bytes .../global/header/tibia-logo-artwork-top.gif | Bin 0 -> 15286 bytes .../loginbox-font-create-account-over.gif | Bin 0 -> 1549 bytes .../loginbox/loginbox-font-create-account.gif | Bin 0 -> 1563 bytes .../loginbox/loginbox-font-logout-over.gif | Bin 0 -> 1436 bytes .../global/loginbox/loginbox-font-logout.gif | Bin 0 -> 1435 bytes .../loginbox-textfield-background.gif | Bin 0 -> 1218 bytes .../global/menu/button-background-over.gif | Bin 0 -> 2326 bytes .../images/global/menu/button-background.gif | Bin 0 -> 3543 bytes .../images/global/menu/green-light.gif | Bin 0 -> 50 bytes .../images/global/menu/icon-account.gif | Bin 0 -> 297 bytes .../images/global/menu/icon-activesubmenu.gif | Bin 0 -> 58 bytes .../images/global/menu/icon-community.gif | Bin 0 -> 594 bytes .../images/global/menu/icon-forum.gif | Bin 0 -> 424 bytes .../images/global/menu/icon-library.gif | Bin 0 -> 394 bytes .../tibiacom/images/global/menu/icon-news.gif | Bin 0 -> 312 bytes .../images/global/menu/icon-shops.gif | Bin 0 -> 1267 bytes .../images/global/menu/icon-support.gif | Bin 0 -> 371 bytes .../images/global/menu/label-account.gif | Bin 0 -> 603 bytes .../images/global/menu/label-community.gif | Bin 0 -> 600 bytes .../images/global/menu/label-forum.gif | Bin 0 -> 571 bytes .../images/global/menu/label-library.gif | Bin 0 -> 584 bytes .../images/global/menu/label-news.gif | Bin 0 -> 475 bytes .../images/global/menu/label-shops.gif | Bin 0 -> 718 bytes .../images/global/menu/label-support.gif | Bin 0 -> 641 bytes .../current-poll/currentpollbox.gif | Bin 0 -> 10720 bytes .../themeboxes/fansites/border_promoted.gif | Bin 0 -> 22343 bytes .../themeboxes/fansites/fansites_themebox.gif | Bin 0 -> 4977 bytes .../themeboxes/networks/networksbox.png | Bin 0 -> 47043 bytes .../networks/tibia-facebook-page-logo.png | Bin 0 -> 7654 bytes .../global/themeboxes/premium/premiumbox.gif | Bin 0 -> 40322 bytes .../global/themeboxes/screenshot/frame.png | Bin 0 -> 1337 bytes .../themeboxes/screenshot/screenshotbox.gif | Bin 0 -> 3879 bytes .../themeboxes/serverinfo/serverinfo.gif | Bin 0 -> 16185 bytes .../themeboxes/serverinfo/serverinfobox.gif | Bin 0 -> 3509 bytes tools/check_name.js | 32 +- tools/validate.php | 52 ++- 263 files changed, 886 insertions(+), 539 deletions(-) create mode 100755 images/global/general/blank.gif create mode 100755 images/global/general/box-bottom.gif create mode 100755 images/global/general/box-top.gif create mode 100755 images/global/general/chain.gif create mode 100755 images/global/general/favicon.ico create mode 100755 images/global/general/hide.gif create mode 100755 images/global/general/minus.gif create mode 100755 images/global/general/nok.gif create mode 100755 images/global/general/ok.gif create mode 100755 images/global/general/plus.gif create mode 100755 images/global/general/show.gif create mode 100644 templates/tibiacom/account.login.html.twig create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_accountlost.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_back.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_buynow.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_cancel.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_changeemail.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_changename.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_changepassword.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_changesex.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_confirm.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_continue.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_createaccount.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_createcharacter.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_declarewar.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_delete.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_disbandguild.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_edit.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_editdescription.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_editmembers.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_editranks.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_foundguild.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_getextraservice.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_getmount.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_getoutfit.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_getpremium.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_getpremiumscroll.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_getpremiumtime.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_gettibiacoins.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_guildevents.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_guildwars.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_iagree.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_invitecharacter.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_joinguild.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_leaveguild.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_login.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_logout.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_manageaccount.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_next.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_overview.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_painel.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_previous.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_registeraccount.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_renameaccount.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_resignleadership.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_showall.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_showonline.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_submit.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_terminateaccount.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_usegamecode.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_vermais.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_view.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_viewallfansites.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_viewhistory.gif create mode 100755 templates/tibiacom/images/global/buttons/_sbutton_votenow.gif create mode 100755 templates/tibiacom/images/global/buttons/mediumbutton-over.gif create mode 100755 templates/tibiacom/images/global/buttons/mediumbutton.gif create mode 100755 templates/tibiacom/images/global/buttons/mediumbutton_createaccount.png create mode 100755 templates/tibiacom/images/global/buttons/mediumbutton_download.png create mode 100755 templates/tibiacom/images/global/buttons/mediumbutton_myaccount.png create mode 100755 templates/tibiacom/images/global/buttons/mediumbutton_playnow.png create mode 100755 templates/tibiacom/images/global/buttons/sbutton.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_back.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_green.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_green_over.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_login.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_over.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_red.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_red_over.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_submit.gif create mode 100755 templates/tibiacom/images/global/buttons/sbutton_view.gif create mode 100755 templates/tibiacom/images/global/content/attentionsign.gif create mode 100755 templates/tibiacom/images/global/content/back-to-top.gif create mode 100755 templates/tibiacom/images/global/content/border-1.gif create mode 100755 templates/tibiacom/images/global/content/box-frame-edge.gif create mode 100755 templates/tibiacom/images/global/content/box-frame-horizontal.gif create mode 100755 templates/tibiacom/images/global/content/box-frame-vertical.gif create mode 100755 templates/tibiacom/images/global/content/bullet.gif create mode 100755 templates/tibiacom/images/global/content/corner-bl.gif create mode 100755 templates/tibiacom/images/global/content/corner-br.gif create mode 100755 templates/tibiacom/images/global/content/corner-tl.gif create mode 100755 templates/tibiacom/images/global/content/corner-tr.gif create mode 100755 templates/tibiacom/images/global/content/headline-bracer-left.gif create mode 100755 templates/tibiacom/images/global/content/headline-bracer-right.gif create mode 100755 templates/tibiacom/images/global/content/helper-div-arrow.png create mode 100755 templates/tibiacom/images/global/content/info.gif create mode 100755 templates/tibiacom/images/global/content/newsheadline_background.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_cipsoft_small.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_community_big.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_community_small.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_development_big.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_development_small.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_support_small.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_technical_big.gif create mode 100755 templates/tibiacom/images/global/content/newsicon_technical_small.gif create mode 100755 templates/tibiacom/images/global/content/order_asc.gif create mode 100755 templates/tibiacom/images/global/content/order_desc.gif create mode 100755 templates/tibiacom/images/global/content/ornament.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/payment_accepted.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-0-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-0-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-1-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-1-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-2-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-2-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-3-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-3-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-4-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-icon-4-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-tube-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-tube-green-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-tube-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-tube-left-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-tube-left-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-tube-right-blue.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/progress-bar-tube-right-green.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/stonebar-center.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/stonebar-left-end.gif create mode 100755 templates/tibiacom/images/global/content/progressbar/stonebar-right-end.gif create mode 100755 templates/tibiacom/images/global/content/scroll.gif create mode 100755 templates/tibiacom/images/global/content/stonebar-center.gif create mode 100755 templates/tibiacom/images/global/content/stonebar-left-end.gif create mode 100755 templates/tibiacom/images/global/content/stonebar-right-end.gif create mode 100755 templates/tibiacom/images/global/content/table-headline-border.gif create mode 100755 templates/tibiacom/images/global/content/table-shadow-bl.gif create mode 100755 templates/tibiacom/images/global/content/table-shadow-bm.gif create mode 100755 templates/tibiacom/images/global/content/table-shadow-br.gif create mode 100755 templates/tibiacom/images/global/content/table-shadow-rm.gif create mode 100755 templates/tibiacom/images/global/content/table-shadow-rt.gif create mode 100755 templates/tibiacom/images/global/content/title-background-green.gif create mode 100755 templates/tibiacom/images/global/forum/button_newtopic_off.gif create mode 100755 templates/tibiacom/images/global/forum/cip_post_border_h.jpg create mode 100755 templates/tibiacom/images/global/forum/cip_post_border_ll.jpg create mode 100755 templates/tibiacom/images/global/forum/cip_post_border_lu.jpg create mode 100755 templates/tibiacom/images/global/forum/cip_post_border_rl.jpg create mode 100755 templates/tibiacom/images/global/forum/cip_post_border_ru.jpg create mode 100755 templates/tibiacom/images/global/forum/cip_post_border_v.jpg create mode 100755 templates/tibiacom/images/global/forum/cip_post_icon.gif create mode 100755 templates/tibiacom/images/global/forum/icons/11.gif create mode 100755 templates/tibiacom/images/global/forum/icons/12.gif create mode 100755 templates/tibiacom/images/global/forum/icons/13.gif create mode 100755 templates/tibiacom/images/global/forum/icons/14.gif create mode 100755 templates/tibiacom/images/global/forum/icons/15.gif create mode 100755 templates/tibiacom/images/global/forum/icons/16.gif create mode 100755 templates/tibiacom/images/global/forum/icons/17.gif create mode 100755 templates/tibiacom/images/global/forum/icons/18.gif create mode 100755 templates/tibiacom/images/global/forum/icons/19.gif create mode 100755 templates/tibiacom/images/global/forum/icons/20.gif create mode 100755 templates/tibiacom/images/global/forum/icons/21.gif create mode 100755 templates/tibiacom/images/global/forum/icons/22.gif create mode 100755 templates/tibiacom/images/global/forum/icons/23.gif create mode 100755 templates/tibiacom/images/global/forum/icons/24.gif create mode 100755 templates/tibiacom/images/global/forum/icons/25.gif create mode 100755 templates/tibiacom/images/global/forum/icons/26.gif create mode 100755 templates/tibiacom/images/global/forum/icons/27.gif create mode 100755 templates/tibiacom/images/global/forum/logo_closed.gif create mode 100755 templates/tibiacom/images/global/forum/logo_hot.gif create mode 100755 templates/tibiacom/images/global/forum/logo_hotnew.gif create mode 100755 templates/tibiacom/images/global/forum/logo_multipage.gif create mode 100755 templates/tibiacom/images/global/forum/logo_new.gif create mode 100755 templates/tibiacom/images/global/forum/logo_oldpost.gif create mode 100755 templates/tibiacom/images/global/forum/logo_sticky.gif create mode 100755 templates/tibiacom/images/global/forum/smile/1.gif create mode 100755 templates/tibiacom/images/global/forum/smile/10.gif create mode 100755 templates/tibiacom/images/global/forum/smile/2.gif create mode 100755 templates/tibiacom/images/global/forum/smile/3.gif create mode 100755 templates/tibiacom/images/global/forum/smile/4.gif create mode 100755 templates/tibiacom/images/global/forum/smile/5.gif create mode 100755 templates/tibiacom/images/global/forum/smile/6.gif create mode 100755 templates/tibiacom/images/global/forum/smile/7.gif create mode 100755 templates/tibiacom/images/global/forum/smile/8.gif create mode 100755 templates/tibiacom/images/global/forum/smile/9.gif create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon-114x114.png create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon-120x120.png create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon-144x144.png create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon-152x152.png create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon-72x72.png create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon-76x76.png create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon-precomposed.png create mode 100755 templates/tibiacom/images/global/general/apple-touch-icon.png mode change 100644 => 100755 templates/tibiacom/images/global/general/blank.gif mode change 100644 => 100755 templates/tibiacom/images/global/general/box-bottom.gif mode change 100644 => 100755 templates/tibiacom/images/global/general/box-top.gif mode change 100644 => 100755 templates/tibiacom/images/global/general/chain.gif create mode 100755 templates/tibiacom/images/global/general/favicon.ico create mode 100755 templates/tibiacom/images/global/general/hide.gif mode change 100644 => 100755 templates/tibiacom/images/global/general/minus.gif create mode 100755 templates/tibiacom/images/global/general/nok.gif create mode 100755 templates/tibiacom/images/global/general/ok.gif mode change 100644 => 100755 templates/tibiacom/images/global/general/plus.gif create mode 100755 templates/tibiacom/images/global/general/show.gif create mode 100755 templates/tibiacom/images/global/header/background-artwork.jpg create mode 100755 templates/tibiacom/images/global/header/dragonlord.gif create mode 100755 templates/tibiacom/images/global/header/pedestal-and-online.gif create mode 100755 templates/tibiacom/images/global/header/tibia-logo-artwork-top.gif create mode 100755 templates/tibiacom/images/global/loginbox/loginbox-font-create-account-over.gif create mode 100755 templates/tibiacom/images/global/loginbox/loginbox-font-create-account.gif create mode 100755 templates/tibiacom/images/global/loginbox/loginbox-font-logout-over.gif create mode 100755 templates/tibiacom/images/global/loginbox/loginbox-font-logout.gif create mode 100755 templates/tibiacom/images/global/loginbox/loginbox-textfield-background.gif create mode 100755 templates/tibiacom/images/global/menu/button-background-over.gif create mode 100755 templates/tibiacom/images/global/menu/button-background.gif create mode 100755 templates/tibiacom/images/global/menu/green-light.gif create mode 100755 templates/tibiacom/images/global/menu/icon-account.gif create mode 100755 templates/tibiacom/images/global/menu/icon-activesubmenu.gif create mode 100755 templates/tibiacom/images/global/menu/icon-community.gif create mode 100755 templates/tibiacom/images/global/menu/icon-forum.gif create mode 100755 templates/tibiacom/images/global/menu/icon-library.gif create mode 100755 templates/tibiacom/images/global/menu/icon-news.gif create mode 100755 templates/tibiacom/images/global/menu/icon-shops.gif create mode 100755 templates/tibiacom/images/global/menu/icon-support.gif create mode 100755 templates/tibiacom/images/global/menu/label-account.gif create mode 100755 templates/tibiacom/images/global/menu/label-community.gif create mode 100755 templates/tibiacom/images/global/menu/label-forum.gif create mode 100755 templates/tibiacom/images/global/menu/label-library.gif create mode 100755 templates/tibiacom/images/global/menu/label-news.gif create mode 100755 templates/tibiacom/images/global/menu/label-shops.gif create mode 100755 templates/tibiacom/images/global/menu/label-support.gif create mode 100755 templates/tibiacom/images/global/themeboxes/current-poll/currentpollbox.gif create mode 100755 templates/tibiacom/images/global/themeboxes/fansites/border_promoted.gif create mode 100755 templates/tibiacom/images/global/themeboxes/fansites/fansites_themebox.gif create mode 100755 templates/tibiacom/images/global/themeboxes/networks/networksbox.png create mode 100755 templates/tibiacom/images/global/themeboxes/networks/tibia-facebook-page-logo.png create mode 100755 templates/tibiacom/images/global/themeboxes/premium/premiumbox.gif create mode 100755 templates/tibiacom/images/global/themeboxes/screenshot/frame.png create mode 100755 templates/tibiacom/images/global/themeboxes/screenshot/screenshotbox.gif create mode 100755 templates/tibiacom/images/global/themeboxes/serverinfo/serverinfo.gif create mode 100755 templates/tibiacom/images/global/themeboxes/serverinfo/serverinfobox.gif diff --git a/images/global/general/blank.gif b/images/global/general/blank.gif new file mode 100755 index 0000000000000000000000000000000000000000..e0144fbc4fbd7aea6f43d8422aa61ff688a2998c GIT binary patch literal 71 zcmZ?wbhEHbRA5kGXkcLY|NlP&1B2pE7Dgb&paUX6G7L;|E&VG`zvW*%XUnbb&G+{F X=5KrCG3{CBvR9|Jz2lzE%3uuu=1&>i literal 0 HcmV?d00001 diff --git a/images/global/general/box-bottom.gif b/images/global/general/box-bottom.gif new file mode 100755 index 0000000000000000000000000000000000000000..e9e0aa0e66e988430582c507afb29d5a58f59c4d GIT binary patch literal 2015 zcmW-gX;4!K0>>XY$O|L{LIN?6<0bFCyyWG4A)JBh%YD89%QVk@O zAXP%8W9>RMpaMD`Tq-IRLO`id6~)<(M_14)j<5x0r-IuZR`>Vq_u>EPH~-|+^^sA< zeEgIWSfMsJN~m^Y{}Ralror^EFGu{DME zNnxQ_AT$^VIVvA?-{A3iVLFXMsZuJH0s${AEsfA>6bMwd$zP?@L`O$K5Uf&Qp`oE% zE?1{ki$xL?MTL+sCQA3I*+;2R>IpR}Mz>|sAxH#EVL66rwE6%xn;#OSQlL17#l(hl z)&z?L5Gs?%F*NG^K&eova6+fVI40HU)P!0Aqp(_~(%~Al3X>ubu9k~M zA~_Dr5hX5r4F>`vPINsCOi=mk7q{|p@Y(Lw6 zss9p;$@O7+LWPS&0+CdriO|i>&&icCLxiSk|2|t4Gb%PVE-FH!QJYLLtN@lmiXt-6 z%F2owSAXasM->WKrc}g4hY1BCkp^w`7uD|rasmSp?0s$}tUzQqCWb|Ocd%dy%;O0X zHYCbnnF2+W2pSooM-cHuJDndILZN}c|AAI0UI4HPC_mVTPXOR5uuA95UUa!_V4$LK ztgF>i?=MX|p3*!s)JXm>T~hIid%l#JS;9LuZBISIvE^2@B9q_Lwg2kDn@zc_s-IbG;lkOIJYIUS`$!a?) zj=sHbm!)*LrTTT8buqv=9Bmo-E2FsBY58SQ7x&vNZcc0e@QWHDuKb*!(z(qTGM{$6*z~gVx^^K$(EM zN|xOA^xA@r>{W3h(dh#QV5E2xZ{;~C9~|i!C;2*vgVcmBTP7OofV?;*&dC~Pf!K7| zFSe}v4iaCui^b6@CrNzGsT`VMp~#pNs&y5a0-+SAw@*}xtrp!hyKp%6{xZ>oq65!- zeV{2F#gB#s+zMh+vZ*1upPgRR@P5-M*PQ77k`tXWX=C4=)p`faTgVweG3K$eUkp9F z$<>Z{Ww2>$om67`<&~E~+I!Z7STZA1)_1b zIg0GTv2)fY?xt^>*Q4eA-FEK^OIMQb&a(I{K~`V0jUMGX*${Srtl3JJb{5Bz=yuaI zxNAa3@{4dt>ljGhbR&nS&8}k~8!0->PRwqu;q0t%8!_FtUREwI&t2yR_4hIvx4Wjj zL(-3%jP$sQZqiNu?sJ~NKNgG>a(JIBgN%$>-MqWAM?7mc3;}j#xZP=u+|_42Oq9Ud zdhh;;g~p3?qo+xG0bUvdSC>60s_$FO4E-P_*CcH3v>l>GEYq~af+y?t8w>ipYZ zs^6~8zx}6`b|WIb{Y8#RJE+Y~mw!JsoMLkN>&f)9f9-OMYtDV0EbQnrXNNCkZ*HKS z+TGLO<(+P(qYe;ozquGJzCL$gD(*k?{o}t}^BuVE8vae;A{gQkvZMjN<;c87Yd?7* z`ppH8U(Nj0j|M;gZHTt6dhwQQUDfN3jvG~P?k8A3pTFcQHk!^K?^#jQFg9ORz!OFW zOidb2(lkE%di>=+9tAkk3LcnyZUxg_q~Ok>xX6W?FYeid@1E8BY_zbt?j^~7A9DMZ zXV;1u5INal1f#QSIekS`U8jjvrL}9}R>qcDRuW9MlAaW*E!~d4SRghvU?gN9$nC=h zw5%G;PFiw0K3;s@ko{E~rz2%lv2pQW!9-iom9bIv#%}T9ltdvX+hGiCrkpDn2^pSY z#XE<1J-`sb$hn!oiMKYn9v1vQb}R1PVw06|N=!=~i(i@)HGxHtUvpxDk__}{z3E_% ze?lI>y93mzDvQCcL=yWe;O|g!>TUCPOD&z}xKeRI!y#U6@MWM*Z_V*aaBT4&m}U}| cW@p~JrK3ZPQYf(2w`5s-RKJ{T1b~?T0Yi+@761SM literal 0 HcmV?d00001 diff --git a/images/global/general/box-top.gif b/images/global/general/box-top.gif new file mode 100755 index 0000000000000000000000000000000000000000..ba0e821f1cd51f363d1d23d1270802130e0a4e86 GIT binary patch literal 2017 zcmW-gZB$c-0fsN+6G+I11TZ1VO>*zeO>T0NdqW_B@(~b-5d;I}IHd|2A>dXKIm$d$ zLK6AV0l`BnJ?m-^3k-KU6q%``N<{_xyW)yuY6F=B>^( znJZ2MEa25LKpIJ$#42q}7)HrNyeg03EM?Gc-*zs|K!otEc zU!AF}s{CTG|Mm#;?iiz`tz~vN;+sD)9ahHnGWPws`wa~ZXTA#b_Vvy`o*x+_9d5Cta(EoI0)ds%*RNmW z82)n)6{1!{N{u=-B~c<4nT-06_I>m&V9bgYF#0aH22#UH3WG%Yf!*`}q?9a~W8kZk_jlWZ7H3`pu=` z-pLlO!uFZ<HeSWJizWuIsq<{Lird{@g zAkz+6ysVd}XjfMbM>g~M@{0Ue*S6+JT1ttt=<~d{^)(N#j$#Fkor^4WJz6Boz6M+- zbKON*mL0Jtk4es^+0V_UfUw-t4ZcWlpgvU z(-z;h=8rjnx_hG=l0TI<{?~qD)AU*6KhlS{zMAbD=sY?Xcr||Oo9fPgJ~~$&C4GK2 zP;+m%dhX)BjmbMg<1K5F*Z%HoM$VPox#SYji|Dis@4qTJ;k~!8 z?$knW`al7ll|ST-=mMBP`1)}dnvdCTfzemz7ckzARvscFPzs)ve{;xU^@kPQm7$ zu3V%paMDY!uLbg=b~>{P#f7K4JP~I9a$j5Gt;=1m2*qGUR(OQBBFI%-ATBXY55SHX zvb*Sj&R#yADX=;C9gyU$5QfM}of`qz z854oSmlXzLp;K}E4gVS*r2(&^=TCXoB5AF%uo#DLwu!wSv~)zLIZxhzv&wdISbEKD zxKMX|9Yg%0JToUj?=QEkkXe27NVC=BMm9fv(UEp*iR?s>u~1Z`><&SVW}v)Fv21D) zO+?)Fh0&4%%a$pDeO0hICdE4I;op3!r}KWOr4#@a=%kmwFdn)n(vO7|@EPy z+)}K5#+98$VHHu0(uGMnkoLesjl3P;6*A2(gG;Du&CL1BmVdeEsk>P7)9A6&V{0_$ zeG`Apj%e~*so-&bQ2Epp407Tg@TYl4{xF}z&RS(z#i;Ba$pxMVc6sAAId@*+&261O zKu=E8=kT5{gHG(#EB32b#bPFf-j=+YV4&w7390kqL&!nkpjacDXp8`P#tpFlO$O1vtkY&x)HU zY6bu|rE<0%0s!iqi4ng3g~#A%5`_UC?r-!RiZLHheBHgGgWJBbEW}6vfs}M!Q;7=< zKL}W|pvN5lgL%PeXD(%}uPMDUM0HUe6yYp0HGa|8nh(iej$h7AS?p>Ec_5|vO6vN> z!#&p*V1fSQ?2^B8TbM23G5*yB_Qh^r{x*f+iYg8~Bs3x|}6ML~iiBQukLPQV4lqg}$9QhPWQ99&v?#jQ*v1Q@IV32hSk literal 0 HcmV?d00001 diff --git a/images/global/general/favicon.ico b/images/global/general/favicon.ico new file mode 100755 index 0000000000000000000000000000000000000000..26e190057025cf7590ac85f5bbec51e9b6b7b60f GIT binary patch literal 3638 zcmeHKX;f547XG@STQ(a-T#&{_S!7XG0a-*u5M^xy1!PlMBd84#(I$chae*j`(xg#F zkgbW*ih?3;ph*P5Ac`^=#F!u;ViGj2NXTtW=FiMIbI$ykA2Z)M@4c$}Zr!@~R-Jq6 z0SquPVFJbw%L4SNrLFz3FHr#Y)0hEuWg@a+256Ar#2EYh(`$5e6p(h}K?ccsZARMf zqlj~n2WY&xZV8s1e*|P60t~Gn76O+)jAGslQgine&Kv`33(QgC2c$&N0+}7~n@e1R z1oH7IKuZT$UO}kY3QSig%O|M=#~X0-^js*|F9rsNP#^+UxB@j1K-Nl{d+8}8!=q?Q zqIPgPIkOZBQvo@iKF;qanRq5jcM<0p3fy~w#dD}#cn3{aY_N7dP_!0kk}d$QbYQ(N zan`n&pv(leqyaBR@YP}9TA3N}!#n6{5a0L$sJMxSZ9rul^?&F?9;r@pp?J7%1Y&oB zsl>#|Fa{XP99%3WnQ$RmYOI0gr*NPR2=W5HK4l4ED6KQ_0jM9s+?foxo04zyfT~QO zAPC4HTeViGAlq^O4NWG$?*9h-^d6UKPti?!+TTDz zF>bE5LCZNS>c1l4|Koo(0_HOO>Ab8tQAc;ak>Qj@$tx8N+h7Gt4N3E2^j3^F)r`~)(6?|mcMOg({%k8>bC$pVYL2J7x!;l)UgAP$r%4k`<}Q|# z3$#>;(MVaR<+MJ`D`K_Bw#ZLs#!TJ5SxeJxdYIQ7m+;7h1u@DgTcYhI>#Uw*vdSeg zA!HVJ{KB=yPC-dl{>$eE!8j(yM!3#fQ!^ky({6brgwyPm)(FjPxt^ZOn4Z4z#=>#q z)~pdatWk|iWUasqH%;<}t1bLw%qjC3v9YnUXS;D-g@#Ku>gWV*+LY$w8Br@l-ej#36QM6iJi<Y#E|&uS?W5qP?**oqpu52t zD#=o?qPGK&pFo;C37Qs^#}=%@g2b(uRo05o-G>p}`!m$NqHvvToivS&MN=ql-}d5M zz5&9HU!eLhnd-w8WIcWgMgA5DC|5DEOR$u3ym;eOcr4b&cV{dRO?mR@UMAvWb-{M? zfSjHQ^bECN-#vhWjSN_(eU9C08L-XH!**GHyW4^KFSMX~?>V%&N>H`*29Ih1^ON-m z-?RyePe!4e`z=(2X$U7@Co8kCaA+7-OL2y7PlGA5+0@{?t_h& z3sQZl?m5RnG3yZ8_b4DcLKWU^eF)iKg34`FGiEy?=Gj}MQH-N>fYJau9h-{5lNHhd70SR;uMH zRu<4?5#>(0!;-OT#~v`osX&EPsc5LfUKda-zX67r&S=_R7~Jf}1**Rh&HyX32Jl*k zo0lxWxcCshKAJeUlj{8Kr_fB=fyD3oFyBZO{(JMW#~<*vWWaPsHaahI(fzeG$v{yTTxyTFhpPz)Gt_ln{?155G zKl;8hfc&nb2=|==KH2JUuNO@PGmt{Hx;%@4*jMjy|AIL<4c~*q)x-Rl1O#uTdx;<& z(+o{zA<%~6;YQ~2Bw=DKym*`jOPoWM`u;B>oH1JGr(Hl zfDSS3L)jhJydH(xx-8tP(Z)PAx_g{7##NC%@&YM{4!)3IN|&R5gNB9%KA+#fmx_TC zC)_{c#0jxfHrl|4X-Yj?BB^c=w4AUxe6FIWr>H1t_Tn_rkbpm!$8JE=8qP?4a@=#* z$B|w;zo~VrWxjTrXkvHRT`Xmr<>g}cE0^@->gUaU^4kjB8e0ut-zj?A{_Q8WTWrLg zgM%{utl6N{HSpJEp50NgZaEcc?xLU{C(hCK%7`Evu>0v*Gk-zQsQ3@O3Sr++*+01 z{B6>cctJyTa(y0KRr6X!8hJ_lv0O0%74nr@TYvbpSuo(;)fIZ|SaM>JmdI5g<3~E< zPbhW}-^f&p;CpM7lxPG8*Ru!NY)Lh(|2@rjZ}TBO-(%O^+^!Xcg%3-DgTHerEp-{m zh2N%N;zv*a#fNg|%_D(Smr`Bb(vbn2e^)Xf&e)YB<8x?!eQF^IaO--{ayaRE#Lrrx zFAl8m$Zu^VKB6-@_)D3|f6H|t=WIOAE4Y`%w@ z=)M2QS(m!P!a^=B!IAOTAI1%le`}Q*4UemdW_IRr&i2-Exep(bhWY_Kx|J%Cw)9PM ze$(1mYgbt=_0LP^^!BEfXlRrKCl6rh(d25rSnDfK7VVxwVEmADATRypu~6^0xUSHy z0sK8tDtKQmT4)f?dXw+-d!=|tkUPk(9^eZE`rh6HXwh2mvnak&ZO`^2ETdC)ed2PG z5D11M`bFdQs~Z4|t6|Y?zp43b*dE^fAZJ(Q$uaaRK6_Rspz|S$QNF>OUR8DafD!8m zi?=l(Fhhp6qHj*wl|=|JLvP$=*7_H#S2wo4VTE_!JY7|!prFu^Q=7g1OhMJ)d z@^rpuZ=dhxc2QR9~?hDHvbR}a%^8iK{_=vEkr^)IyyBtHZW*p zS3o{DGBGSMFDgtns3jx8uXJ2luC6^SV&${QHW92kv-d}KyKTsky;cW6*CE=M;q zh$kX7HZ#c@7xEJj7#9?bD<;Ys7P2B8Mn^(~Bp{h6BV;lyh9@MjAsvH#blDmf%NrPA zE-6DpJ#=nilr=KV9T|;Al_VgGDkWF+IC>oE*WKsco^$Z6AR2rRDqgSaRacEco z0R^<+D8yie!evnKLCWd@d`{|u6^DXAUx5e&7z2BQfNXzydoBV8cLD$j2nZq*2ni1Z z2^1U;5(AwG69b+b2n+@Qcc_pFBBHLD94R*mI0G94EeJC-r3R;A01ONr2s$XG8UqX- zB_0zD$u_P76der=s9^^O5dsJ-AqWva0}&N9BRdf$134cj-UtE<+jk972n7`rdY1we zAs(#oGynkvQ6C`4E70JMg$4@}7>GDgVnm7;ElS+dMFkihs6vVyNwOp=0|7t;Sjn=b L%a<@&1_1y&Rn~w8 literal 0 HcmV?d00001 diff --git a/images/global/general/minus.gif b/images/global/general/minus.gif new file mode 100755 index 0000000000000000000000000000000000000000..ee030eb2155903f19d9300a55e738d429bb26852 GIT binary patch literal 224 zcmZ?wbhEHb}=~`Z{gT->D56~o`l!Pq!K zfumPmkwG&-hQZ;1_>3G4S?*M&t*ndK8Q871no3DJIZd+oFSE{RfkTHyov1q#)8xu5 T@!+Or1|Bw^j?OL~MFwjCTtrb`=Dz^1;!hR^5YPb;Ahit4 zRvs)H{w(cuT&Zw~K~RhLm;j&S_fp9ZvWF9wg+8c?db%mhw=8vO;j+03tsi;xW>OnqgJ;!hT!Bm;vEhybZ& zU^c5LIrwo6i&ERxrda{+O%FdyWKhU)N}qc8vgfk)}Rwh O7A9m^&2M92um%7n+9u!t literal 0 HcmV?d00001 diff --git a/images/global/general/plus.gif b/images/global/general/plus.gif new file mode 100755 index 0000000000000000000000000000000000000000..2346f79a4e67f42f7bdd6dd37c1ff1e5704a75b5 GIT binary patch literal 224 zcmZ?wbhEHb*ns{>}=~`XKrMuqbM)q z;$&^8uT_*2&(O)hFq^@`%z$C7xU-{`i;I14YmJYem#LYtt+i=$Z3)A91}`_elDtG6 zP1WAk(m9hm6@RiYfPfB&0NKgF8k_Kd)i2Y^>0m9Jv4r5|kON9vCV!P_kKyh)$-uZ! zfvx90gMgxk6c_UY_6i3TDb6Q~TNy>Vx|cA|y(PhOX2A@H|5AE~nhj={)J=6$Vw#+q UB^}(<%*M^i-O<^_t;k>v00{Cx3IG5A literal 0 HcmV?d00001 diff --git a/images/global/general/show.gif b/images/global/general/show.gif new file mode 100755 index 0000000000000000000000000000000000000000..a27a17482f7688d1b7315fb85986a403f4383e42 GIT binary patch literal 681 zcmZ?wbhEHbRAAs?c*ekBWnrW!FH@8gZ*ObHaGt^0(aOci+SFLr!ptBeCEUTzoaHEs ze1nXUp^l-xmX(#MkDr&3pPs3iu}ZVN_+(M@0DYc~+{4gn&8D5C-rHKET&5sAM}T(|H`jVjTWeD@7el#PsoL@k69-*AFCF!GRiQb8Vv~fq zH*m?+N=sLZYsM?PxjT8e*@?G^Si2iZcS>sJD2pu+=Gen-7OPj1m+0(ltDd9Ga+Fy$ zQ$Z_8g?~BUoXMR^jk5Zw8meUqas^VlN$LVC_?l}=_?PkawwCg4=8>E#Celif-HvoULs0 array('subtopic' => 'characters', 'name' => '$1'), '/^commands\/add\/?$/' => array('subtopic' => 'commands', 'action' => 'add'), '/^commands\/edit\/?$/' => array('subtopic' => 'commands', 'action' => 'edit'), - '/^news\/add\/?$/' => array('subtopic' => 'news', 'action' => 'add'), - '/^news\/edit\/?$/' => array('subtopic' => 'news', 'action' => 'edit'), - '/^news\/archive\/?$/' => array('subtopic' => 'newsarchive'), - '/^news\/archive\/[0-9]+\/?$/' => array('subtopic' => 'newsarchive', 'id' => '$2'), - '/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'), '/^faq\/add\/?$/' => array('subtopic' => 'faq', 'action' => 'add'), '/^faq\/edit\/?$/' => array('subtopic' => 'faq', 'action' => 'edit'), '/^forum\/add_board\/?$/' => array('subtopic' => 'forum', 'action' => 'add_board'),# @@ -93,11 +93,19 @@ else { '/^forum\/board\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_board', 'id' => '$2', 'page' => '$3'), '/^forum\/thread\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2'), '/^forum\/thread\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2', 'page' => '$3'), + '/^gallery\/add\/?$/' => array('subtopic' => 'gallery', 'action' => 'add'), + '/^gallery\/edit\/?$/' => array('subtopic' => 'gallery', 'action' => 'edit'), + '/^gallery\/[0-9]+\/?$/' => array('subtopic' => 'gallery', 'image' => '$1'), '/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'), + '/^guilds\/[A-Za-z0-9-_%+\']+$/' => array('subtopic' => 'guilds', 'action' => 'show', 'guild' => '$1'), '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2', 'page' => '$3'), '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'page' => '$2'), '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2'), '/^highscores\/[A-Za-z0-9-_\']+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'), + '/^news\/add\/?$/' => array('subtopic' => 'news', 'action' => 'add'), + '/^news\/edit\/?$/' => array('subtopic' => 'news', 'action' => 'edit'), + '/^news\/archive\/?$/' => array('subtopic' => 'newsarchive'), + '/^news\/archive\/[0-9]+\/?$/' => array('subtopic' => 'newsarchive', 'id' => '$2'), '/^polls\/[0-9]+\/?$/' => array('subtopic' => 'polls', 'id' => '$1') ); diff --git a/install/steps/database.php b/install/steps/database.php index 0f3d0ea5..aebe68d9 100644 --- a/install/steps/database.php +++ b/install/steps/database.php @@ -1,5 +1,6 @@ enabled()) { $value = 0; - if(!$cache->fetch('views_counter', $value)) + if(!$cache->fetch('views_counter', $value) || $value <= 1) { $value = 0; if(fetchDatabaseConfig('views_counter', $value)) $views_counter = $value; else - registerDatabaseConfig('views_counter', 1); // save in the database + registerDatabaseConfig('views_counter', 2); // save in the database } - else + else { $views_counter = $value; + } $cache->set('views_counter', ++$views_counter, 60 * 60); - if(($views_counter % COUNTER_SYNC) == 0) // sync with database + if($views_counter > 1 && ($views_counter % COUNTER_SYNC) == 0) // sync with database updateDatabaseConfig('views_counter', $views_counter); /* { diff --git a/system/functions.php b/system/functions.php index 3069e161..4efa85c0 100644 --- a/system/functions.php +++ b/system/functions.php @@ -383,294 +383,6 @@ function delete_guild($id) return true; } -/** - * Validate character name. - * Name lenght must be 3-25 chars - * - * @param string $name Name to check - * @param string $error Error description will be placed here - * @return bool Is name valid? - */ -function check_name($name, &$error = '') -{ - if(!isset($name[0])) - { - $error = 'Please enter character name.'; - return false; - } - - $length = strlen($name); - if($length < 3) - { - $error = 'Character name is too short. Min. lenght 3 characters.'; - return false; - } - - if($length > 25) - { - $error = 'Character name is too long. Max. lenght 25 characters.'; - return false; - } - - if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- [ ] '") != $length) - { - $error = 'Invalid name format. Use only A-Z.'; - return false; - } - - return preg_match("/[A-z ']/", $name); -} - -/** - * Validate account id - * Id lenght must be 6-10 chars - * - * @param string $name Account name to check - * @param string $error Error description will be placed here - * @return bool Is account name valid? - */ -function check_account_id($id, &$error = '') -{ - if(!isset($id[0])) - { - $error = 'Please enter an account.'; - return false; - } - - if(!check_number($id)) { - $error = 'Invalid account name format. Use only numbers 0-9.'; - return false; - } - - $length = strlen($id); - if($length < 6) - { - $error = 'Account is too short (min. 6 chars).'; - return false; - } - - if($length > 10) - { - $error = 'Account is too long (max. 10 chars).'; - return false; - } - - return true; -} - -/** - * Validate account name - * Name lenght must be 3-32 chars - * - * @param string $name Account name to check - * @param string $error Error description will be placed here - * @return bool Is account name valid? - */ -function check_account_name($name, &$error = '') -{ - if(!isset($name[0])) - { - $error = 'Please enter an account name.'; - return false; - } - - $length = strlen($name); - if($length < 3) - { - $error = 'Account name is too short (min. 3 chars).'; - return false; - } - - if($length > 32) - { - $error = 'Account name is too long (max. 32 chars).'; - return false; - } - - if(strspn($name, "QWERTYUIOPASDFGHJKLZXCVBNM0123456789") != $length) - { - $error = 'Invalid account name format. Use only A-Z and numbers 0-9.'; - return false; - } - - return preg_match("/[A-Z0-9]/", $name); -} - -//is it valid nick for new char? -function check_name_new_char($name, &$error = '') -{ - global $db, $config; - - $name_lower = strtolower($name); - - $first_words_blocked = array('admin ', 'administrator ', 'gm ', 'cm ', 'god ','tutor ', "'", '-'); - foreach($first_words_blocked as $word) - { - if($word == substr($name_lower, 0, strlen($word))) { - $error = 'Your name contains blocked words.'; - return false; - } - } - - if(substr($name_lower, -1) == "'" || substr($name_lower, -1) == "-") { - $error = 'Your name contains illegal characters.'; - return false; - } - - if(substr($name_lower, 1, 1) == ' ') { - $error = 'Your name contains illegal space.'; - return false; - } - - if(substr($name_lower, -2, 1) == " ") { - $error = 'Your name contains illegal space.'; - return false; - } - - if(strtolower($config['lua']['serverName']) == $name_lower) { - $error = 'Your name cannot be same as server name.'; - return false; - } - - $names_blocked = array('admin', 'administrator', 'gm', 'cm', 'god', 'tutor'); - foreach($names_blocked as $word) - { - if($word == $name_lower) { - $error = 'Your name contains blocked words.'; - return false; - } - } - - $words_blocked = array('admin', 'administrator', 'gamemaster', 'game master', 'game-master', "game'master", '--', "''","' ", " '", '- ', ' -', "-'", "'-", 'fuck', 'sux', 'suck', 'noob', 'tutor'); - foreach($words_blocked as $word) - { - if(!(strpos($name_lower, $word) === false)) { - $error = 'Your name contains illegal words.'; - return false; - } - } - - $name_length = strlen($name_lower); - for($i = 0; $i < $name_length; $i++) - { - if(isset($name_lower[$i]) && isset($name_lower[$i + 1]) && $name_lower[$i] == $name_lower[$i + 1] && isset($name_lower[$i + 2]) && $name_lower[$i] == $name_lower[$i + 2]) { - $error = 'Your name is invalid.'; - return false; - } - } - - for($i = 0; $i < $name_length; $i++) - { - if(isset($name_lower[$i - 1]) && $name_lower[$i - 1] == ' ' && isset($name_lower[$i + 1]) && $name_lower[$i + 1] == ' ') { - $error = 'Your name contains too many spaces.'; - return false; - } - } - - if(isset($config['monsters'])) - { - if(in_array($name_lower, $config['monsters'])) { - $error = 'Your name cannot contains monster name.'; - return false; - } - } - - $player = new OTS_Player(); - $player->find($name); - if($player->isLoaded()) { - $error = 'Character with this name already exist.'; - return false; - } - - //check if was namelocked previously - if(tableExist('player_namelocks') && fieldExist('name', 'player_namelocks')) { - $namelock = $db->query('SELECT `player_id` FROM `player_namelocks` WHERE `name` = ' . $db->quote($name)); - if($namelock->rowCount() > 0) { - $error = 'Character with this name has been namelocked.'; - return false; - } - } - - $monsters = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'monsters` WHERE `name` LIKE ' . $db->quote($name_lower)); - if($monsters->rowCount() > 0) { - $error = 'Your name cannot contains monster name.'; - return false; - } - - $spells_name = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'spells` WHERE `name` LIKE ' . $db->quote($name_lower)); - if($spells_name->rowCount() > 0) { - $error = 'Your name cannot contains spell name.'; - return false; - } - - $spells_words = $db->query('SELECT `words` FROM `' . TABLE_PREFIX . 'spells` WHERE `words` = ' . $db->quote($name_lower)); - if($spells_words->rowCount() > 0) { - $error = 'Your name cannot contains spell name.'; - return false; - } - - if(isset($config['npc'])) - { - if(in_array($name_lower, $config['npc'])) { - $error = 'Your name cannot contains NPC name.'; - return false; - } - } - - if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '") != $name_length) { - $error = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.'; - return false; - } - - if($name_length < 3 || $name_length > 28) { - $error = 'Your name cannot be shorter than 3 characters and longer than 28 characters.'; - return false; - } - - - if(!preg_match("/[A-z ']{3,28}/", $name)) { - $error = 'Your name containst illegal characters.'; - return false; - } - - return true; -} - -function check_rank_name($name) -{ - if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-[ ] ") != strlen($name)) - return false; - - return preg_match("/[A-z ]{1,32}/", $name); -} - -function check_guild_name($name) -{ - if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789- ") != strlen($name)) - return false; - - return preg_match("/[A-z ]{3,32}/", $name); -} - -function check_password($pass) -{ - if(strspn($pass, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890") != strlen($pass)) - return false; - - return preg_match("/[A-z0-9]/", $pass); -} - -function check_mail($email) -{ - return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[A-z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email); - //return preg_match("/[A-z0-9._-]+@[A-z0-9-]+\.[A-z]{2,4}/", $email); -} - -function check_number($number) -{ - return preg_match ("/^([0-9]+)$/", $number); -} - //################### DISPLAY FUNCTIONS ##################### //return shorter text (news ticker) function short_text($text, $limit) @@ -1224,10 +936,13 @@ function load_config_lua($filename) } function str_replace_first($search, $replace, $subject) { - $pos = strpos($subject, $search); - if ($pos !== false) { - return substr_replace($subject, $replace, $pos, strlen($search)); - } - return $subject; + $pos = strpos($subject, $search); + if ($pos !== false) { + return substr_replace($subject, $replace, $pos, strlen($search)); + } + return $subject; } + +// validator functions +require_once(LIBS . 'validator.php'); ?> diff --git a/system/init.php b/system/init.php index 82e319ca..7807cd18 100644 --- a/system/init.php +++ b/system/init.php @@ -32,7 +32,7 @@ require_once(SYSTEM . 'libs/cache.php'); $cache = Cache::getInstance($config['cache_engine'], $config['cache_prefix']); // twig -require_once LIBS . 'Twig/Autoloader.php'; +require_once(LIBS . 'Twig/Autoloader.php'); Twig_Autoloader::register(); $twig_loader = new Twig_Loader_Filesystem(SYSTEM . 'templates'); diff --git a/system/libs/pot/OTS_Player.php b/system/libs/pot/OTS_Player.php index 3b8a79aa..4033fd8e 100644 --- a/system/libs/pot/OTS_Player.php +++ b/system/libs/pot/OTS_Player.php @@ -2363,7 +2363,7 @@ class OTS_Player extends OTS_Row_DAO 'skill_shielding' => POT::SKILL_SHIELD, 'skill_fishing' => POT::SKILL_FISH ); - if(check_number($skill)) + if(Validator::number($skill)) $this->skills[ (int) $skill]['value'] = (int) $value; else { $this->skills[ (int) $skill_ids[$skill]]['value'] = (int) $value; @@ -2409,7 +2409,7 @@ class OTS_Player extends OTS_Row_DAO 'skill_fishing' => POT::SKILL_FISH ); - if(check_number($skill)) + if(Validator::number($skill)) $this->skills[ (int) $skill]['tries'] = (int) $tries; else { $this->skills[ (int) $skill_ids[$skill]]['tries'] = (int) $tries; diff --git a/system/libs/spells.php b/system/libs/spells.php index 8c671b4c..35695a6d 100644 --- a/system/libs/spells.php +++ b/system/libs/spells.php @@ -1,5 +1,4 @@ 10) + { + self::$lastError = 'Account is too long (max. 10 chars).'; + return false; + } + + return true; + } + + /** + * Validate account name + * Name lenght must be 3-32 chars + * + * @param string $name Account name to check + * @return bool Is account name valid? + */ + public static function accountName($name) + { + if(!isset($name[0])) + { + self::$lastError = 'Please enter your account name!'; + return false; + } + + $length = strlen($name); + if($length < 3) + { + self::$lastError = 'Account name is too short (min. 3 chars).'; + return false; + } + + if($length > 32) + { + self::$lastError = 'Account name is too long (max. 32 chars).'; + return false; + } + + if(strspn($name, "QWERTYUIOPASDFGHJKLZXCVBNM0123456789") != $length) + { + self::$lastError = 'Invalid account name format. Use only A-Z and numbers 0-9.'; + return false; + } + + if(!preg_match("/[A-Z0-9]/", $name)) + { + self::$lastError = 'Invalid account name format. Use only A-Z and numbers 0-9.'; + return false; + } + + return true; + } + /** * Advanced mail validator * * @param string $email + * @return bool Is email valid? */ public static function email($email) { - return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[A-z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email); + if(empty($email)) { + self::$lastError = 'Please enter your new email address.'; + return false; + } + + if(strlen($email) > 255) { + self::$lastError = 'E-mail is too long (max. 255 chars).'; + return false; + } + + if(!preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[A-z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $email)) { + self::$lastError = 'Invalid e-mail format.'; + return false; + } + + return true; } + /** + * Validate account password + * Name lenght must be 3-32 chars + * + * @param string $name Account name to check + * @return bool Is account name valid? + */ + public static function password($password) + { + if (!isset($password[0])) { + self::$lastError = 'Please enter the password.'; + return false; + } + + if (strlen($password) < 8 || strlen($password) > 30) { + self::$lastError = 'The password must have at least 8 and maximum 30 letters!'; + return false; + } + + if(strspn($password, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890") != strlen($password)) { + self::$lastError = 'Password contains illegal letters (a-z, A-Z and 0-9 only!).'; + return false; + } + + if(!ctype_alnum($password)) { + self::$lastError = 'Password contains illegal letters (a-z, A-Z and 0-9 only!).'; + return false; + } + + if(!preg_match('/[a-zA-Z]/', $password)) { + self::$lastError = 'The password must contain at least one letter A-Z or a-z!'; + return false; + } + + if(!preg_match('/[0-9]/', $password)) { + self::$lastError = 'The password must contain at least one letter other than A-Z or a-z!'; + return false; + } + + return true; + } + + /** + * Validate character name. + * Name lenght must be 3-25 chars + * + * @param string $name Name to check + * @return bool Is name valid? + */ + public static function characterName($name) + { + if(!isset($name[0])) + { + self::$lastError = 'Please enter character name.'; + return false; + } + + $length = strlen($name); + if($length < 3) + { + self::$lastError = 'Character name is too short. Min. lenght 3 characters.'; + return false; + } + + if($length > 25) + { + self::$lastError = 'Character name is too long. Max. lenght 25 characters.'; + return false; + } + + if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- [ ] '") != $length) + { + self::$lastError = "Invalid name format. Use only A-Z, spaces and '."; + return false; + } + if(!preg_match("/[A-z ']/", $name)) + { + self::$lastError = "Invalid name format. Use only A-Z, spaces and '."; + return false; + } + + return true; + } + + /** + * Validate new character name. + * Name lenght must be 3-25 chars + * + * @param string $name Name to check + * @return bool Is name valid? + */ + public static function newCharacterName($name) + { + global $db, $config; + + $name_lower = strtolower($name); + + $first_words_blocked = array('admin ', 'administrator ', 'gm ', 'cm ', 'god ','tutor ', "'", '-'); + foreach($first_words_blocked as $word) + { + if($word == substr($name_lower, 0, strlen($word))) { + self::$lastError = 'Your name contains blocked words.'; + return false; + } + } + + if(substr($name_lower, -1) == "'" || substr($name_lower, -1) == "-") { + self::$lastError = 'Your name contains illegal characters.'; + return false; + } + + if(substr($name_lower, 1, 1) == ' ') { + self::$lastError = 'Your name contains illegal space.'; + return false; + } + + if(substr($name_lower, -2, 1) == " ") { + self::$lastError = 'Your name contains illegal space.'; + return false; + } + + if(strtolower($config['lua']['serverName']) == $name_lower) { + self::$lastError = 'Your name cannot be same as server name.'; + return false; + } + + $names_blocked = array('admin', 'administrator', 'gm', 'cm', 'god', 'tutor'); + foreach($names_blocked as $word) + { + if($word == $name_lower) { + self::$lastError = 'Your name contains blocked words.'; + return false; + } + } + + $words_blocked = array('admin', 'administrator', 'gamemaster', 'game master', 'game-master', "game'master", '--', "''","' ", " '", '- ', ' -', "-'", "'-", 'fuck', 'sux', 'suck', 'noob', 'tutor'); + foreach($words_blocked as $word) + { + if(!(strpos($name_lower, $word) === false)) { + self::$lastError = 'Your name contains illegal words.'; + return false; + } + } + + $name_length = strlen($name_lower); + for($i = 0; $i < $name_length; $i++) + { + if(isset($name_lower[$i]) && isset($name_lower[$i + 1]) && $name_lower[$i] == $name_lower[$i + 1] && isset($name_lower[$i + 2]) && $name_lower[$i] == $name_lower[$i + 2]) { + self::$lastError = 'Your name is invalid.'; + return false; + } + } + + for($i = 0; $i < $name_length; $i++) + { + if(isset($name_lower[$i - 1]) && $name_lower[$i - 1] == ' ' && isset($name_lower[$i + 1]) && $name_lower[$i + 1] == ' ') { + self::$lastError = 'Your name contains too many spaces.'; + return false; + } + } + + if(isset($config['monsters'])) + { + if(in_array($name_lower, $config['monsters'])) { + self::$lastError = 'Your name cannot contains monster name.'; + return false; + } + } + + $player = new OTS_Player(); + $player->find($name); + if($player->isLoaded()) { + self::$lastError = 'Character with this name already exist.'; + return false; + } + + //check if was namelocked previously + if(tableExist('player_namelocks') && fieldExist('name', 'player_namelocks')) { + $namelock = $db->query('SELECT `player_id` FROM `player_namelocks` WHERE `name` = ' . $db->quote($name)); + if($namelock->rowCount() > 0) { + self::$lastError = 'Character with this name has been namelocked.'; + return false; + } + } + + $monsters = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'monsters` WHERE `name` LIKE ' . $db->quote($name_lower)); + if($monsters->rowCount() > 0) { + self::$lastError = 'Your name cannot contains monster name.'; + return false; + } + + $spells_name = $db->query('SELECT `name` FROM `' . TABLE_PREFIX . 'spells` WHERE `name` LIKE ' . $db->quote($name_lower)); + if($spells_name->rowCount() > 0) { + self::$lastError = 'Your name cannot contains spell name.'; + return false; + } + + $spells_words = $db->query('SELECT `words` FROM `' . TABLE_PREFIX . 'spells` WHERE `words` = ' . $db->quote($name_lower)); + if($spells_words->rowCount() > 0) { + self::$lastError = 'Your name cannot contains spell name.'; + return false; + } + + if(isset($config['npc'])) + { + if(in_array($name_lower, $config['npc'])) { + self::$lastError = 'Your name cannot contains NPC name.'; + return false; + } + } + + if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '") != $name_length) { + self::$lastError = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.'; + return false; + } + + if($name_length < 3 || $name_length > 28) { + self::$lastError = 'Your name cannot be shorter than 3 characters and longer than 28 characters.'; + return false; + } + + + if(!preg_match("/[A-z ']{3,28}/", $name)) { + self::$lastError = 'Your name containst illegal characters.'; + return false; + } + + return true; + } + + /** + * Validate guild name + * Name lenght must be 3-32 chars + * + * @param string $name Name to check + * @return bool Is name valid? + */ + public static function guildName($name) + { + if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789- ") != strlen($name)) { + self::$lastError = 'Invalid guild name format.'; + return false; + } + + if(!preg_match("/[A-z ]{3,32}/", $name)) { + self::$lastError = 'Invalid guild name format.'; + return false; + } + + return true; + } + + /** + * Validate rank name + * Rank lenght must be 1-32 chars + * + * @param string $name Name to check + * @return bool Is name valid? + */ + public static function rankName($name) + { + if(strspn($name, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-[ ] ") != strlen($name)) { + self::$lastError = 'Invalid rank name. Please use only a-Z, 0-9 and spaces.'; + return false; + } + + if(!preg_match("/[A-z ]{1,32}/", $name)) { + self::$lastError = 'Invalid rank name. Please use only a-Z, 0-9 and spaces.'; + return false; + } + + return true; + } /** * Simple string validator, checks if string contains valid characters * @@ -30,5 +408,9 @@ class Validator public static function str($str, $numbers = false) { return preg_match('/^[a-z0-9\ ]*$/i', $str); } + + public static function getLastError() { + return self::$lastError; + } } ?> diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php index b2186b5a..001a6f8e 100644 --- a/system/pages/accountmanagement.php +++ b/system/pages/accountmanagement.php @@ -141,17 +141,12 @@ $errors = array(); if($new_password != $new_password2) { $errors[] = "The new passwords do not match!"; } - else if($password_strlen < 8) { - $errors[] = "New password minimal length is 8 characters."; - } - else if($password_strlen > 32) { - $errors[] = "New password maximal length is 32 characters."; - } if(empty($errors)) { - if(!check_password($new_password)) { - $errors[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!). Minimum password length is 7 characters and maximum 32."; + if(!Validator::password($new_password)) { + $errors[] = Validator::getLastError(); } + $old_password = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $old_password); if($old_password != $account_logged->getPassword()) { $errors[] = "Current password is incorrect!"; @@ -215,14 +210,8 @@ if($action == "changeemail") { $email_new = $_POST['new_email']; $post_password = $_POST['password']; - if(empty($email_new)) { - $errors[] = 'Please enter your new email address.'; - } - else - { - if(!check_mail($email_new)) { - $errors[] = 'Email address is not correct.'; - } + if(!Validator::email($email_new)) { + $errors[] = Validator::getLastError(); } if(empty($post_password)) { @@ -536,7 +525,7 @@ if($action == "changeemail") { $new_hideacc = isset($_POST['accountvisible']) ? (int)$_POST['accountvisible'] : NULL; if($player_name != null) { - if (check_name($player_name)) { + if (Validator::characterName($player_name)) { $player = new OTS_Player(); $player->find($player_name); if ($player->isLoaded()) { @@ -609,9 +598,8 @@ if($action == "changeemail") { if(empty($errors)) { - $error = ''; - if(!admin() && !check_name_new_char($name, $error)) - $errors[] = $error; + if(!admin() && !Validator::newCharacterName($name)) + $errors[] = Validator::getLastError(); } if(empty($errors)) { @@ -654,6 +642,7 @@ if($action == "changeemail") { echo $twig->render('account.change_name.html.twig', array( 'points' => $points, + 'errors' => $errors //'account_players' => $account_logged->getPlayersList() )); } @@ -743,7 +732,7 @@ if($action == "changeemail") { $password_verify = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $password_verify); if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) { if(!empty($player_name) && !empty($password_verify)) { - if(check_name($player_name)) { + if(Validator::characterName($player_name)) { $player = new OTS_Player(); $player->find($player_name); if($player->isLoaded()) { @@ -805,18 +794,23 @@ if($action == "changeemail") { $newchar_town = isset($_POST['town']) ? $_POST['town'] : NULL; $newchar_created = false; - if(isset($_POST['savecharacter']) && $_POST['savecharacter'] == 1) { + $save = isset($_POST['save']) && $_POST['save'] == 1; + if($save) { if(empty($newchar_name)) - $errors[] = 'Please enter a name for your character!'; + $errors['name'] = 'Please enter a name for your character!'; else if(strlen($newchar_name) > 25) - $errors[] = 'Name is too long. Max. lenght 25 letters.'; + $errors['name'] = 'Name is too long. Max. lenght 25 letters.'; else if(strlen($newchar_name) < 3) - $errors[] = 'Name is too short. Min. lenght 3 letters.'; + $errors['name'] = 'Name is too short. Min. lenght 3 letters.'; else { + if(!admin() && !Validator::newCharacterName($newchar_name)) { + $errors['name'] = Validator::getLastError(); + } + $exist = new OTS_Player(); $exist->find($newchar_name); if($exist->isLoaded()) { - $errors[] = 'Character with this name already exist.'; + $errors['name'] = 'Character with this name already exist.'; } } @@ -840,10 +834,6 @@ if($action == "changeemail") { } if(empty($errors)) { - $error = ''; - if(!admin() && !check_name_new_char($newchar_name, $error)) { - $errors[] = $error; - } if(!isset($config['genders'][$newchar_sex])) $errors[] = 'Sex is invalid.'; if(!in_array($newchar_town, $config['character_towns'])) @@ -865,7 +855,7 @@ if($action == "changeemail") { { $number_of_players_on_account = $account_logged->getPlayersList()->count(); if($number_of_players_on_account >= $config['characters_per_account']) - $errors[] .= 'You have too many characters on your account ('.$number_of_players_on_account.'/'.$config['characters_per_account'].')!'; + $errors[] = 'You have too many characters on your account ('.$number_of_players_on_account.'/'.$config['characters_per_account'].')!'; } if(empty($errors)) @@ -874,7 +864,7 @@ if($action == "changeemail") { $char_to_copy = new OTS_Player(); $char_to_copy->find($char_to_copy_name); if(!$char_to_copy->isLoaded()) - $errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy: '.$char_to_copy_name.' doesn\'t exist.'; + $errors[] = 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy: '.$char_to_copy_name.' doesn\'t exist.'; } if(empty($errors)) @@ -986,7 +976,9 @@ if($action == "changeemail") { 'name' => $newchar_name, 'sex' => $newchar_sex, 'vocation' => $newchar_vocation, - 'town' => $newchar_town + 'town' => $newchar_town, + 'save' => $save, + 'errors' => $errors )); } } diff --git a/system/pages/admin/players.php b/system/pages/admin/players.php index 0e1d2f07..ad9f17f0 100644 --- a/system/pages/admin/players.php +++ b/system/pages/admin/players.php @@ -23,7 +23,7 @@ function echo_error($message) { } function verify_number($number, $name, $max_length) { - if(!check_number($number)) + if(!Validator::number($number)) echo_error($name . ' can contain only numbers.'); $number_length = strlen($number); @@ -50,11 +50,11 @@ $id = 0; if(isset($_REQUEST['id'])) $id = (int)$_REQUEST['id']; else if(isset($_REQUEST['search_name'])) { - if(strlen($_REQUEST['search_name']) < 3 && !check_number($_REQUEST['search_name'])) { + if(strlen($_REQUEST['search_name']) < 3 && !Validator::number($_REQUEST['search_name'])) { echo 'Player name is too short.'; } else { - if(check_number($_REQUEST['search_name'])) + if(Validator::number($_REQUEST['search_name'])) $id = $_REQUEST['search_name']; else { $query = $db->query('SELECT `id` FROM `players` WHERE `name` = ' . $db->quote($_REQUEST['search_name'])); @@ -90,11 +90,11 @@ if($id > 0) { $name = $_POST['name']; $_error = ''; - if(!check_name($name, $_error)) - echo_error($_error); + if(!Validator::characterName($name)) + echo_error(Validator::getLastError()); - //if(!check_name_new_char($name, $_error)) - // echo_error($_error); + //if(!Validator::newCharacterName($name) + // echo_error(Validator::getLastError()); $player_db = $ots->createObject('Player'); $player_db->find($name); diff --git a/system/pages/characters.php b/system/pages/characters.php index c5ba3420..70078ab5 100644 --- a/system/pages/characters.php +++ b/system/pages/characters.php @@ -12,7 +12,8 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Characters'; -require(SYSTEM . 'item.php'); +require_once(SYSTEM . 'item.php'); + $groups = new OTS_Groups_List(); function generate_search_form($autofocus = false) { @@ -213,7 +214,7 @@ if($player->isLoaded() && !$player->isDeleted()) for($i = 1; $i < 11; $i++) { - if(check_number($equipment[$i])) + if(Validator::number($equipment[$i])) $equipment[$i] = getItemImage($equipment[$i]); else $equipment[$i] = ' ' . $equipment[$i] . ''; diff --git a/system/pages/createaccount.php b/system/pages/createaccount.php index c5ea73e6..8e3c8a73 100644 --- a/system/pages/createaccount.php +++ b/system/pages/createaccount.php @@ -22,8 +22,8 @@ if($logged) } $errors = array(); -$step = isset($_POST['step']) ? $_POST['step'] : ''; -if($step == 'save') +$save = isset($_POST['save']) && $_POST['save'] == 1; +if($save) { if(USE_ACCOUNT_NAME) { $account_name = $_POST['account']; @@ -38,23 +38,15 @@ if($step == 'save') // account if(isset($account_id)) { - if(empty($account_id)) - $errors['account'] = 'Please enter your account number!'; - else if(!check_number($account_id)) - $errors['account'] = 'Invalid account number format. Please use only numbers 0-9.'; - } - else { - if(empty($account_name)) - $errors['account'] = 'Please enter your account name!'; - else if(!check_account_name($account_name_up)) - $errors['account'] = 'Invalid account name format. Please use only A-Z and numbers 0-9.'; + if(!Validator::accountId($account_id)) + $errors['account'] = Validator::getLastError(); } + else if(!Validator::accountName($account_name_up)) + $errors['account'] = Validator::getLastError(); // email - if(empty($email)) - $errors['email'] = 'Please enter your email address!'; - else if(!check_mail($email)) - $errors['email'] = 'Email address is not correct.'; + if(!Validator::email($email)) + $errors['email'] = Validator::getLastError(); // country $country = ''; @@ -81,14 +73,14 @@ if($step == 'save') } // password - if(empty($password)) + if(!isset($password[0])) { $errors['password'] = 'Please enter the password for your new account.'; - elseif($password != $password2) + } + elseif($password != $password2) { $errors['password'] = 'Passwords are not the same.'; - else - { - if(!check_password($password)) - $errors['password'] = 'Password contains illegal chars (a-z, A-Z and 0-9 only!). Minimum password length is 7 characters and maximum 32.'; + } + else if(!Validator::password($password)) { + $errors['password'] = Validator::getLastError(); } // check if account name is not equal to password @@ -246,6 +238,7 @@ if($step == 'save') 'accept_rules' => isset($_POST['accept_rules']) ? $_POST['accept_rules'] : false, 'country_recognized' => $country_recognized, 'country' => isset($country) ? $country : null, - 'errors' => $errors + 'errors' => $errors, + 'save' => $save )); ?> \ No newline at end of file diff --git a/system/pages/gallery.php b/system/pages/gallery.php index 17e86818..8bd37d91 100644 --- a/system/pages/gallery.php +++ b/system/pages/gallery.php @@ -76,17 +76,17 @@ if(isset($_GET['image'])) $image = $image->fetch(); else { - echo 'Image with this name does not exists.'; + echo 'Image with this id does not exists.'; return; } - $previous_image = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] - 1) . ' ORDER by `ordering`;'); + $previous_image = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] - 1) . ' ORDER by `ordering`;'); if($previous_image->rowCount() == 1) $previous_image = $previous_image->fetch(); else $previous_image = NULL; - $next_image = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] + 1) . ' ORDER by `ordering`;'); + $next_image = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($image['id'] + 1) . ' ORDER by `ordering`;'); if($next_image->rowCount() == 1) $next_image = $next_image->fetch(); else diff --git a/system/pages/guilds.php b/system/pages/guilds.php index 55f37089..766b9cf1 100644 --- a/system/pages/guilds.php +++ b/system/pages/guilds.php @@ -159,8 +159,8 @@ if($action == '') if($action == 'show') { $guild_name = $_REQUEST['guild']; - if(!check_guild_name($guild_name)) - $guild_errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) + $guild_errors[] = Validator::getLastError(); if(empty($guild_errors)) { $guild = $ots->createObject('Guild'); @@ -424,8 +424,8 @@ if($action == 'show') if($action == 'changerank') { $guild_name = $_REQUEST['guild']; - if(!check_guild_name($guild_name)) - $guild_errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) + $guild_errors[] = Validator::getLastError(); if(!$logged) $guild_errors[] = 'You are not logged in. You can\'t change rank.'; if(empty($guild_errors)) @@ -513,7 +513,7 @@ echo ' { $player_name = stripslashes($_REQUEST['name']); $new_rank = (int) $_REQUEST['rankid']; - if(!check_name($player_name)) + if(!Validator::characterName($player_name)) $change_errors[] = 'Invalid player name format.'; $rank = $ots->createObject('GuildRank'); $rank->load($new_rank); @@ -625,9 +625,9 @@ if($action == 'deleteinvite') $name = stripslashes($_REQUEST['name']); if(!$logged) $guild_errors[] = 'You are not logged in. You can\'t delete invitations.'; - if(!check_guild_name($guild_name)) - $guild_errors[] = 'Invalid guild name format.'; - if(!check_name($name)) + if(!Validator::guildName($guild_name)) + $guild_errors[] = Validator::getLastError(); + if(!Validator($name)) $guild_errors[] = 'Invalid name format.'; if(empty($guild_errors)) { @@ -726,8 +726,8 @@ if($action == 'invite') $guild_errors[] = 'You are not logged in. You can\'t invite players.'; } - if(!check_guild_name($guild_name)) { - $guild_errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) { + $guild_errors[] = Validator::getLastError(); } if(empty($guild_errors)) { @@ -770,7 +770,7 @@ if($action == 'invite') } if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') { - if(!check_name($name)) { + if(!Validator::characterName($name)) { $guild_errors[] = 'Invalid name format.'; } @@ -831,8 +831,8 @@ if($action == 'acceptinvite') { if(!$logged) { $errors[] = 'You are not logged in. You can\'t accept invitations.'; } - if(!check_guild_name($guild_name)) { - $errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) { + $errors[] = Validator::getLastError(); } if(empty($errors)) { $guild = $ots->createObject('Guild'); @@ -843,7 +843,7 @@ if($action == 'acceptinvite') { } if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') { - if(!check_name($name)) { + if(!Validator::characterName($name)) { $errors[] = 'Invalid name format.'; } @@ -947,11 +947,11 @@ if($action == 'kickplayer') { $errors[] = 'You are not logged in. You can\'t kick characters.'; } - if(!check_guild_name($guild_name)) { - $errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) { + $errors[] = Validator::getLastError(); } - if(!check_name($name)) { + if(!Validator::characterName($name)) { $errors[] = 'Invalid name format.'; } @@ -1052,8 +1052,8 @@ if($action == 'leaveguild') { $errors[] = 'You are not logged in. You can\'t leave guild.'; } - if(!check_guild_name($guild_name)) { - $errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) { + $errors[] = Validator::getLastError(); } if(empty($errors)) { @@ -1068,7 +1068,7 @@ if($action == 'leaveguild') { if(empty($errors)) { $guild_owner_name = $guild->getOwner()->getName(); if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') { - if(!check_name($name)) { + if(!Validator::characterName($name)) { $errors[] = 'Invalid name format.'; } @@ -1198,12 +1198,12 @@ if($action == 'createguild') if($todo == 'save') { - if(!check_guild_name($guild_name)) { - $guild_errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) { + $guild_errors[] = Validator::getLastError(); $guild_name = ''; } - if(!check_name($name)) { + if(!Validator::characterName($name)) { $guild_errors[] = 'Invalid character name format.'; $name = ''; } @@ -1293,8 +1293,8 @@ else { //-----------------------------------------------------------------------------//----------------------------------------------------------------------------- if($action == 'manager') { $guild_name = $_REQUEST['guild']; - if(!check_guild_name($guild_name)) { - $guild_errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) { + $guild_errors[] = Validator::getLastError(); } if(empty($guild_errors)) { @@ -1345,8 +1345,8 @@ if(!empty($guild_errors)) { //-----------------------------------------------------------------------------//----------------------------------------------------------------------------- if($action == 'changelogo') { $guild_name = $_REQUEST['guild']; - if(!check_guild_name($guild_name)) { - $errors[] = 'Invalid guild name format.'; + if(!Validator::guildName($guild_name)) { + $errors[] = Validator::getLastError(); } if(empty($errors)) { @@ -1463,8 +1463,8 @@ if($action == 'changelogo') { if($action == 'deleterank') { $guild_name = $_REQUEST['guild']; $rank_to_delete = (int) $_REQUEST['rankid']; -if(!check_guild_name($guild_name)) { -$guild_errors[] = 'Invalid guild name format.'; +if(!Validator::guildName($guild_name)) { +$guild_errors[] = Validator::getLastError(); } if(empty($guild_errors)) { $guild = $ots->createObject('Guild'); @@ -1567,11 +1567,11 @@ echo '
query('SELECT * FROM ' . $db->tableName('houses') . ' WHERE ' . $db->fieldName('name') . ' LIKE ' . $db->quote($houseName) . ' OR `id` = ' . $db->quote($houseId)); if($house->rowCount() > 0) diff --git a/system/pages/lostaccount.php b/system/pages/lostaccount.php index cc03efc4..b066aaae 100644 --- a/system/pages/lostaccount.php +++ b/system/pages/lostaccount.php @@ -30,7 +30,7 @@ else if($action == 'step1' && $action_type == '') { elseif($action == 'step1' && $action_type == 'email') { $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) + if(Validator::characterName($nick)) { $player = new OTS_Player(); $account = new OTS_Account(); @@ -77,7 +77,7 @@ elseif($action == 'sendcode') { $email = $_REQUEST['email']; $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) + if(Validator::characterName($nick)) { $player = new OTS_Player(); $account = new OTS_Account(); @@ -139,7 +139,7 @@ elseif($action == 'sendcode') elseif($action == 'step1' && $action_type == 'reckey') { $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) + if(Validator::characterName($nick)) { $player = new OTS_Player(); $account = new OTS_Account(); @@ -181,7 +181,7 @@ elseif($action == 'step2') { $rec_key = trim($_REQUEST['key']); $nick = stripslashes($_REQUEST['nick']); - if(check_name($nick)) + if(Validator::characterName($nick)) { $player = new OTS_Player(); $account = new OTS_Account(); @@ -272,7 +272,7 @@ elseif($action == 'step3') $nick = stripslashes($_REQUEST['nick']); $new_pass = trim($_REQUEST['passor']); $new_email = trim($_REQUEST['email']); - if(check_name($nick)) + if(Validator::characterName($nick)) { $player = new OTS_Player(); $account = new OTS_Account(); @@ -286,9 +286,9 @@ elseif($action == 'step3') { if($account_key == $rec_key) { - if(check_password($new_pass)) + if(Validator::password($new_pass)) { - if(check_mail($new_email)) + if(Validator::email($new_email)) { $account->setEMail($new_email); @@ -345,10 +345,10 @@ elseif($action == 'step3') '; } else - echo 'Wrong e-mail format.'; + echo Validator::getLastError(); } else - echo 'Wrong password format. Use only a-Z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.'; + echo Validator::getLastError(); } else echo 'Wrong recovery key!'; @@ -478,7 +478,7 @@ elseif($action == 'setnewpassword') { if($account->getCustomField('email_code') == $code) { - if(check_password($newpassword)) + if(Validator::password($newpassword)) { if($config_salt_enabled) { @@ -523,7 +523,7 @@ elseif($action == 'setnewpassword') '; } else - $error= 'Wrong password format. Use only a-z, A-Z, 0-9. Minimum password length is 7 characters and maximum 32.'; + $error= Validator::getLastError(); } else $error= 'Wrong code to change password.'; diff --git a/system/templates/account.change_name.html.twig b/system/templates/account.change_name.html.twig index ccf5fad1..a4376390 100644 --- a/system/templates/account.change_name.html.twig +++ b/system/templates/account.change_name.html.twig @@ -34,9 +34,11 @@ To change a name of character select player and choose a new name.
New Name: - + + +
-
Please enter your character name.
+
Please enter your character name.
diff --git a/system/templates/account.create.html.twig b/system/templates/account.create.html.twig index 6ce4ab96..a5f30886 100644 --- a/system/templates/account.create.html.twig +++ b/system/templates/account.create.html.twig @@ -26,25 +26,21 @@ Also you have to agree to the terms presented below. If you have done so, your a Account {% if constant('USE_ACCOUNT_NAME') %}Name{% else %}Number{% endif %}: - - + + - {% if errors.account is defined %} - {{ errors.account }} - {% endif %} + {% if errors.account is defined %}{{ errors.account }}{% endif %} Email Address: - - + + - {% if errors.email is defined %} - {{ errors.email }} - {% endif %} + {% if errors.email is defined %}{{ errors.email }}{% endif %} {% if config.account_country %} @@ -57,27 +53,6 @@ Also you have to agree to the terms presented below. If you have done so, your a {% endfor %} - {% if errors.country is defined %} @@ -89,23 +64,21 @@ Also you have to agree to the terms presented below. If you have done so, your a Password: - + + - {% if errors.password is defined %} - {{ errors.password }} - {% endif %} + {% if errors.password is defined %}{{ errors.password }}{% endif %} Repeat password: - + + - {% if errors.password is defined %} - {{ errors.password }} - {% endif %} + {% if errors.password is defined %}{{ errors.password }}{% endif %} {% if config.recaptcha_enabled %} diff --git a/system/templates/account.create.js.html.twig b/system/templates/account.create.js.html.twig index 57182b07..95484786 100644 --- a/system/templates/account.create.js.html.twig +++ b/system/templates/account.create.js.html.twig @@ -1,28 +1,60 @@