Changeset 49 for trunk/user.php
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:ignore
set to
SqlTranslate.zip
-
Property svn:ignore
set to
-
trunk/user.php
r43 r49 1 1 <?php 2 2 3 3 include('includes/global.php'); 4 4 5 // SQL injection hack protection 6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 7 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 8 9 10 if (array_key_exists('text', $_POST) and Licence(2)) { 11 $text = $_POST['text']; 12 $email = $_POST['email']; 13 $subject = $_POST['subject']; 14 echo 'email: <b>'.$email.'</b><br />'; 15 echo 'předmět: <b>'.$subject.'</b><br />'; 16 echo 'text: <b>'.$text.'</b><br />'; 5 if(array_key_exists('text', $_POST) and Licence(LICENCE_ADMIN)) 6 { 7 $text = $_POST['text']; 8 $email = $_POST['email']; 9 $subject = $_POST['subject']; 10 echo('email: <b>'.$email.'</b><br />'); 11 echo('předmět: <b>'.$subject.'</b><br />'); 12 echo('text: <b>'.$text.'</b><br />'); 17 13 18 if(@mail($email, $subject, $text, "From: maron2@centrum.cz\nReply-To: maron2@centrum.cz\nX-Mailer: PHP/")){ 19 echo 'Zpráva byla odeslána.<br /><br />'; 20 } 21 else{ echo "Nepodařilo se odesat E-mail.<br /><br />"; }; 22 14 if(@mail($email, $subject, $text, 'From: '.$Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/')) 15 { 16 echo('Zpráva byla odeslána.<br /><br />'); 23 17 } 18 else 19 { 20 echo('Nepodařilo se odesat E-mail.<br /><br />'); 21 } 22 } 24 23 25 if (array_key_exists('user', $_GET) and Licence(1)) { 26 27 $LineUser = mysql_fetch_array($Database->SQLCommand("28 SELECT *, (29 (SELECT count(*) FROM `quests` WHERE User = ".$_GET['user']." AND User <> 0 AND Complete = 1) +30 (SELECT count(*) FROM `npc_text` WHERE User = ".$_GET['user']." AND User <> 0 AND Complete = 1) +31 (SELECT count(*) FROM `page_text` WHERE User = ".$_GET['user']." AND User <> 0 AND Complete = 1) 32 ) as NumberTranslate, (33 IFNULL((SELECT sum(Vote) AS Vote FROM `quests` WHERE User = ".$_GET['user']." AND Complete =1),0)34 + IFNULL((SELECT sum(Vote) AS Vote FROM `page_text` WHERE User = ".$_GET['user']." AND Complete =1),0)35 + IFNULL((SELECT sum(Vote) AS Vote FROM `npc_text` WHERE User = ".$_GET['user']." AND Complete =1),0)36 ) / (37 (SELECT count(Vote) AS Vote FROM `quests` WHERE User = ".$_GET['user']." AND Complete =1)38 + (SELECT count(Vote) AS Vote FROM `page_text` WHERE User = ".$_GET['user']." AND Complete =1)39 + (SELECT count(Vote) AS Vote FROM `npc_text` WHERE User = ".$_GET['user']." AND Complete =1) 40 ) AS Vote41 FROM `user` WHERE ID = ".$_GET['user']));24 if(array_key_exists('user', $_GET) and Licence(LICENCE_MODERATOR)) 25 { 26 27 $Query = 'SELECT *, ('; 28 foreach($TranslationTree as $Group) 29 if($Group['TablePrefix'] != '') 30 $Query .= '(SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND User <> 0 AND Complete = 1) + '; 31 $Query .= '0) as NumberTranslate, ('; 32 foreach($TranslationTree as $Group) 33 if($Group['TablePrefix'] != '') 34 $Query .= 'IFNULL((SELECT sum(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND Complete = 1), 0) + '; 35 $Query .= '0) / ('; 36 foreach($TranslationTree as $Group) 37 if($Group['TablePrefix'] != '') 38 $Query .= '(SELECT count(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND Complete = 1) +'; 39 $Query .= '0) AS Vote FROM `user` WHERE ID = '.$_GET['user']; 40 $LineUser = mysql_fetch_array($Database->SQLCommand($Query)); 42 41 43 echo 'ID: <b>'.$_GET['user'].'</b><br />';44 echo 'Jméno: <b>'.$LineUser['user'].'</b><br />';45 echo 'Implicitní jazyk: <b>'.$LineUser['Language'].'</b><br />';46 echo 'Posledí připojení: <b>'.$LineUser['LastLogin'].'</b><br />';47 echo 'Posledí IP: <b>'.$LineUser['LastIP'].'</b><br />';48 echo 'Počet přeložených: <b>'.$LineUser['NumberTranslate'].'</b><br />';49 echo 'Průměrná známka: <b>'.$LineUser['Vote'].'</b><br />';50 echo 'Email: <b>'.$LineUser['Email'].'</b><br />';51 echo '<br>42 echo('ID: <b>'.$_GET['user'].'</b><br />'); 43 echo('Jméno: <b>'.$LineUser['user'].'</b><br />'); 44 echo('Výchozí jazyk: <b>'.$LineUser['Language'].'</b><br />'); 45 echo('Poslední připojení: <b>'.$LineUser['LastLogin'].'</b><br />'); 46 echo('Poslední IP: <b>'.$LineUser['LastIP'].'</b><br />'); 47 echo('Počet přeložených: <b>'.$LineUser['NumberTranslate'].'</b><br />'); 48 echo('Průměrná známka: <b>'.$LineUser['Vote'].'</b><br />'); 49 echo('Email: <b>'.$LineUser['Email'].'</b><br />'); 50 echo('<br /> 52 51 53 52 <form action="user.php" method="post"> 54 53 Napsat E-mail: 55 <input type="text" name="email" value="'.$LineUser['Email'].'" >54 <input type="text" name="email" value="'.$LineUser['Email'].'" /> 56 55 Předmět: 57 <input type="text" name="subject" value="Projekt překládání textů WoW" >58 <input type="submit" value="Odeslat" >56 <input type="text" name="subject" value="Projekt překládání textů WoW" /> 57 <input type="submit" value="Odeslat" /> 59 58 <br> 60 59 <textarea name="text" rows="20" cols="62"> 61 62 63 64 60 65 61 S pozdravem '.$_SESSION['User'].' … … 67 63 Projekt překládání textů WoW '.$Config['Web']['BaseURL'].' 68 64 </textarea> 69 </form> 70 '; 71 72 } 65 </form>'); 66 } 73 67 74 ShowFooter(); 68 ShowFooter(); 69 75 70 ?> 76 71
Note:
See TracChangeset
for help on using the changeset viewer.