1. if ($submit)
  2. {
  3. $error = array();
  4.  
  5. if(!$auth->acl_get('a_'))
  6. {
  7. $error[] = 'Puuduvad vastavad ơigused';
  8. }
  9.  
  10. $sql = 'SELECT count(*), user_id
  11. FROM ' . USERS_TABLE . '
  12. WHERE username_clean = "' . strtolower($username) . '"';
  13. $user = $db->sql_query($sql);
  14. $user = $db->sql_fetchrow($user);
  15.  
  16. if ($user['count(*)'] == 0)
  17. {
  18. $error[] = 'Kasutajat ei eksistreeri';
  19. }
  20.  
  21. if (is_numeric($nr) == false)
  22. {
  23. $error[] = 'See ei ole number';
  24. }
  25.  
  26. if (count($error) == 0)
  27. {
  28. $db->sql_query('UPDATE ' . USERS_TABLE . '
  29. SET user_klubikaart = "' . $nr . '"
  30. WHERE username_clean = "' . strtolower($username) . '"');
  31.  
  32. group_user_add($group_id, $user['user_id'], false, false, true);
  33. header('Location: '.append_sid($phpbb_root_path.'ct.'.$phpEx));
  34. }
  35. else
  36. {
  37. $error_formed = '';
  38. $first = true;
  39. foreach ($error as $row)
  40. {
  41. $error_formed .= ($first ? '' : '<br />').$row;
  42. $first = false;
  43. }
  44. }
  45. }