Просмотр файла katrinka.ru/admin/user_update.php

Размер файла: 2.85Kb
  1. <?php
  2. include '../wap/config.php';
  3. include 'acl.php';
  4. list ($uid, $pl) = priv_level();
  5. if (!$id) exit;
  6. if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"))) {
  7. echo ("пЫЙВЛБ РПДЛМАЮЕОЙС Л вд!\n");
  8. };
  9. pg_query($conn,"SET CLIENT_ENCODING TO 'KOI8';");
  10. # $message=htmlspecialchars(trim($_POST['message']),ENT_QUOTES);
  11. # $message=htmlspecialchars(trim($_POST['message']),ENT_QUOTES);
  12.  
  13. if ($delete==1) {
  14. pg_query($conn,"delete from wapgbk where uid='$id';");
  15. pg_query($conn,"delete from chat where fr_u='$id' or to_u='$id';");
  16. pg_query($conn,"delete from downloads where uid='$id';");
  17. pg_query($conn,"delete from users_ignore where uid='$id' or who='$id';");
  18. pg_query($conn,"delete from users where id='$id';");
  19. pg_query($conn,"update site_var set v_num=(select v_num from site_var where id=2)-1 where id=2;");
  20. pg_close($conn);
  21. header("Location: users.php");
  22. exit;
  23. }
  24. $bday=sprintf("%s-%s-%s", $year, $month, $day);
  25.  
  26. $login=htmlspecialchars(trim($_POST['login']),ENT_QUOTES);
  27. $pass=htmlspecialchars(trim($_POST['pass']),ENT_QUOTES);
  28. $email=htmlspecialchars(trim($_POST['email']),ENT_QUOTES);
  29. $name=htmlspecialchars(trim($_POST['name']),ENT_QUOTES);
  30. $operator=htmlspecialchars(trim($_POST['operator']),ENT_QUOTES);
  31. $fr=htmlspecialchars(trim($_POST['fr']),ENT_QUOTES);
  32. $phonenum=htmlspecialchars(trim($_POST['phonenum']),ENT_QUOTES);
  33. $website=htmlspecialchars(trim($_POST['website']),ENT_QUOTES);
  34. $info=htmlspecialchars(trim($_POST['info']),ENT_QUOTES);
  35. $job=htmlspecialchars(trim($_POST['job']),ENT_QUOTES);
  36. $cust_status=htmlspecialchars(trim($_POST['cust_status']),ENT_QUOTES);
  37. $phonemodel=htmlspecialchars(trim($_POST['phonemodel']),ENT_QUOTES);
  38. $wap=htmlspecialchars(trim($_POST['wap']),ENT_QUOTES);
  39. $icq=htmlspecialchars(trim($_POST['icq']),ENT_QUOTES);
  40. $avatar=htmlspecialchars(trim($_POST['avatar']),ENT_QUOTES);
  41.  
  42. if (!$moder) $moder=0;
  43. if (!$invisible) $invisible=0;
  44. if ($icq=='') $icq=0;
  45.  
  46. $res=pg_query($conn,"select id from users where login='$login';");
  47. if (pg_numrows($res)==1) {
  48. $did=pg_result($res,0,0);
  49. if ($did!=$id) {
  50. print "фБЛПК ОЙЛ ХЦЕ ЪБОСФ\n";
  51. pg_close($conn);
  52. exit;
  53. }
  54. }
  55.  
  56. if ($pl==4) {
  57. $res=pg_query($conn,"update users set login='$login',passwd='$pass',email='$email',name='$name',bday='$bday',operator='$operator',moder='$moder',fr='$fr',phonenum='$phonenum',web='$website',info='$info',cust_status='$cust_status',phonemod='$phonemodel',icq='$icq',wap='$wap',access='$access',invisible='$invisible',avatar='$avatar',job='$job' where id='$id';");
  58. }
  59. pg_close($conn);
  60. switch ($l) {
  61. case 1:
  62. $link=sprintf("Location: users.php?p=%d", $p);
  63. break;
  64. case 2:
  65. $link=sprintf("Location: chat.php?r=%d", $r);
  66. break;
  67. case 3:
  68. $link=sprintf("Location: users_ignore.php");
  69. break;
  70. default:
  71. $link=sprintf("Location: /");
  72. }
  73. header($link);
  74. ?>