aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
blob: 7620cf1ff7a4059ef2e7a765f79db2700f20dbc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* Obtain user_ids from usernames or vice versa. Returns false on
* success else the error string
*
* @param array &$user_id_ary The user ids to check or empty if usernames used
* @param array &$username_ary The usernames to check or empty if user ids used
* @param mixed $user_type Array of user types to check, false if not restricting by user type
*/
function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)
{
	global $db;

	// Are both arrays already filled? Yep, return else
	// are neither array filled?
	if ($user_id_ary && $username_ary)
	{
		return false;
	}
	else if (!$user_id_ary && !$username_ary)
	{
		return 'NO_USERS';
	}

	$which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary';

	if (${$which_ary} && !is_array(${$which_ary}))
	{
		${$which_ary} = array(${$which_ary});
	}

	$sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary});
	unset(${$which_ary});

	$user_id_ary = $username_ary = array();

	// Grab the user id/username records
	$sql_where = ($which_ary == 'user_id_ary') ? 'user_id' : 'username_clean';
	$sql = 'SELECT user_id, username
		FROM ' . USERS_TABLE . '
		WHERE ' . $db->sql_in_set($sql_where, $sql_in);

	if ($user_type !== false && !empty($user_type))
	{
		$sql .= ' AND ' . $db->sql_in_set('user_type', $user_type);
	}

	$result = $db->sql_query($sql);

	if (!($row = $db->sql_fetchrow($result)))
	{
		$db->sql_freeresult($result);
		return 'NO_USERS';
	}

	do
	{
		$username_ary[$row['user_id']] = $row['username'];
		$user_id_ary[] = $row['user_id'];
	}
	while ($row = $db->sql_fetchrow($result));
	$db->sql_freeresult($result);

	return false;
}

/**
* Get latest registered username and update database to reflect it
*/
function update_last_username()
{
	global $config, $db;

	// Get latest username
	$sql = 'SELECT user_id, username, user_colour
		FROM ' . USERS_TABLE . '
		WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
		ORDER BY user_id DESC';
	$result = $db->sql_query_limit($sql, 1);
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if ($row)
	{
		$config->set('newest_user_id', $row['user_id'], false);
		$config->set('newest_username', $row['username'], false);
		$config->set('newest_user_colour', $row['user_colour'], false);
	}
}

/**
* Updates a username across all relevant tables/fields
*
* @param string $old_name the old/current username
* @param string $new_name the new username
*/
function user_update_name($old_name, $new_name)
{
	global $config, $db, $cache, $phpbb_dispatcher;

	$update_ary = array(
		FORUMS_TABLE			=> array('forum_last_poster_name'),
		MODERATOR_CACHE_TABLE	=> array('username'),
		POSTS_TABLE				=> array('post_username'),
		TOPICS_TABLE			=> array('topic_first_poster_name', 'topic_last_poster_name'),
	);

	foreach ($update_ary as $table => $field_ary)
	{
		foreach ($field_ary as $field)
		{
			$sql = "UPDATE $table
				SET $field = '" . $db->sql_escape($new_name) . "'
				WHERE $field = '" . $db->sql_escape($old_name) . "'";
			$db->sql_query($sql);
		}
	}

	if ($config['newest_username'] == $old_name)
	{
		$config->set('newest_username', $new_name, false);
	}

	/**
	* Update a username when it is changed
	*
	* @event core.update_username
	* @var	string	old_name	The old username that is replaced
	* @var	string	new_name	The new username
	* @since 3.1.0-a1
	*/
	$vars = array('old_name', 'new_name');
	extract($phpbb_dispatcher->trigger_event('core.update_username', compact($vars)));

	// Because some tables/caches use username-specific data we need to purge this here.
	$cache->destroy('sql', MODERATOR_CACHE_TABLE);
}

/**
* Adds an user
*
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array
* @param array $notifications_data The notifications settings for the new user
* @return the new user's ID.
*/
function user_add($user_row, $cp_data = false, $notifications_data = null)
{
	global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
	global $phpbb_dispatcher, $phpbb_container;

	if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
	{
		return false;
	}

	$username_clean = utf8_clean_string($user_row['username']);

	if (empty($username_clean))
	{
		return false;
	}

	$sql_ary = array(
		'username'			=> $user_row['username'],
		'username_clean'	=> $username_clean,
		'user_password'		=> (isset($user_row['user_password'])) ? $user_row['user_password'] : '',
		'user_email'		=> strtolower($user_row['user_email']),
		'user_email_hash'	=> phpbb_email_hash($user_row['user_email']),
		'group_id'			=> $user_row['group_id'],
		'user_type'			=> $user_row['user_type'],
	);

	// These are the additional vars able to be specified
	$additional_vars = array(
		'user_permissions'	=> '',
		'user_timezone'		=> $config['board_timezone'],
		'user_dateformat'	=> $config['default_dateformat'],
		'user_lang'			=> $config['default_lang'],
		'user_style'		=> (int) $config['default_style'],
		'user_actkey'		=> '',
		'user_ip'			=> '',
		'user_regdate'		=> time(),
		'user_passchg'		=> time(),
		'user_options'		=> 230271,
		// We do not set the new flag here - registration scripts need to specify it
		'user_new'			=> 0,

		'user_inactive_reason'	=> 0,
		'user_inactive_time'	=> 0,
		'user_lastmark'			=> time(),
		'user_lastvisit'		=> 0,
		'user_lastpost_time'	=> 0,
		'user_lastpage'			=> '',
		'user_posts'			=> 0,
		'user_colour'			=> '',
		'user_avatar'			=> '',
		'user_avatar_type'		=> '',
		'user_avatar_width'		=> 0,
		'user_avatar_height'	=> 0,
		'user_new_privmsg'		=> 0,
		'user_unread_privmsg'	=> 0,
		'user_last_privmsg'		=> 0,
		'user_message_rules'	=> 0,
		'user_full_folder'		=> PRIVMSGS_NO_BOX,
		'user_emailtime'		=> 0,

		'user_notify'			=> 0,
		'user_notify_pm'		=> 1,
		'user_notify_type'		=> NOTIFY_EMAIL,
		'user_allow_pm'			=> 1,
		'user_allow_viewonline'	=> 1,
		'user_allow_viewemail'	=> 1,
		'user_allow_massemail'	=> 1,

		'user_sig'					=> '',
		'user_sig_bbcode_uid'		=> '',
		'user_sig_bbcode_bitfield'	=> '',

		'user_form_salt'			=> unique_id(),
	);

	// Now fill the sql array with not required variables
	foreach ($additional_vars as $key => $default_value)
	{
		$sql_ary[$key] = (isset($user_row[$key])) ? $user_row[$key] : $default_value;
	}

	// Any additional variables in $user_row not covered above?
	$remaining_vars = array_diff(array_keys($user_row), array_keys($sql_ary));

	// Now fill our sql array with the remaining vars
	if (sizeof($remaining_vars))
	{
		foreach ($remaining_vars as $key)
		{
			$sql_ary[$key] = $user_row[$key];
		}
	}

	/**
	* Use this event to modify the values to be inserted when a user is added
	*
	* @event core.user_add_modify_data
	* @var array	user_row		Array of user details submited to user_add
	* @var array	cp_data			Array of Custom profile fields submited to user_add
	* @var array	sql_ary		Array of data to be inserted when a user is added
	* @since 3.1.0-a1
	* @change 3.1.0-b5
	*/
	$vars = array('user_row', 'cp_data', 'sql_ary');
	extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars)));

	$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
	$db->sql_query($sql);

	$user_id = $db->sql_nextid();

	// Insert Custom Profile Fields
	if ($cp_data !== false && sizeof($cp_data))
	{
		$cp_data['user_id'] = (int) $user_id;

		/* @var $cp \phpbb\profilefields\manager */
		$cp = $phpbb_container->get('profilefields.manager');
		$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
			$db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
		$db->sql_query($sql);
	}

	// Place into appropriate group...
	$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
		'user_id'		=> (int) $user_id,
		'group_id'		=> (int) $user_row['group_id'],
		'user_pending'	=> 0)
	);
	$db->sql_query($sql);

	// Now make it the users default group...
	group_set_user_default($user_row['group_id'], array($user_id), false);

	// Add to newly registered users group if user_new is 1
	if ($config['new_member_post_limit'] && $sql_ary['user_new'])
	{
		$sql = 'SELECT group_id
			FROM ' . GROUPS_TABLE . "
			WHERE group_name = 'NEWLY_REGISTERED'
				AND group_type = " . GROUP_SPECIAL;
		$result = $db->sql_query($sql);
		$add_group_id = (int) $db->sql_fetchfield('group_id');
		$db->sql_freeresult($result);

		if ($add_group_id)
		{
			global $phpbb_log;

			// Because these actions only fill the log unnecessarily, we disable it
			$phpbb_log->disable('admin');

			// Add user to "newly registered users" group and set to default group if admin specified so.
			if ($config['new_member_group_default'])
			{
				group_user_add($add_group_id, $user_id, false, false, true);
				$user_row['group_id'] = $add_group_id;
			}
			else
			{
				group_user_add($add_group_id, $user_id);
			}

			$phpbb_log->enable('admin');
		}
	}

	// set the newest user and adjust the user count if the user is a normal user and no activation mail is sent
	if ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_FOUNDER)
	{
		$config->set('newest_user_id', $user_id, false);
		$config->set('newest_username', $user_row['username'], false);
		$config->increment('num_users', 1, false);

		$sql = 'SELECT group_colour
			FROM ' . GROUPS_TABLE . '
			WHERE group_id = ' . (int) $user_row['group_id'];
		$result = $db->sql_query_limit($sql, 1);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		$config->set('newest_user_colour', $row['group_colour'], false);
	}

	// Use default notifications settings if notifications_data is not set
	if ($notifications_data === null)
	{
		$notifications_data = array(
			array(
				'item_type'	=> 'notification.type.post',
				'method'	=> 'notification.method.email',
			),
			array(
				'item_type'	=> 'notification.type.topic',
				'method'	=> 'notification.method.email',
			),
		);
	}

	// Subscribe user to notifications if necessary
	if (!empty($notifications_data))
	{
		/* @var $phpbb_notifications \phpbb\notification\manager */
		$phpbb_notifications = $phpbb_container->get('notification_manager');
		foreach ($notifications_data as $subscription)
		{
			$phpbb_notifications->add_subscription($subscription['item_type'], 0, $subscription['method'], $user_id);
		}
	}

	/**
	* Event that returns user id, user detals and user CPF of newly registared user
	*
	* @event core.user_add_after
	* @var int		user_id			User id of newly registared user
	* @var array	user_row		Array of user details submited to user_add
	* @var array	cp_data			Array of Custom profile fields submited to user_add
	* @since 3.1.0-b5
	*/
	$vars = array('user_id', 'user_row', 'cp_data');
	extract($phpbb_dispatcher->trigger_event('core.user_add_after', compact($vars)));

	return $user_id;
}

/**
 * Remove User
 *
 * @param string	$mode		Either 'retain' or 'remove'
 * @param mixed		$user_ids	Either an array of integers or an integer
 * @param bool		$retain_username
 * @return bool
 */
function user_delete($mode, $user_ids, $retain_username = true)
{
	global $cache, $config, $db, $user, $phpbb_dispatcher, $phpbb_container;
	global $phpbb_root_path, $phpEx;

	$db->sql_transaction('begin');

	$user_rows = array();
	if (!is_array($user_ids))
	{
		$user_ids = array($user_ids);
	}

	$user_id_sql = $db->sql_in_set('user_id', $user_ids);

	$sql = 'SELECT *
		FROM ' . USERS_TABLE . '
		WHERE ' . $user_id_sql;
	$result = $db->sql_query($sql);
	while ($row = $db->sql_fetchrow($result))
	{
		$user_rows[(int) $row['user_id']] = $row;
	}
	$db->sql_freeresult($result);

	if (empty($user_rows))
	{
		return false;
	}

	/**
	* Event before a user is deleted
	*
	* @event core.delete_user_before
	* @var	string	mode		Mode of deletion (retain/delete posts)
	* @var	array	user_ids	IDs of the deleted user
	* @var	mixed	retain_username	True if username should be retained
	*				or false if not
	* @since 3.1.0-a1
	*/
	$vars = array('mode', 'user_ids', 'retain_username');
	extract($phpbb_dispatcher->trigger_event('core.delete_user_before', compact($vars)));

	// Before we begin, we will remove the reports the user issued.
	$sql = 'SELECT r.post_id, p.topic_id
		FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
		WHERE ' . $db->sql_in_set('r.user_id', $user_ids) . '
			AND p.post_id = r.post_id';
	$result = $db->sql_query($sql);

	$report_posts = $report_topics = array();
	while ($row = $db->sql_fetchrow($result))
	{
		$report_posts[] = $row['post_id'];
		$report_topics[] = $row['topic_id'];
	}
	$db->sql_freeresult($result);

	if (sizeof($report_posts))
	{
		$report_posts = array_unique($report_posts);
		$report_topics = array_unique($report_topics);

		// Get a list of topics that still contain reported posts
		$sql = 'SELECT DISTINCT topic_id
			FROM ' . POSTS_TABLE . '
			WHERE ' . $db->sql_in_set('topic_id', $report_topics) . '
				AND post_reported = 1
				AND ' . $db->sql_in_set('post_id', $report_posts, true);
		$result = $db->sql_query($sql);

		$keep_report_topics = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$keep_report_topics[] = $row['topic_id'];
		}
		$db->sql_freeresult($result);

		if (sizeof($keep_report_topics))
		{
			$report_topics = array_diff($report_topics, $keep_report_topics);
		}
		unset($keep_report_topics);

		// Now set the flags back
		$sql = 'UPDATE ' . POSTS_TABLE . '
			SET post_reported = 0
			WHERE ' . $db->sql_in_set('post_id', $report_posts);
		$db->sql_query($sql);

		if (sizeof($report_topics))
		{
			$sql = 'UPDATE ' . TOPICS_TABLE . '
				SET topic_reported = 0
				WHERE ' . $db->sql_in_set('topic_id', $report_topics);
			$db->sql_query($sql);
		}
	}

	// Remove reports
	$db->sql_query('DELETE FROM ' . REPORTS_TABLE . ' WHERE ' . $user_id_sql);

	$num_users_delta = 0;

	// Get auth provider collection in case accounts might need to be unlinked
	$provider_collection = $phpbb_container->get('auth.provider_collection');

	// Some things need to be done in the loop (if the query changes based
	// on which user is currently being deleted)
	$added_guest_posts = 0;
	foreach ($user_rows as $user_id => $user_row)
	{
		if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == 'avatar.driver.upload')
		{
			avatar_delete('user', $user_row);
		}

		// Unlink accounts
		foreach ($provider_collection as $provider_name => $auth_provider)
		{
			$provider_data = $auth_provider->get_auth_link_data($user_id);

			if ($provider_data !== null)
			{
				$link_data = array(
					'user_id' => $user_id,
					'link_method' => 'user_delete',
				);

				// BLOCK_VARS might contain hidden fields necessary for unlinking accounts
				if (isset($provider_data['BLOCK_VARS']) && is_array($provider_data['BLOCK_VARS']))
				{
					foreach ($provider_data['BLOCK_VARS'] as $provider_service)
					{
						if (!array_key_exists('HIDDEN_FIELDS', $provider_service))
						{
							$provider_service['HIDDEN_FIELDS'] = array();
						}

						$auth_provider->unlink_account(array_merge($link_data, $provider_service['HIDDEN_FIELDS']));
					}
				}
				else
				{
					$auth_provider->unlink_account($link_data);
				}
			}
		}

		// Decrement number of users if this user is active
		if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE)
		{
			--$num_users_delta;
		}

		switch ($mode)
		{
			case 'retain':
				if ($retain_username === false)
				{
					$post_username = $user->lang['GUEST'];
				}
				else
				{
					$post_username = $user_row['username'];
				}

				// If the user is inactive and newly registered
				// we assume no posts from the user, and save
				// the queries
				if ($user_row['user_type'] != USER_INACTIVE || $user_row['user_inactive_reason'] != INACTIVE_REGISTER || $user_row['user_posts'])
				{
					// When we delete these users and retain the posts, we must assign all the data to the guest user
					$sql = 'UPDATE ' . FORUMS_TABLE . '
						SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = ''
						WHERE forum_last_poster_id = $user_id";
					$db->sql_query($sql);

					$sql = 'UPDATE ' . POSTS_TABLE . '
						SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "'
						WHERE poster_id = $user_id";
					$db->sql_query($sql);

					$sql = 'UPDATE ' . TOPICS_TABLE . '
						SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = ''
						WHERE topic_poster = $user_id";
					$db->sql_query($sql);

					$sql = 'UPDATE ' . TOPICS_TABLE . '
						SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
						WHERE topic_last_poster_id = $user_id";
					$db->sql_query($sql);

					// Since we change every post by this author, we need to count this amount towards the anonymous user

					if ($user_row['user_posts'])
					{
						$added_guest_posts += $user_row['user_posts'];
					}
				}
			break;

			case 'remove':
				// there is nothing variant specific to deleting posts
			break;
		}
	}

	if ($num_users_delta != 0)
	{
		$config->increment('num_users', $num_users_delta, false);
	}

	// Now do the invariant tasks
	// all queries performed in one call of this function are in a single transaction
	// so this is kosher
	if ($mode == 'retain')
	{
		// Assign more data to the Anonymous user
		$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
			SET poster_id = ' . ANONYMOUS . '
			WHERE ' . $db->sql_in_set('poster_id', $user_ids);
		$db->sql_query($sql);

		$sql = 'UPDATE ' . USERS_TABLE . '
			SET user_posts = user_posts + ' . $added_guest_posts . '
			WHERE user_id = ' . ANONYMOUS;
		$db->sql_query($sql);
	}
	else if ($mode == 'remove')
	{
		if (!function_exists('delete_posts'))
		{
			include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
		}

		// Delete posts, attachments, etc.
		// delete_posts can handle any number of IDs in its second argument
		delete_posts('poster_id', $user_ids);
	}

	$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);

	// Delete the miscellaneous (non-post) data for the user
	foreach ($table_ary as $table)
	{
		$sql = "DELETE FROM $table
			WHERE " . $user_id_sql;
		$db->sql_query($sql);
	}

	$cache->destroy('sql', MODERATOR_CACHE_TABLE);

	// Change user_id to anonymous for posts edited by this user
	$sql = 'UPDATE ' . POSTS_TABLE . '
		SET post_edit_user = ' . ANONYMOUS . '
		WHERE ' . $db->sql_in_set('post_edit_user', $user_ids);
	$db->sql_query($sql);

	// Change user_id to anonymous for pms edited by this user
	$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
		SET message_edit_user = ' . ANONYMOUS . '
		WHERE ' . $db->sql_in_set('message_edit_user', $user_ids);
	$db->sql_query($sql);

	// Change user_id to anonymous for posts deleted by this user
	$sql = 'UPDATE ' . POSTS_TABLE . '
		SET post_delete_user = ' . ANONYMOUS . '
		WHERE ' . $db->sql_in_set('post_delete_user', $user_ids);
	$db->sql_query($sql);

	// Change user_id to anonymous for topics deleted by this user
	$sql = 'UPDATE ' . TOPICS_TABLE . '
		SET topic_delete_user = ' . ANONYMOUS . '
		WHERE ' . $db->sql_in_set('topic_delete_user', $user_ids);
	$db->sql_query($sql);

	// Delete user log entries about this user
	$sql = 'DELETE FROM ' . LOG_TABLE . '
		WHERE ' . $db->sql_in_set('reportee_id', $user_ids);
	$db->sql_query($sql);

	// Change user_id to anonymous for this users triggered events
	$sql = 'UPDATE ' . LOG_TABLE . '
		SET user_id = ' . ANONYMOUS . '
		WHERE ' . $user_id_sql;
	$db->sql_query($sql);

	// Delete the user_id from the zebra table
	$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
		WHERE ' . $user_id_sql . '
			OR ' . $db->sql_in_set('zebra_id', $user_ids);
	$db->sql_query($sql);

	// Delete the user_id from the banlist
	$sql = 'DELETE FROM ' . BANLIST_TABLE . '
		WHERE ' . $db->sql_in_set('ban_userid', $user_ids);
	$db->sql_query($sql);

	// Delete the user_id from the session table
	$sql = 'DELETE FROM ' . SESSIONS_TABLE . '
		WHERE ' . $db->sql_in_set('session_user_id', $user_ids);
	$db->sql_query($sql);

	// Clean the private messages tables from the user
	if (!function_exists('phpbb_delete_user_pms'))
	{
		include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
	}
	phpbb_delete_users_pms($user_ids);

	$phpbb_notifications = $phpbb_container->get('notification_manager');
	$phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_ids);

	$db->sql_transaction('commit');

	/**
	* Event after a user is deleted
	*
	* @event core.delete_user_after
	* @var	string	mode		Mode of deletion (retain/delete posts)
	* @var	array	user_ids	IDs of the deleted user
	* @var	mixed	retain_username	True if username should be retained
	*				or false if not
	* @since 3.1.0-a1
	*/
	$vars = array('mode', 'user_ids', 'retain_username');
	extract($phpbb_dispatcher->trigger_event('core.delete_user_after', compact($vars)));

	// Reset newest user info if appropriate
	if (in_array($config['newest_user_id'], $user_ids))
	{
		update_last_username();
	}

	return false;
}

/**
* Flips user_type from active to inactive and vice versa, handles group membership updates
*
* @param string $mode can be flip for flipping from active/inactive, activate or deactivate
*/
function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
{
	global $config, $db, $user, $auth, $phpbb_dispatcher;

	$deactivated = $activated = 0;
	$sql_statements = array();

	if (!is_array($user_id_ary))
	{
		$user_id_ary = array($user_id_ary);
	}

	if (!sizeof($user_id_ary))
	{
		return;
	}

	$sql = 'SELECT user_id, group_id, user_type, user_inactive_reason
		FROM ' . USERS_TABLE . '
		WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
	$result = $db->sql_query($sql);

	while ($row = $db->sql_fetchrow($result))
	{
		$sql_ary = array();

		if ($row['user_type'] == USER_IGNORE || $row['user_type'] == USER_FOUNDER ||
			($mode == 'activate' && $row['user_type'] != USER_INACTIVE) ||
			($mode == 'deactivate' && $row['user_type'] == USER_INACTIVE))
		{
			continue;
		}

		if ($row['user_type'] == USER_INACTIVE)
		{
			$activated++;
		}
		else
		{
			$deactivated++;

			// Remove the users session key...
			$user->reset_login_keys($row['user_id']);
		}

		$sql_ary += array(
			'user_type'				=> ($row['user_type'] == USER_NORMAL) ? USER_INACTIVE : USER_NORMAL,
			'user_inactive_time'	=> ($row['user_type'] == USER_NORMAL) ? time() : 0,
			'user_inactive_reason'	=> ($row['user_type'] == USER_NORMAL) ? $reason : 0,
		);

		$sql_statements[$row['user_id']] = $sql_ary;
	}
	$db->sql_freeresult($result);

	/**
	* Check or modify activated/deactivated users data before submitting it to the database
	*
	* @event core.user_active_flip_before
	* @var	string	mode			User type changing mode, can be: flip|activate|deactivate
	* @var	int		reason			Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
	* @var	int		activated		The number of users to be activated
	* @var	int		deactivated		The number of users to be deactivated
	* @var	array	user_id_ary		Array with user ids to change user type
	* @var	array	sql_statements	Array with users data to submit to the database, keys: user ids, values: arrays with user data
	* @since 3.1.4-RC1
	*/
	$vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
	extract($phpbb_dispatcher->trigger_event('core.user_active_flip_before', compact($vars)));

	if (sizeof($sql_statements))
	{
		foreach ($sql_statements as $user_id => $sql_ary)
		{
			$sql = 'UPDATE ' . USERS_TABLE . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
				WHERE user_id = ' . $user_id;
			$db->sql_query($sql);
		}

		$auth->acl_clear_prefetch(array_keys($sql_statements));
	}

	/**
	* Perform additional actions after the users have been activated/deactivated
	*
	* @event core.user_active_flip_after
	* @var	string	mode			User type changing mode, can be: flip|activate|deactivate
	* @var	int		reason			Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
	* @var	int		activated		The number of users to be activated
	* @var	int		deactivated		The number of users to be deactivated
	* @var	array	user_id_ary		Array with user ids to change user type
	* @var	array	sql_statements	Array with users data to submit to the database, keys: user ids, values: arrays with user data
	* @since 3.1.4-RC1
	*/
	$vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
	extract($phpbb_dispatcher->trigger_event('core.user_active_flip_after', compact($vars)));

	if ($deactivated)
	{
		$config->increment('num_users', $deactivated * (-1), false);
	}

	if ($activated)
	{
		$config->increment('num_users', $activated, false);
	}

	// Update latest username
	update_last_username();
}

/**
* Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address
*
* @param string $mode Type of ban. One of the following: user, ip, email
* @param mixed $ban Banned entity. Either string or array with usernames, ips or email addresses
* @param int $ban_len Ban length in minutes
* @param string $ban_len_other Ban length as a date (YYYY-MM-DD)
* @param boolean $ban_exclude Exclude these entities from banning?
* @param string $ban_reason String describing the reason for this ban
* @return boolean
*/
function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '')
{
	global $db, $user, $auth, $cache, $phpbb_log;

	// Delete stale bans
	$sql = 'DELETE FROM ' . BANLIST_TABLE . '
		WHERE ban_end < ' . time() . '
			AND ban_end <> 0';
	$db->sql_query($sql);

	$ban_list = (!is_array($ban)) ? array_unique(explode("\n", $ban)) : $ban;
	$ban_list_log = implode(', ', $ban_list);

	$current_time = time();

	// Set $ban_end to the unix time when the ban should end. 0 is a permanent ban.
	if ($ban_len)
	{
		if ($ban_len != -1 || !$ban_len_other)
		{
			$ban_end = max($current_time, $current_time + ($ban_len) * 60);
		}
		else
		{
			$ban_other = explode('-', $ban_len_other);
			if (sizeof($ban_other) == 3 && ((int) $ban_other[0] < 9999) &&
				(strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2))
			{
				$ban_end = max($current_time, $user->create_datetime()
					->setDate((int) $ban_other[0], (int) $ban_other[1], (int) $ban_other[2])
					->setTime(0, 0, 0)
					->getTimestamp() + $user->timezone->getOffset(new DateTime('UTC')));
			}
			else
			{
				trigger_error('LENGTH_BAN_INVALID', E_USER_WARNING);
			}
		}
	}
	else
	{
		$ban_end = 0;
	}

	$founder = $founder_names = array();

	if (!$ban_exclude)
	{
		// Create a list of founder...
		$sql = 'SELECT user_id, user_email, username_clean
			FROM ' . USERS_TABLE . '
			WHERE user_type = ' . USER_FOUNDER;
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$founder[$row['user_id']] = $row['user_email'];
			$founder_names[$row['user_id']] = $row['username_clean'];
		}
		$db->sql_freeresult($result);
	}

	$banlist_ary = array();

	switch ($mode)
	{
		case 'user':
			$type = 'ban_userid';

			// At the moment we do not support wildcard username banning

			// Select the relevant user_ids.
			$sql_usernames = array();

			foreach ($ban_list as $username)
			{
				$username = trim($username);
				if ($username != '')
				{
					$clean_name = utf8_clean_string($username);
					if ($clean_name == $user->data['username_clean'])
					{
						trigger_error('CANNOT_BAN_YOURSELF', E_USER_WARNING);
					}
					if (in_array($clean_name, $founder_names))
					{
						trigger_error('CANNOT_BAN_FOUNDER', E_USER_WARNING);
					}
					$sql_usernames[] = $clean_name;
				}
			}

			// Make sure we have been given someone to ban
			if (!sizeof($sql_usernames))
			{
				trigger_error('NO_USER_SPECIFIED', E_USER_WARNING);
			}

			$sql = 'SELECT user_id
				FROM ' . USERS_TABLE . '
				WHERE ' . $db->sql_in_set('username_clean', $sql_usernames);

			// Do not allow banning yourself, the guest account, or founders.
			$non_bannable = array($user->data['user_id'], ANONYMOUS);
			if (sizeof($founder))
			{
				$sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), $non_bannable), true);
			}
			else
			{
				$sql .= ' AND ' . $db->sql_in_set('user_id', $non_bannable, true);
			}

			$result = $db->sql_query($sql);

			if ($row = $db->sql_fetchrow($result))
			{
				do
				{
					$banlist_ary[] = (int) $row['user_id'];
				}
				while ($row = $db->sql_fetchrow($result));
			}
			else
			{
				$db->sql_freeresult($result);
				trigger_error('NO_USERS', E_USER_WARNING);
			}
			$db->sql_freeresult($result);
		break;

		case 'ip':
			$type = 'ban_ip';

			foreach ($ban_list as $ban_item)
			{
				if (preg_match('#^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$#', trim($ban_item), $ip_range_explode))
				{
					// This is an IP range
					// Don't ask about all this, just don't ask ... !
					$ip_1_counter = $ip_range_explode[1];
					$ip_1_end = $ip_range_explode[5];

					while ($ip_1_counter <= $ip_1_end)
					{
						$ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0;
						$ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6];

						if ($ip_2_counter == 0 && $ip_2_end == 254)
						{
							$ip_2_counter = 256;
							$ip_2_fragment = 256;

							$banlist_ary[] = "$ip_1_counter.*";
						}

						while ($ip_2_counter <= $ip_2_end)
						{
							$ip_3_counter = ($ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[3] : 0;
							$ip_3_end = ($ip_2_counter < $ip_2_end || $ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[7];

							if ($ip_3_counter == 0 && $ip_3_end == 254)
							{
								$ip_3_counter = 256;
								$ip_3_fragment = 256;

								$banlist_ary[] = "$ip_1_counter.$ip_2_counter.*";
							}

							while ($ip_3_counter <= $ip_3_end)
							{
								$ip_4_counter = ($ip_3_counter == $ip_range_explode[3] && $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[4] : 0;
								$ip_4_end = ($ip_3_counter < $ip_3_end || $ip_2_counter < $ip_2_end) ? 254 : $ip_range_explode[8];

								if ($ip_4_counter == 0 && $ip_4_end == 254)
								{
									$ip_4_counter = 256;
									$ip_4_fragment = 256;

									$banlist_ary[] = "$ip_1_counter.$ip_2_counter.$ip_3_counter.*";
								}

								while ($ip_4_counter <= $ip_4_end)
								{
									$banlist_ary[] = "$ip_1_counter.$ip_2_counter.$ip_3_counter.$ip_4_counter";
									$ip_4_counter++;
								}
								$ip_3_counter++;
							}
							$ip_2_counter++;
						}
						$ip_1_counter++;
					}
				}
				else if (preg_match('#^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$#', trim($ban_item)) || preg_match('#^[a-f0-9:]+\*?$#i', trim($ban_item)))
				{
					// Normal IP address
					$banlist_ary[] = trim($ban_item);
				}
				else if (preg_match('#^\*$#', trim($ban_item)))
				{
					// Ban all IPs
					$banlist_ary[] = '*';
				}
				else if (preg_match('#^([\w\-_]\.?){2,}$#is', trim($ban_item)))
				{
					// hostname
					$ip_ary = gethostbynamel(trim($ban_item));

					if (!empty($ip_ary))
					{
						foreach ($ip_ary as $ip)
						{
							if ($ip)
							{
								if (strlen($ip) > 40)
								{
									continue;
								}

								$banlist_ary[] = $ip;
							}
						}
					}
				}

				if (empty($banlist_ary))
				{
					trigger_error('NO_IPS_DEFINED', E_USER_WARNING);
				}
			}
		break;

		case 'email':
			$type = 'ban_email';

			foreach ($ban_list as $ban_item)
			{
				$ban_item = trim($ban_item);

				if (preg_match('#^.*?@*|(([a-z0-9\-]+\.)+([a-z]{2,3}))$#i', $ban_item))
				{
					if (strlen($ban_item) > 100)
					{
						continue;
					}

					if (!sizeof($founder) || !in_array($ban_item, $founder))
					{
						$banlist_ary[] = $ban_item;
					}
				}
			}

			if (sizeof($ban_list) == 0)
			{
				trigger_error('NO_EMAILS_DEFINED', E_USER_WARNING);
			}
		break;

		default:
			trigger_error('NO_MODE', E_USER_WARNING);
		break;
	}

	// Fetch currently set bans of the specified type and exclude state. Prevent duplicate bans.
	$sql_where = ($type == 'ban_userid') ? 'ban_userid <> 0' : "$type <> ''";

	$sql = "SELECT $type
		FROM " . BANLIST_TABLE . "
		WHERE $sql_where
			AND ban_exclude = " . (int) $ban_exclude;
	$result = $db->sql_query($sql);

	// Reset $sql_where, because we use it later...
	$sql_where = '';

	if ($row = $db->sql_fetchrow($result))
	{
		$banlist_ary_tmp = array();
		do
		{
			switch ($mode)
			{
				case 'user':
					$banlist_ary_tmp[] = $row['ban_userid'];
				break;

				case 'ip':
					$banlist_ary_tmp[] = $row['ban_ip'];
				break;

				case 'email':
					$banlist_ary_tmp[] = $row['ban_email'];
				break;
			}
		}
		while ($row = $db->sql_fetchrow($result));

		$banlist_ary_tmp = array_intersect($banlist_ary, $banlist_ary_tmp);

		if (sizeof($banlist_ary_tmp))
		{
			// One or more entities are already banned/excluded, delete the existing bans, so they can be re-inserted with the given new length
			$sql = 'DELETE FROM ' . BANLIST_TABLE . '
				WHERE ' . $db->sql_in_set($type, $banlist_ary_tmp) . '
					AND ban_exclude = ' . (int) $ban_exclude;
			$db->sql_query($sql);
		}

		unset($banlist_ary_tmp);
	}
	$db->sql_freeresult($result);

	// We have some entities to ban
	if (sizeof($banlist_ary))
	{
		$sql_ary = array();

		foreach ($banlist_ary as $ban_entry)
		{
			$sql_ary[] = array(
				$type				=> $ban_entry,
				'ban_start'			=> (int) $current_time,
				'ban_end'			=> (int) $ban_end,
				'ban_exclude'		=> (int) $ban_exclude,
				'ban_reason'		=> (string) $ban_reason,
				'ban_give_reason'	=> (string) $ban_give_reason,
			);
		}

		$db->sql_multi_insert(BANLIST_TABLE, $sql_ary);

		// If we are banning we want to logout anyone matching the ban
		if (!$ban_exclude)
		{
			switch ($mode)
			{
				case 'user':
					$sql_where = 'WHERE ' . $db->sql_in_set('session_user_id', $banlist_ary);
				break;

				case 'ip':
					$sql_where = 'WHERE ' . $db->sql_in_set('session_ip', $banlist_ary);
				break;

				case 'email':
					$banlist_ary_sql = array();

					foreach ($banlist_ary as $ban_entry)
					{
						$banlist_ary_sql[] = (string) str_replace('*', '%', $ban_entry);
					}

					$sql = 'SELECT user_id
						FROM ' . USERS_TABLE . '
						WHERE ' . $db->sql_in_set('user_email', $banlist_ary_sql);
					$result = $db->sql_query($sql);

					$sql_in = array();

					if ($row = $db->sql_fetchrow($result))
					{
						do
						{
							$sql_in[] = $row['user_id'];
						}
						while ($row = $db->sql_fetchrow($result));

						$sql_where = 'WHERE ' . $db->sql_in_set('session_user_id', $sql_in);
					}
					$db->sql_freeresult($result);
				break;
			}

			if (isset($sql_where) && $sql_where)
			{
				$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
					$sql_where";
				$db->sql_query($sql);

				if ($mode == 'user')
				{
					$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' ' . ((in_array('*', $banlist_ary)) ? '' : 'WHERE ' . $db->sql_in_set('user_id', $banlist_ary));
					$db->sql_query($sql);
				}
			}
		}

		// Update log
		$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';

		// Add to admin log, moderator log and user notes
		$phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log_entry . strtoupper($mode), false, array($ban_reason, $ban_list_log));
		$phpbb_log->add('mod', $user->data['user_id'], $user->ip, $log_entry . strtoupper($mode), false, array(
			'forum_id' => 0,
			'topic_id' => 0,
			$ban_reason,
			$ban_list_log
		));
		if ($mode == 'user')
		{
			foreach ($banlist_ary as $user_id)
			{
				$phpbb_log->add('user', $user->data['user_id'], $user->ip, $log_entry . strtoupper($mode), false, array(
					'reportee_id' => $user_id,
					$ban_reason,
					$ban_list_log
				));
			}
		}

		$cache->destroy('sql', BANLIST_TABLE);

		return true;
	}

	// There was nothing to ban/exclude. But destroying the cache because of the removal of stale bans.
	$cache->destroy('sql', BANLIST_TABLE);

	return false;
}

/**
* Unban User
*/
function user_unban($mode, $ban)
{
	global $db, $user, $auth, $cache, $phpbb_log;

	// Delete stale bans
	$sql = 'DELETE FROM ' . BANLIST_TABLE . '
		WHERE ban_end < ' . time() . '
			AND ban_end <> 0';
	$db->sql_query($sql);

	if (!is_array($ban))
	{
		$ban = array($ban);
	}

	$unban_sql = array_map('intval', $ban);

	if (sizeof($unban_sql))
	{
		// Grab details of bans for logging information later
		switch ($mode)
		{
			case 'user':
				$sql = 'SELECT u.username AS unban_info, u.user_id
					FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . ' b
					WHERE ' . $db->sql_in_set('b.ban_id', $unban_sql) . '
						AND u.user_id = b.ban_userid';
			break;

			case 'email':
				$sql = 'SELECT ban_email AS unban_info
					FROM ' . BANLIST_TABLE . '
					WHERE ' . $db->sql_in_set('ban_id', $unban_sql);
			break;

			case 'ip':
				$sql = 'SELECT ban_ip AS unban_info
					FROM ' . BANLIST_TABLE . '
					WHERE ' . $db->sql_in_set('ban_id', $unban_sql);
			break;
		}
		$result = $db->sql_query($sql);

		$l_unban_list = '';
		$user_ids_ary = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info'];
			if ($mode == 'user')
			{
				$user_ids_ary[] = $row['user_id'];
			}
		}
		$db->sql_freeresult($result);

		$sql = 'DELETE FROM ' . BANLIST_TABLE . '
			WHERE ' . $db->sql_in_set('ban_id', $unban_sql);
		$db->sql_query($sql);

		// Add to moderator log, admin log and user notes
		$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_UNBAN_' . strtoupper($mode), false, array($l_unban_list));
		$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_UNBAN_' . strtoupper($mode), false, array(
			'forum_id' => 0,
			'topic_id' => 0,
			$l_unban_list
		));
		if ($mode == 'user')
		{
			foreach ($user_ids_ary as $user_id)
			{
				$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_UNBAN_' . strtoupper($mode), false, array(
					'reportee_id' => $user_id,
					$l_unban_list
				));
			}
		}
	}

	$cache->destroy('sql', BANLIST_TABLE);

	return false;
}

/**
* Internet Protocol Address Whois
* RFC3912: WHOIS Protocol Specification
*
* @param string $ip		Ip address, either IPv4 or IPv6.
*
* @return string		Empty string if not a valid ip address.
*						Otherwise make_clickable()'ed whois result.
*/
function user_ipwhois($ip)
{
	if (empty($ip))
	{
		return '';
	}

	if (preg_match(get_preg_expression('ipv4'), $ip))
	{
		// IPv4 address
		$whois_host = 'whois.arin.net.';
	}
	else if (preg_match(get_preg_expression('ipv6'), $ip))
	{
		// IPv6 address
		$whois_host = 'whois.sixxs.net.';
	}
	else
	{
		return '';
	}

	$ipwhois = '';

	if (($fsk = @fsockopen($whois_host, 43)))
	{
		// CRLF as per RFC3912
		fputs($fsk, "$ip\r\n");
		while (!feof($fsk))
		{
			$ipwhois .= fgets($fsk, 1024);
		}
		@fclose($fsk);
	}

	$match = array();

	// Test for referrals from $whois_host to other whois databases, roll on rwhois
	if (preg_match('#ReferralServer:[\x20]*whois://(.+)#im', $ipwhois, $match))
	{
		if (strpos($match[1], ':') !== false)
		{
			$pos	= strrpos($match[1], ':');
			$server	= substr($match[1], 0, $pos);
			$port	= (int) substr($match[1], $pos + 1);
			unset($pos);
		}
		else
		{
			$server	= $match[1];
			$port	= 43;
		}

		$buffer = '';

		if (($fsk = @fsockopen($server, $port)))
		{
			fputs($fsk, "$ip\r\n");
			while (!feof($fsk))
			{
				$buffer .= fgets($fsk, 1024);
			}
			@fclose($fsk);
		}

		// Use the result from $whois_host if we don't get any result here
		$ipwhois = (empty($buffer)) ? $ipwhois : $buffer;
	}

	$ipwhois = htmlspecialchars($ipwhois);

	// Magic URL ;)
	return trim(make_clickable($ipwhois, false, ''));
}

/**
* Data validation ... used primarily but not exclusively by ucp modules
*
* "Master" function for validating a range of data types
*/
function validate_data($data, $val_ary)
{
	global $user;

	$error = array();

	foreach ($val_ary as $var => $val_seq)
	{
		if (!is_array($val_seq[0]))
		{
			$val_seq = array($val_seq);
		}

		foreach ($val_seq as $validate)
		{
			$function = array_shift($validate);
			array_unshift($validate, $data[$var]);

			if (is_array($function))
			{
				$result = call_user_func_array(array($function[0], 'validate_' . $function[1]), $validate);
			}
			else
			{
				$function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
				$result = call_user_func_array($function_prefix . $function, $validate);
			}

			if ($result)
			{
				// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
				$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
			}
		}
	}

	return $error;
}

/**
* Validate String
*
* @return	boolean|string	Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
function validate_string($string, $optional = false, $min = 0, $max = 0)
{
	if (empty($string) && $optional)
	{
		return false;
	}

	if ($min && utf8_strlen(htmlspecialchars_decode($string)) < $min)
	{
		return 'TOO_SHORT';
	}
	else if ($max && utf8_strlen(htmlspecialchars_decode($string)) > $max)
	{
		return 'TOO_LONG';
	}

	return false;
}

/**
* Validate Number
*
* @return	boolean|string	Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
function validate_num($num, $optional = false, $min = 0, $max = 1E99)
{
	if (empty($num) && $optional)
	{
		return false;
	}

	if ($num < $min)
	{
		return 'TOO_SMALL';
	}
	else if ($num > $max)
	{
		return 'TOO_LARGE';
	}

	return false;
}

/**
* Validate Date
* @param String $string a date in the dd-mm-yyyy format
* @return	boolean
*/
function validate_date($date_string, $optional = false)
{
	$date = explode('-', $date_string);
	if ((empty($date) || sizeof($date) != 3) && $optional)
	{
		return false;
	}
	else if ($optional)
	{
		for ($field = 0; $field <= 1; $field++)
		{
			$date[$field] = (int) $date[$field];
			if (empty($date[$field]))
			{
				$date[$field] = 1;
			}
		}
		$date[2] = (int) $date[2];
		// assume an arbitrary leap year
		if (empty($date[2]))
		{
			$date[2] = 1980;
		}
	}

	if (sizeof($date) != 3 || !checkdate($date[1], $date[0], $date[2]))
	{
		return 'INVALID';
	}

	return false;
}


/**
* Validate Match
*
* @return	boolean|string	Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
function validate_match($string, $optional = false, $match = '')
{
	if (empty($string) && $optional)
	{
		return false;
	}

	if (empty($match))
	{
		return false;
	}

	if (!preg_match($match, $string))
	{
		return 'WRONG_DATA';
	}

	return false;
}

/**
* Validate Language Pack ISO Name
*
* Tests whether a language name is valid and installed
*
* @param string $lang_iso	The language string to test
*
* @return bool|string		Either false if validation succeeded or
*							a string which will be used as the error message
*							(with the variable name appended)
*/
function validate_language_iso_name($lang_iso)
{
	global $db;

	$sql = 'SELECT lang_id
		FROM ' . LANG_TABLE . "
		WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
	$result = $db->sql_query($sql);
	$lang_id = (int) $db->sql_fetchfield('lang_id');
	$db->sql_freeresult($result);

	return ($lang_id) ? false : 'WRONG_DATA';
}

/**
* Validate Timezone Name
*
* Tests whether a timezone name is valid
*
* @param string $timezone	The timezone string to test
*
* @return bool|string		Either false if validation succeeded or
*							a string which will be used as the error message
*							(with the variable name appended)
*/
function phpbb_validate_timezone($timezone)
{
	return (in_array($timezone, phpbb_get_timezone_identifiers($timezone))) ? false : 'TIMEZONE_INVALID';
}

/**
* Check to see if the username has been taken, or if it is disallowed.
* Also checks if it includes the " character, which we don't allow in usernames.
* Used for registering, changing names, and posting anonymously with a username
*
* @param string $username The username to check
* @param string $allowed_username An allowed username, default being $user->data['username']
*
* @return	mixed	Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
function validate_username($username, $allowed_username = false)
{
	global $config, $db, $user, $cache;

	$clean_username = utf8_clean_string($username);
	$allowed_username = ($allowed_username === false) ? $user->data['username_clean'] : utf8_clean_string($allowed_username);

	if ($allowed_username == $clean_username)
	{
		return false;
	}

	// ... fast checks first.
	if (strpos($username, '&quot;') !== false || strpos($username, '"') !== false || empty($clean_username))
	{
		return 'INVALID_CHARS';
	}

	switch ($config['allow_name_chars'])
	{
		case 'USERNAME_CHARS_ANY':
			$regex = '.+';
		break;

		case 'USERNAME_ALPHA_ONLY':
			$regex = '[A-Za-z0-9]+';
		break;

		case 'USERNAME_ALPHA_SPACERS':
			$regex = '[A-Za-z0-9-[\]_+ ]+';
		break;

		case 'USERNAME_LETTER_NUM':
			$regex = '[\p{Lu}\p{Ll}\p{N}]+';
		break;

		case 'USERNAME_LETTER_NUM_SPACERS':
			$regex = '[-\]_+ [\p{Lu}\p{Ll}\p{N}]+';
		break;

		case 'USERNAME_ASCII':
		default:
			$regex = '[\x01-\x7F]+';
		break;
	}

	if (!preg_match('#^' . $regex . '$#u', $username))
	{
		return 'INVALID_CHARS';
	}

	$sql = 'SELECT username
		FROM ' . USERS_TABLE . "
		WHERE username_clean = '" . $db->sql_escape($clean_username) . "'";
	$result = $db->sql_query($sql);
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if ($row)
	{
		return 'USERNAME_TAKEN';
	}

	$sql = 'SELECT group_name
		FROM ' . GROUPS_TABLE . "
		WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($username)) . "'";
	$result = $db->sql_query($sql);
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if ($row)
	{
		return 'USERNAME_TAKEN';
	}

	$bad_usernames = $cache->obtain_disallowed_usernames();

	foreach ($bad_usernames as $bad_username)
	{
		if (preg_match('#^' . $bad_username . '$#', $clean_username))
		{
			return 'USERNAME_DISALLOWED';
		}
	}

	return false;
}

/**
* Check to see if the password meets the complexity settings
*
* @return	boolean|string	Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
function validate_password($password)
{
	global $config;

	if ($password === '' || $config['pass_complex'] === 'PASS_TYPE_ANY')
	{
		// Password empty or no password complexity required.
		return false;
	}

	$upp = '\p{Lu}';
	$low = '\p{Ll}';
	$num = '\p{N}';
	$sym = '[^\p{Lu}\p{Ll}\p{N}]';
	$chars = array();

	switch ($config['pass_complex'])
	{
		// No break statements below ...
		// We require strong passwords in case pass_complex is not set or is invalid
		default:

		// Require mixed case letters, numbers and symbols
		case 'PASS_TYPE_SYMBOL':
			$chars[] = $sym;

		// Require mixed case letters and numbers
		case 'PASS_TYPE_ALPHA':
			$chars[] = $num;

		// Require mixed case letters
		case 'PASS_TYPE_CASE':
			$chars[] = $low;
			$chars[] = $upp;
	}

	foreach ($chars as $char)
	{
		if (!preg_match('#' . $char . '#u', $password))
		{
			return 'INVALID_CHARS';
		}
	}

	return false;
}

/**
* Check to see if email address is a valid address and contains a MX record
*
* @param string $email The email to check
*
* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
function phpbb_validate_email($email, $config = null)
{
	if ($config === null)
	{
		global $config;
	}

	$email = strtolower($email);

	if (!preg_match('/^' . get_preg_expression('email') . '$/i', $email))
	{
		return 'EMAIL_INVALID';
	}

	// Check MX record.
	// The idea for this is from reading the UseBB blog/announcement. :)
	if ($config['email_check_mx'])
	{
		list(, $domain) = explode('@', $email);

		if (phpbb_checkdnsrr($domain, 'A') === false && phpbb_checkdnsrr($domain, 'MX') === false)
		{
			return 'DOMAIN_NO_MX_RECORD';
		}
	}

	return false;
}

/**
* Check to see if email address is banned or already present in the DB
*
* @param string $email The email to check
* @param string $allowed_email An allowed email, default being $user->data['user_email']
*
* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
function validate_user_email($email, $allowed_email = false)
{
	global $config, $db, $user;

	$email = strtolower($email);
	$allowed_email = ($allowed_email === false) ? strtolower($user->data['user_email']) : strtolower($allowed_email);

	if ($allowed_email == $email)
	{
		return false;
	}

	$validate_email = phpbb_validate_email($email, $config);
	if ($validate_email)
	{
		return $validate_email;
	}

	if (($ban_reason = $user->check_ban(false, false, $email, true)) !== false)
	{
		return ($ban_reason === true) ? 'EMAIL_BANNED' : $ban_reason;
	}

	if (!$config['allow_emailreuse'])
	{
		$sql = 'SELECT user_email_hash
			FROM ' . USERS_TABLE . "
			WHERE user_email_hash = " . $db->sql_escape(phpbb_email_hash($email));
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if ($row)
		{
			return 'EMAIL_TAKEN';
		}
	}

	return false;
}

/**
* Validate jabber address
* Taken from the jabber class within flyspray (see author notes)
*
* @author flyspray.org
*/
function validate_jabber($jid)
{
	if (!$jid)
	{
		return false;
	}

	$separator_pos = strpos($jid, '@');

	if ($separator_pos === false)
	{
		return 'WRONG_DATA';
	}

	$username = substr($jid, 0, $separator_pos);
	$realm = substr($jid, $separator_pos + 1);

	if (strlen($username) == 0 || strlen($realm) < 3)
	{
		return 'WRONG_DATA';
	}

	$arr = explode('.', $realm);

	if (sizeof($arr) == 0)
	{
		return 'WRONG_DATA';
	}

	foreach ($arr as $part)
	{
		if (substr($part, 0, 1) == '-' || substr($part, -1, 1) == '-')
		{
			return 'WRONG_DATA';
		}

		if (!preg_match("@^[a-zA-Z0-9-.]+$@", $part))
		{
			return 'WRONG_DATA';
		}
	}

	$boundary = array(array(0, 127), array(192, 223), array(224, 239), array(240, 247), array(248, 251), array(252, 253));

	// Prohibited Characters RFC3454 + RFC3920
	$prohibited = array(
		// Table C.1.1
		array(0x0020, 0x0020),		// SPACE
		// Table C.1.2
		array(0x00A0, 0x00A0),		// NO-BREAK SPACE
		array(0x1680, 0x1680),		// OGHAM SPACE MARK
		array(0x2000, 0x2001),		// EN QUAD
		array(0x2001, 0x2001),		// EM QUAD
		array(0x2002, 0x2002),		// EN SPACE
		array(0x2003, 0x2003),		// EM SPACE
		array(0x2004, 0x2004),		// THREE-PER-EM SPACE
		array(0x2005, 0x2005),		// FOUR-PER-EM SPACE
		array(0x2006, 0x2006),		// SIX-PER-EM SPACE
		array(0x2007, 0x2007),		// FIGURE SPACE
		array(0x2008, 0x2008),		// PUNCTUATION SPACE
		array(0x2009, 0x2009),		// THIN SPACE
		array(0x200A, 0x200A),		// HAIR SPACE
		array(0x200B, 0x200B),		// ZERO WIDTH SPACE
		array(0x202F, 0x202F),		// NARROW NO-BREAK SPACE
		array(0x205F, 0x205F),		// MEDIUM MATHEMATICAL SPACE
		array(0x3000, 0x3000),		// IDEOGRAPHIC SPACE
		// Table C.2.1
		array(0x0000, 0x001F),		// [CONTROL CHARACTERS]
		array(0x007F, 0x007F),		// DELETE
		// Table C.2.2
		array(0x0080, 0x009F),		// [CONTROL CHARACTERS]
		array(0x06DD, 0x06DD),		// ARABIC END OF AYAH
		array(0x070F, 0x070F),		// SYRIAC ABBREVIATION MARK
		array(0x180E, 0x180E),		// MONGOLIAN VOWEL SEPARATOR
		array(0x200C, 0x200C), 		// ZERO WIDTH NON-JOINER
		array(0x200D, 0x200D),		// ZERO WIDTH JOINER
		array(0x2028, 0x2028),		// LINE SEPARATOR
		array(0x2029, 0x2029),		// PARAGRAPH SEPARATOR
		array(0x2060, 0x2060),		// WORD JOINER
		array(0x2061, 0x2061),		// FUNCTION APPLICATION
		array(0x2062, 0x2062),		// INVISIBLE TIMES
		array(0x2063, 0x2063),		// INVISIBLE SEPARATOR
		array(0x206A, 0x206F),		// [CONTROL CHARACTERS]
		array(0xFEFF, 0xFEFF),		// ZERO WIDTH NO-BREAK SPACE
		array(0xFFF9, 0xFFFC),		// [CONTROL CHARACTERS]
		array(0x1D173, 0x1D17A),	// [MUSICAL CONTROL CHARACTERS]
		// Table C.3
		array(0xE000, 0xF8FF),		// [PRIVATE USE, PLANE 0]
		array(0xF0000, 0xFFFFD),	// [PRIVATE USE, PLANE 15]
		array(0x100000, 0x10FFFD),	// [PRIVATE USE, PLANE 16]
		// Table C.4
		array(0xFDD0, 0xFDEF),		// [NONCHARACTER CODE POINTS]
		array(0xFFFE, 0xFFFF),		// [NONCHARACTER CODE POINTS]
		array(0x1FFFE, 0x1FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x2FFFE, 0x2FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x3FFFE, 0x3FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x4FFFE, 0x4FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x5FFFE, 0x5FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x6FFFE, 0x6FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x7FFFE, 0x7FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x8FFFE, 0x8FFFF),	// [NONCHARACTER CODE POINTS]
		array(0x9FFFE, 0x9FFFF),	// [NONCHARACTER CODE POINTS]
		array(0xAFFFE, 0xAFFFF),	// [NONCHARACTER CODE POINTS]
		array(0xBFFFE, 0xBFFFF),	// [NONCHARACTER CODE POINTS]
		array(0xCFFFE, 0xCFFFF),	// [NONCHARACTER CODE POINTS]
		array(0xDFFFE, 0xDFFFF),	// [NONCHARACTER CODE POINTS]
		array(0xEFFFE, 0xEFFFF),	// [NONCHARACTER CODE POINTS]
		array(0xFFFFE, 0xFFFFF),	// [NONCHARACTER CODE POINTS]
		array(0x10FFFE, 0x10FFFF),	// [NONCHARACTER CODE POINTS]
		// Table C.5
		array(0xD800, 0xDFFF),		// [SURROGATE CODES]
		// Table C.6
		array(0xFFF9, 0xFFF9),		// INTERLINEAR ANNOTATION ANCHOR
		array(0xFFFA, 0xFFFA),		// INTERLINEAR ANNOTATION SEPARATOR
		array(0xFFFB, 0xFFFB),		// INTERLINEAR ANNOTATION TERMINATOR
		array(0xFFFC, 0xFFFC),		// OBJECT REPLACEMENT CHARACTER
		array(0xFFFD, 0xFFFD),		// REPLACEMENT CHARACTER
		// Table C.7
		array(0x2FF0, 0x2FFB),		// [IDEOGRAPHIC DESCRIPTION CHARACTERS]
		// Table C.8
		array(0x0340, 0x0340),		// COMBINING GRAVE TONE MARK
		array(0x0341, 0x0341),		// COMBINING ACUTE TONE MARK
		array(0x200E, 0x200E),		// LEFT-TO-RIGHT MARK
		array(0x200F, 0x200F),		// RIGHT-TO-LEFT MARK
		array(0x202A, 0x202A),		// LEFT-TO-RIGHT EMBEDDING
		array(0x202B, 0x202B),		// RIGHT-TO-LEFT EMBEDDING
		array(0x202C, 0x202C),		// POP DIRECTIONAL FORMATTING
		array(0x202D, 0x202D),		// LEFT-TO-RIGHT OVERRIDE
		array(0x202E, 0x202E),		// RIGHT-TO-LEFT OVERRIDE
		array(0x206A, 0x206A),		// INHIBIT SYMMETRIC SWAPPING
		array(0x206B, 0x206B),		// ACTIVATE SYMMETRIC SWAPPING
		array(0x206C, 0x206C),		// INHIBIT ARABIC FORM SHAPING
		array(0x206D, 0x206D),		// ACTIVATE ARABIC FORM SHAPING
		array(0x206E, 0x206E),		// NATIONAL DIGIT SHAPES
		array(0x206F, 0x206F),		// NOMINAL DIGIT SHAPES
		// Table C.9
		array(0xE0001, 0xE0001),	// LANGUAGE TAG
		array(0xE0020, 0xE007F),	// [TAGGING CHARACTERS]
		// RFC3920
		array(0x22, 0x22),			// "
		array(0x26, 0x26),			// &
		array(0x27, 0x27),			// '
		array(0x2F, 0x2F),			// /
		array(0x3A, 0x3A),			// :
		array(0x3C, 0x3C),			// <
		array(0x3E, 0x3E),			// >
		array(0x40, 0x40)			// @
	);

	$pos = 0;
	$result = true;

	while ($pos < strlen($username))
	{
		$len = $uni = 0;
		for ($i = 0; $i <= 5; $i++)
		{
			if (ord($username[$pos]) >= $boundary[$i][0] && ord($username[$pos]) <= $boundary[$i][1])
			{
				$len = $i + 1;
				$uni = (ord($username[$pos]) - $boundary[$i][0]) * pow(2, $i * 6);

				for ($k = 1; $k < $len; $k++)
				{
					$uni += (ord($username[$pos + $k]) - 128) * pow(2, ($i - $k) * 6);
				}

				break;
			}
		}

		if ($len == 0)
		{
			return 'WRONG_DATA';
		}

		foreach ($prohibited as $pval)
		{
			if ($uni >= $pval[0] && $uni <= $pval[1])
			{
				$result = false;
				break 2;
			}
		}

		$pos = $pos + $len;
	}

	if (!$result)
	{
		return 'WRONG_DATA';
	}

	return false;
}

/**
* Validate hex colour value
*
* @param string $colour The hex colour value
* @param bool $optional Whether the colour value is optional. True if an empty
*			string will be accepted as correct input, false if not.
* @return bool|string Error message if colour value is incorrect, false if it
*			fits the hex colour code
*/
function phpbb_validate_hex_colour($colour, $optional = false)
{
	if ($colour === '')
	{
		return (($optional) ? false : 'WRONG_DATA');
	}

	if (!preg_match('/^([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/', $colour))
	{
		return 'WRONG_DATA';
	}

	return false;
}

/**
* Verifies whether a style ID corresponds to an active style.
*
* @param int $style_id The style_id of a style which should be checked if activated or not.
* @return boolean
*/
function phpbb_style_is_active($style_id)
{
	global $db;

	$sql = 'SELECT style_active
		FROM ' . STYLES_TABLE . '
		WHERE style_id = '. (int) $style_id;
	$result = $db->sql_query($sql);

	$style_is_active = (bool) $db->sql_fetchfield('style_active');
	$db->sql_freeresult($result);

	return $style_is_active;
}

/**
* Remove avatar
*/
function avatar_delete($mode, $row, $clean_db = false)
{
	global $phpbb_root_path, $config, $db, $user;

	// Check if the users avatar is actually *not* a group avatar
	if ($mode == 'user')
	{
		if (strpos($row['user_avatar'], 'g') === 0 || (((int) $row['user_avatar'] !== 0) && ((int) $row['user_avatar'] !== (int) $row['user_id'])))
		{
			return false;
		}
	}

	if ($clean_db)
	{
		avatar_remove_db($row[$mode . '_avatar']);
	}
	$filename = get_avatar_filename($row[$mode . '_avatar']);

	if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $filename))
	{
		@unlink($phpbb_root_path . $config['avatar_path'] . '/' . $filename);
		return true;
	}

	return false;
}

/**
* Generates avatar filename from the database entry
*/
function get_avatar_filename($avatar_entry)
{
	global $config;

	if ($avatar_entry[0] === 'g')
	{
		$avatar_group = true;
		$avatar_entry = substr($avatar_entry, 1);
	}
	else
	{
		$avatar_group = false;
	}
	$ext 			= substr(strrchr($avatar_entry, '.'), 1);
	$avatar_entry	= intval($avatar_entry);
	return $config['avatar_salt'] . '_' . (($avatar_group) ? 'g' : '') . $avatar_entry . '.' . $ext;
}

/**
* Returns an explanation string with maximum avatar settings
*
* @return string
*/
function phpbb_avatar_explanation_string()
{
	global $config, $user;

	return $user->lang('AVATAR_EXPLAIN',
		$user->lang('PIXELS', (int) $config['avatar_max_width']),
		$user->lang('PIXELS', (int) $config['avatar_max_height']),
		round($config['avatar_filesize'] / 1024));
}

//
// Usergroup functions
//

/**
* Add or edit a group. If we're editing a group we only update user
* parameters such as rank, etc. if they are changed
*/
function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
{
	global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container, $phpbb_log;

	/** @var \phpbb\group\helper $group_helper */
	$group_helper = $phpbb_container->get('group_helper');

	$error = array();

	// Attributes which also affect the users table
	$user_attribute_ary = array('group_colour', 'group_rank', 'group_avatar', 'group_avatar_type', 'group_avatar_width', 'group_avatar_height');

	// Check data. Limit group name length.
	if (!utf8_strlen($name) || utf8_strlen($name) > 60)
	{
		$error[] = (!utf8_strlen($name)) ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG'];
	}

	$err = group_validate_groupname($group_id, $name);
	if (!empty($err))
	{
		$error[] = $user->lang[$err];
	}

	if (!in_array($type, array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE)))
	{
		$error[] = $user->lang['GROUP_ERR_TYPE'];
	}

	$group_teampage = !empty($group_attributes['group_teampage']);
	unset($group_attributes['group_teampage']);

	if (!sizeof($error))
	{
		$current_legend = \phpbb\groupposition\legend::GROUP_DISABLED;
		$current_teampage = \phpbb\groupposition\teampage::GROUP_DISABLED;

		/* @var $legend \phpbb\groupposition\legend */
		$legend = $phpbb_container->get('groupposition.legend');

		/* @var $teampage \phpbb\groupposition\teampage */
		$teampage = $phpbb_container->get('groupposition.teampage');

		if ($group_id)
		{
			try
			{
				$current_legend = $legend->get_group_value($group_id);
				$current_teampage = $teampage->get_group_value($group_id);
			}
			catch (\phpbb\groupposition\exception $exception)
			{
				trigger_error($user->lang($exception->getMessage()));
			}
		}

		if (!empty($group_attributes['group_legend']))
		{
			if (($group_id && ($current_legend == \phpbb\groupposition\legend::GROUP_DISABLED)) || !$group_id)
			{
				// Old group currently not in the legend or new group, add at the end.
				$group_attributes['group_legend'] = 1 + $legend->get_group_count();
			}
			else
			{
				// Group stayes in the legend
				$group_attributes['group_legend'] = $current_legend;
			}
		}
		else if ($group_id && ($current_legend != \phpbb\groupposition\legend::GROUP_DISABLED))
		{
			// Group is removed from the legend
			try
			{
				$legend->delete_group($group_id, true);
			}
			catch (\phpbb\groupposition\exception $exception)
			{
				trigger_error($user->lang($exception->getMessage()));
			}
			$group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED;
		}
		else
		{
			$group_attributes['group_legend'] = \phpbb\groupposition\legend::GROUP_DISABLED;
		}

		// Unset the objects, we don't need them anymore.
		unset($legend);

		$user_ary = array();
		$sql_ary = array(
			'group_name'			=> (string) $name,
			'group_desc'			=> (string) $desc,
			'group_desc_uid'		=> '',
			'group_desc_bitfield'	=> '',
			'group_type'			=> (int) $type,
		);

		// Parse description
		if ($desc)
		{
			generate_text_for_storage($sql_ary['group_desc'], $sql_ary['group_desc_uid'], $sql_ary['group_desc_bitfield'], $sql_ary['group_desc_options'], $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies);
		}

		if (sizeof($group_attributes))
		{
			// Merge them with $sql_ary to properly update the group
			$sql_ary = array_merge($sql_ary, $group_attributes);
		}

		// Setting the log message before we set the group id (if group gets added)
		$log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED';

		$query = '';

		if ($group_id)
		{
			$sql = 'SELECT user_id
				FROM ' . USERS_TABLE . '
				WHERE group_id = ' . $group_id;
			$result = $db->sql_query($sql);

			while ($row = $db->sql_fetchrow($result))
			{
				$user_ary[] = $row['user_id'];
			}
			$db->sql_freeresult($result);

			if (isset($sql_ary['group_avatar']))
			{
				remove_default_avatar($group_id, $user_ary);
			}

			if (isset($sql_ary['group_rank']))
			{
				remove_default_rank($group_id, $user_ary);
			}

			$sql = 'UPDATE ' . GROUPS_TABLE . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
				WHERE group_id = $group_id";
			$db->sql_query($sql);

			// Since we may update the name too, we need to do this on other tables too...
			$sql = 'UPDATE ' . MODERATOR_CACHE_TABLE . "
				SET group_name = '" . $db->sql_escape($sql_ary['group_name']) . "'
				WHERE group_id = $group_id";
			$db->sql_query($sql);

			// One special case is the group skip auth setting. If this was changed we need to purge permissions for this group
			if (isset($group_attributes['group_skip_auth']))
			{
				// Get users within this group...
				$sql = 'SELECT user_id
					FROM ' . USER_GROUP_TABLE . '
					WHERE group_id = ' . $group_id . '
						AND user_pending = 0';
				$result = $db->sql_query($sql);

				$user_id_ary = array();
				while ($row = $db->sql_fetchrow($result))
				{
					$user_id_ary[] = $row['user_id'];
				}
				$db->sql_freeresult($result);

				if (!empty($user_id_ary))
				{
					global $auth;

					// Clear permissions cache of relevant users
					$auth->acl_clear_prefetch($user_id_ary);
				}
			}
		}
		else
		{
			$sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
			$db->sql_query($sql);
		}

		// Remove the group from the teampage, only if unselected and we are editing a group,
		// which is currently displayed.
		if (!$group_teampage && $group_id && $current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED)
		{
			try
			{
				$teampage->delete_group($group_id);
			}
			catch (\phpbb\groupposition\exception $exception)
			{
				trigger_error($user->lang($exception->getMessage()));
			}
		}

		if (!$group_id)
		{
			$group_id = $db->sql_nextid();

			if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == 'avatar.driver.upload')
			{
				group_correct_avatar($group_id, $sql_ary['group_avatar']);
			}
		}

		try
		{
			if ($group_teampage && $current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED)
			{
				$teampage->add_group($group_id);
			}

			if ($group_teampage)
			{
				if ($current_teampage == \phpbb\groupposition\teampage::GROUP_DISABLED)
				{
					$teampage->add_group($group_id);
				}
			}
			else if ($group_id && ($current_teampage != \phpbb\groupposition\teampage::GROUP_DISABLED))
			{
				$teampage->delete_group($group_id);
			}
		}
		catch (\phpbb\groupposition\exception $exception)
		{
			trigger_error($user->lang($exception->getMessage()));
		}
		unset($teampage);

		// Set user attributes
		$sql_ary = array();
		if (sizeof($group_attributes))
		{
			// Go through the user attributes array, check if a group attribute matches it and then set it. ;)
			foreach ($user_attribute_ary as $attribute)
			{
				if (!isset($group_attributes[$attribute]))
				{
					continue;
				}

				// If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set...
				if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute])
				{
					continue;
				}

				$sql_ary[$attribute] = $group_attributes[$attribute];
			}
		}

		if (sizeof($sql_ary) && sizeof($user_ary))
		{
			group_set_user_default($group_id, $user_ary, $sql_ary);
		}

		$name = $group_helper->get_name($name);
		$phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($name));

		group_update_listings($group_id);
	}

	return (sizeof($error)) ? $error : false;
}


/**
* Changes a group avatar's filename to conform to the naming scheme
*/
function group_correct_avatar($group_id, $old_entry)
{
	global $config, $db, $phpbb_root_path;

	$group_id		= (int) $group_id;
	$ext 			= substr(strrchr($old_entry, '.'), 1);
	$old_filename 	= get_avatar_filename($old_entry);
	$new_filename 	= $config['avatar_salt'] . "_g$group_id.$ext";
	$new_entry 		= 'g' . $group_id . '_' . substr(time(), -5) . ".$ext";

	$avatar_path = $phpbb_root_path . $config['avatar_path'];
	if (@rename($avatar_path . '/'. $old_filename, $avatar_path . '/' . $new_filename))
	{
		$sql = 'UPDATE ' . GROUPS_TABLE . '
			SET group_avatar = \'' . $db->sql_escape($new_entry) . "'
			WHERE group_id = $group_id";
		$db->sql_query($sql);
	}
}


/**
* Remove avatar also for users not having the group as default
*/
function avatar_remove_db($avatar_name)
{
	global $config, $db;

	$sql = 'UPDATE ' . USERS_TABLE . "
		SET user_avatar = '',
		user_avatar_type = ''
		WHERE user_avatar = '" . $db->sql_escape($avatar_name) . '\'';
	$db->sql_query($sql);
}


/**
* Group Delete
*/
function group_delete($group_id, $group_name = false)
{
	global $db, $cache, $auth, $user, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_container, $phpbb_log;

	if (!$group_name)
	{
		$group_name = get_group_name($group_id);
	}

	$start = 0;

	do
	{
		$user_id_ary = $username_ary = array();

		// Batch query for group members, call group_user_del
		$sql = 'SELECT u.user_id, u.username
			FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u
			WHERE ug.group_id = $group_id
				AND u.user_id = ug.user_id";
		$result = $db->sql_query_limit($sql, 200, $start);

		if ($row = $db->sql_fetchrow($result))
		{
			do
			{
				$user_id_ary[] = $row['user_id'];
				$username_ary[] = $row['username'];

				$start++;
			}
			while ($row = $db->sql_fetchrow($result));

			group_user_del($group_id, $user_id_ary, $username_ary, $group_name);
		}
		else
		{
			$start = 0;
		}
		$db->sql_freeresult($result);
	}
	while ($start);

	// Delete group from legend and teampage
	try
	{
		/* @var $legend \phpbb\groupposition\legend */
		$legend = $phpbb_container->get('groupposition.legend');
		$legend->delete_group($group_id);
		unset($legend);
	}
	catch (\phpbb\groupposition\exception $exception)
	{
		// The group we want to delete does not exist.
		// No reason to worry, we just continue the deleting process.
		//trigger_error($user->lang($exception->getMessage()));
	}

	try
	{
		/* @var $teampage \phpbb\groupposition\teampage */
		$teampage = $phpbb_container->get('groupposition.teampage');
		$teampage->delete_group($group_id);
		unset($teampage);
	}
	catch (\phpbb\groupposition\exception $exception)
	{
		// The group we want to delete does not exist.
		// No reason to worry, we just continue the deleting process.
		//trigger_error($user->lang($exception->getMessage()));
	}

	// Delete group
	$sql = 'DELETE FROM ' . GROUPS_TABLE . "
		WHERE group_id = $group_id";
	$db->sql_query($sql);

	// Delete auth entries from the groups table
	$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . "
		WHERE group_id = $group_id";
	$db->sql_query($sql);

	/**
	* Event after a group is deleted
	*
	* @event core.delete_group_after
	* @var	int		group_id	ID of the deleted group
	* @var	string	group_name	Name of the deleted group
	* @since 3.1.0-a1
	*/
	$vars = array('group_id', 'group_name');
	extract($phpbb_dispatcher->trigger_event('core.delete_group_after', compact($vars)));

	// Re-cache moderators
	if (!function_exists('phpbb_cache_moderators'))
	{
		include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
	}

	phpbb_cache_moderators($db, $cache, $auth);

	$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_GROUP_DELETE', false, array($group_name));

	// Return false - no error
	return false;
}

/**
* Add user(s) to group
*
* @return mixed false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'
*/
function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false)
{
	global $db, $auth, $user, $phpbb_container, $phpbb_log;

	// We need both username and user_id info
	$result = user_get_id_name($user_id_ary, $username_ary);

	if (!sizeof($user_id_ary) || $result !== false)
	{
		return 'NO_USER';
	}

	// Remove users who are already members of this group
	$sql = 'SELECT user_id, group_leader
		FROM ' . USER_GROUP_TABLE . '
		WHERE ' . $db->sql_in_set('user_id', $user_id_ary) . "
			AND group_id = $group_id";
	$result = $db->sql_query($sql);

	$add_id_ary = $update_id_ary = array();
	while ($row = $db->sql_fetchrow($result))
	{
		$add_id_ary[] = (int) $row['user_id'];

		if ($leader && !$row['group_leader'])
		{
			$update_id_ary[] = (int) $row['user_id'];
		}
	}
	$db->sql_freeresult($result);

	// Do all the users exist in this group?
	$add_id_ary = array_diff($user_id_ary, $add_id_ary);

	// If we have no users
	if (!sizeof($add_id_ary) && !sizeof($update_id_ary))
	{
		return 'GROUP_USERS_EXIST';
	}

	$db->sql_transaction('begin');

	// Insert the new users
	if (sizeof($add_id_ary))
	{
		$sql_ary = array();

		foreach ($add_id_ary as $user_id)
		{
			$sql_ary[] = array(
				'user_id'		=> (int) $user_id,
				'group_id'		=> (int) $group_id,
				'group_leader'	=> (int) $leader,
				'user_pending'	=> (int) $pending,
			);
		}

		$db->sql_multi_insert(USER_GROUP_TABLE, $sql_ary);
	}

	if (sizeof($update_id_ary))
	{
		$sql = 'UPDATE ' . USER_GROUP_TABLE . '
			SET group_leader = 1
			WHERE ' . $db->sql_in_set('user_id', $update_id_ary) . "
				AND group_id = $group_id";
		$db->sql_query($sql);
	}

	if ($default)
	{
		group_user_attributes('default', $group_id, $user_id_ary, false, $group_name, $group_attributes);
	}

	$db->sql_transaction('commit');

	// Clear permissions cache of relevant users
	$auth->acl_clear_prefetch($user_id_ary);

	if (!$group_name)
	{
		$group_name = get_group_name($group_id);
	}

	$log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED');

	$phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($group_name, implode(', ', $username_ary)));

	group_update_listings($group_id);

	if ($pending)
	{
		/* @var $phpbb_notifications \phpbb\notification\manager */
		$phpbb_notifications = $phpbb_container->get('notification_manager');

		foreach ($add_id_ary as $user_id)
		{
			$phpbb_notifications->add_notifications('notification.type.group_request', array(
				'group_id'		=> $group_id,
				'user_id'		=> $user_id,
				'group_name'	=> $group_name,
			));
		}
	}

	// Return false - no error
	return false;
}

/**
* Remove a user/s from a given group. When we remove users we update their
* default group_id. We do this by examining which "special" groups they belong
* to. The selection is made based on a reasonable priority system
*
* @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'
*/
function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
{
	global $db, $auth, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_log;

	if ($config['coppa_enable'])
	{
		$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
	}
	else
	{
		$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED', 'BOTS', 'GUESTS');
	}

	// We need both username and user_id info
	$result = user_get_id_name($user_id_ary, $username_ary);

	if (!sizeof($user_id_ary) || $result !== false)
	{
		return 'NO_USER';
	}

	$sql = 'SELECT *
		FROM ' . GROUPS_TABLE . '
		WHERE ' . $db->sql_in_set('group_name', $group_order);
	$result = $db->sql_query($sql);

	$group_order_id = $special_group_data = array();
	while ($row = $db->sql_fetchrow($result))
	{
		$group_order_id[$row['group_name']] = $row['group_id'];

		$special_group_data[$row['group_id']] = array(
			'group_colour'			=> $row['group_colour'],
			'group_rank'				=> $row['group_rank'],
		);

		// Only set the group avatar if one is defined...
		if ($row['group_avatar'])
		{
			$special_group_data[$row['group_id']] = array_merge($special_group_data[$row['group_id']], array(
				'group_avatar'			=> $row['group_avatar'],
				'group_avatar_type'		=> $row['group_avatar_type'],
				'group_avatar_width'		=> $row['group_avatar_width'],
				'group_avatar_height'	=> $row['group_avatar_height'])
			);
		}
	}
	$db->sql_freeresult($result);

	// Get users default groups - we only need to reset default group membership if the group from which the user gets removed is set as default
	$sql = 'SELECT user_id, group_id
		FROM ' . USERS_TABLE . '
		WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
	$result = $db->sql_query($sql);

	$default_groups = array();
	while ($row = $db->sql_fetchrow($result))
	{
		$default_groups[$row['user_id']] = $row['group_id'];
	}
	$db->sql_freeresult($result);

	// What special group memberships exist for these users?
	$sql = 'SELECT g.group_id, g.group_name, ug.user_id
		FROM ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g
		WHERE ' . $db->sql_in_set('ug.user_id', $user_id_ary) . "
			AND g.group_id = ug.group_id
			AND g.group_id <> $group_id
			AND g.group_type = " . GROUP_SPECIAL . '
		ORDER BY ug.user_id, g.group_id';
	$result = $db->sql_query($sql);

	$temp_ary = array();
	while ($row = $db->sql_fetchrow($result))
	{
		if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || $group_order_id[$row['group_name']] < $temp_ary[$row['user_id']]))
		{
			$temp_ary[$row['user_id']] = $row['group_id'];
		}
	}
	$db->sql_freeresult($result);

	// sql_where_ary holds the new default groups and their users
	$sql_where_ary = array();
	foreach ($temp_ary as $uid => $gid)
	{
		$sql_where_ary[$gid][] = $uid;
	}
	unset($temp_ary);

	foreach ($special_group_data as $gid => $default_data_ary)
	{
		if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid]))
		{
			remove_default_rank($group_id, $sql_where_ary[$gid]);
			remove_default_avatar($group_id, $sql_where_ary[$gid]);
			group_set_user_default($gid, $sql_where_ary[$gid], $default_data_ary);
		}
	}
	unset($special_group_data);

	/**
	* Event before users are removed from a group
	*
	* @event core.group_delete_user_before
	* @var	int		group_id		ID of the group from which users are deleted
	* @var	string	group_name		Name of the group
	* @var	array	user_id_ary		IDs of the users which are removed
	* @var	array	username_ary	names of the users which are removed
	* @since 3.1.0-a1
	*/
	$vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary');
	extract($phpbb_dispatcher->trigger_event('core.group_delete_user_before', compact($vars)));

	$sql = 'DELETE FROM ' . USER_GROUP_TABLE . "
		WHERE group_id = $group_id
			AND " . $db->sql_in_set('user_id', $user_id_ary);
	$db->sql_query($sql);

	// Clear permissions cache of relevant users
	$auth->acl_clear_prefetch($user_id_ary);

	/**
	* Event after users are removed from a group
	*
	* @event core.group_delete_user_after
	* @var	int		group_id		ID of the group from which users are deleted
	* @var	string	group_name		Name of the group
	* @var	array	user_id_ary		IDs of the users which are removed
	* @var	array	username_ary	names of the users which are removed
	* @since 3.1.7-RC1
	*/
	$vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary');
	extract($phpbb_dispatcher->trigger_event('core.group_delete_user_after', compact($vars)));

	if (!$group_name)
	{
		$group_name = get_group_name($group_id);
	}

	$log = 'LOG_GROUP_REMOVE';

	if ($group_name)
	{
		$phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($group_name, implode(', ', $username_ary)));
	}

	group_update_listings($group_id);

	/* @var $phpbb_notifications \phpbb\notification\manager */
	$phpbb_notifications = $phpbb_container->get('notification_manager');

	$phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);

	// Return false - no error
	return false;
}


/**
* Removes the group avatar of the default group from the users in user_ids who have that group as default.
*/
function remove_default_avatar($group_id, $user_ids)
{
	global $db;

	if (!is_array($user_ids))
	{
		$user_ids = array($user_ids);
	}
	if (empty($user_ids))
	{
		return false;
	}

	$user_ids = array_map('intval', $user_ids);

	$sql = 'SELECT *
		FROM ' . GROUPS_TABLE . '
		WHERE group_id = ' . (int) $group_id;
	$result = $db->sql_query($sql);
	if (!$row = $db->sql_fetchrow($result))
	{
		$db->sql_freeresult($result);
		return false;
	}
	$db->sql_freeresult($result);

	$sql = 'UPDATE ' . USERS_TABLE . "
		SET user_avatar = '',
			user_avatar_type = '',
			user_avatar_width = 0,
			user_avatar_height = 0
		WHERE group_id = " . (int) $group_id . "
			AND user_avatar = '" . $db->sql_escape($row['group_avatar']) . "'
			AND " . $db->sql_in_set('user_id', $user_ids);

	$db->sql_query($sql);
}

/**
* Removes the group rank of the default group from the users in user_ids who have that group as default.
*/
function remove_default_rank($group_id, $user_ids)
{
	global $db;

	if (!is_array($user_ids))
	{
		$user_ids = array($user_ids);
	}
	if (empty($user_ids))
	{
		return false;
	}

	$user_ids = array_map('intval', $user_ids);

	$sql = 'SELECT *
		FROM ' . GROUPS_TABLE . '
		WHERE group_id = ' . (int) $group_id;
	$result = $db->sql_query($sql);
	if (!$row = $db->sql_fetchrow($result))
	{
		$db->sql_freeresult($result);
		return false;
	}
	$db->sql_freeresult($result);

	$sql = 'UPDATE ' . USERS_TABLE . '
		SET user_rank = 0
		WHERE group_id = ' . (int) $group_id . '
			AND user_rank <> 0
			AND user_rank = ' . (int) $row['group_rank'] . '
			AND ' . $db->sql_in_set('user_id', $user_ids);
	$db->sql_query($sql);
}

/**
* This is used to promote (to leader), demote or set as default a member/s
*/
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
{
	global $db, $auth, $user, $phpbb_root_path, $phpEx, $config, $phpbb_container, $phpbb_log;

	// We need both username and user_id info
	$result = user_get_id_name($user_id_ary, $username_ary);

	if (!sizeof($user_id_ary) || $result !== false)
	{
		return 'NO_USERS';
	}

	if (!$group_name)
	{
		$group_name = get_group_name($group_id);
	}

	switch ($action)
	{
		case 'demote':
		case 'promote':

			$sql = 'SELECT user_id
				FROM ' . USER_GROUP_TABLE . "
				WHERE group_id = $group_id
					AND user_pending = 1
					AND " . $db->sql_in_set('user_id', $user_id_ary);
			$result = $db->sql_query_limit($sql, 1);
			$not_empty = ($db->sql_fetchrow($result));
			$db->sql_freeresult($result);
			if ($not_empty)
			{
				return 'NO_VALID_USERS';
			}

			$sql = 'UPDATE ' . USER_GROUP_TABLE . '
				SET group_leader = ' . (($action == 'promote') ? 1 : 0) . "
				WHERE group_id = $group_id
					AND user_pending = 0
					AND " . $db->sql_in_set('user_id', $user_id_ary);
			$db->sql_query($sql);

			$log = ($action == 'promote') ? 'LOG_GROUP_PROMOTED' : 'LOG_GROUP_DEMOTED';
		break;

		case 'approve':
			// Make sure we only approve those which are pending ;)
			$sql = 'SELECT u.user_id, u.user_email, u.username, u.username_clean, u.user_notify_type, u.user_jabber, u.user_lang
				FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
				WHERE ug.group_id = ' . $group_id . '
					AND ug.user_pending = 1
					AND ug.user_id = u.user_id
					AND ' . $db->sql_in_set('ug.user_id', $user_id_ary);
			$result = $db->sql_query($sql);

			$user_id_ary = array();
			while ($row = $db->sql_fetchrow($result))
			{
				$user_id_ary[] = $row['user_id'];
			}
			$db->sql_freeresult($result);

			if (!sizeof($user_id_ary))
			{
				return false;
			}

			$sql = 'UPDATE ' . USER_GROUP_TABLE . "
				SET user_pending = 0
				WHERE group_id = $group_id
					AND " . $db->sql_in_set('user_id', $user_id_ary);
			$db->sql_query($sql);

			/* @var $phpbb_notifications \phpbb\notification\manager */
			$phpbb_notifications = $phpbb_container->get('notification_manager');

			$phpbb_notifications->add_notifications('notification.type.group_request_approved', array(
				'user_ids'		=> $user_id_ary,
				'group_id'		=> $group_id,
				'group_name'	=> $group_name,
			));
			$phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);

			$log = 'LOG_USERS_APPROVED';
		break;

		case 'default':
			// We only set default group for approved members of the group
			$sql = 'SELECT user_id
				FROM ' . USER_GROUP_TABLE . "
				WHERE group_id = $group_id
					AND user_pending = 0
					AND " . $db->sql_in_set('user_id', $user_id_ary);
			$result = $db->sql_query($sql);

			$user_id_ary = $username_ary = array();
			while ($row = $db->sql_fetchrow($result))
			{
				$user_id_ary[] = $row['user_id'];
			}
			$db->sql_freeresult($result);

			$result = user_get_id_name($user_id_ary, $username_ary);
			if (!sizeof($user_id_ary) || $result !== false)
			{
				return 'NO_USERS';
			}

			$sql = 'SELECT user_id, group_id
				FROM ' . USERS_TABLE . '
				WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true);
			$result = $db->sql_query($sql);

			$groups = array();
			while ($row = $db->sql_fetchrow($result))
			{
				if (!isset($groups[$row['group_id']]))
				{
					$groups[$row['group_id']] = array();
				}
				$groups[$row['group_id']][] = $row['user_id'];
			}
			$db->sql_freeresult($result);

			foreach ($groups as $gid => $uids)
			{
				remove_default_rank($gid, $uids);
				remove_default_avatar($gid, $uids);
			}
			group_set_user_default($group_id, $user_id_ary, $group_attributes);
			$log = 'LOG_GROUP_DEFAULTS';
		break;
	}

	// Clear permissions cache of relevant users
	$auth->acl_clear_prefetch($user_id_ary);

	$phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($group_name, implode(', ', $username_ary)));

	group_update_listings($group_id);

	return false;
}

/**
* A small version of validate_username to check for a group name's existence. To be called directly.
*/
function group_validate_groupname($group_id, $group_name)
{
	global $config, $db;

	$group_name =  utf8_clean_string($group_name);

	if (!empty($group_id))
	{
		$sql = 'SELECT group_name
			FROM ' . GROUPS_TABLE . '
			WHERE group_id = ' . (int) $group_id;
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (!$row)
		{
			return false;
		}

		$allowed_groupname = utf8_clean_string($row['group_name']);

		if ($allowed_groupname == $group_name)
		{
			return false;
		}
	}

	$sql = 'SELECT group_name
		FROM ' . GROUPS_TABLE . "
		WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($group_name)) . "'";
	$result = $db->sql_query($sql);
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if ($row)
	{
		return 'GROUP_NAME_TAKEN';
	}

	return false;
}

/**
* Set users default group
*
* @access private
*/
function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
{
	global $config, $phpbb_container, $db, $phpbb_dispatcher;

	if (empty($user_id_ary))
	{
		return;
	}

	$attribute_ary = array(
		'group_colour'			=> 'string',
		'group_rank'			=> 'int',
		'group_avatar'			=> 'string',
		'group_avatar_type'		=> 'string',
		'group_avatar_width'	=> 'int',
		'group_avatar_height'	=> 'int',
	);

	$sql_ary = array(
		'group_id'		=> $group_id
	);

	// Were group attributes passed to the function? If not we need to obtain them
	if ($group_attributes === false)
	{
		$sql = 'SELECT ' . implode(', ', array_keys($attribute_ary)) . '
			FROM ' . GROUPS_TABLE . "
			WHERE group_id = $group_id";
		$result = $db->sql_query($sql);
		$group_attributes = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);
	}

	foreach ($attribute_ary as $attribute => $type)
	{
		if (isset($group_attributes[$attribute]))
		{
			// If we are about to set an avatar or rank, we will not overwrite with empty, unless we are not actually changing the default group
			if ((strpos($attribute, 'group_avatar') === 0 || strpos($attribute, 'group_rank') === 0) && !$group_attributes[$attribute])
			{
				continue;
			}

			settype($group_attributes[$attribute], $type);
			$sql_ary[str_replace('group_', 'user_', $attribute)] = $group_attributes[$attribute];
		}
	}

	$updated_sql_ary = $sql_ary;

	// Before we update the user attributes, we will update the rank for users that don't have a custom rank
	if (isset($sql_ary['user_rank']))
	{
		$sql = 'UPDATE ' . USERS_TABLE . '
			SET ' . $db->sql_build_array('UPDATE', array('user_rank' => $sql_ary['user_rank'])) . '
			WHERE user_rank = 0
				AND ' . $db->sql_in_set('user_id', $user_id_ary);
		$db->sql_query($sql);
		unset($sql_ary['user_rank']);
	}

	// Before we update the user attributes, we will update the avatar for users that don't have a custom avatar
	$avatar_options = array('user_avatar', 'user_avatar_type', 'user_avatar_height', 'user_avatar_width');

	if (isset($sql_ary['user_avatar']))
	{
		$avatar_sql_ary = array();
		foreach ($avatar_options as $avatar_option)
		{
			if (isset($sql_ary[$avatar_option]))
			{
				$avatar_sql_ary[$avatar_option] = $sql_ary[$avatar_option];
			}
		}

		$sql = 'UPDATE ' . USERS_TABLE . '
			SET ' . $db->sql_build_array('UPDATE', $avatar_sql_ary) . "
			WHERE user_avatar = ''
				AND " . $db->sql_in_set('user_id', $user_id_ary);
		$db->sql_query($sql);
	}

	// Remove the avatar options, as we already updated them
	foreach ($avatar_options as $avatar_option)
	{
		unset($sql_ary[$avatar_option]);
	}

	if (!empty($sql_ary))
	{
		$sql = 'UPDATE ' . USERS_TABLE . '
			SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
			WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
		$db->sql_query($sql);
	}

	if (isset($sql_ary['user_colour']))
	{
		// Update any cached colour information for these users
		$sql = 'UPDATE ' . FORUMS_TABLE . "
			SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
			WHERE " . $db->sql_in_set('forum_last_poster_id', $user_id_ary);
		$db->sql_query($sql);

		$sql = 'UPDATE ' . TOPICS_TABLE . "
			SET topic_first_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
			WHERE " . $db->sql_in_set('topic_poster', $user_id_ary);
		$db->sql_query($sql);

		$sql = 'UPDATE ' . TOPICS_TABLE . "
			SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "'
			WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary);
		$db->sql_query($sql);

		if (in_array($config['newest_user_id'], $user_id_ary))
		{
			$config->set('newest_user_colour', $sql_ary['user_colour'], false);
		}
	}

	// Make all values available for the event
	$sql_ary = $updated_sql_ary;

	/**
	* Event when the default group is set for an array of users
	*
	* @event core.user_set_default_group
	* @var	int		group_id			ID of the group
	* @var	array	user_id_ary			IDs of the users
	* @var	array	group_attributes	Group attributes which were changed
	* @var	array	update_listing		Update the list of moderators and foes
	* @var	array	sql_ary				User attributes which were changed
	* @since 3.1.0-a1
	*/
	$vars = array('group_id', 'user_id_ary', 'group_attributes', 'update_listing', 'sql_ary');
	extract($phpbb_dispatcher->trigger_event('core.user_set_default_group', compact($vars)));

	if ($update_listing)
	{
		group_update_listings($group_id);
	}

	// Because some tables/caches use usercolour-specific data we need to purge this here.
	$phpbb_container->get('cache.driver')->destroy('sql', MODERATOR_CACHE_TABLE);
}

/**
* Get group name
*/
function get_group_name($group_id)
{
	global $db, $user, $phpbb_container;

	$sql = 'SELECT group_name, group_type
		FROM ' . GROUPS_TABLE . '
		WHERE group_id = ' . (int) $group_id;
	$result = $db->sql_query($sql);
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if (!$row)
	{
		return '';
	}

	/** @var \phpbb\group\helper $group_helper */
	$group_helper = $phpbb_container->get('group_helper');

	return $group_helper->get_name($row['group_name']);
}

/**
* Obtain either the members of a specified group, the groups the specified user is subscribed to
* or checking if a specified user is in a specified group. This function does not return pending memberships.
*
* Note: Never use this more than once... first group your users/groups
*/
function group_memberships($group_id_ary = false, $user_id_ary = false, $return_bool = false)
{
	global $db;

	if (!$group_id_ary && !$user_id_ary)
	{
		return true;
	}

	if ($user_id_ary)
	{
		$user_id_ary = (!is_array($user_id_ary)) ? array($user_id_ary) : $user_id_ary;
	}

	if ($group_id_ary)
	{
		$group_id_ary = (!is_array($group_id_ary)) ? array($group_id_ary) : $group_id_ary;
	}

	$sql = 'SELECT ug.*, u.username, u.username_clean, u.user_email
		FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u
		WHERE ug.user_id = u.user_id
			AND ug.user_pending = 0 AND ';

	if ($group_id_ary)
	{
		$sql .= ' ' . $db->sql_in_set('ug.group_id', $group_id_ary);
	}

	if ($user_id_ary)
	{
		$sql .= ($group_id_ary) ? ' AND ' : ' ';
		$sql .= $db->sql_in_set('ug.user_id', $user_id_ary);
	}

	$result = ($return_bool) ? $db->sql_query_limit($sql, 1) : $db->sql_query($sql);

	$row = $db->sql_fetchrow($result);

	if ($return_bool)
	{
		$db->sql_freeresult($result);
		return ($row) ? true : false;
	}

	if (!$row)
	{
		return false;
	}

	$return = array();

	do
	{
		$return[] = $row;
	}
	while ($row = $db->sql_fetchrow($result));

	$db->sql_freeresult($result);

	return $return;
}

/**
* Re-cache moderators and foes if group has a_ or m_ permissions
*/
function group_update_listings($group_id)
{
	global $db, $cache, $auth;

	$hold_ary = $auth->acl_group_raw_data($group_id, array('a_', 'm_'));

	if (!sizeof($hold_ary))
	{
		return;
	}

	$mod_permissions = $admin_permissions = false;

	foreach ($hold_ary as $g_id => $forum_ary)
	{
		foreach ($forum_ary as $forum_id => $auth_ary)
		{
			foreach ($auth_ary as $auth_option => $setting)
			{
				if ($mod_permissions && $admin_permissions)
				{
					break 3;
				}

				if ($setting != ACL_YES)
				{
					continue;
				}

				if ($auth_option == 'm_')
				{
					$mod_permissions = true;
				}

				if ($auth_option == 'a_')
				{
					$admin_permissions = true;
				}
			}
		}
	}

	if ($mod_permissions)
	{
		if (!function_exists('phpbb_cache_moderators'))
		{
			global $phpbb_root_path, $phpEx;
			include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
		}
		phpbb_cache_moderators($db, $cache, $auth);
	}

	if ($mod_permissions || $admin_permissions)
	{
		if (!function_exists('phpbb_update_foes'))
		{
			global $phpbb_root_path, $phpEx;
			include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
		}
		phpbb_update_foes($db, $auth, array($group_id));
	}
}



/**
* Funtion to make a user leave the NEWLY_REGISTERED system group.
* @access public
* @param $user_id The id of the user to remove from the group
*/
function remove_newly_registered($user_id, $user_data = false)
{
	global $db;

	if ($user_data === false)
	{
		$sql = 'SELECT *
			FROM ' . USERS_TABLE . '
			WHERE user_id = ' . $user_id;
		$result = $db->sql_query($sql);
		$user_row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (!$user_row)
		{
			return false;
		}
		else
		{
			$user_data  = $user_row;
		}
	}

	if (empty($user_data['user_new']))
	{
		return false;
	}

	$sql = 'SELECT group_id
		FROM ' . GROUPS_TABLE . "
		WHERE group_name = 'NEWLY_REGISTERED'
			AND group_type = " . GROUP_SPECIAL;
	$result = $db->sql_query($sql);
	$group_id = (int) $db->sql_fetchfield('group_id');
	$db->sql_freeresult($result);

	if (!$group_id)
	{
		return false;
	}

	// We need to call group_user_del here, because this function makes sure everything is correctly changed.
	// A downside for a call within the session handler is that the language is not set up yet - so no log entry
	group_user_del($group_id, $user_id);

	// Set user_new to 0 to let this not be triggered again
	$sql = 'UPDATE ' . USERS_TABLE . '
		SET user_new = 0
		WHERE user_id = ' . $user_id;
	$db->sql_query($sql);

	// The new users group was the users default group?
	if ($user_data['group_id'] == $group_id)
	{
		// Which group is now the users default one?
		$sql = 'SELECT group_id
			FROM ' . USERS_TABLE . '
			WHERE user_id = ' . $user_id;
		$result = $db->sql_query($sql);
		$user_data['group_id'] = $db->sql_fetchfield('group_id');
		$db->sql_freeresult($result);
	}

	return $user_data['group_id'];
}

/**
* Gets user ids of currently banned registered users.
*
* @param array $user_ids Array of users' ids to check for banning,
*						leave empty to get complete list of banned ids
* @param bool|int $ban_end Bool True to get users currently banned
* 						Bool False to only get permanently banned users
* 						Int Unix timestamp to get users banned until that time
* @return array	Array of banned users' ids if any, empty array otherwise
*/
function phpbb_get_banned_user_ids($user_ids = array(), $ban_end = true)
{
	global $db;

	$sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0';

	// Get banned User ID's
	// Ignore stale bans which were not wiped yet
	$banned_ids_list = array();
	$sql = 'SELECT ban_userid
		FROM ' . BANLIST_TABLE . "
		WHERE $sql_user_ids
			AND ban_exclude <> 1";

	if ($ban_end === true)
	{
		// Banned currently
		$sql .= " AND (ban_end > " . time() . '
				OR ban_end = 0)';
	}
	else if ($ban_end === false)
	{
		// Permanently banned
		$sql .= " AND ban_end = 0";
	}
	else
	{
		// Banned until a specified time
		$sql .= " AND (ban_end > " . (int) $ban_end . '
				OR ban_end = 0)';
	}

	$result = $db->sql_query($sql);
	while ($row = $db->sql_fetchrow($result))
	{
		$user_id = (int) $row['ban_userid'];
		$banned_ids_list[$user_id] = $user_id;
	}
	$db->sql_freeresult($result);

	return $banned_ids_list;
}

/**
* Function for assigning a template var if the zebra module got included
*/
function phpbb_module_zebra($mode, &$module_row)
{
	global $template;

	$template->assign_var('S_ZEBRA_ENABLED', true);

	if ($mode == 'friends')
	{
		$template->assign_var('S_ZEBRA_FRIENDS_ENABLED', true);
	}

	if ($mode == 'foes')
	{
		$template->assign_var('S_ZEBRA_FOES_ENABLED', true);
	}
}
="hl str">"The terms and conditions of this License are governed by the Laws of " "France.\n" "All disputes on the terms of this license will preferably be settled out of " "court. As a last \n" "resort, the dispute will be referred to the appropriate Courts of Law of " "Paris - France.\n" "For any question on this document, please contact Mandriva S.A. \n" msgstr "" "Uvod\n" "\n" "Operativni sustav i njegove različite komponente raspoložive u Mandriva " "Linux distribuciji \n" "će se zvati \"Software-ski Produkti\" daljnje u tekstu. Software-ski " "Produkti uključuju, ali nisu \n" "ograničeni na, skup programa, metoda, zakona i dokumentacija vezanih uz " "operativni\n" "sustav i različite komponente Mandriva Linux distribucije.\n" "\n" "\n" "1. Licencni Dogovor\n" "\n" "Molimo pažljivo pročitajte ovaj dokument. Ovaj dokument je licenci dogovor " "između vas i \n" "Mandriva S.A. koji se primjenjuje na Software-ske produkte.\n" "Instaliranjem, dupliciranjem ili korištenjem Software-skih Produkata u bilo " "kojem obliku,eksplicitno \n" "prihvaćate i potpuno se slažete da ćete prihvatiti stavke i uvjete ove " "Licence. \n" "Ukoliko se ne slažete sa bilo kojim dijelom licence, nije vam dozvoljeno " "instalirati, duplicirati ili koristiti \n" "Software-ski produkt. \n" "Svaki pokušaj instalacije, dupliciranja ili korištenja Software-skog " "Produkta u obliku kojem ne priliči \n" "sa stavkama i uvjetima ove licence je prazno i uništiti će vaša prava pod " "ovom\n" "Licencom. Uslijed uništenja licence, morate odmah unišititi sve kopije \n" "Software-skog Produkta.\n" "\n" "\n" "2. Ograničeno Jamstvo\n" "\n" "Software-ski Produkt i pripadajuća dokumentacija je pružena \"kako je\", bez " "jamstva, do \n" "mjere dozvoljene zakonom.\n" "Mandriva S.A. neće, u bilo kojim slučajevima i do te mjere dozvoljene " "zakonom, biti odgovaran za bilo kakvu specijalnu,\n" "nesretnu, direktnu ili indirektnu štetu bilo kakvu (uključujući granice " "štete od gubitka\n" "posla, prestanka posla, financijskih gubitaka, legalnih plaćanja i kazni " "posljedica sudskih \n" "presuda, ili bilo kakvih drugih posljedica gubitka) što je posljedica " "korištenja ili nemogućnosti korištenja Software-skog \n" "Produkta, iako je Mandriva S.A. bio upozoren od mogućnosti takve \n" "štete.\n" "\n" "OGRANIČENA ODGOVORNOST POVEZANA SA POSJEDOVANJEM ILI KORIŠTENJEM ZABRANJENOG " "SOFTWARE-A U NEKIM ZEMLJAMA\n" "\n" "Do granice dozvoljene zakonom, Mandriva S.A. ili njegovi distributori neće, " "u bilo kakvim slučajevima, biti \n" "odgovaran za bilo kakvu specijalnu, nesretnu, direktnu ili indirektnu štetu " "bilo kako (uključujući \n" "ograničene štete zbog gubitka posla, prekida posla, financijskog gubitka, " "legalnih plaćanja \n" "i kazni posljedica sudskih presuda, ili bilo kakvih drugih " "posljedicagubitka) što je posljedica \n" "posjedovanja ili korištenja software-skih komponenti ili kao posljedica " "skidanja (download-a) software-skih komponenti \n" "sa jednog od Mandriva Linux site-ova koja su zabranjena ili ograničena u " "nekim zemljama po lokalnim zakonima.\n" "Ova ograničena odgovornost se primjenjuje na, ali nije ograničena, jake " "kriptografske komponente \n" "uključene u Software-ski Produkt.\n" "\n" "\n" "3. GPL Licenca i slične licence\n" "\n" "Software-ski Prodkt se sastoji od komponenti napravljenih od raznih ljudi " "ili entiteta. Veliki \n" "broj tih komponenti je pokriveno pod stavkama i uvjetima GNU Opće Javne \n" "Licence, u daljnjem tekstu zvana \"GPL\", ili sličnih licenci. Veliki broj " "tih licenci dozvoljava vam korištenje, \n" "dupliciranje, prilagođavanje ili redistribuciju komponenti koju ona pokriva. " "Molimo pročitajte pažljivo stavke \n" "i uvjete licencnog dogovora svake komponente prije korištenja bilo koje " "komponente. Bilo koje pitanje \n" "o licenci komponente trebao bi biti adresiran autoru komponente a ne " "Mandriva-u.\n" "Programe razvijeni od strane Mandriva S.A. su pokriveni GPL licencom. " "Dokumentacija napisana \n" "od strane Mandriva S.A. je pokrivena specifičnom licencom. Molimo pogledajte " "dokumentaciju za \n" "više detalja.\n" "\n" "\n" "4. Prava na intelektualno vlasništvo\n" "\n" "Sva prava komponenti Software-skog Produkta pripada njihovim uvaženim " "autorima i \n" "zaštićeni su intelektualnim vlasništvom i autorskim zakonima primjenjivim na " "software-ske programe.\n" "Mandriva S.A. zadržava svoje pravo za izmjenu ili prilagođavanje Software-" "skog Produkta, kao cijelinu ili u\n" "dijelovima, u svim slučajevima za sve namjene.\n" "\"Mandriva\", \"Mandriva Linux\" i pripadajući logoi su zaštićeni prodajni " "znaci Mandriva S.A. \n" "\n" "\n" "5. Državni zakoni \n" "\n" "Ukoliko neki dio ovog dogovora govori ništa, ilegalan ili neprikladan " "sudstvu, taj \n" "dio može se isključiti iz ovog ugovora. Ali ostajete obveznu drugim " "primjenjivim sekcijama\n" "ugovora.\n" "Za stavke i uvjete ove Licence je nadležan zakon Francuske.\n" "Sve sporove oko stavaka licence će preferirano biti uređeno sudom. Kao " "zadnji \n" "izlaz, spor će biti predan odgovarajućem Sudu u Parizu - Francuska.\n" "Za bilo kakva pitanja o ovom dokumentu, molimo kontaktirajte Mandriva S." "A. \n" #: messages.pm:90 #, c-format msgid "" "Warning: Free Software may not necessarily be patent free, and some Free\n" "Software included may be covered by patents in your country. For example, " "the\n" "MP3 decoders included may require a licence for further usage (see\n" "http://www.mp3licensing.com for more details). If you are unsure if a " "patent\n" "may be applicable to you, check your local laws." msgstr "" #. -PO: keep the double empty lines between sections, this is formatted a la LaTeX #: messages.pm:98 #, c-format msgid "" "\n" "Warning\n" "\n" "Please read carefully the terms below. If you disagree with any\n" "portion, you are not allowed to install the next CD media. Press 'Refuse' \n" "to continue the installation without using these media.\n" "\n" "\n" "Some components contained in the next CD media are not governed\n" "by the GPL License or similar agreements. Each such component is then\n" "governed by the terms and conditions of its own specific license. \n" "Please read carefully and comply with such specific licenses before \n" "you use or redistribute the said components. \n" "Such licenses will in general prevent the transfer, duplication \n" "(except for backup purposes), redistribution, reverse engineering, \n" "de-assembly, de-compilation or modification of the component. \n" "Any breach of agreement will immediately terminate your rights under \n" "the specific license. Unless the specific license terms grant you such\n" "rights, you usually cannot install the programs on more than one\n" "system, or adapt it to be used on a network. In doubt, please contact \n" "directly the distributor or editor of the component. \n" "Transfer to third parties or copying of such components including the \n" "documentation is usually forbidden.\n" "\n" "\n" "All rights to the components of the next CD media belong to their \n" "respective authors and are protected by intellectual property and \n" "copyright laws applicable to software programs.\n" msgstr "" "\n" "Upozorenje\n" "\n" "Molimo pročitajte pažljivo činjenice niže. Ukoliko se ne slažete sa bilo\n" "kojim dijelom, nemate dozvolu instalirati slijedeći CD medij. Pritisnite " "'Odbij' \n" "za nastavak instalacije bez korištenja ovog medija.\n" "\n" "\n" "Neke komponente sadržane u slijedećem CD mediju nisu pokrivene\n" "GPL licencom ili sličnim ugovorom. Svaka takva komponenta je tada\n" "pokrivena stavkama i uvjetima svojim vlastitim specifičnim licencama. \n" "Molimo pročitajte pažljivo i složite se specifičnim licencama prije \n" "vašeg korištenja ili redistribuiranja navedenih komponenti. \n" "Takve licence općenito zabranjuju prijenos, dupliciranje \n" "(osim za spasonosne kopije), redistribuciju, reverzno inženjerstvo, \n" "disasembliranje, dekompilaciju ili promjenu komponente. \n" "Svako kršenje ugovora će odmah prekinuti vaša prava kod\n" "specifične licence. Ako vam stavke specifične licence ne odobre takva\n" "prava, obično ne možete instalirati programe na više od jednog\n" "sustava, ili prilagoditi ga za korištenje na mreži. Ako ste u nedoumici,\n" "kontaktirajte direktno distributera ili urednika komponente. \n" "Prijenos trećim osobama ili kopiranje takvih komponenti uključujući \n" "dokumentaciju je obično zabranjeno.\n" "\n" "\n" "Sva prava na komponente slijedećeg CD medija pripadaju njihovim \n" "uvaženim autorima i zaštićeni su intelektualnim vlasništvom i \n" "autorskim zakonima primjenjivim na software-ske programe.\n" #. -PO: keep the double empty lines between sections, this is formatted a la LaTeX #: messages.pm:131 #, fuzzy, c-format msgid "" "Congratulations, installation is complete.\n" "Remove the boot media and press Enter to reboot.\n" "\n" "\n" "For information on fixes which are available for this release of Mandriva " "Linux,\n" "consult the Errata available from:\n" "\n" "\n" "%s\n" "\n" "\n" "Information on configuring your system is available in the post\n" "install chapter of the Official Mandriva Linux User's Guide." msgstr "" "Čestitam, instalacija je kompletna.\n" "Uklonite boot medij i pritisnite return za ponovno podizanje.\n" "\n" "\n" "Za informacije o popravcima koji su raspoloživi za ovo izdanje Mandriva " "Linux-a,\n" "konzultirajte Eratu raspoloživu na\n" "\n" "\n" "%s\n" "\n" "\n" "Informacije o konfiguriranju vašeg sustava je raspoloživo u poslije\n" "instalacijskom poglavlju od Official Mandriva Linux User's Guide." #: modules/interactive.pm:19 #, fuzzy, c-format msgid "This driver has no configuration parameter!" msgstr "OKI winprinter konfiguracija" #: modules/interactive.pm:22 #, fuzzy, c-format msgid "Module configuration" msgstr "Ručno namještanje" #: modules/interactive.pm:22 #, c-format msgid "You can configure each parameter of the module here." msgstr "" #: modules/interactive.pm:63 #, c-format msgid "Found %s interfaces" msgstr "Pronašao sam %s međusklopova" #: modules/interactive.pm:64 #, c-format msgid "Do you have another one?" msgstr "Da li imate još koji?" #: modules/interactive.pm:65 #, c-format msgid "Do you have any %s interfaces?" msgstr "Da li imate %s međusklopova?" #: modules/interactive.pm:71 #, c-format msgid "See hardware info" msgstr "Pokaži info o hardveru" #: modules/interactive.pm:82 #, fuzzy, c-format msgid "Installing driver for USB controller" msgstr "Instaliram upravljački program %s za karticu %s" #: modules/interactive.pm:83 #, fuzzy, c-format msgid "Installing driver for firewire controller %s" msgstr "Instaliram upravljački program %s za karticu %s" #: modules/interactive.pm:84 #, fuzzy, c-format msgid "Installing driver for hard drive controller %s" msgstr "Instaliram upravljački program %s za karticu %s" #: modules/interactive.pm:85 #, fuzzy, c-format msgid "Installing driver for ethernet controller %s" msgstr "Instaliram upravljački program %s za karticu %s" #. -PO: the first %s is the card type (scsi, network, sound,...) #. -PO: the second is the vendor+model name #: modules/interactive.pm:96 #, c-format msgid "Installing driver for %s card %s" msgstr "Instaliram upravljački program %s za karticu %s" #: modules/interactive.pm:99 #, c-format msgid "Configuring Hardware" msgstr "" #: modules/interactive.pm:110 #, fuzzy, c-format msgid "" "You may now provide options to module %s.\n" "Note that any address should be entered with the prefix 0x like '0x123'" msgstr "" "Sada možete unijeti opcije za modul %s.\n" "Primjetite da svaka adresa treba biti unešena sa prefiksom 0x kao '0x123'" #: modules/interactive.pm:116 #, c-format msgid "" "You may now provide options to module %s.\n" "Options are in format ``name=value name2=value2 ...''.\n" "For instance, ``io=0x300 irq=7''" msgstr "" "Sada možete unijeti postavke za modul %s.\n" "Postavke su formata ``ime=vrijednost ime2=vrijednost2...''.\n" "Na primjer, ``io=0x300 irq=7''" #: modules/interactive.pm:118 #, c-format msgid "Module options:" msgstr "Postavke modula:" #. -PO: the %s is the driver type (scsi, network, sound,...) #: modules/interactive.pm:131 #, c-format msgid "Which %s driver should I try?" msgstr "Koji %s upravljački program želite isprobati?" #: modules/interactive.pm:140 #, c-format msgid "" "In some cases, the %s driver needs to have extra information to work\n" "properly, although it normally works fine without them. Would you like to " "specify\n" "extra options for it or allow the driver to probe your machine for the\n" "information it needs? Occasionally, probing will hang a computer, but it " "should\n" "not cause any damage." msgstr "" "U nekim slučajevima, %s upravljački program treba dodatne informacije da bi " "radio\n" "ispravno, iako normalno radi i bez toga. Da li želite specifirati te " "dodatne\n" "opcije za njega ili želite dozvoliti upravljačkom programu da isproba vaše\n" "računalo za informacije koje treba? Ponekad, isprobavanje može zamrznuti\n" "vaše računlo, ali ne bi trebalo izazvati nikakvu štetu." #: modules/interactive.pm:144 #, c-format msgid "Autoprobe" msgstr "Auto. ispitaj" #: modules/interactive.pm:144 #, c-format msgid "Specify options" msgstr "Odredi postavke" #: modules/interactive.pm:156 #, c-format msgid "" "Loading module %s failed.\n" "Do you want to try again with other parameters?" msgstr "" "Učitavanje modula %s nije uspjelo.\n" "Da li želite pokušati ponovo sa drugim parametrima?" #: partition_table.pm:409 #, c-format msgid "mount failed: " msgstr "montiranje nije uspjelo: " #: partition_table.pm:518 #, c-format msgid "Extended partition not supported on this platform" msgstr "Proširene particije nisu podržane na ovoj platformi" #: partition_table.pm:536 #, c-format msgid "" "You have a hole in your partition table but I can not use it.\n" "The only solution is to move your primary partitions to have the hole next " "to the extended partitions." msgstr "" "Imate rupu u svojoj particijskoj tablici međutim ja je ne mogu iskoristiti.\n" "Jedino rješenje je da pomaknete vašu primarnu particiju kako bi rupa bila\n" "odmah do proširenih particija." #: partition_table/raw.pm:285 #, fuzzy, c-format msgid "" "Something bad is happening on your drive. \n" "A test to check the integrity of data has failed. \n" "It means writing anything on the disk will end up with random, corrupted " "data." msgstr "" "Nešto loše se dešava sa vašim pogonom. \n" "Test za provjeru integriteta podataka je neuspješan. \n" "To znači da pisanje bilo čega na vaš disk rezultira slučajnim smećem" #: pkgs.pm:228 pkgs.pm:231 pkgs.pm:240 #, c-format msgid "Unused packages removal" msgstr "" #: pkgs.pm:228 #, c-format msgid "Finding unused hardware packages..." msgstr "" #: pkgs.pm:231 #, c-format msgid "Finding unused localization packages..." msgstr "" #: pkgs.pm:241 #, c-format msgid "" "We have detected that some packages are not needed for your system " "configuration." msgstr "" #: pkgs.pm:242 #, c-format msgid "We will remove the following packages, unless you choose otherwise:" msgstr "" #: pkgs.pm:245 pkgs.pm:246 #, fuzzy, c-format msgid "Unused hardware support" msgstr "omogući podršku za radio" #: pkgs.pm:249 pkgs.pm:250 #, c-format msgid "Unused localization" msgstr "" #: raid.pm:42 #, fuzzy, c-format msgid "Can not add a partition to _formatted_ RAID %s" msgstr "Ne mogu dodati particiju na _formatirani_ RAID md%d" #: raid.pm:157 #, c-format msgid "Not enough partitions for RAID level %d\n" msgstr "Nema dovoljno particija za RAID nivo %d\n" #: scanner.pm:95 #, c-format msgid "Could not create directory /usr/share/sane/firmware!" msgstr "Ne mogu napraviti direktorij /usr/share/sane/firmware!" #: scanner.pm:106 #, c-format msgid "Could not create link /usr/share/sane/%s!" msgstr "Ne mogu napraviti link /usr/share/sane/%s!" #: scanner.pm:113 #, c-format msgid "Could not copy firmware file %s to /usr/share/sane/firmware!" msgstr "Ne mogu kopirati firmware datoteku %s u /usr/share/sane/firmware!" #: scanner.pm:120 #, c-format msgid "Could not set permissions of firmware file %s!" msgstr "Ne mogu postaviti ovlasti firmware datoteke %s!" #: scanner.pm:200 #, fuzzy, c-format msgid "Scannerdrake" msgstr "Odaberite skener" #: scanner.pm:201 #, c-format msgid "Could not install the packages needed to share your scanner(s)." msgstr "Nije bilo moguće instalirati pakete potrebe za razmjenu vaših skenera" #: scanner.pm:202 #, c-format msgid "Your scanner(s) will not be available for non-root users." msgstr "" #: security/help.pm:11 #, fuzzy, c-format msgid "Accept bogus IPv4 error messages." msgstr "Prihvati lažne IPv4 poruke o greškama" #: security/help.pm:13 #, fuzzy, c-format msgid "Accept broadcasted icmp echo." msgstr "Prihvati broadcastani icmp echo" #: security/help.pm:15 #, fuzzy, c-format msgid "Accept icmp echo." msgstr "Prihvati icmp echo" #: security/help.pm:17 #, fuzzy, c-format msgid "Allow autologin." msgstr "Dozvoli/Zabrani auto-prijavu" #. -PO: here "ALL" is a value in a pull-down menu; translate it the same as "ALL" is #: security/help.pm:21 #, fuzzy, c-format msgid "" "If set to \"ALL\", /etc/issue and /etc/issue.net are allowed to exist.\n" "\n" "If set to \"None\", no issues are allowed.\n" "\n" "Else only /etc/issue is allowed." msgstr "" "Ukoliko ste podesili na \"ALL\", imat ćete /etc/issue i /etc/issue.net.\n" "\n" "Ukoliko ste podesili na NONE, nećete imati niti jednu \"distribuciju" "\" (issue).\n" "\n" "Bez ikakvog podešenja imat ćete samo /etc/issue." #: security/help.pm:27 #, fuzzy, c-format msgid "Allow reboot by the console user." msgstr "Dozvoli/Zabrani ponovno pokretanje od strane korisnika konzole." #: security/help.pm:29 #, fuzzy, c-format msgid "Allow remote root login." msgstr "(na ovom računalu)" #: security/help.pm:31 #, fuzzy, c-format msgid "Allow direct root login." msgstr "(na ovom računalu)" #: security/help.pm:33 #, c-format msgid "" "Allow the list of users on the system on display managers (kdm and gdm)." msgstr "" #: security/help.pm:35 #, fuzzy, c-format msgid "" "Allow to export display when\n" "passing from the root account to the other users.\n" "\n" "See pam_xauth(8) for more details.'" msgstr "" "Dozvolite/zabranite eksportiranje zaslona kada\n" "prolazite sa root računa na druge korisnike.\n" "\n" "Pogledajte pam_xauth(8) za više detalja.'" #: security/help.pm:40 #, fuzzy, c-format msgid "" "Allow X connections:\n" "\n" "- \"All\" (all connections are allowed),\n" "\n" "- \"Local\" (only connection from local machine),\n" "\n" "- \"None\" (no connection)." msgstr "" "Dozvoli/Zabrani X veze:\n" "\n" "- ALL (Sve veze su dozvoljene),\n" "\n" "- LOCAL (samo veze sa lokalnog računala),\n" "\n" "- NONE (bez veza)." #: security/help.pm:48 #, c-format msgid "" "The argument specifies if clients are authorized to connect\n" "to the X server from the network on the tcp port 6000 or not." msgstr "" "Argument precizira ako su klijenti ovlašteni ili neovlaštena za konekciju\n" "na X server sa mreže na tcp port 6000." #. -PO: here "ALL", "Local" and "None" are values in a pull-down menu; translate them the same as they're #: security/help.pm:53 #, c-format msgid "" "Authorize:\n" "\n" "- all services controlled by tcp_wrappers (see hosts.deny(5) man page) if " "set to \"ALL\",\n" "\n" "- only local ones if set to \"Local\"\n" "\n" "- none if set to \"None\".\n" "\n" "To authorize the services you need, use /etc/hosts.allow (see hosts.allow" "(5))." msgstr "" #: security/help.pm:63 #, c-format msgid "" "If SERVER_LEVEL (or SECURE_LEVEL if absent)\n" "is greater than 3 in /etc/security/msec/security.conf, creates the\n" "symlink /etc/security/msec/server to point to\n" "/etc/security/msec/server.<SERVER_LEVEL>.\n" "\n" "The /etc/security/msec/server is used by chkconfig --add to decide to\n" "add a service if it is present in the file during the installation of\n" "packages." msgstr "" "ako je SERVER_LEVEL (ili SECURE_LEVEL nije prisutan)\n" "veći od 3 u /etc/security/msec/security.conf, satvara\n" "symlink /etc/security/msec/server prema\n" "/etc/security/msec/server.<SERVER_LEVEL>.\n" "\n" "/etc/security/msec/server koristichkconfig --add da bi odlučio da\n" "doda servis ako je prisutan u datoteci tijekom instalacije paketa." #: security/help.pm:72 #, fuzzy, c-format msgid "" "Enable crontab and at for users.\n" "\n" "Put allowed users in /etc/cron.allow and /etc/at.allow (see man at(1)\n" "and crontab(1))." msgstr "" "Omogući/isključi crontab i at za korisnike.\n" "\n" "Stavi korisnike kojima je dozvoljeno u /etc/cron.allow i /etc/at.allow " "(vidi upute na (1)\n" "i crontab(1))." #: security/help.pm:77 #, fuzzy, c-format msgid "Enable syslog reports to console 12" msgstr "Omogući/isključi izvještaj sysloga u konzolu 12" #: security/help.pm:79 #, c-format msgid "" "Enable name resolution spoofing protection. If\n" "\"%s\" is true, also reports to syslog." msgstr "" #: security/help.pm:80 #, fuzzy, c-format msgid "Security Alerts:" msgstr "Sigurnosna razina" #: security/help.pm:82 #, fuzzy, c-format msgid "Enable IP spoofing protection." msgstr "Omogući zaštitu od krivotvorenja IP adresa" #: security/help.pm:84 #, fuzzy, c-format msgid "Enable libsafe if libsafe is found on the system." msgstr "Omogući libsafe ako je libsafe pronađen na sistemu" #: security/help.pm:86 #, fuzzy, c-format msgid "Enable the logging of IPv4 strange packets." msgstr "Omogući vođenje zapisa čudnih IPv4 paketa" #: security/help.pm:88 #, fuzzy, c-format msgid "Enable msec hourly security check." msgstr "Omogući sigurnosnu provjeru msec-a svakog sata" #: security/help.pm:90 #, fuzzy, c-format msgid "" "Enable su only from members of the wheel group. If set to no, allows su from " "any user." msgstr "Aktiviraj su samo za članove grupe ili dozvoli su za svakog korisnika." #: security/help.pm:92 #, c-format msgid "Use password to authenticate users." msgstr "" #: security/help.pm:94 #, fuzzy, c-format msgid "Activate ethernet cards promiscuity check." msgstr "Aktiviraj/Onemogući provjeru promiskuitetnog moda rada mrežnih kartica" #: security/help.pm:96 #, fuzzy, c-format msgid "Activate daily security check." msgstr "Prihvati/Odbij dnevnu sigurnosnu provjeru." #: security/help.pm:98 #, fuzzy, c-format msgid "Enable sulogin(8) in single user level." msgstr "Uključi/Isključi sulogin(8) u jedno-korisničkom modu rada." #: security/help.pm:100 #, c-format msgid "Add the name as an exception to the handling of password aging by msec." msgstr "Dodaj ime kao izuzetak rukovođenju starenja lozinke u msec." #: security/help.pm:102 #, c-format msgid "Set password aging to \"max\" days and delay to change to \"inactive\"." msgstr "" "Postavite zastarijevanje lozinke na \"max\" dana i odgodite promjenu na " "\"inactive\"." #: security/help.pm:104 #, c-format msgid "Set the password history length to prevent password reuse." msgstr "" #: security/help.pm:106 #, c-format msgid "" "Set the password minimum length and minimum number of digit and minimum " "number of capitalized letters." msgstr "" #: security/help.pm:108 #, fuzzy, c-format msgid "Set the root's file mode creation mask." msgstr "Bez lozinke" #: security/help.pm:109 #, c-format msgid "if set to yes, check open ports." msgstr "" #: security/help.pm:110 #, c-format msgid "" "if set to yes, check for:\n" "\n" "- empty passwords,\n" "\n" "- no password in /etc/shadow\n" "\n" "- for users with the 0 id other than root." msgstr "" #: security/help.pm:117 #, c-format msgid "if set to yes, check permissions of files in the users' home." msgstr "" #: security/help.pm:118 #, c-format msgid "if set to yes, check if the network devices are in promiscuous mode." msgstr "" #: security/help.pm:119 #, c-format msgid "if set to yes, run the daily security checks." msgstr "" #: security/help.pm:120 #, c-format msgid "if set to yes, check additions/removals of sgid files." msgstr "" #: security/help.pm:121 #, c-format msgid "if set to yes, check empty password in /etc/shadow." msgstr "ako je postavljeno na da, provjeri prazne lozinke u /etc/shadow." #: security/help.pm:122 #, c-format msgid "if set to yes, verify checksum of the suid/sgid files." msgstr "" #: security/help.pm:123 #, c-format msgid "if set to yes, check additions/removals of suid root files." msgstr "" #: security/help.pm:124 #, c-format msgid "if set to yes, report unowned files." msgstr "" #: security/help.pm:125 #, c-format msgid "if set to yes, check files/directories writable by everybody." msgstr "" "ako je postavljeno na da, provjeri datoteke/direktorije sa dopušenjima za " "pisanje za svakoga" #: security/help.pm:126 #, c-format msgid "if set to yes, run chkrootkit checks." msgstr "" #: security/help.pm:127 #, c-format msgid "" "if set, send the mail report to this email address else send it to root." msgstr "" "ako je postavljeno, šalji izvještaje malom na ovu adresu a inače šalji root " "korisniku." #: security/help.pm:128 #, c-format msgid "if set to yes, report check result by mail." msgstr "" #: security/help.pm:129 #, c-format msgid "Do not send mails if there's nothing to warn about" msgstr "Ne šalji e-mailove ukoliko nema upozonja" #: security/help.pm:130 #, c-format msgid "if set to yes, run some checks against the rpm database." msgstr "" #: security/help.pm:131 #, c-format msgid "if set to yes, report check result to syslog." msgstr "" #: security/help.pm:132 #, c-format msgid "if set to yes, reports check result to tty." msgstr "" #: security/help.pm:134 #, c-format msgid "Set shell commands history size. A value of -1 means unlimited." msgstr "" #: security/help.pm:136 #, c-format msgid "Set the shell timeout. A value of zero means no timeout." msgstr "" #: security/help.pm:136 #, c-format msgid "Timeout unit is second" msgstr "" #: security/help.pm:138 #, fuzzy, c-format msgid "Set the user's file mode creation mask." msgstr "Korisnici" #: security/l10n.pm:11 #, c-format msgid "Accept bogus IPv4 error messages" msgstr "Prihvati lažne IPv4 poruke o greškama" #: security/l10n.pm:12 #, c-format msgid "Accept broadcasted icmp echo" msgstr "Prihvati broadcastani icmp echo" #: security/l10n.pm:13 #, c-format msgid "Accept icmp echo" msgstr "Prihvati icmp echo" #: security/l10n.pm:15 #, c-format msgid "/etc/issue* exist" msgstr "/etc/issue* izlazi " #: security/l10n.pm:16 #, c-format msgid "Reboot by the console user" msgstr "" #: security/l10n.pm:17 #, fuzzy, c-format msgid "Allow remote root login" msgstr "(na ovom računalu)" #: security/l10n.pm:18 #, c-format msgid "Direct root login" msgstr "Izravno prijavljivanje root korisnika" #: security/l10n.pm:19 #, c-format msgid "List users on display managers (kdm and gdm)" msgstr "" #: security/l10n.pm:20 #, c-format msgid "Export display when passing from root to the other users" msgstr "" #: security/l10n.pm:21 #, fuzzy, c-format msgid "Allow X Window connections" msgstr "Normalna modemska veza" #: security/l10n.pm:22 #, c-format msgid "Authorize TCP connections to X Window" msgstr "Odobri TCP veze na X prozor" #: security/l10n.pm:23 #, c-format msgid "Authorize all services controlled by tcp_wrappers" msgstr "Odobri sve servise koje kontroliraju tcp_wrappersi" #: security/l10n.pm:24 #, fuzzy, c-format msgid "Chkconfig obey msec rules" msgstr "Podešavanje servisa" #: security/l10n.pm:25 #, c-format msgid "Enable \"crontab\" and \"at\" for users" msgstr "Omogući \"crontab\" i \"at\" za korisnike" #: security/l10n.pm:26 #, c-format msgid "Syslog reports to console 12" msgstr "" #: security/l10n.pm:27 #, c-format msgid "Name resolution spoofing protection" msgstr "" #: security/l10n.pm:28 #, c-format msgid "Enable IP spoofing protection" msgstr "Omogući zaštitu od krivotvorenja IP adresa" #: security/l10n.pm:29 #, c-format msgid "Enable libsafe if libsafe is found on the system" msgstr "Omogući libsafe ako je libsafe pronađen na sistemu" #: security/l10n.pm:30 #, c-format msgid "Enable the logging of IPv4 strange packets" msgstr "Omogući vođenje zapisa čudnih IPv4 paketa" #: security/l10n.pm:31 #, c-format msgid "Enable msec hourly security check" msgstr "Omogući sigurnosnu provjeru msec-a svakog sata" #: security/l10n.pm:32 #, fuzzy, c-format msgid "Enable su only from the wheel group members" msgstr "" "Omogući su (switch user) samo za članove whell grupe ili za bilo kojeg " "korisnika" #: security/l10n.pm:33 #, c-format msgid "Use password to authenticate users" msgstr "" #: security/l10n.pm:34 #, c-format msgid "Ethernet cards promiscuity check" msgstr "Provjera promiskuiteta mrežnih kartica" #: security/l10n.pm:35 #, c-format msgid "Daily security check" msgstr "Dnevna sigurnosna provjera" #: security/l10n.pm:36 #, c-format msgid "Sulogin(8) in single user level" msgstr "" #: security/l10n.pm:37 #, fuzzy, c-format msgid "No password aging for" msgstr "Bez lozinke" #: security/l10n.pm:38 #, c-format msgid "Set password expiration and account inactivation delays" msgstr "" #: security/l10n.pm:39 #, fuzzy, c-format msgid "Password history length" msgstr "Lozinka je prejednostavna" #: security/l10n.pm:40 #, c-format msgid "Password minimum length and number of digits and upcase letters" msgstr "Minimalna duljina zaporke i broj brojeva i velikih slova" #: security/l10n.pm:41 #, fuzzy, c-format msgid "Root umask" msgstr "Bez lozinke" #: security/l10n.pm:42 #, c-format msgid "Shell history size" msgstr "" #: security/l10n.pm:43 #, fuzzy, c-format msgid "Shell timeout" msgstr "Vrijeme čekanja podizanja kernela" #: security/l10n.pm:44 #, fuzzy, c-format msgid "User umask" msgstr "Korisnici" #: security/l10n.pm:45 #, fuzzy, c-format msgid "Check open ports" msgstr "detektiran na portu %s" #: security/l10n.pm:46 #, c-format msgid "Check for unsecured accounts" msgstr "Provjera nesigurnih korisničkih računa" #: security/l10n.pm:47 #, c-format msgid "Check permissions of files in the users' home" msgstr "Provjeri ovlasti datoteka u korisnikovom home-u" #: security/l10n.pm:48 #, c-format msgid "Check if the network devices are in promiscuous mode" msgstr "Provjeri jesu li mrežni uređaji u promiskuitetnom modu." #: security/l10n.pm:49 #, c-format msgid "Run the daily security checks" msgstr "" #: security/l10n.pm:50 #, c-format msgid "Check additions/removals of sgid files" msgstr "Provjera dodavanja/uklanjanja sgid datoteka" #: security/l10n.pm:51 #, c-format msgid "Check empty password in /etc/shadow" msgstr "Provjeri prazne zaporke u /etc/shadow" #: security/l10n.pm:52 #, c-format msgid "Verify checksum of the suid/sgid files" msgstr "" #: security/l10n.pm:53 #, c-format msgid "Check additions/removals of suid root files" msgstr "Provjera dodavanja/uklanjanja suid root datoteka" #: security/l10n.pm:54 #, c-format msgid "Report unowned files" msgstr "" #: security/l10n.pm:55 #, c-format msgid "Check files/directories writable by everybody" msgstr "Provjera datoteka/mapa za koje svi imaju pravo pisanja" #: security/l10n.pm:56 #, c-format msgid "Run chkrootkit checks" msgstr "" #: security/l10n.pm:57 #, c-format msgid "Do not send empty mail reports" msgstr "" #: security/l10n.pm:58 #, c-format msgid "If set, send the mail report to this email address else send it to root" msgstr "" "Ukoliko je podešena, pošalji izvještaj na ovu adresu elektronske pošte, u " "protivnom pošalji je root korisniku" #: security/l10n.pm:59 #, c-format msgid "Report check result by mail" msgstr "" #: security/l10n.pm:60 #, c-format msgid "Run some checks against the rpm database" msgstr "" #: security/l10n.pm:61 #, c-format msgid "Report check result to syslog" msgstr "" #: security/l10n.pm:62 #, c-format msgid "Reports check result to tty" msgstr "" #: security/level.pm:10 #, c-format msgid "Welcome To Crackers" msgstr "Dobrodošli Crackeri" #: security/level.pm:11 #, c-format msgid "Poor" msgstr "Slab" #: security/level.pm:12 #, c-format msgid "Standard" msgstr "Standardno" #: security/level.pm:13 #, c-format msgid "High" msgstr "Visok" #: security/level.pm:14 #, c-format msgid "Higher" msgstr "Viši" #: security/level.pm:15 #, c-format msgid "Paranoid" msgstr "Paranoidan" #: security/level.pm:41 #, c-format msgid "" "This level is to be used with care. It makes your system more easy to use,\n" "but very sensitive. It must not be used for a machine connected to others\n" "or to the Internet. There is no password access." msgstr "" "Ova razina se treba koristiti sa pažnjom. Ona čini vaš sustav mnogo lakšim " "za korištenje,\n" "ali vrlo osjetljiv: ne smije biti korišten za računala koja su povezana u " "mreži ili na Internet. Naime, nema lozinke za pristup." #: security/level.pm:44 #, c-format msgid "" "Passwords are now enabled, but use as a networked computer is still not " "recommended." msgstr "" "Lozinke su sada uključene međutim još ne preporučam korištenje ovog računala " "u mrežnom okolišu." #: security/level.pm:45 #, c-format msgid "" "This is the standard security recommended for a computer that will be used " "to connect to the Internet as a client." msgstr "" "Ovo je standardna sigurnosna razina preporučena za računala koja će biti " "korištena za spajanje na Internet kao klijent." #: security/level.pm:46 #, c-format msgid "" "There are already some restrictions, and more automatic checks are run every " "night." msgstr "" "Već postoje neka ograničenja i više automatskih provjera se pokreće svake " "noći." #: security/level.pm:47 #, c-format msgid "" "With this security level, the use of this system as a server becomes " "possible.\n" "The security is now high enough to use the system as a server which can " "accept\n" "connections from many clients. Note: if your machine is only a client on the " "Internet, you should choose a lower level." msgstr "" "Sa ovom sigurnosnom razinom, korištenje ovog sustava kao poslužitelj postaje " "moguće.\n" "Sigurnost je sada toliko visoka da se sustav može koristiti kao poslužitelj\n" "koji prima zahtjeve od mnogo klijenata. Upozorenje: ako je vaše računalo " "samo klijent na Internetu, bolje da izaberete nižu razinu." #: security/level.pm:50 #, c-format msgid "" "This is similar to the previous level, but the system is entirely closed and " "security features are at their maximum." msgstr "" "Temeljeno na prijašnjoj razini, ali je sustav potpuno zatvoren.\n" "Sigurnosne značajke su na maksimumu." #: security/level.pm:55 #, c-format msgid "Security" msgstr "Sigurnost" #: security/level.pm:55 #, fuzzy, c-format msgid "DrakSec Basic Options" msgstr "Opcije" #: security/level.pm:58 #, c-format msgid "Please choose the desired security level" msgstr "Izaberite sigurnosni nivo" #. -PO: this string is used to properly format "<security level>: <level description>" #: security/level.pm:62 #, c-format msgid "%s: %s" msgstr "" #: security/level.pm:66 #, c-format msgid "Use libsafe for servers" msgstr "Koristi libsafe za poslužitelje" #: security/level.pm:67 #, c-format msgid "" "A library which defends against buffer overflow and format string attacks." msgstr "" "Biblioteka koja štiti od prekoračenja spremnika i format string napada." #: security/level.pm:68 #, fuzzy, c-format msgid "Security Administrator:" msgstr "Udaljeno administriranje" #: security/level.pm:69 #, c-format msgid "Login or email:" msgstr "" #: services.pm:19 #, c-format msgid "Launch the ALSA (Advanced Linux Sound Architecture) sound system" msgstr "Pokreni ALSA (Naprednu Linux Zvučnu Arhitekturu) zvučni sustav" #: services.pm:20 #, c-format msgid "Anacron is a periodic command scheduler." msgstr "Anacron periodno zakazivanje komandi" #: services.pm:21 #, c-format msgid "" "apmd is used for monitoring battery status and logging it via syslog.\n" "It can also be used for shutting down the machine when the battery is low." msgstr "" "apmd služi za monitoriranje statusa i baterije i njegovo logiranje putem " "syslog-a.\n" "Također može biti korišten za gašenje računala kada je baterija slaba." #: services.pm:23 #, c-format msgid "" "Runs commands scheduled by the at command at the time specified when\n" "at was run, and runs batch commands when the load average is low enough." msgstr "" "Pokreće komande zakazane sa at komandom u specifirano vrijeme kada\n" "je at pokrenut, i pokreće batch komande kada je prosječna zauzetost dovoljno " "niska." #: services.pm:25 #, c-format msgid "" "cron is a standard UNIX program that runs user-specified programs\n" "at periodic scheduled times. vixie cron adds a number of features to the " "basic\n" "UNIX cron, including better security and more powerful configuration options." msgstr "" "cron je standardan UNIX program koji pokreće korisnički definirane programe\n" "u periodično zakazana vremena. vixie cron dodaje veliki broj korisnih " "funkcija običnom UNIX cron-u, uključujući bolju sigurnost i veću snagu " "konfiguracijskih opcija." #: services.pm:28 #, c-format msgid "" "Common UNIX Printing System (CUPS) is an advanced printer spooling system" msgstr "" #: services.pm:29 #, c-format msgid "Launches the graphical display manager" msgstr "" #: services.pm:30 #, c-format msgid "" "FAM is a file monitoring daemon. It is used to get reports when files " "change.\n" "It is used by GNOME and KDE" msgstr "" #: services.pm:32 #, c-format msgid "" "GPM adds mouse support to text-based Linux applications such the\n" "Midnight Commander. It also allows mouse-based console cut-and-paste " "operations,\n" "and includes support for pop-up menus on the console." msgstr "" "GPM dodaje podršku za mišu tekst baziranim Linux aplikacijama kao što je\n" "Midnight Commander. Također pruža miš baziranim konzolama odreži-i-zalijepi " "operacije,\n" "i uključuje podršku za iskočive menije u konzoli." #: services.pm:35 #, c-format msgid "HAL is a daemon that collects and maintains information about hardware" msgstr "" #: services.pm:36 #, c-format msgid "" "HardDrake runs a hardware probe, and optionally configures\n" "new/changed hardware." msgstr "" "HardDrake pokreće isprobavanje hardware-a, i opciono konfigurira\n" "novi/promjenjeni hardware." #: services.pm:38 #, c-format msgid "" "Apache is a World Wide Web server. It is used to serve HTML files and CGI." msgstr "" "Apache je World Wide Web poslužitelj. Koristi se za posluživanje HTML\n" "dokumenata i CGI skripti." #: services.pm:39 #, c-format msgid "" "The internet superserver daemon (commonly called inetd) starts a\n" "variety of other internet services as needed. It is responsible for " "starting\n" "many services, including telnet, ftp, rsh, and rlogin. Disabling inetd " "disables\n" "all of the services it is responsible for." msgstr "" "Internet superserver demon (najčešće zvan inetd) pokreće \n" "razne druge internet servise po potrebi. Odgovoran je za pokretanje \n" "mnogo servisa, uključujući telnet, ftp, rsh, i rlogin. Isključivanje inetd-" "a\n" "onemogučuje sve servise za koje je zadužen." #: services.pm:43 #, c-format msgid "" "Launch packet filtering for Linux kernel 2.2 series, to set\n" "up a firewall to protect your machine from network attacks." msgstr "" "Pokreće paketno filtriranje za Linux kernel 2.2 serije, za postavljanje\n" "vatrozida za zaštitu vašeg računala od mrežnih napada." #: services.pm:45 #, c-format msgid "" "This package loads the selected keyboard map as set in\n" "/etc/sysconfig/keyboard. This can be selected using the kbdconfig utility.\n" "You should leave this enabled for most machines." msgstr "" "Ovaj paket učitava odabranu tastaturnu mapu kao što je postavljenu u\n" "/etc/sysconfig/keyboard. Ona se može odabrati koristeći kbdconfig alat.\n" "Trebali biste ostaviti ovo uključeno za većinu računala." #: services.pm:48 #, c-format msgid "" "Automatic regeneration of kernel header in /boot for\n" "/usr/include/linux/{autoconf,version}.h" msgstr "" "Automatsko regeneriranje kernel header-a u /boot za\n" "/usr/include/linux/{autoconf,version}.h" #: services.pm:50 #, c-format msgid "Automatic detection and configuration of hardware at boot." msgstr "Automatska detekcija i konfiguracija hardware-a pri podizanju." #: services.pm:51 #, c-format msgid "" "Linuxconf will sometimes arrange to perform various tasks\n" "at boot-time to maintain the system configuration." msgstr "" "Linuxconf će ponekada urediti izvršavanje raznih radnji\n" "pri samom podizanju kako bi održao sustavsku konfiguraciju." #: services.pm:53 #, c-format msgid "" "lpd is the print daemon required for lpr to work properly. It is\n" "basically a server that arbitrates print jobs to printer(s)." msgstr "" "lpd je daemon za ispis koji je potreban od lpr-a kako bi radio ispravno.\n" "On je pojednostavljeno poslužitelj koji šalje ispisne poslove pisaču(ima)." #: services.pm:55 #, c-format msgid "" "Linux Virtual Server, used to build a high-performance and highly\n" "available server." msgstr "" "Linux Virtualni Poslužitelj, koristi se za pravljenje visoko raspoloživog\n" "poslužitelja visokih performansi." #: services.pm:57 #, c-format msgid "" "DBUS is a daemon which broadcasts notifications of system events and other " "messages" msgstr "" #: services.pm:58 #, c-format msgid "" "named (BIND) is a Domain Name Server (DNS) that is used to resolve host " "names to IP addresses." msgstr "" "named (BIND) je Domain Name Server (DNS) poslužitelj koji se upotrebljava\n" "za razlučivanje imena računala u IP adrese." #: services.pm:59 #, c-format msgid "" "Mounts and unmounts all Network File System (NFS), SMB (Lan\n" "Manager/Windows), and NCP (NetWare) mount points." msgstr "" "Montira i Demontira sve Mrežne datotečne sustave (NFS), SMB (Lan\n" "Manager/Windows), i NCP (NetWare) točke montiranja." #: services.pm:61 #, c-format msgid "" "Activates/Deactivates all network interfaces configured to start\n" "at boot time." msgstr "" "Aktivira/Deaktivira sva podešena mrežna sučelja prilikom pokretanja\n" "sustava." #: services.pm:63 #, c-format msgid "" "NFS is a popular protocol for file sharing across TCP/IP networks.\n" "This service provides NFS server functionality, which is configured via the\n" "/etc/exports file." msgstr "" "NFS je popularan protokol za dijeljenje datoteka putem TCP/IP mreža.\n" "Ovaj servis pruža NFS poslužiteljsku funkcionalnost, koji se konfigurira\n" "putem /etc/exports datoteke." #: services.pm:66 #, c-format msgid "" "NFS is a popular protocol for file sharing across TCP/IP\n" "networks. This service provides NFS file locking functionality." msgstr "" "NFS je popularan protokol za dijeljenje datoteka putem TCP/IP mreža.\n" "Ovaj servis pruža funkcionalnost NFS datotečnog zaključavanja." #: services.pm:68 #, c-format msgid "Synchronizes system time using the Network Time Protocol (NTP)" msgstr "" #: services.pm:69 #, c-format msgid "" "Automatically switch on numlock key locker under console\n" "and Xorg at boot." msgstr "" "Automatski uključuje numlock tipku u konzoli i\n" "Xorg-u pri podizanju." #: services.pm:71 #, c-format msgid "Support the OKI 4w and compatible winprinters." msgstr "Podržava OKI 4w i kompaktibilne win pisače." #: services.pm:72 #, c-format msgid "" "PCMCIA support is usually to support things like ethernet and\n" "modems in laptops. It will not get started unless configured so it is safe " "to have\n" "it installed on machines that do not need it." msgstr "" "PCMCIA podrška je obično za podržavanje stvari poput ethernet i\n" "modema u laptopima. Ona neće biti pokrenuta ukoliko nije tako\n" " konfigurirana zato je sigurno pokrenuti ju iako na instaliranom\n" " računalu ne treba." #: services.pm:75 #, c-format msgid "" "The portmapper manages RPC connections, which are used by\n" "protocols such as NFS and NIS. The portmap server must be running on " "machines\n" "which act as servers for protocols which make use of the RPC mechanism." msgstr "" "Portmapper uređuje RPC vezama, koje su korištene u protokolima\n" "poput NFS-a ili NIS-a. Portmap poslužitelj mora biti pokrenut na računalima\n" "koji su poslužitelji za protokole koji se služe RPC mehanizmima." #: services.pm:78 #, c-format msgid "" "Postfix is a Mail Transport Agent, which is the program that moves mail from " "one machine to another." msgstr "" "Postfix je Mail Transport Agent, što je program kojišalje mail-ove sa jednog " "računala na drugo." #: services.pm:79 #, c-format msgid "" "Saves and restores system entropy pool for higher quality random\n" "number generation." msgstr "" "Sprema i vraća sustavsku entropiju za veću kvalitetu generiranja\n" "slučajnih brojeva." #: services.pm:81 #, fuzzy, c-format msgid "" "Assign raw devices to block devices (such as hard drive\n" "partitions), for the use of applications such as Oracle or DVD players" msgstr "" "Dodjeljuje raw uređaje (kao što su hard disk\n" "particije), za uporabu u aplikacijama kao što su Oracle" #: services.pm:83 #, c-format msgid "" "The routed daemon allows for automatic IP router table updated via\n" "the RIP protocol. While RIP is widely used on small networks, more complex\n" "routing protocols are needed for complex networks." msgstr "" "Routed daemon omogućava automatsku IP ruter tablicu koja se obnavlja\n" "putem RIP protokola. Dok se RIP najšire koristi na malim mrežama, više " "kompleksniji\n" "ruting protokoli su potrebni za kompleksnije mreže." #: services.pm:86 #, c-format msgid "" "The rstat protocol allows users on a network to retrieve\n" "performance metrics for any machine on that network." msgstr "" "Rstat protokol omogućava korisnicima na mreži da dohvate\n" "mjerljive performanse za svako računalo koje je na mreži." #: services.pm:88 #, c-format msgid "" "The rusers protocol allows users on a network to identify who is\n" "logged in on other responding machines." msgstr "" "Rusers protokol omogućava korisnicima na mreži da identificira tko je\n" "prijavljen na drugim računalima koja odgovaraju." #: services.pm:90 #, c-format msgid "" "The rwho protocol lets remote users get a list of all of the users\n" "logged into a machine running the rwho daemon (similar to finger)." msgstr "" "Rwho protokol omogućava udaljenim korisnicima da dobiju popis svih\n" "korisnika prijavljenih na računalo na kojima je pokrenut rwho (slično finger-" "u)." #: services.pm:92 #, c-format msgid "" "SANE (Scanner Access Now Easy) enables to access scanners, video cameras, ..." msgstr "" #: services.pm:93 #, c-format msgid "" "The SMB/CIFS protocol enables to share access to files & printers and also " "integrates with a Windows Server domain" msgstr "" #: services.pm:94 #, c-format msgid "Launch the sound system on your machine" msgstr "Pokreni zvučni sustav na vašem računalu" #: services.pm:95 #, c-format msgid "" "Secure Shell is a network protocol that allows data to be exchanged over a " "secure channel between two computers" msgstr "" #: services.pm:96 #, c-format msgid "" "Syslog is the facility by which many daemons use to log messages\n" "to various system log files. It is a good idea to always run syslog." msgstr "" "Syslog je resurs kojega koriste mnogi demoni kako bi logirali poruke\n" "u različite sustavske log datoteke. Dobra je ideja uvijek imati pokrenuti " "syslog." #: services.pm:98 #, c-format msgid "Load the drivers for your usb devices." msgstr "Učitava upravljačke programe za vaše usb uređaje." #: services.pm:99 #, c-format msgid "Starts the X Font Server." msgstr "" #: services.pm:100 #, c-format msgid "Starts other deamons on demand." msgstr "" #: services.pm:123 #, c-format msgid "Printing" msgstr "Ispisivanje" #: services.pm:124 #, c-format msgid "Internet" msgstr "Internet" #: services.pm:127 #, c-format msgid "File sharing" msgstr "Dijeljenje datoteka" #: services.pm:129 #, c-format msgid "System" msgstr "Sustav" #: services.pm:134 #, c-format msgid "Remote Administration" msgstr "Udaljeno administriranje" #: services.pm:142 #, c-format msgid "Database Server" msgstr "Poslužitelj baza podataka" #: services.pm:153 services.pm:189 #, c-format msgid "Services" msgstr "Servisi" #: services.pm:153 #, c-format msgid "Choose which services should be automatically started at boot time" msgstr "Izaberite koji servisi trebaju biti startani automatski kod boot-a" #: services.pm:171 #, c-format msgid "Services: %d activated for %d registered" msgstr "Servisi: %d aktiviran za %d registriran" #: services.pm:205 #, c-format msgid "running" msgstr "radi" #: services.pm:205 #, c-format msgid "stopped" msgstr "zaustavljen" #: services.pm:210 #, c-format msgid "Services and daemons" msgstr "Servisi i daemoni" #: services.pm:216 #, c-format msgid "" "No additional information\n" "about this service, sorry." msgstr "" "Nema dodatnih informacija\n" "o ovom servisu, žalim." #: services.pm:221 ugtk2.pm:923 #, c-format msgid "Info" msgstr "Info" #: services.pm:224 #, c-format msgid "Start when requested" msgstr "" #: services.pm:224 #, c-format msgid "On boot" msgstr "Pri pokretanju" #: services.pm:242 #, c-format msgid "Start" msgstr "Započni" #: services.pm:242 #, c-format msgid "Stop" msgstr "Zaustavi" #: standalone.pm:25 #, fuzzy, c-format msgid "" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 2, or (at your option)\n" "any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" "\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, " "USA.\n" msgstr "" "Ovaj program je besplatni softver; možete ga redistribuirati i/ili " "mijenjati\n" "pod uvjetima GNU General Public License objavljenje od Free Software\n" "Foundationa; ili inačice 2, ili (kako izaberete) neke kasnije inačice.\n" "\n" "Ovaj program se distribuira u nadi da će biti koristan, ali\n" "BEZ IKAKVE GARANCIJE; bez čak i podrazumijevane TRŽIŠNE GARANCIJE\n" "ili POGODNOSTI ZA ODREĐENU SVRHU. Pogledajte\n" "GNU General Public License za više detalja.\n" "\n" "Trebali ste dobiti presliku GNU General Public License\n" "sa ovim programom; ako ne, pišite na Free Software Foundation,\n" "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA." #: standalone.pm:44 #, c-format msgid "" "[--config-info] [--daemon] [--debug] [--default] [--show-conf]\n" "Backup and Restore application\n" "\n" "--default : save default directories.\n" "--debug : show all debug messages.\n" "--show-conf : list of files or directories to backup.\n" "--config-info : explain configuration file options (for non-X " "users).\n" "--daemon : use daemon configuration. \n" "--help : show this message.\n" "--version : show version number.\n" msgstr "" #: standalone.pm:56 #, c-format msgid "" "[--boot] [--splash]\n" "OPTIONS:\n" " --boot - enable to configure boot loader\n" " --splash - enable to configure boot theme\n" "default mode: offer to configure autologin feature" msgstr "" "[--boot] [--splash]\n" "OPCIJE:\n" " --boot - omogući za konfiguraciju boot loadera\n" " --splash - omogući za konfiguraciju boot teme\n" "uobičajeno: ponudi podešavanje automatske prijave" #: standalone.pm:61 #, c-format msgid "" "[OPTIONS] [PROGRAM_NAME]\n" "\n" "OPTIONS:\n" " --help - print this help message.\n" " --report - program should be one of Mandriva Linux tools\n" " --incident - program should be one of Mandriva Linux tools" msgstr "" #: standalone.pm:67 #, c-format msgid "" "[--add]\n" " --add - \"add a network interface\" wizard\n" " --del - \"delete a network interface\" wizard\n" " --skip-wizard - manage connections\n" " --internet - configure internet\n" " --wizard - like --add" msgstr "" "[--add]\n" " --add - čarobnjak za \"dodavanje mrežnog uređaja\"\n" " --del - čarobnjak za \"brisanje mrežnog uređaja\"\n" " --skip-wizard - upravljanje vezama/mrežom\n" " --internet - podešavanje interneta\n" " --wizard - poput --add" #: standalone.pm:73 #, c-format msgid "" "\n" "Font Importation and monitoring application\n" "\n" "OPTIONS:\n" "--windows_import : import from all available windows partitions.\n" "--xls_fonts : show all fonts that already exist from xls\n" "--install : accept any font file and any directory.\n" "--uninstall : uninstall any font or any directory of font.\n" "--replace : replace all font if already exist\n" "--application : 0 none application.\n" " : 1 all application available supported.\n" " : name_of_application like so for staroffice \n" " : and gs for ghostscript for only this one." msgstr "" #: standalone.pm:88 #, c-format msgid "" "[OPTIONS]...\n" "Mandriva Linux Terminal Server Configurator\n" "--enable : enable MTS\n" "--disable : disable MTS\n" "--start : start MTS\n" "--stop : stop MTS\n" "--adduser : add an existing system user to MTS (requires username)\n" "--deluser : delete an existing system user from MTS (requires " "username)\n" "--addclient : add a client machine to MTS (requires MAC address, IP, " "nbi image name)\n" "--delclient : delete a client machine from MTS (requires MAC address, " "IP, nbi image name)" msgstr "" #: standalone.pm:100 #, fuzzy, c-format msgid "[keyboard]" msgstr "Tipkovnica" #: standalone.pm:101 #, c-format msgid "[--file=myfile] [--word=myword] [--explain=regexp] [--alert]" msgstr "[--file=mojadatoteka] [--word=mojariječ] [--explain=regexp] [--alert]" #: standalone.pm:102 #, c-format msgid "" "[OPTIONS]\n" "Network & Internet connection and monitoring application\n" "\n" "--defaultintf interface : show this interface by default\n" "--connect : connect to internet if not already connected\n" "--disconnect : disconnect to internet if already connected\n" "--force : used with (dis)connect : force (dis)connection.\n" "--status : returns 1 if connected 0 otherwise, then exit.\n" "--quiet : do not be interactive. To be used with (dis)connect." msgstr "" #: standalone.pm:112 #, c-format msgid "" "[OPTION]...\n" " --no-confirmation do not ask first confirmation question in Mandriva " "Update mode\n" " --no-verify-rpm do not verify packages signatures\n" " --changelog-first display changelog before filelist in the " "description window\n" " --merge-all-rpmnew propose to merge all .rpmnew/.rpmsave files found" msgstr "" #: standalone.pm:117 #, c-format msgid "" "[--manual] [--device=dev] [--update-sane=sane_source_dir] [--update-" "usbtable] [--dynamic=dev]" msgstr "" #: standalone.pm:118 #, c-format msgid "" " [everything]\n" " XFdrake [--noauto] monitor\n" " XFdrake resolution" msgstr "" " [sve]\n" " XFdrake [--noauto] monitor\n" " XFdrake rezolucija" #: standalone.pm:154 #, c-format msgid "" "\n" "Usage: %s [--auto] [--beginner] [--expert] [-h|--help] [--noauto] [--" "testing] [-v|--version] " msgstr "" #: timezone.pm:161 timezone.pm:162 #, fuzzy, c-format msgid "All servers" msgstr "Dodaj korisnika" #: timezone.pm:196 #, c-format msgid "Global" msgstr "" #: timezone.pm:199 #, fuzzy, c-format msgid "Africa" msgstr "Južna Afrika" #: timezone.pm:200 #, fuzzy, c-format msgid "Asia" msgstr "Austrija" #: timezone.pm:201 #, c-format msgid "Europe" msgstr "" #: timezone.pm:202 #, fuzzy, c-format msgid "North America" msgstr "Južna Afrika" #: timezone.pm:203 #, c-format msgid "Oceania" msgstr "Oceanija" #: timezone.pm:204 #, fuzzy, c-format msgid "South America" msgstr "Južna Afrika" #: timezone.pm:213 #, c-format msgid "Hong Kong" msgstr "Hong Kong" #: timezone.pm:250 #, c-format msgid "Russian Federation" msgstr "Ruska Federacija" #: timezone.pm:258 #, c-format msgid "Yugoslavia" msgstr "Jugoslavija" #: ugtk2.pm:813 #, c-format msgid "Is this correct?" msgstr "Da li je ovo ispravno?" #: ugtk2.pm:873 #, fuzzy, c-format msgid "No file chosen" msgstr "izbornik datoteka" #: ugtk2.pm:875 #, fuzzy, c-format msgid "You have chosen a file, not a directory" msgstr "Trebate odrediti datoteku, a ne direktorij.\n" #: ugtk2.pm:877 #, fuzzy, c-format msgid "You have chosen a directory, not a file" msgstr "Ime '/' može biti samo mapa, a ne ključ" #: ugtk2.pm:879 #, fuzzy, c-format msgid "No such directory" msgstr "Nije mapa" #: ugtk2.pm:879 #, c-format msgid "No such file" msgstr "Datoteka ne postoji" #: wizards.pm:95 #, c-format msgid "" "%s is not installed\n" "Click \"Next\" to install or \"Cancel\" to quit" msgstr "" "%s nije instaliraj\n" "Kliknite \"Slijedeći\" da instalira ili \"Odustani\" da odustanete" #: wizards.pm:99 #, c-format msgid "Installation failed" msgstr "Instalacija nije uspjela" #~ msgid "LILO/grub Installation" #~ msgstr "LILO/grub instalacija" #~ msgid "Precise RAM size if needed (found %d MB)" #~ msgstr "Precizna veličina RAMa (pronađeno %d MB)" #~ msgid "Give the ram size in MB" #~ msgstr "Upišite veličinu RAM u Mb" #~ msgid "" #~ "If you plan to use aboot, be careful to leave a free space (2048 sectors " #~ "is enough)\n" #~ "at the beginning of the disk" #~ msgstr "" #~ "Ukoliko želite koristiti aboot morate ostaviti dovoljno mjesta (npr. 2048 " #~ "sektora) na\n" #~ "početku diska" #~ msgid "Security level" #~ msgstr "Sigurnosna razina" #~ msgid "Expand Tree" #~ msgstr "Proširi stablo" #~ msgid "Collapse Tree" #~ msgstr "Sažmi stablo" #~ msgid "Toggle between flat and group sorted" #~ msgstr "Prebaci između ravno i grupno sortiranog" #~ msgid "Choose action" #~ msgstr "Izaberite akciju" #, fuzzy #~ msgid "Active Directory with SFU" #~ msgstr "Povrati sve pohrane" #, fuzzy #~ msgid "Active Directory with Winbind" #~ msgstr "Povrati sve pohrane" #, fuzzy #~ msgid "Active Directory with SFU:" #~ msgstr "Povrati sve pohrane" #, fuzzy #~ msgid "Active Directory with Winbind:" #~ msgstr "Povrati sve pohrane" #~ msgid "Authentication LDAP" #~ msgstr "LDAP Autentifikacija" #~ msgid "TLS" #~ msgstr "TLS" #~ msgid "SSL" #~ msgstr "SSL" #, fuzzy #~ msgid "Authentication Active Directory" #~ msgstr "Provjera autentičnosti" #, fuzzy #~ msgid "LDAP users database" #~ msgstr "Baze" #, fuzzy #~ msgid "Password for user" #~ msgstr "Lozinka" #~ msgid "Authentication NIS" #~ msgstr "NIS Autentifikacija" #, fuzzy #~ msgid "Authentication Windows Domain" #~ msgstr "LDAP Autentifikacija" #~ msgid "Undo" #~ msgstr "Vrati" #~ msgid "Save partition table" #~ msgstr "Spremi particijsku tabelu" #~ msgid "Restore partition table" #~ msgstr "Vrati particijsku tabelu" #~ msgid "" #~ "The backup partition table has not the same size\n" #~ "Still continue?" #~ msgstr "" #~ "Backup particijske tablice nema istu veličinu\n" #~ "Da ipak nastavim?" #~ msgid "Info: " #~ msgstr "Info: " #, fuzzy #~ msgid "Unknown driver" #~ msgstr "Nepoznati model" #~ msgid "Error reading file %s" #~ msgstr "Greška prilikom čitanja datoteke %s" #~ msgid "Restoring from file %s failed: %s" #~ msgstr "Vraćanje iz datoteke %s nije uspjelo: %s" #~ msgid "Bad backup file" #~ msgstr "Loša backup datoteka" #~ msgid "Error writing to file %s" #~ msgstr "Greška prilikom pisanja u datoteku %s" #~ msgid "Error: The \"%s\" driver for your sound card is unlisted" #~ msgstr "" #~ "Greška: \"%s\" upravljački program za vašu zvučnu karticu nije prisutan " #~ "na listi" #~ msgid "Ext2" #~ msgstr "Ext2" #~ msgid "Journalised FS" #~ msgstr "Journalised FS" #~ msgid "Starts the X Font Server (this is mandatory for Xorg to run)." #~ msgstr "" #~ "Pokreće X Pismovni Poslužitelj (ovo je nužno za Xorg da se pokrene)." #~ msgid "Add user" #~ msgstr "Dodaj korisnika" #~ msgid "Accept user" #~ msgstr "Prihvati korisnika" #, fuzzy #~ msgid "" #~ "Do not update directory inode access times on this filesystem\n" #~ "(e.g, for faster access on the news spool to speed up news servers)." #~ msgstr "" #~ "Ne osvježavaj vremenski pristup inodeu na ovom datotečnom sustavu\n" #~ "(na primjer za brži pristup na odlagalište diskusija da se ubrzaju " #~ "poslužitelji vijesti (newsa))" #~ msgid "Rescue partition table" #~ msgstr "Spasi particijsku tabelu" #~ msgid "Removable media automounting" #~ msgstr "Automatsko montiranje prenosivog medija" #~ msgid "Trying to rescue partition table" #~ msgstr "Pokušavam spasiti particijsku tablicu" #~ msgid "Accept/Refuse bogus IPv4 error messages." #~ msgstr "Prihvati/odbij lažne IPv4 poruke o greškama" #~ msgid "Accept/Refuse broadcasted icmp echo." #~ msgstr "Prihvati/Odbij broadcastani icmp echo." #~ msgid "Accept/Refuse icmp echo." #~ msgstr "Prihvati/Odbij icmp echo." #, fuzzy #~ msgid "Allow/Forbid remote root login." #~ msgstr "(na ovom računalu)" #~ msgid "Enable/Disable IP spoofing protection." #~ msgstr "Omogući/isključi zaštitu lažiranja IP adresa" #~ msgid "Enable/Disable libsafe if libsafe is found on the system." #~ msgstr "Omogući/isključi libsafe ako je libsafe pronađen na sistemu" #~ msgid "Enable/Disable the logging of IPv4 strange packets." #~ msgstr "Omogući/isključi vođenje zapisa o čudnim IPv4 paketima." #~ msgid "Enable/Disable msec hourly security check." #~ msgstr "Omogući/isključi sigurnosnu provjeru msec-a svaki sat" #~ msgid "Number of capture buffers:" #~ msgstr "Broj međuspremnika za hvatanje " #, fuzzy #~ msgid "PLL setting:" #~ msgstr "Postavka opterećenja" #~ msgid "Radio support:" #~ msgstr "Podrška za radio:" #~ msgid " [--skiptest] [--cups] [--lprng] [--lpd] [--pdq]" #~ msgstr " [--skiptest] [--cups] [--lprng] [--lpd] [--pdq]"