| 1 | <script language="JavaScript"><!-- |
| 2 | function validate(formular) { |
| 3 | if (formular.login.value=="") |
| 4 | { |
| 5 | alert("Prihlasovacie meno musite vyplnit!"); |
| 6 | formular.login.focus(); |
| 7 | return false; |
| 8 | } |
| 9 | else if (formular.email.value=="") |
| 10 | { |
| 11 | alert("Emailovu adresu musite vyplnit!"); |
| 12 | formular.email.focus(); |
| 13 | return false; |
| 14 | } |
| 15 | else if (window.RegExp) { |
| 16 | re= new RegExp("^[^@]+@[^.]+\..+$"); |
| 17 | if (!re.test(formular.email.value)) { |
| 18 | alert("Zadany email nieje spravna adresa elektronickej posty!"); |
| 19 | formular.email.focus; |
| 20 | return false; |
| 21 | } |
| 22 | } |
| 23 | else if (formular.password1.value!=formular.password2.value) |
| 24 | { |
| 25 | alert("Vase hesla niesu rovnake, prosim napiste ich znovu!"); |
| 26 | formular.password1.focus(); |
| 27 | return false; |
| 28 | } |
| 29 | else return true; |
| 30 | } |
| 31 | //--> |
| 32 | </script> |
| 33 | |
| 34 | <?php |
| 35 | include("./inc/form.inc"); |
| 36 | $form=new HTML_Form($PHP_SELF,"POST","","multipart/form-data",true); |
| 37 | |
| 38 | if (!$kyberia) { |
| 39 | include("./inc/kyberia.inc"); |
| 40 | $kyberia=new CLASS_KYBERIA(); |
| 41 | } |
| 42 | |
| 43 | |
| 44 | if (!$sent) $form->showForm('','','','',$kyberia->listSkinArray()); |
| 45 | |
| 46 | if ($sent=="ok") { |
| 47 | if (($password1==$password2) AND ($kyberia->isLogin($login))) { |
| 48 | if ($image=='') echo "Nezadali ste ziadny obrazok a preto budete vystupovat na diskusnych forach bez svojej ikonky. Mozete to pravdaze zmenit v uzivatelskych nastaveniach.<br>"; |
| 49 | else if ($image_size>=4096) echo "Vas obrazok je privelky. V zaujme rychleho nacitania stranok pre vsetkych uzivatelov fora si ho zmente pod 4 kb a nasledne uploadnite v zmene nastavenia.<br>"; |
| 50 | else Copy($image,$kyberia->UserImages.$login.$image_name); |
| 51 | if ($kyberia->registerUser($login,$password1,$email,$web,$skin+1,$image_name,$info)) { |
| 52 | echo "Boli ste uspesne zaregistrovany do systemu kyberia!"; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | elseif ($password1!=$password2) { |
| 57 | echo "<h2>Vase hesla niesu rovnake</h2>"; |
| 58 | $form->showForm($login,$email,$web,$info,$kyberia->listSkinArray()); |
| 59 | } |
| 60 | |
| 61 | elseif (!$kyberia->isLogin($login)) { |
| 62 | echo "<h2>Bohuzial uz je uzivatel s danym menom v nasom systeme zaregistrovany, prosim potrapte si fantaziu.</h2><br>"; |
| 63 | $form->showForm($login,$email,$web,$info,$kyberia->listSkinArray()); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | |
| 68 | |
| 69 | ?> |