source: trunk/user.php@ 87

Last change on this file since 87 was 87, checked in by george, 16 years ago
  • Opraveno: Zobrazení informací o uživateli. Odstraněna chyba v SQL dotazu.
File size: 2.0 KB
Line 
1<?php
2
3include('includes/global.php');
4
5ShowPage();
6
7if(array_key_exists('text', $_POST) and Licence(LICENCE_ADMIN))
8{
9 $text = $_POST['text'];
10 $email = $_POST['email'];
11 $subject = $_POST['subject'];
12 echo('email: <b>'.$email.'</b><br />');
13 echo('předmět: <b>'.$subject.'</b><br />');
14 echo('text: <b>'.$text.'</b><br />');
15
16 if(@mail($email, $subject, $text, 'From: '.$Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
17 {
18 echo('Zpráva byla odeslána.<br /><br />');
19 }
20 else
21 {
22 echo('Nepodařilo se odesat E-mail.<br /><br />');
23 }
24}
25
26if(array_key_exists('user', $_GET) and Licence(LICENCE_MODERATOR))
27{
28
29 $Query = 'SELECT *, (';
30 foreach($TranslationTree as $Group)
31 if($Group['TablePrefix'] != '')
32 $Query .= '(SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND User <> 0 AND Complete = 1) + ';
33 $Query .= '0) as NumberTranslate FROM `user` WHERE ID = '.$_GET['user'];
34 $LineUser = mysql_fetch_array($Database->SQLCommand($Query));
35
36 echo('ID: <b>'.$_GET['user'].'</b><br />');
37 echo('Jméno: <b>'.$LineUser['user'].'</b><br />');
38 echo('Výchozí jazyk: <b>'.$LineUser['Language'].'</b><br />');
39 echo('Poslední připojení: <b>'.$LineUser['LastLogin'].'</b><br />');
40 echo('Poslední IP: <b>'.$LineUser['LastIP'].'</b><br />');
41 echo('Počet přeložených: <b>'.$LineUser['NumberTranslate'].'</b><br />');
42 echo('Email: <b>'.$LineUser['Email'].'</b><br />');
43 echo('<br />
44
45<form action="user.php" method="post">
46Napsat E-mail:
47<input type="text" name="email" value="'.$LineUser['Email'].'" />
48Předmět:
49<input type="text" name="subject" value="Projekt překládání textů WoW" />
50<input type="submit" value="Odeslat" />
51<br>
52<textarea name="text" rows="20" cols="62">
53
54S pozdravem '.$_SESSION['User'].'
55--------------------------------------------------------
56Projekt překládání textů WoW '.$Config['Web']['BaseURL'].'
57</textarea>
58</form>');
59}
60
61ShowFooter();
62
63?>
64
Note: See TracBrowser for help on using the repository browser.