Просмотр файла includes/usercp_clone.php

Размер файла: 3.55Kb
  1. <?php
  2. /***************************************************************************
  3. * mides.ru
  4. * -------------------
  5. ***************************************************************************/
  6. if ( !defined('IN_PHPBB') )
  7. {
  8. die('Hacking attempt');
  9. exit;
  10. }
  11.  
  12. if ($userdata['user_level'] != ADMIN)
  13. {
  14. message_die(GENERAL_ERROR, 'Вы не являетесь администратором форума');
  15. }
  16.  
  17. if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
  18. {
  19. message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
  20. }
  21.  
  22. include($phpbb_root_path . 'includes/page_header.' . $phpEx);
  23. $template->set_filenames(array('body' => 'profile_password.tpl'));
  24.  
  25. $user_id = intval($HTTP_GET_VARS[POST_USERS_URL]);
  26.  
  27. $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $user_id";
  28. if (!($result = $db->sql_query($sql)))
  29. {
  30. message_die(GENERAL_ERROR, 'Could not obtain user information');
  31. }
  32. $userinfo = $db->sql_fetchrow($result);
  33. $user_password = $userinfo['user_password'];
  34. $username = $userinfo['username'];
  35. $user_icq = $userinfo['user_icq'];
  36. $user_website = $userinfo['user_website'];
  37.  
  38. $template->assign_vars(array('USERNAME' => $username));
  39.  
  40. $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_password = '$user_password'";
  41. if (!($result = $db->sql_query($sql)))
  42. {
  43. message_die(GENERAL_ERROR, 'Could not obtain user password information');
  44. }
  45. if ( $row = $db->sql_fetchrow($result) )
  46. {
  47. $i = 0;
  48. $link_passwords = '';
  49. do
  50. {
  51. $link_passwords .= '- <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;u=".$row['user_id']) . '">' . $row['username'] . '</a><br>';
  52. $i++;
  53. }
  54. while ( $row = $db->sql_fetchrow($result) );
  55. $db->sql_freeresult($result);
  56. } else {
  57. $link_passwords = 'Нет ников с такими же паролями';
  58. }
  59.  
  60. $template->assign_vars(array('LINK_PASSWORD' => $link_passwords));
  61.  
  62. if ( !empty($user_icq) )
  63. {
  64. $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_icq = '$user_icq'";
  65. if (!($result = $db->sql_query($sql)))
  66. {
  67. message_die(GENERAL_ERROR, 'Could not obtain user password information');
  68. }
  69. if ( $row = $db->sql_fetchrow($result) )
  70. {
  71. $i = 0;
  72. $link_icq = '';
  73. do
  74. {
  75. $link_icq .= '- <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;u=".$row['user_id']) . '">' . $row['username'] . '</a><br>';
  76. $i++;
  77. }
  78. while ( $row = $db->sql_fetchrow($result) );
  79. $db->sql_freeresult($result);
  80. } else {
  81. $link_icq = 'Нет ников с такими же ICQ';
  82. }
  83. } else {
  84. $link_icq = 'ICQ не установлен';
  85. }
  86. $template->assign_vars(array('LINK_ICQ' => $link_icq));
  87.  
  88. if ( !empty($user_website) )
  89. {
  90. $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_website = '$user_website'";
  91. if (!($result = $db->sql_query($sql)))
  92. {
  93. message_die(GENERAL_ERROR, 'Could not obtain user password information');
  94. }
  95. if ( $row = $db->sql_fetchrow($result) )
  96. {
  97. $i = 0;
  98. $link_website = '';
  99. do
  100. {
  101. $link_website .= '- <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;u=".$row['user_id']) . '">' . $row['username'] . '</a><br>';
  102. $i++;
  103. }
  104. while ( $row = $db->sql_fetchrow($result) );
  105. $db->sql_freeresult($result);
  106. } else {
  107. $link_website = 'Нет ников с такими же сайтами';
  108. }
  109. } else {
  110. $link_website = 'Сайт не установлен';
  111. }
  112. $template->assign_vars(array('LINK_WEBSITE' => $link_website));
  113.  
  114. $template->pparse('body');
  115. include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
  116.  
  117. ?>