aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/auth.php
blob: b32d435d7b6e334b75411f8d83adb022abfbf3e3 (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
<?php
/** 
*
* @package phpBB3
* @version $Id$ 
* @copyright (c) 2005 phpBB Group 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

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

/**
* ACP Permission/Auth class
* @package phpBB3
*/
class auth_admin extends auth
{
	var $option_ids = array();

	/**
	* Init auth settings
	*/
	function auth_admin()
	{
		global $db, $cache;

		if (($this->acl_options = $cache->get('acl_options')) === false)
		{
			$sql = 'SELECT auth_option, is_global, is_local
				FROM ' . ACL_OPTIONS_TABLE . '
				ORDER BY auth_option_id';
			$result = $db->sql_query($sql);

			$global = $local = 0;
			$this->acl_options = array();
			while ($row = $db->sql_fetchrow($result))
			{
				if ($row['is_global'])
				{
					$this->acl_options['global'][$row['auth_option']] = $global++;
				}

				if ($row['is_local'])
				{
					$this->acl_options['local'][$row['auth_option']] = $local++;
				}
			}
			$db->sql_freeresult($result);

			$cache->put('acl_options', $this->acl_options);
		}

		if (!sizeof($this->option_ids))
		{
			$sql = 'SELECT auth_option_id, auth_option
				FROM ' . ACL_OPTIONS_TABLE;
			$result = $db->sql_query($sql);

			$this->option_ids = array();
			while ($row = $db->sql_fetchrow($result))
			{
				$this->option_ids[$row['auth_option']] = $row['auth_option_id'];
			}
			$db->sql_freeresult($result);
		}
	}
	
	/**
	* Get permission mask
	* This function only supports getting permissions of one type (for example a_)
	*
	* @param set|view $mode defines the permissions we get, view gets effective permissions (checking user AND group permissions), set only gets the user or group permission set alone
	* @param mixed $user_id user ids to search for (a user_id or a group_id has to be specified at least)
	* @param mixed $group_id group ids to search for, return group related settings (a user_id or a group_id has to be specified at least)
	* @param mixed $forum_id forum_ids to search for. Defining a forum id also means getting local settings
	* @param string $auth_option the auth_option defines the permission setting to look for (a_ for example)
	* @param local|global $scope the scope defines the permission scope. If local, a forum_id is additionally required
	* @param ACL_NEVER|ACL_NO|ACL_YES $acl_fill defines the mode those permissions not set are getting filled with
	*/
	function get_mask($mode, $user_id = false, $group_id = false, $forum_id = false, $auth_option = false, $scope = false, $acl_fill = ACL_NEVER)
	{
		global $db, $user;

		$hold_ary = array();
		$view_user_mask = ($mode == 'view' && $group_id === false) ? true : false;

		if ($auth_option === false || $scope === false)
		{
			return array();
		}

		$acl_user_function = ($mode == 'set') ? 'acl_user_raw_data' : 'acl_raw_data';

		if (!$view_user_mask)
		{
			if ($forum_id !== false)
			{
				$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', $forum_id) : $this->$acl_user_function($user_id, $auth_option . '%', $forum_id);
			}
			else
			{
				$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', ($scope == 'global') ? 0 : false) : $this->$acl_user_function($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false);
			}
		}

		// Make sure hold_ary is filled with every setting (prevents missing forums/users/groups)
		$ug_id = ($group_id !== false) ? ((!is_array($group_id)) ? array($group_id) : $group_id) : ((!is_array($user_id)) ? array($user_id) : $user_id);
		$forum_ids = ($forum_id !== false) ? ((!is_array($forum_id)) ? array($forum_id) : $forum_id) : (($scope == 'global') ? array(0) : array());

		// Only those options we need
		$compare_options = array_diff(preg_replace('/^((?!' . $auth_option . ').+)|(' . $auth_option . ')$/', '', array_keys($this->acl_options[$scope])), array(''));

		// If forum_ids is false and the scope is local we actually want to have all forums within the array
		if ($scope == 'local' && !sizeof($forum_ids))
		{
			$sql = 'SELECT forum_id 
				FROM ' . FORUMS_TABLE;
			$result = $db->sql_query($sql, 120);

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

		if ($view_user_mask)
		{
			$auth2 = null;

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

			while ($userdata = $db->sql_fetchrow($result))
			{
				if ($user->data['user_id'] != $userdata['user_id'])
				{
					$auth2 = new auth();
					$auth2->acl($userdata);
				}
				else
				{
					global $auth;
					$auth2 = &$auth;
				}

				
				$hold_ary[$userdata['user_id']] = array();
				foreach ($forum_ids as $f_id)
				{
					$hold_ary[$userdata['user_id']][$f_id] = array();
					foreach ($compare_options as $option)
					{
						$hold_ary[$userdata['user_id']][$f_id][$option] = $auth2->acl_get($option, $f_id);
					}
				}
			}
			$db->sql_freeresult($result);

			unset($userdata);
			unset($auth2);
		}

		foreach ($ug_id as $_id)
		{
			if (!isset($hold_ary[$_id]))
			{
				$hold_ary[$_id] = array();
			}

			foreach ($forum_ids as $f_id)
			{
				if (!isset($hold_ary[$_id][$f_id]))
				{
					$hold_ary[$_id][$f_id] = array();
				}
			}
		}

		// Now, we need to fill the gaps with $acl_fill. ;)

		// Now switch back to keys
		if (sizeof($compare_options))
		{
			$compare_options = array_combine($compare_options, array_fill(1, sizeof($compare_options), $acl_fill));
		}

		// Defining the user-function here to save some memory
		$return_acl_fill = create_function('$value', 'return ' . $acl_fill . ';');

		// Actually fill the gaps
		if (sizeof($hold_ary))
		{
			foreach ($hold_ary as $ug_id => $row)
			{
				foreach ($row as $id => $options)
				{
					// Do not include the global auth_option
					unset($options[$auth_option]);

					// Not a "fine" solution, but at all it's a 1-dimensional 
					// array_diff_key function filling the resulting array values with zeros
					// The differences get merged into $hold_ary (all permissions having $acl_fill set)
					$hold_ary[$ug_id][$id] = array_merge($options, 

						array_map($return_acl_fill,
							array_flip(
								array_diff(
									array_keys($compare_options), array_keys($options)
								)
							)
						)
					);
				}
			}
		}
		else
		{
			$hold_ary[($group_id !== false) ? $group_id : $user_id][(int) $forum_id] = $compare_options;
		}

		return $hold_ary;
	}

	/**
	* Get permission mask for roles
	* This function only supports getting masks for one role
	*/
	function get_role_mask($role_id)
	{
		global $db;

		$hold_ary = array();

		// Get users having this role set...
		$sql = 'SELECT user_id, forum_id
			FROM ' . ACL_USERS_TABLE . '
			WHERE auth_role_id = ' . $role_id . '
			ORDER BY forum_id';
		$result = $db->sql_query($sql);

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

		// Now grab groups... 
		$sql = 'SELECT group_id, forum_id
			FROM ' . ACL_GROUPS_TABLE . '
			WHERE auth_role_id = ' . $role_id . '
			ORDER BY forum_id';
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$hold_ary[$row['forum_id']]['groups'][] = $row['group_id'];
		}
		$db->sql_freeresult($result);		

		return $hold_ary;
	}

	/**
	* Display permission mask (assign to template)
	*/
	function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
	{
		global $template, $user, $db, $phpbb_root_path, $phpEx;

		// Define names for template loops, might be able to be set
		$tpl_pmask = 'p_mask';
		$tpl_fmask = 'f_mask';
		$tpl_category = 'category';
		$tpl_mask = 'mask';

		$l_acl_type = (isset($user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)])) ? $user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)] : 'ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type);

		// Allow trace for viewing permissions and in user mode
		$show_trace = ($mode == 'view' && $user_mode == 'user') ? true : false;

		// Get names
		if ($user_mode == 'user')
		{
			$sql = 'SELECT user_id as ug_id, username as ug_name
				FROM ' . USERS_TABLE . '
				WHERE ' . $db->sql_in_set('user_id', array_keys($hold_ary)) . '
				ORDER BY username_clean ASC';
		}
		else
		{
			$sql = 'SELECT group_id as ug_id, group_name as ug_name, group_type
				FROM ' . GROUPS_TABLE . '
				WHERE ' . $db->sql_in_set('group_id', array_keys($hold_ary)) . '
				ORDER BY group_type DESC, group_name ASC';
		}
		$result = $db->sql_query($sql);

		$ug_names_ary = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['ug_name']] : $row['ug_name']);
		}
		$db->sql_freeresult($result);

		// Get used forums
		$forum_ids = array();
		foreach ($hold_ary as $ug_id => $row)
		{
			$forum_ids = array_merge($forum_ids, array_keys($row));
		}
		$forum_ids = array_unique($forum_ids);

		$forum_names_ary = array();
		if ($local)
		{
			$forum_names_ary = make_forum_select(false, false, true, false, false, false, true);

			// Remove the disabled ones, since we do not create an option field here...
			foreach ($forum_names_ary as $key => $value)
			{
				if (!$value['disabled'])
				{
					continue;
				}
				unset($forum_names_ary[$key]);
			}
		}
		else
		{
			$forum_names_ary[0] = $l_acl_type;
		}

		// Get available roles
		$sql = 'SELECT *
			FROM ' . ACL_ROLES_TABLE . "
			WHERE role_type = '" . $db->sql_escape($permission_type) . "'
			ORDER BY role_order ASC";
		$result = $db->sql_query($sql);

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

		$cur_roles = $this->acl_role_data($user_mode, $permission_type, array_keys($hold_ary));

		// Build js roles array (role data assignments)
		$s_role_js_array = '';
		
		if (sizeof($roles))
		{
			$s_role_js_array = array();

			// Make sure every role (even if empty) has its array defined
			foreach ($roles as $_role_id => $null)
			{
				$s_role_js_array[$_role_id] = "\n" . 'role_options[' . $_role_id . '] = new Array();' . "\n";
			}

			$sql = 'SELECT r.role_id, o.auth_option, r.auth_setting
				FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o
				WHERE o.auth_option_id = r.auth_option_id
					AND ' . $db->sql_in_set('r.role_id', array_keys($roles));
			$result = $db->sql_query($sql);

			while ($row = $db->sql_fetchrow($result))
			{
				$flag = substr($row['auth_option'], 0, strpos($row['auth_option'], '_') + 1);
				if ($flag == $row['auth_option'])
				{
					continue;
				}

				$s_role_js_array[$row['role_id']] .= 'role_options[' . $row['role_id'] . '][\'' . $row['auth_option'] . '\'] = ' . $row['auth_setting'] . '; ';
			}
			$db->sql_freeresult($result);

			$s_role_js_array = implode('', $s_role_js_array);
		}

		$template->assign_var('S_ROLE_JS_ARRAY', $s_role_js_array);
		unset($s_role_js_array);

		// Now obtain memberships
		$user_groups_default = $user_groups_custom = array();
		if ($user_mode == 'user' && $group_display)
		{
			$sql = 'SELECT group_id, group_name, group_type
				FROM ' . GROUPS_TABLE . '
				ORDER BY group_type DESC, group_name ASC';
			$result = $db->sql_query($sql);

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

			$memberships = group_memberships(false, array_keys($hold_ary), false);

			// User is not a member of any group? Bad admin, bad bad admin...
			if ($memberships)
			{
				foreach ($memberships as $row)
				{
					if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL)
					{
						$user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']];
					}
					else
					{
						$user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name'];
					}
				}
			}
			unset($memberships, $groups);
		}

		// If we only have one forum id to display or being in local mode and more than one user/group to display, 
		// we switch the complete interface to group by user/usergroup instead of grouping by forum
		// To achive this, we need to switch the array a bit
		if (sizeof($forum_ids) == 1 || ($local && sizeof($ug_names_ary) > 1))
		{
			$hold_ary_temp = $hold_ary;
			$hold_ary = array();
			foreach ($hold_ary_temp as $ug_id => $row)
			{
				foreach ($row as $forum_id => $auth_row)
				{
					$hold_ary[$forum_id][$ug_id] = $auth_row;
				}
			}
			unset($hold_ary_temp);

			foreach ($hold_ary as $forum_id => $forum_array)
			{
				$content_array = $categories = array();
				$this->build_permission_array($hold_ary[$forum_id], $content_array, $categories, array_keys($ug_names_ary));

				$template->assign_block_vars($tpl_pmask, array(
					'NAME'			=> ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
					'CATEGORIES'	=> implode('</th><th>', $categories),

					'L_ACL_TYPE'	=> $l_acl_type,

					'S_LOCAL'		=> ($local) ? true : false,
					'S_GLOBAL'		=> (!$local) ? true : false,
					'S_NUM_CATS'	=> sizeof($categories),
					'S_VIEW'		=> ($mode == 'view') ? true : false,
					'S_NUM_OBJECTS'	=> sizeof($content_array),
					'S_USER_MODE'	=> ($user_mode == 'user') ? true : false,
					'S_GROUP_MODE'	=> ($user_mode == 'group') ? true : false)
				);

				foreach ($content_array as $ug_id => $ug_array)
				{
					// Build role dropdown options
					$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;

					$s_role_options = '';
					foreach ($roles as $role_id => $role_row)
					{
						$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
						$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];

						$title = ($role_description) ? ' title="' . $role_description . '"' : '';
						$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';
					}

					if ($s_role_options)
					{
						$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;
					}

					$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
						'NAME'				=> $ug_names_ary[$ug_id],
						'S_ROLE_OPTIONS'	=> $s_role_options,
						'UG_ID'				=> $ug_id,
						'FORUM_ID'			=> $forum_id)
					);

					$this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));

					unset($content_array[$ug_id]);
				}

				unset($hold_ary[$forum_id]);
			}
		}
		else
		{
			foreach ($ug_names_ary as $ug_id => $ug_name)
			{
				if (!isset($hold_ary[$ug_id]))
				{
					continue;
				}

				$content_array = $categories = array();
				$this->build_permission_array($hold_ary[$ug_id], $content_array, $categories, array_keys($forum_names_ary));

				$template->assign_block_vars($tpl_pmask, array(
					'NAME'			=> $ug_name,
					'CATEGORIES'	=> implode('</th><th>', $categories),

					'USER_GROUPS_DEFAULT'	=> ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '',
					'USER_GROUPS_CUSTOM'	=> ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '',
					'L_ACL_TYPE'			=> $l_acl_type,

					'S_LOCAL'		=> ($local) ? true : false,
					'S_GLOBAL'		=> (!$local) ? true : false,
					'S_NUM_CATS'	=> sizeof($categories),
					'S_VIEW'		=> ($mode == 'view') ? true : false,
					'S_NUM_OBJECTS'	=> sizeof($content_array),
					'S_USER_MODE'	=> ($user_mode == 'user') ? true : false,
					'S_GROUP_MODE'	=> ($user_mode == 'group') ? true : false)
				);

				@reset($content_array);
				while (list($forum_id, $forum_array) = each($content_array))
				{
					// Build role dropdown options
					$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;

					$s_role_options = '';

					@reset($roles);
					while (list($role_id, $role_row) = each($roles))
					{
						$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
						$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];

						$title = ($role_description) ? ' title="' . $role_description . '"' : '';
						$s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';
					}

					if ($s_role_options)
					{
						$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;
					}

					if (!$forum_id)
					{
						$folder_image = '';
					}
					else
					{
						if ($forum_names_ary[$forum_id]['forum_status'] == ITEM_LOCKED)
						{
							$folder_image = '<img src="images/icon_folder_lock_small.gif" width="19" height="18" alt="' . $user->lang['FORUM_LOCKED'] . '" />';
						}
						else
						{
							switch ($forum_names_ary[$forum_id]['forum_type'])
							{
								case FORUM_LINK:
									$folder_image = '<img src="images/icon_folder_link_small.gif" width="22" height="18" alt="' . $user->lang['FORUM_LINK'] . '" />';
								break;

								default:
									$folder_image = ($forum_names_ary[$forum_id]['left_id'] + 1 != $forum_names_ary[$forum_id]['right_id']) ? '<img src="images/icon_folder_sub_small.gif" width="22" height="18" alt="' . $user->lang['SUBFORUM'] . '" />' : '<img src="images/icon_folder_small.gif" width="19" height="18" alt="' . $user->lang['FOLDER'] . '" />';
								break;
							}
						}
					}

					$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
						'NAME'				=> ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
						'PADDING'			=> ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'],
						'FOLDER_IMAGE'		=> $folder_image,
						'S_ROLE_OPTIONS'	=> $s_role_options,
						'UG_ID'				=> $ug_id,
						'FORUM_ID'			=> $forum_id)
					);

					$this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
				}

				unset($hold_ary[$ug_id], $ug_names_ary[$ug_id]);
			}
		}
	}

	/**
	* Display permission mask for roles
	*/
	function display_role_mask(&$hold_ary)
	{
		global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;

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

		// Get forum names
		$sql = 'SELECT forum_id, forum_name
			FROM ' . FORUMS_TABLE . '
			WHERE ' . $db->sql_in_set('forum_id', array_keys($hold_ary));
		$result = $db->sql_query($sql);

		$forum_names = array();
		while ($row = $db->sql_fetchrow($result))
		{
			$forum_names[$row['forum_id']] = $row['forum_name'];
		}
		$db->sql_freeresult($result);

		foreach ($hold_ary as $forum_id => $auth_ary)
		{
			$template->assign_block_vars('role_mask', array(
				'NAME'				=> ($forum_id == 0) ? $user->lang['GLOBAL_MASK'] : $forum_names[$forum_id],
				'FORUM_ID'			=> $forum_id)
			);

			if (isset($auth_ary['users']) && sizeof($auth_ary['users']))
			{
				$sql = 'SELECT user_id, username
					FROM ' . USERS_TABLE . '
					WHERE ' . $db->sql_in_set('user_id', $auth_ary['users']) . '
					ORDER BY username_clean ASC';
				$result = $db->sql_query($sql);

				while ($row = $db->sql_fetchrow($result))
				{
					$template->assign_block_vars('role_mask.users', array(
						'USER_ID'		=> $row['user_id'],
						'USERNAME'		=> $row['username'],
						'U_PROFILE'		=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u={$row['user_id']}"))
					);
				}
				$db->sql_freeresult($result);
			}

			if (isset($auth_ary['groups']) && sizeof($auth_ary['groups']))
			{
				$sql = 'SELECT group_id, group_name, group_type
					FROM ' . GROUPS_TABLE . '
					WHERE ' . $db->sql_in_set('group_id', $auth_ary['groups']) . '
					ORDER BY group_type ASC, group_name';
				$result = $db->sql_query($sql);

				while ($row = $db->sql_fetchrow($result))
				{
					$template->assign_block_vars('role_mask.groups', array(
						'GROUP_ID'		=> $row['group_id'],
						'GROUP_NAME'	=> ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
						'U_PROFILE'		=> append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&amp;g={$row['group_id']}"))
					);
				}
				$db->sql_freeresult($result);
			}
		}
	}

	/**
	* NOTE: this function is not in use atm
	* Add a new option to the list ... $options is a hash of form ->
	* $options = array(
	*	'local'		=> array('option1', 'option2', ...),
	*	'global'	=> array('optionA', 'optionB', ...)
	* );
	*/
	function acl_add_option($options)
	{
		global $db, $cache;

		if (!is_array($options))
		{
			return false;
		}

		$cur_options = array();

		$sql = 'SELECT auth_option, is_global, is_local
			FROM ' . ACL_OPTIONS_TABLE . '
			ORDER BY auth_option_id';
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			if ($row['is_global'])
			{
				$cur_options['global'][] = $row['auth_option'];
			}

			if ($row['is_local'])
			{
				$cur_options['local'][] = $row['auth_option'];
			}
		}
		$db->sql_freeresult($result);

		// Here we need to insert new options ... this requires discovering whether
		// an options is global, local or both and whether we need to add an permission
		// set flag (x_)
		$new_options = array('local' => array(), 'global' => array());

		foreach ($options as $type => $option_ary)
		{
			$option_ary = array_unique($option_ary);

			foreach ($option_ary as $option_value)
			{
				if (!in_array($option_value, $cur_options[$type]))
				{
					$new_options[$type][] = $option_value;
				}

				$flag = substr($option_value, 0, strpos($option_value, '_') + 1);

				if (!in_array($flag, $cur_options[$type]) && !in_array($flag, $new_options[$type]))
				{
					$new_options[$type][] = $flag;
				}
			}
		}
		unset($options);

		$options = array();
		$options['local'] = array_diff($new_options['local'], $new_options['global']);
		$options['global'] = array_diff($new_options['global'], $new_options['local']);
		$options['local_global'] = array_intersect($new_options['local'], $new_options['global']);

		$sql_ary = array();

		foreach ($options as $type => $option_ary)
		{
			foreach ($option_ary as $option)
			{
				$sql_ary[] = array(
					'auth_option'	=> $option,
					'is_global'		=> ($type == 'global' || $type == 'local_global') ? 1 : 0,
					'is_local'		=> ($type == 'local' || $type == 'local_global') ? 1 : 0
				);
			}
		}

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

		$cache->destroy('acl_options');
		$this->acl_clear_prefetch();

		return true;
	}

	/**
	* Set a user or group ACL record
	*/
	function acl_set($ug_type, $forum_id, $ug_id, $auth, $role_id = 0, $clear_prefetch = true)
	{
		global $db;

		// One or more forums
		if (!is_array($forum_id))
		{
			$forum_id = array($forum_id);
		}

		// One or more users
		if (!is_array($ug_id))
		{
			$ug_id = array($ug_id);
		}

		$ug_id_sql = $db->sql_in_set($ug_type . '_id', array_map('intval', $ug_id));
		$forum_sql = $db->sql_in_set('forum_id', array_map('intval', $forum_id));

		// Instead of updating, inserting, removing we just remove all current settings and re-set everything...
		$table = ($ug_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE;
		$id_field = $ug_type . '_id';

		// Get any flags as required
		reset($auth);
		$flag = key($auth);
		$flag = substr($flag, 0, strpos($flag, '_') + 1);
		
		// This ID (the any-flag) is set if one or more permissions are true...
		$any_option_id = (int) $this->option_ids[$flag];

		// Remove any-flag from auth ary
		if (isset($auth[$flag]))
		{
			unset($auth[$flag]);
		}

		// Remove current auth options...
		$auth_option_ids = array();
		foreach ($auth as $auth_option => $auth_setting)
		{
			$auth_option_ids[] = (int) $this->option_ids[$auth_option];
		}

		$sql = "DELETE FROM $table
			WHERE $forum_sql
				AND $ug_id_sql
				AND auth_option_id IN ($any_option_id, " . implode(', ', $auth_option_ids) . ')';
		$db->sql_query($sql);

		// Remove those having a role assigned... the correct type of course...
		$sql = 'SELECT role_id
			FROM ' . ACL_ROLES_TABLE . "
			WHERE role_type = '" . $db->sql_escape($flag) . "'";
		$result = $db->sql_query($sql);

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

		if (sizeof($role_ids))
		{
			$sql = "DELETE FROM $table
				WHERE $forum_sql
					AND $ug_id_sql
					AND auth_option_id = 0
					AND " . $db->sql_in_set('auth_role_id', $role_ids);
			$db->sql_query($sql);
		}

		// Ok, include the any-flag if one or more auth options are set to yes...
		foreach ($auth as $auth_option => $setting)
		{
			if ($setting == ACL_YES && (!isset($auth[$flag]) || $auth[$flag] == ACL_NEVER))
			{
				$auth[$flag] = ACL_YES;
			}
		}

		$sql_ary = array();
		foreach ($forum_id as $forum)
		{
			$forum = (int) $forum;

			if ($role_id)
			{
				foreach ($ug_id as $id)
				{
					$sql_ary[] = array(
						$id_field			=> (int) $id,
						'forum_id'			=> (int) $forum,
						'auth_option_id'	=> 0,
						'auth_setting'		=> 0,
						'auth_role_id'		=> $role_id
					);
				}
			}
			else
			{
				foreach ($auth as $auth_option => $setting)
				{
					$auth_option_id = (int) $this->option_ids[$auth_option];

					if ($setting != ACL_NO)
					{
						foreach ($ug_id as $id)
						{
							$sql_ary[] = array(
								$id_field			=> (int) $id,
								'forum_id'			=> (int) $forum,
								'auth_option_id'	=> (int) $auth_option_id,
								'auth_setting'		=> (int) $setting
							);
						}
					}
				}
			}
		}

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

		if ($clear_prefetch)
		{
			$this->acl_clear_prefetch();
		}
	}

	/**
	* Set a role-specific ACL record
	*/
	function acl_set_role($role_id, $auth)
	{
		global $db;

		// Get any-flag as required
		reset($auth);
		$flag = key($auth);
		$flag = substr($flag, 0, strpos($flag, '_') + 1);
		
		// Remove any-flag from auth ary
		if (isset($auth[$flag]))
		{
			unset($auth[$flag]);
		}

		// Re-set any flag...
		foreach ($auth as $auth_option => $setting)
		{
			if ($setting == ACL_YES && (!isset($auth[$flag]) || $auth[$flag] == ACL_NEVER))
			{
				$auth[$flag] = ACL_YES;
			}
		}

		$sql_ary = array();
		foreach ($auth as $auth_option => $setting)
		{
			$auth_option_id = (int) $this->option_ids[$auth_option];

			if ($setting != ACL_NO)
			{
				$sql_ary[] = array(
					'role_id'			=> (int) $role_id,
					'auth_option_id'	=> (int) $auth_option_id,
					'auth_setting'		=> (int) $setting
				);
			}
		}

		// If no data is there, we set the any-flag to ACL_NEVER...
		if (!sizeof($sql_ary))
		{
			$sql_ary[] = array(
				'role_id'			=> (int) $role_id,
				'auth_option_id'	=> $this->option_ids[$flag],
				'auth_setting'		=> ACL_NEVER
			);
		}

		// Remove current auth options...
		$sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
			WHERE role_id = ' . $role_id;
		$db->sql_query($sql);

		// Now insert the new values
		$db->sql_multi_insert(ACL_ROLES_DATA_TABLE, $sql_ary);

		$this->acl_clear_prefetch();
	}

	/**
	* Remove local permission
	*/
	function acl_delete($mode, $ug_id = false, $forum_id = false, $permission_type = false)
	{
		global $db;

		if ($ug_id === false && $forum_id === false)
		{
			return;
		}

		$option_id_ary = array();
		$table = ($mode == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE;
		$id_field = $mode . '_id';

		$where_sql = array();

		if ($forum_id !== false)
		{
			$where_sql[] = (!is_array($forum_id)) ? 'forum_id = ' . (int) $forum_id : $db->sql_in_set('forum_id', array_map('intval', $forum_id));
		}

		if ($ug_id !== false)
		{
			$where_sql[] = (!is_array($ug_id)) ? $id_field . ' = ' . (int) $ug_id : $db->sql_in_set($id_field, array_map('intval', $ug_id));
		}

		// There seem to be auth options involved, therefore we need to go through the list and make sure we capture roles correctly
		if ($permission_type !== false)
		{
			// Get permission type
			$sql = 'SELECT auth_option, auth_option_id
				FROM ' . ACL_OPTIONS_TABLE . "
				WHERE auth_option LIKE '" . $db->sql_escape(str_replace('_', "\_", $permission_type)) . "%'";
			$sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';

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

			$auth_id_ary = array();
			while ($row = $db->sql_fetchrow($result))
			{
				$option_id_ary[] = $row['auth_option_id'];
				$auth_id_ary[$row['auth_option']] = ACL_NO;
			}
			$db->sql_freeresult($result);

			// First of all, lets grab the items having roles with the specified auth options assigned
			$sql = "SELECT auth_role_id, $id_field, forum_id
				FROM $table, " . ACL_ROLES_TABLE . " r
				WHERE auth_role_id <> 0
					AND auth_role_id = r.role_id
					AND r.role_type = '{$permission_type}'
					AND " . implode(' AND ', $where_sql) . '
				ORDER BY auth_role_id';
			$result = $db->sql_query($sql);

			$cur_role_auth = array();
			while ($row = $db->sql_fetchrow($result))
			{
				$cur_role_auth[$row['auth_role_id']][$row['forum_id']][] = $row[$id_field];
			}
			$db->sql_freeresult($result);

			// Get role data for resetting data
			if (sizeof($cur_role_auth))
			{
				$sql = 'SELECT ao.auth_option, rd.role_id, rd.auth_setting
					FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_ROLES_DATA_TABLE . ' rd
					WHERE ao.auth_option_id = rd.auth_option_id
						AND ' . $db->sql_in_set('rd.role_id', array_keys($cur_role_auth));
				$result = $db->sql_query($sql);

				$auth_settings = array();
				while ($row = $db->sql_fetchrow($result))
				{
					// We need to fill all auth_options, else setting it will fail...
					if (!isset($auth_settings[$row['role_id']]))
					{
						$auth_settings[$row['role_id']] = $auth_id_ary;
					}
					$auth_settings[$row['role_id']][$row['auth_option']] = $row['auth_setting'];
				}
				$db->sql_freeresult($result);

				// Set the options
				foreach ($cur_role_auth as $role_id => $auth_row)
				{
					foreach ($auth_row as $f_id => $ug_row)
					{
						$this->acl_set($mode, $f_id, $ug_row, $auth_settings[$role_id], 0, false);
					}
				}
			}
		}

		// Now, normally remove permissions...
		if ($permission_type !== false)
		{
			$where_sql[] = $db->sql_in_set('auth_option_id', array_map('intval', $option_id_ary));
		}
		
		$sql = "DELETE FROM $table
			WHERE " . implode(' AND ', $where_sql);
		$db->sql_query($sql);

		$this->acl_clear_prefetch();
	}

	/**
	* Assign category to template
	* used by display_mask()
	*/
	function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
	{
		global $template, $user, $phpbb_admin_path, $phpEx;

		@reset($category_array);
		while (list($cat, $cat_array) = each($category_array))
		{
			$template->assign_block_vars($tpl_cat, array(
				'S_YES'		=> ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
				'S_NEVER'	=> ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
				'S_NO'		=> ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false,
							
				'CAT_NAME'	=> $user->lang['permission_cat'][$cat])
			);

			// Sort array
			$key_array = array_intersect(array_keys($user->lang), array_map(create_function('$a', 'return "acl_" . $a;'), array_keys($cat_array['permissions'])));
			$values_array = $cat_array['permissions'];

			$cat_array['permissions'] = array();

			foreach ($key_array as $key)
			{
				$key = str_replace('acl_', '', $key);
				$cat_array['permissions'][$key] = $values_array[$key];
			}
			unset($key_array, $values_array);

			@reset($cat_array['permissions']);
			while (list($permission, $allowed) = each($cat_array['permissions']))
			{
				if ($s_view)
				{
					$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
						'S_YES'		=> ($allowed == ACL_YES) ? true : false,
						'S_NEVER'	=> ($allowed == ACL_NEVER) ? true : false,

						'UG_ID'			=> $ug_id,
						'FORUM_ID'		=> $forum_id,
						'FIELD_NAME'	=> $permission,
						'S_FIELD_NAME'	=> 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',

						'U_TRACE'		=> ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
						'UA_TRACE'		=> ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',

						'PERMISSION'	=> $user->lang['acl_' . $permission]['lang'])
					);
				}
				else
				{
					$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
						'S_YES'		=> ($allowed == ACL_YES) ? true : false,
						'S_NEVER'	=> ($allowed == ACL_NEVER) ? true : false,
						'S_NO'		=> ($allowed == ACL_NO) ? true : false,

						'UG_ID'			=> $ug_id,
						'FORUM_ID'		=> $forum_id,
						'FIELD_NAME'	=> $permission,
						'S_FIELD_NAME'	=> 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',

						'U_TRACE'		=> ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
						'UA_TRACE'		=> ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',

						'PERMISSION'	=> $user->lang['acl_' . $permission]['lang'])
					);
				}
			}
		}
	}

	/**
	* Building content array from permission rows with explicit key ordering
	* used by display_mask()
	*/
	function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
	{
		global $user;

		foreach ($key_sort_array as $forum_id)
		{
			if (!isset($permission_row[$forum_id]))
			{
				continue;
			}

			$permissions = $permission_row[$forum_id];
			ksort($permissions);

			@reset($permissions);
			while (list($permission, $auth_setting) = each($permissions))
			{
				if (!isset($user->lang['acl_' . $permission]))
				{
					$user->lang['acl_' . $permission] = array(
						'cat'	=> 'misc',
						'lang'	=> '{ acl_' . $permission . ' }'
					);
				}
			
				$cat = $user->lang['acl_' . $permission]['cat'];
			
				// Build our categories array
				if (!isset($categories[$cat]))
				{
					$categories[$cat] = $user->lang['permission_cat'][$cat];
				}

				// Build our content array
				if (!isset($content_array[$forum_id]))
				{
					$content_array[$forum_id] = array();
				}

				if (!isset($content_array[$forum_id][$cat]))
				{
					$content_array[$forum_id][$cat] = array(
						'S_YES'			=> false,
						'S_NEVER'		=> false,
						'S_NO'			=> false,
						'permissions'	=> array(),
					);
				}

				$content_array[$forum_id][$cat]['S_YES'] |= ($auth_setting == ACL_YES) ? true : false;
				$content_array[$forum_id][$cat]['S_NEVER'] |= ($auth_setting == ACL_NEVER) ? true : false;
				$content_array[$forum_id][$cat]['S_NO'] |= ($auth_setting == ACL_NO) ? true : false;

				$content_array[$forum_id][$cat]['permissions'][$permission] = $auth_setting;
			}
		}
	}

	/**
	* Use permissions from another user. This transferes a permission set from one user to another.
	* The other user is always able to revert back to his permission set.
	* This function does not check for lower/higher permissions, it is possible for the user to gain 
	* "more" permissions by this.
	* Admin permissions will not be copied.
	*/
	function ghost_permissions($from_user_id, $to_user_id)
	{
		global $db;

		if ($to_user_id == ANONYMOUS)
		{
			return false;
		}

		$hold_ary = $this->acl_raw_data($from_user_id, false, false);

		if (isset($hold_ary[$from_user_id]))
		{
			$hold_ary = $hold_ary[$from_user_id];
		}
		
		// Key 0 in $hold_ary are global options, all others are forum_ids

		// We disallow copying admin permissions
		foreach ($this->acl_options['global'] as $opt => $id)
		{
			if (strpos($opt, 'a_') === 0)
			{
				$hold_ary[0][$opt] = ACL_NEVER;
			}
		}

		// Force a_switchperm to be allowed
		$hold_ary[0]['a_switchperm'] = ACL_YES;

		$user_permissions = $this->build_bitstring($hold_ary);

		if (!$user_permissions)
		{
			return false;
		}

		$sql = 'UPDATE ' . USERS_TABLE . "
			SET user_permissions = '" . $db->sql_escape($user_permissions) . "',
				user_perm_from = $from_user_id
			WHERE user_id = " . $to_user_id;
		$db->sql_query($sql);

		return true;
	}
}

?>
str">"higher if the machine is to contain crucial data, or if it's to be directly\n" "exposed to the Internet. The trade-off that a higher security level is\n" "generally obtained at the expense of ease of use.\n" "\n" "If you do not know what to choose, keep the default option. You'll be able\n" "to change it later with the draksec tool, which is part of Mandriva Linux\n" "Control Center.\n" "\n" "Fill the \"%s\" field with the e-mail address of the person responsible for\n" "security. Security messages will be sent to that address." msgstr "" "På dette punktet vil DrakX la deg velge sikkerhetsnivået som er ønsket for\n" "maskinen. Som en tommelfingerregel bør sikkerhetsnivået settes høyere,\n" "hvis maskinen skal ha viktige data lagret der, eller hvis den skal være\n" "direkte tilgjengelig på internettet. Men, et høyere sikkerhetsnivå går \n" "gjerne på bekostning av brukervennligheten.\n" "\n" "Hvis du ikke vet hva du skal velge, behold standardvalget. Du vil kunne\n" "endre sikkerhetsnivået senere med verktøyet draksec fra Mandriva Linux\n" "Kontrollsenter.\n" "\n" "'%s'-feltet kan informere systemet om den bruker på systemet som\n" "vil være ansvarlig for sikkerheten. Sikkerhetsbeskjeder vil bli sendt til\n" "denne adressen." #: ../help.pm:461 #, c-format msgid "Security Administrator" msgstr "Sikkerhetsadministrator" #: ../help.pm:464 #, c-format msgid "" "At this point, you need to choose which partition(s) will be used for the\n" "installation of your Mandriva Linux system. If partitions have already been\n" "defined, either from a previous installation of GNU/Linux or by another\n" "partitioning tool, you can use existing partitions. Otherwise, hard drive\n" "partitions must be defined.\n" "\n" "To create partitions, you must first select a hard drive. You can select\n" "the disk for partitioning by clicking on ``hda'' for the first IDE drive,\n" "``hdb'' for the second, ``sda'' for the first SCSI drive and so on.\n" "\n" "To partition the selected hard drive, you can use these options:\n" "\n" " * \"%s\": this option deletes all partitions on the selected hard drive\n" "\n" " * \"%s\": this option enables you to automatically create ext3 and swap\n" "partitions in the free space of your hard drive\n" "\n" "\"%s\": gives access to additional features:\n" "\n" " * \"%s\": saves the partition table to a floppy. Useful for later\n" "partition-table recovery if necessary. It is strongly recommended that you\n" "perform this step.\n" "\n" " * \"%s\": allows you to restore a previously saved partition table from a\n" "floppy disk.\n" "\n" " * \"%s\": if your partition table is damaged, you can try to recover it\n" "using this option. Please be careful and remember that it does not always\n" "work.\n" "\n" " * \"%s\": discards all changes and reloads the partition table that was\n" "originally on the hard drive.\n" "\n" " * \"%s\": un-checking this option will force users to manually mount and\n" "unmount removable media such as floppies and CD-ROMs.\n" "\n" " * \"%s\": use this option if you wish to use a wizard to partition your\n" "hard drive. This is recommended if you do not have a good understanding of\n" "partitioning.\n" "\n" " * \"%s\": use this option to cancel your changes.\n" "\n" " * \"%s\": allows additional actions on partitions (type, options, format)\n" "and gives more information about the hard drive.\n" "\n" " * \"%s\": when you are finished partitioning your hard drive, this will\n" "save your changes back to disk.\n" "\n" "When defining the size of a partition, you can finely set the partition\n" "size by using the Arrow keys of your keyboard.\n" "\n" "Note: you can reach any option using the keyboard. Navigate through the\n" "partitions using [Tab] and the [Up/Down] arrows.\n" "\n" "When a partition is selected, you can use:\n" "\n" " * Ctrl-c to create a new partition (when an empty partition is selected)\n" "\n" " * Ctrl-d to delete a partition\n" "\n" " * Ctrl-m to set the mount point\n" "\n" "To get information about the different file system types available, please\n" "read the ext2FS chapter from the ``Reference Manual''.\n" "\n" "If you are installing on a PPC machine, you will want to create a small HFS\n" "``bootstrap'' partition of at least 1MB which will be used by the yaboot\n" "bootloader. If you opt to make the partition a bit larger, say 50MB, you\n" "may find it a useful place to store a spare kernel and ramdisk images for\n" "emergency boot situations." msgstr "" "På dette punktet må du velge hvilke partisjon(er) som skal brukes til å\n" "installere ditt nye Mandriva Linux-system på. Hvis partisjoner allerede har\n" "blitt definert enten fra en tidligere installasjon av GNU/Linux eller fra et " "annet\n" "partisjoneringsverktøy, kan du bruke eksisterende partisjoner. I andre\n" "tilfeller må harddiskpartisjoner defineres.\n" "\n" "For å opprette partisjoner må du først velge en harddisk. Du kan velge disk\n" "for partisjonering ved å klikke på ``hda'' for den første IDE-disken,\n" "``hdb'' for den andre eller ``sda'' for den første SCSI-disken osv.\n" "\n" "For å partisjonere den valgte harddisken kan du bruke disse valgene:\n" "\n" " * \"%s\": dette valget sletter alle partisjoner tilgjengelig på den valgte " "harddisken.\n" "\n" " * \"%s\": dette valget lar deg automatisk opprette ext3 og\n" "swappartisjoner på din harddisk's ledige plass.\n" "\n" "\"%s\": gir deg tilgang til ekstra finesser:\n" "\n" " * \"%s\":lagrer partisjonstabellen din på en diskett. Nyttig hvis " "partisjonen\n" "trengs å gjenopprettes senere. Det anbefales på det sterkeste at du utfører " "dette trinn.\n" "\n" " * \"%s\": gir deg muligheten til å gjenopprette en tidligere lagret " "partisjonstabell\n" "fra en diskett.\n" "\n" " * \"%s\": hvis partisjonstabellen din er skadet kan du forsøke å redde den " "ved å\n" "bruke dette valget. Vær forsiktig og husk at det kan gå galt.\n" "\n" " * \"%s\": ignorerer alle forandringer og laster inn harddiskens " "opprinnelige\n" "partisjonstabell på nytt.\n" "\n" " * \"%s\": ved å sjekke vekk dette valget, så vil brukere bli nødt til å " "manuelt montere\n" "og avmontere flyttbare medium som disketter og CDer.\n" "\n" " * \"%s\": bruk dette valget om du vil bruke en veiviser for å partisjonere\n" "harddisken din. Dette er anbefalt om du ikke har gode nok kunnskaper om\n" "partisjonering.\n" "\n" " * \"%s\": du kan bruke dette valget til å forkaste endringene dine.\n" "\n" " * \"%s\": gir deg ekstra valg under partisjoneringen (type, instillinger, " "format)\n" "og gir deg mere informasjon om harddisken.\n" "\n" " * \"%s\": når du er ferdig med å partisjonere harddisken din, så bruk dette " "valget\n" "for å lagre endringene dine på disken.\n" "\n" "Når du definerer størrelsen på en partisjon, så kan du finjustere størrelsen " "med\n" "piltastene på tastaturet ditt.\n" "\n" "Merk: du kan nå valgene ved å bruke tastaturet. . Naviger gjennom " "partisjonene ved å bruke [Tab] og [Opp/Ned]-piltastene.\n" "\n" "Når en partisjon er valgt kan du bruke:\n" "\n" " * Ctrl-c for å opprette en ny partisjon (når en tom partisjon er valgt).\n" "\n" " * Ctrl-d for å slette en partisjon.\n" "\n" " * Ctrl-m for å sette monteringspunktet.\n" "\n" "For å få informasjon om de forskjellige filsystemene som er tilgjengelige,\n" "vennlist les ext2FS-kapittelet fra ``Reference Manual''.\n" "\n" "Hvis du installerer på en PPC-maskin, så vil du nok lage en liten\n" "HFS-'bootstrap-partisjon' på minst en megabyte for bruk av\n" "yaboot-oppstartslasteren. Hvis du ønsker å lage partisjonen litt større,\n" "la oss si 50 MB, så kan du lagre en ekstra kjerne og ramdiskbilde for " "nødsituasjoner." #: ../help.pm:533 #, c-format msgid "Removable media auto-mounting" msgstr "Automontering av fjernbart media" #: ../help.pm:533 #, c-format msgid "Toggle between normal/expert mode" msgstr "Skift mellom normal-/ekspert-modus" #: ../help.pm:536 #, c-format msgid "" "More than one Microsoft partition has been detected on your hard drive.\n" "Please choose the one which you want to resize in order to install your new\n" "Mandriva Linux operating system.\n" "\n" "Each partition is listed as follows: \"Linux name\", \"Windows name\"\n" "\"Capacity\".\n" "\n" "\"Linux name\" is structured: \"hard drive type\", \"hard drive number\",\n" "\"partition number\" (for example, \"hda1\").\n" "\n" "\"Hard drive type\" is \"hd\" if your hard dive is an IDE hard drive and\n" "\"sd\" if it is a SCSI hard drive.\n" "\n" "\"Hard drive number\" is always a letter after \"hd\" or \"sd\". With IDE\n" "hard drives:\n" "\n" " * \"a\" means \"master hard drive on the primary IDE controller\";\n" "\n" " * \"b\" means \"slave hard drive on the primary IDE controller\";\n" "\n" " * \"c\" means \"master hard drive on the secondary IDE controller\";\n" "\n" " * \"d\" means \"slave hard drive on the secondary IDE controller\".\n" "\n" "With SCSI hard drives, an \"a\" means \"lowest SCSI ID\", a \"b\" means\n" "\"second lowest SCSI ID\", etc.\n" "\n" "\"Windows name\" is the letter of your hard drive under Windows (the first\n" "disk or partition is called \"C:\")." msgstr "" "Mer enn en Microsoft Windows-partisjon har blitt oppdaget på harddisken " "din.\n" "Velg den du ønsker å endre størrelsen på for å installere ditt nye\n" "Mandriva Linux-operativsystem.\n" "\n" "Hver partisjon er listet som følger: \"Linux-navn\",\n" " \"Windows-navn\", \"Kapasitet\".\n" "\n" "\"Linux-navn\" er kodet som følger: \"harddisktype\", \"harddisknummer\",\n" "\"partisjonsnummer\" (f.eks., \"hda1\").\n" "\n" "\"Harddisktype\" er \"hd\" hvis harddisken din er en IDE harddisk og\n" "\"sd\" hvis det er en SCSI harddisk.\n" "\n" "\"Harddisknummer\" er alltid en bokstav etter \"hd\" eller \"sd\". Med\n" "IDE-harddisker:\n" "\n" " * \"a\" betyr \"master-harddisk på primær IDE kontroller\",\n" "\n" " * \"b\" betyr \"slave-harddisk på primær IDE kontroller\",\n" "\n" " * \"c\" betyr \"master-harddisk på sekundær IDE kontroller\",\n" "\n" " * \"d\" betyr \"slave-harddisk på sekundær IDE kontroller\".\n" "\n" "Med SCSI-harddisker betyr en \"a\" en \"primær harddisk\", en \"b\" betyr " "\"sekundær harddisk\", osv.\n" "\n" "\"Windows-navn\" er bokstaven på harddisken din under Windows (den første\n" "disken eller partisjonen er kalt \"C:\")." #: ../help.pm:567 #, c-format msgid "" "\"%s\": check the current country selection. If you're not in this country,\n" "click on the \"%s\" button and choose another. If your country is not in " "the\n" "list shown, click on the \"%s\" button to get the complete country list." msgstr "" %s»: Sjekk ditt valg av land. Dersom du ikke befinner deg i dette landet,\n" "klikk på «%s»-knappen og velg et annet. Dersom ditt land ikke er i\n" "den første lista, klikk på «%s»\"-knappen for å få den fullstendige lista\n" " over land." #: ../help.pm:572 #, c-format msgid "" "This step is activated only if an existing GNU/Linux partition has been\n" "found on your machine.\n" "\n" "DrakX now needs to know if you want to perform a new installation or an\n" "upgrade of an existing Mandriva Linux system:\n" "\n" " * \"%s\". For the most part, this completely wipes out the old system.\n" "However, depending on your partitioning scheme, you can prevent some of\n" "your existing data (notably \"home\" directories) from being over-written.\n" "If you wish to change how your hard drives are partitioned, or to change\n" "the file system, you should use this option.\n" "\n" " * \"%s\". This installation class allows you to update the packages\n" "currently installed on your Mandriva Linux system. Your current " "partitioning\n" "scheme and user data will not be altered. Most of the other configuration\n" "steps remain available and are similar to a standard installation.\n" "\n" "Using the ``Upgrade'' option should work fine on Mandriva Linux systems\n" "running version \"8.1\" or later. Performing an upgrade on versions prior\n" "to Mandriva Linux version \"8.1\" is not recommended." msgstr "" "Dette trinnet blir bare aktivert dersom det blir funnet en eksisterende\n" "GNU/Linux-partisjon på maskinen din.\n" "\n" "DrakX trenger nå å vite om du vil utføre en ny installasjon eller en " "oppgradering\n" "av et eksisterende Mandriva Linux-system:\n" "\n" " * «%s»: Dette vil stort sett slette hele det gamle systemet. Dersom du\n" "ønsker å forandre hvordan harddiskene blir partisjonert, eller forandre på\n" "filsystemene, bør du velge dette. Men avhengig av hvordan du partisjonerer " "kan\n" "du avverge at noen av de gamle dataene blir overskrevet.\n" "\n" " * «%s»: Denne installasjonsklassen lar deg oppgradere pakkene som\n" "er installert på ditt nåværende Mandriva Linux-system. Dine nåværende\n" "partisjonsoppdelinger og brukerdata blir ikke berørt. De fleste andre " "oppsettstrinn\n" "forblir tilgjengelige, i likhet med en standard installasjon.\n" "\n" "«Oppgrader»-valget bør fungere fint på Mandriva Linux systemer som kjører\n" "versjon «8.1» eller nyere. Oppgradering av versjoner tidligere enn «8.1» er\n" " ikke anbefalt. " #: ../help.pm:594 #, c-format msgid "" "Depending on the language you chose (), DrakX will automatically select a\n" "particular type of keyboard configuration. Check that the selection suits\n" "you or choose another keyboard layout.\n" "\n" "Also, you may not have a keyboard which corresponds exactly to your\n" "language: for example, if you are an English-speaking Swiss native, you may\n" "have a Swiss keyboard. Or if you speak English and are located in Quebec,\n" "you may find yourself in the same situation where your native language and\n" "country-set keyboard do not match. In either case, this installation step\n" "will allow you to select an appropriate keyboard from a list.\n" "\n" "Click on the \"%s\" button to be shown a list of supported keyboards.\n" "\n" "If you choose a keyboard layout based on a non-Latin alphabet, the next\n" "dialog will allow you to choose the key binding which will switch the\n" "keyboard between the Latin and non-Latin layouts." msgstr "" "Avhengig av standardspråket du har valgt, vil DrakX automatisk velge\n" "et tilsvarende tastaturoppsett. Sjekk at valget passer deg, eller velg\n" "et annet tastaturoppsett.\n" "\n" "Det kan også hende at du ikke har et tastatur som passer presist \n" "til ditt språk.\n" "Hvis du for eksempel er en engelsktalende sveitsisk person, kan\n" "det være at du har et sveitsisk tastatur, eller hvis du snakker engelsk, " "men\n" "oppholder deg i Quebec så kan du finne deg i den samme situasjonen hvor\n" "ditt eget språk og tastatur ikke stemmer overens. I slike tilfeller vil " "dette\n" "installasjonstrinnet la deg velge et passende tastatur fra en liste.\n" "\n" "Klikk på «%s»-knappen for å få en komplett liste over støttede tastaturer.\n" "\n" "Hvis du velger et tastatur som ikke er basert på det latinske alfabetet,\n" "vil den neste dialogen tillate at du setter opp en tastekombinasjon\n" "som vil bytte mellom latin og ikke-latinsk tastaturoppsett." #: ../help.pm:612 #, c-format msgid "" "The first step is to choose your preferred language.\n" "\n" "Your choice of preferred language will affect the installer, the\n" "documentation, and the system in general. First select the region you're\n" "located in, then the language you speak.\n" "\n" "Clicking on the \"%s\" button will allow you to select other languages to\n" "be installed on your workstation, thereby installing the language-specific\n" "files for system documentation and applications. For example, if Spanish\n" "users are to use your machine, select English as the default language in\n" "the tree view and \"%s\" in the Advanced section.\n" "\n" "About UTF-8 (unicode) support: Unicode is a new character encoding meant to\n" "cover all existing languages. However full support for it in GNU/Linux is\n" "still under development. For that reason, Mandriva Linux's use of UTF-8 " "will\n" "depend on the user's choices:\n" "\n" " * If you choose a language with a strong legacy encoding (latin1\n" "languages, Russian, Japanese, Chinese, Korean, Thai, Greek, Turkish, most\n" "iso-8859-2 languages), the legacy encoding will be used by default;\n" "\n" " * Other languages will use unicode by default;\n" "\n" " * If two or more languages are required, and those languages are not using\n" "the same encoding, then unicode will be used for the whole system;\n" "\n" " * Finally, unicode can also be forced for use throughout the system at a\n" "user's request by selecting the \"%s\" option independently of which\n" "languages were been chosen.\n" "\n" "Note that you're not limited to choosing a single additional language. You\n" "may choose several, or even install them all by selecting the \"%s\" box.\n" "Selecting support for a language means translations, fonts, spell checkers,\n" "etc. will also be installed for that language.\n" "\n" "To switch between the various languages installed on your system, you can\n" "launch the \"localedrake\" command as \"root\" to change the language used\n" "by the entire system. Running the command as a regular user will only\n" "change the language settings for that particular user." msgstr "" "Det første trinnet er å velge ditt foretrukne språk.\n" "\n" "Ditt valg av foretrukket språk vil påvirke språket til dokumentasjonen,\n" "installasjonsrutinen og systemet generelt. Velg først regionen du befinner\n" "deg i, og deretter språket du bruker.\n" "\n" "Om du klikker på «%s»-knappen får du mulighet til å velge andre\n" "språk som du ønsker å installere på din arbeidsstasjon. Du installerer da\n" "samtidig de språkspesifikke filene for systemdokumentasjon og\n" "applikasjoner. Hvis du ønsker norsk som standardspråk, men også\n" "ønsker å tilrettelegge for spanske brukere på maskinen, kan du velge\n" "norsk som standardspråk i trevisningen, og «%s» i det avanserte avsnitt.\n" "\n" "Om UTF-8 (ISO 10646) støtte. ISO 10646 er en ny tegnsettskoding det\n" "er ment til å dekke alle eksisterende språk. Men full støtte for det i GNU/" "Linux er\n" "stadig under utvikling. Av denne grunnen vil Mandriva Linux bruke det\n" "eller ei avhengig av brukerens valg:\n" "\n" " * Hvis du velger et språk med sterk binding til gammel kodnng (latin1-\n" "språk, russisk, japansk, kinesisk, koreansk, thai, gresk, tyrkisk, de " "fleste\n" "ISO-8859-2-språk) vil den gamle kodingen bli brukt som standard;\n" "\n" "Andre språk vil bruke ISO 10646 som standard;\n" "\n" " * Hvis to eller flere språk er krevd, og ikke disse språk bruker samme " "koding,\n" "vil ISO 10646 bli brukt for hele systemet;\n" "\n" " * Endelig kan ISO 10646 også bli påtvunget systemet ved brukervalg\n" "ved å velge '%s'-valget uavhengig av hvilke språk som er valgt.\n" "\n" "Legg merke til at du ikke er begrenset til et enkelt tilleggsspråk. Du\n" "kan velge flere, eller til og med alle ved å sjekke av i «%s»-boksen.\n" "Valg av språkstøtte betyr at oversettelser, skrifttyper, stavekontroller,\n" "osv. for språket også vil bli installert.\n" "\n" "For å bytte mellom de installerte språkene på systemet, kan du starte\n" "programmet «/usr/sbin/localedrake» som «root» for å bytte språket som\n" "systemet bruker. Dersom dette programmet kjøres under en vanlig bruker,\n" "vil bare språket for denne brukeren endres." #: ../help.pm:650 #, c-format msgid "Espanol" msgstr "Spansk" #: ../help.pm:653 #, c-format msgid "" "Usually, DrakX has no problems detecting the number of buttons on your\n" "mouse. If it does, it assumes you have a two-button mouse and will\n" "configure it for third-button emulation. The third-button mouse button of a\n" "two-button mouse can be obtained by simultaneously clicking the left and\n" "right mouse buttons. DrakX will automatically know whether your mouse uses\n" "a PS/2, serial or USB interface.\n" "\n" "If you have a 3-button mouse without a wheel, you can choose a \"%s\"\n" "mouse. DrakX will then configure your mouse so that you can simulate the\n" "wheel with it: to do so, press the middle button and move your mouse\n" "pointer up and down.\n" "\n" "If for some reason you wish to specify a different type of mouse, select it\n" "from the list provided.\n" "\n" "You can select the \"%s\" entry to chose a ``generic'' mouse type which\n" "will work with nearly all mice.\n" "\n" "If you choose a mouse other than the default one, a test screen will be\n" "displayed. Use the buttons and wheel to verify that the settings are\n" "correct and that the mouse is working correctly. If the mouse is not\n" "working well, press the space bar or [Return] key to cancel the test and\n" "you will be returned to the mouse list.\n" "\n" "Occasionally wheel mice are not detected automatically, so you will need to\n" "select your mouse from a list. Be sure to select the one corresponding to\n" "the port that your mouse is attached to. After selecting a mouse and\n" "pressing the \"%s\" button, a mouse image will be displayed on-screen.\n" "Scroll the mouse wheel to ensure that it is activating correctly. As you\n" "scroll your mouse wheel, you will see the on-screen scroll wheel moving.\n" "Test the buttons and check that the mouse pointer moves on-screen as you\n" "move your mouse about." msgstr "" "DrakX oppdager vanligvis antall knapper på musen din. Hvis ikke, så vil det\n" "antas at du har en to-knappers mus og det vil settes opp treknappers-" "emulering.\n" "Den tredje museknappen kan på en toknappers-mus bli brukt ved å\n" "trykke ned både høyre og venstre museknapp samtidig. DrakX vil\n" "automatisk oppdage om din mus bruker PS/2-, seriell- eller USB-grensesnitt.\n" "\n" "Hvis du har en 3-knappsmus uten hjul, kan du velge musen\n" %s». DrakX vil så konfugurere musen din så du kan simulere hjulet med den;\n" "for å gjøre dette skal du trykke på den tredje knappen og flytte musen din\n" "opp og ned.\n" "\n" "Hvis du ønsker å spepesifisere en annerledes musetype, velg den passende\n" "typen fra listen du blir vist.\n" "\n" "Du kan velge «%s» eller velge en ``generisk\" mus-type som vil fungere\n" "med alle mus.\n" "\n" "Hvis du velger en annen mus enn hva som er forhåndsvalgt, så vil en\n" "testskjerm bli vist. Bruk knappene og musehjulet for å sjekke at\n" "oppsettet er riktig, og at musa virker ordentlig. Hvis musa ikke virker " "riktig,\n" "trykk [Space] eller [Enter] for å avbryte testen og gå tilbake til listen " "over valg.\n" "\n" "Noen ganger så blir ikke musehjulet automatisk oppdaget. Du vil da måtte\n" "velge manuelt fra listen. Vær sikker på at du velger en som er på riktig " "port.\n" "Etter at du har klikket på «%s»-knappen, så vil et musebilde bli vist på " "skjermen.\n" "Du må da bevege musehjulet for å aktivere det riktig. Når du ser at " "musehjulet på\n" "skjermen beveges etter som du ruller på det, sjekk også at knappene fungerer " "og\n" "at musepekeren på skjermen beveger seg når du flytter på musa." #: ../help.pm:684 #, c-format msgid "with Wheel emulation" msgstr "med hjulemulering" #: ../help.pm:684 #, c-format msgid "Universal | Any PS/2 & USB mice" msgstr "Universal | Alle PS/2- & USB-mus" #: ../help.pm:687 #, c-format msgid "" "Please select the correct port. For example, the \"COM1\" port under\n" "Windows is named \"ttyS0\" under GNU/Linux." msgstr "" "Velg den riktige porten. F.eks., \"COM1\"-porten under\n" "Windows blir kalt \"ttyS0\" i GNU/Linux." #: ../help.pm:691 #, c-format msgid "" "This is the most crucial decision point for the security of your GNU/Linux\n" "system: you must enter the \"root\" password. \"Root\" is the system\n" "administrator and is the only user authorized to make updates, add users,\n" "change the overall system configuration, and so on. In short, \"root\" can\n" "do everything! That's why you must choose a password which is difficult to\n" "guess: DrakX will tell you if the password you chose is too simple. As you\n" "can see, you're not forced to enter a password, but we strongly advise\n" "against this. GNU/Linux is just as prone to operator error as any other\n" "operating system. Since \"root\" can overcome all limitations and\n" "unintentionally erase all data on partitions by carelessly accessing the\n" "partitions themselves, it is important that it be difficult to become\n" "\"root\".\n" "\n" "The password should be a mixture of alphanumeric characters and at least 8\n" "characters long. Never write down the \"root\" password -- it makes it far\n" "too easy to compromise your system.\n" "\n" "One caveat: do not make the password too long or too complicated because " "you\n" "must be able to remember it!\n" "\n" "The password will not be displayed on screen as you type it. To reduce the\n" "chance of a blind typing error you'll need to enter the password twice. If\n" "you do happen to make the same typing error twice, you'll have to use this\n" "``incorrect'' password the first time you'll try to connect as \"root\".\n" "\n" "If you want an authentication server to control access to your computer,\n" "click on the \"%s\" button.\n" "\n" "If your network uses either LDAP, NIS, or PDC Windows Domain authentication\n" "services, select the appropriate one for \"%s\". If you do not know which\n" "one to use, you should ask your network administrator.\n" "\n" "If you happen to have problems with remembering passwords, or if your\n" "computer will never be connected to the Internet and you absolutely trust\n" "everybody who uses your computer, you can choose to have \"%s\"." msgstr "" "Dette er det mest kritisike valget med hensyn til sikkerheten på ditt\n" "GNU/Linux-system: du må skrive inn «root»-passordet. «Root» er\n" "systemadministratoren og er den eneste som er autorisert til å gjøre\n" "oppdateringer, legge til brukere, endre på generellt oppsett, etc.\n" "Kort sagt, «root» kan gjøre alt! Derfor er det viktig at du velger et\n" "root-passord som er vanskelig å gjette -- DrakX vil si i fra hvis det er\n" "for enkelt. Som du ser, så kan du velge å ikke skrive inn noe passord,\n" "men det er noe vi anbefaler på det sterkeste å ikke gjøre. Man kan lage\n" "feil på GNU/Linux så lett som på ethvert annet operativsystem.\n" "Siden «root» kan omgå alle begrensninger og ved uhell kan slette\n" "alle data på en partisjon ved ubetenksomt bare å røre partisjonene selv,\n" "så er det viktig å gjøre det vanskelig å bli «root».\n" "\n" "Passordet bør være en blanding av alfanummeriske tegn og være på minst 8\n" "tegn. Aldri skriv ned «roo»\"-passordet -- det gjør det for enkelt å bryte " "seg\n" "inn på systemet ditt. \n" "\n" "Uansett -- du bør ikke lage passordet for langt og komplisert siden du må \n" "være i stand til å huske det uten altfor mye trøbbel.\n" "\n" "Passordet vil ikke bli vist på skjermen når du skriver det. Dermed må du\n" "skrive inn passordet to ganger for å minske sjansen for å skrive feil. Hvis\n" "du klarer å skrive passordet feil to ganger, så må dette ``feilaktige'' " "passordet\n" "bli brukt første gang du logger inn.\n" "\n" "Hvis du ønsker å autentisere deg via en autentiserings-tjener, klikk på\n" %s»-knappen.\n" "\n" "Hvis nettverket ditt bruker enten LDAP-, NIS- eller PDC Windows-\n" "domenepåloggingstjeneste, så velg det tilsvarende til\n" %s». Har du ingen anelse, så spørr nettverksadministratoren din.\n" "\n" "Hvis du skulle ha problemer med å huske passord, hvis maskinen din aldri " "vil\n" "brukes for å koble til internett, eller at du stoler på absolutt alle som " "bruker din\n" "maskin, så kan du velge «%s»." #: ../help.pm:725 #, c-format msgid "authentication" msgstr "autentisering" #: ../help.pm:728 #, c-format msgid "" "A boot loader is a little program which is started by the computer at boot\n" "time. It's responsible for starting up the whole system. Normally, the boot\n" "loader installation is totally automated. DrakX will analyze the disk boot\n" "sector and act according to what it finds there:\n" "\n" " * if a Windows boot sector is found, it will replace it with a GRUB/LILO\n" "boot sector. This way you'll be able to load either GNU/Linux or any other\n" "OS installed on your machine.\n" "\n" " * if a GRUB or LILO boot sector is found, it'll replace it with a new one.\n" "\n" "If DrakX can not determine where to place the boot sector, it'll ask you\n" "where it should place it. Generally, the \"%s\" is the safest place.\n" "Choosing \"%s\" will not install any boot loader. Use this option only if " "you\n" "know what you're doing." msgstr "" "En oppstartslaster er et lite program som er startet av datamaskinen\n" "når den starter opp. Den er ansvarlig for å starte hele systemet. Vanligvis\n" "er oppstartslaster-installasjonen helt automatisk. DrakX vil analysere\n" "oppstartssektoren på harddisken og sette oppstartslasteren opp etter hva\n" "den finner der.\n" "\n" " * Hvis en oppstartssektor for Windows blir funnet, vil den erstatte denne " "med\n" "en GRUB- eller LILO-oppstartsektor. På denne måten kan du laste enten\n" "GNU/Linux eller ethvert annet operativsystem installert på din maskin.\n" "\n" " * Hvis en oppstartsektor for GRUB eller LILO blir funnet, vil den bli " "erstattet\n" "med en ny.\n" "\n" "Dersom det ikke er mulig å avgjøre dette automatisk, vil DrakX spørre deg " "hvor\n" "oppstartslasteren skal installeres. Vanligvis er «%s» det sikreste stedet.\n" "Valg av «%s» vil ikke installere noen oppstartslaster. Bruk kun dette\n" "hvis du vet hva du gjør." #: ../help.pm:745 #, c-format msgid "" "Now, it's time to select a printing system for your computer. Other\n" "operating systems may offer you one, but Mandriva Linux offers two. Each of\n" "the printing systems is best suited to particular types of configuration.\n" "\n" " * \"%s\" -- which is an acronym for ``print, do not queue'', is the choice\n" "if you have a direct connection to your printer, you want to be able to\n" "panic out of printer jams, and you do not have networked printers. (\"%s\"\n" "will handle only very simple network cases and is somewhat slow when used\n" "within networks.) It's recommended that you use \"pdq\" if this is your\n" "first experience with GNU/Linux.\n" "\n" " * \"%s\" stands for `` Common Unix Printing System'' and is an excellent\n" "choice for printing to your local printer or to one halfway around the\n" "planet. It's simple to configure and can act as a server or a client for\n" "the ancient \"lpd\" printing system, so it's compatible with older\n" "operating systems which may still need print services. While quite\n" "powerful, the basic setup is almost as easy as \"pdq\". If you need to\n" "emulate a \"lpd\" server, make sure you turn on the \"cups-lpd\" daemon.\n" "\"%s\" includes graphical front-ends for printing or choosing printer\n" "options and for managing the printer.\n" "\n" "If you make a choice now, and later find that you do not like your printing\n" "system you may change it by running PrinterDrake from the Mandriva Linux\n" "Control Center and clicking on the \"%s\" button." msgstr "" "Nå er det på tide å velge utskriftsystemet for din maskin. Andre\n" "operativsystemer tilbyr kanskje en, men Mandriva Linux tilbyr to.\n" "Hvert av systemene er best for et spesiell type oppsett.\n" "\n" " * «%s» -- som står for ``print, do not queue'', er valget hvis du har en\n" "direkte tilkobling til din printer og du vil ha muligheten til å flykte fra\n" "printerkræsj, og du ikke har nettverksskrivere. («%s» vil bare håndtere\n" "veldig enkle nettverkstilfeller og er nogenlunde treg for nettverk.) Det er\n" "anbefalt at du bruker «pdq» hvis dette er din første erfaring med GNU/" "Linux.\n" "\n" " * «%s» står for ``Common Unix Printing System'', er perfekt til å skrive " "til\n" "din egen lokale skriver, og også til skrivere på andre siden av kloden.\n" "Den er simpel og kan opptrå som både skriver og klient for det " "forhistoriske\n" "«lpd»-utskriftssystemet, så den er kompatibel med de eldre operativsystemer\n" "som fortsatt trenger utskriftstjenester. Selv om den er ganske kraftig, så " "er\n" "basisoppsettet nesten like enkelt som «pdq». Hvis du trenger å emulere en\n" "«lpd»-tjener, må du slå på «cups-lpd»-tjenesten. «%s» inkluderer et grafisk " "grensesnitt for utskrift eller oppsett av skriver og styring av skriver.\n" "\n" "Hvis du gjør et valg nå, og så senere finner ut at du ikke liker ditt " "utskriftssystem,\n" "så kan du endre det ved å kjøre PrinterDrake fra Mandriva Linux " "Kontrollsenter og\n" "klikke på «%s»-knappen. " #: ../help.pm:768 #, c-format msgid "pdq" msgstr "pdq" #: ../help.pm:768 #, c-format msgid "Expert" msgstr "Ekspert" #: ../help.pm:771 #, c-format msgid "" "DrakX will first detect any IDE devices present in your computer. It will\n" "also scan for one or more PCI SCSI cards on your system. If a SCSI card is\n" "found, DrakX will automatically install the appropriate driver.\n" "\n" "Because hardware detection is not foolproof, DrakX may fail in detecting\n" "your hard drives. If so, you'll have to specify your hardware by hand.\n" "\n" "If you had to manually specify your PCI SCSI adapter, DrakX will ask if you\n" "want to configure options for it. You should allow DrakX to probe the\n" "hardware for the card-specific options which are needed to initialize the\n" "adapter. Most of the time, DrakX will get through this step without any\n" "issues.\n" "\n" "If DrakX is not able to probe for the options to automatically determine\n" "which parameters need to be passed to the hardware, you'll need to manually\n" "configure the driver." msgstr "" "DrakX vil nå oppdage alle IDE-enheter som er tilstede på ditt system. Det\n" "vil også scanne etter en eller flere PCI SCSI-kort på systemet ditt. Hvis " "et\n" "SCSI-kort er tilstede, så vil DrakX automatisk installere den passende " "driveren.\n" "\n" "På grunn av at maskinvareoppdagelse ikke er feilfritt, så kan det være at\n" "DrakX ikke klarer å oppdage dine harddisker. Hvis dette skjer, så må du\n" "spesifisere din maskinvare for hånd.\n" "\n" "Hvis du må spesifisere PCI SCSI-kontrolleren din manuelt, så vil DrakX\n" "spørre deg om å gjøre noen valg for det. Du burde tillate DrakX å teste\n" "maskinvaren for kort-spesifikke valg som trengs for å initialisere\n" "maskinvaren. Som regel så vil DrakX klare å gå igjennom dette steget uten\n" "problemer.\n" "\n" "Hvis DrakX ikke er i stand til å oppdage de riktige parametrene som trengs\n" "for din maskinvare, så må du manuelt sette opp driveren." #: ../help.pm:789 #, c-format msgid "" "\"%s\": if a sound card is detected on your system, it'll be displayed\n" "here. If you notice the sound card is not the one actually present on your\n" "system, you can click on the button and choose a different driver." msgstr "" %s»: hvis et lydkort blir oppdaget på systemet ditt, blir det vist her.\n" "Hvis du oppdager at lydkortet som blir vist her ikke er det som\n" "faktisk er til stede på ditt system, så kan du klikke på denne knappen for\n" "å velge en annen driver." #: ../help.pm:794 #, c-format msgid "" "As a review, DrakX will present a summary of information it has gathered\n" "about your system. Depending on the hardware installed on your machine, you\n" "may have some or all of the following entries. Each entry is made up of the\n" "hardware item to be configured, followed by a quick summary of the current\n" "configuration. Click on the corresponding \"%s\" button to make the change.\n" "\n" " * \"%s\": check the current keyboard map configuration and change it if\n" "necessary.\n" "\n" " * \"%s\": check the current country selection. If you're not in this\n" "country, click on the \"%s\" button and choose another. If your country\n" "is not in the list shown, click on the \"%s\" button to get the complete\n" "country list.\n" "\n" " * \"%s\": by default, DrakX deduces your time zone based on the country\n" "you have chosen. You can click on the \"%s\" button here if this is not\n" "correct.\n" "\n" " * \"%s\": verify the current mouse configuration and click on the button\n" "to change it if necessary.\n" "\n" " * \"%s\": clicking on the \"%s\" button will open the printer\n" "configuration wizard. Consult the corresponding chapter of the ``Starter\n" "Guide'' for more information on how to set up a new printer. The interface\n" "presented in our manual is similar to the one used during installation.\n" "\n" " * \"%s\": if a sound card is detected on your system, it'll be displayed\n" "here. If you notice the sound card is not the one actually present on your\n" "system, you can click on the button and choose a different driver.\n" "\n" " * \"%s\": if you have a TV card, this is where information about its\n" "configuration will be displayed. If you have a TV card and it is not\n" "detected, click on \"%s\" to try to configure it manually.\n" "\n" " * \"%s\": you can click on \"%s\" to change the parameters associated with\n" "the card if you feel the configuration is wrong.\n" "\n" " * \"%s\": by default, DrakX configures your graphical interface in\n" "\"800x600\" or \"1024x768\" resolution. If that does not suit you, click on\n" "\"%s\" to reconfigure your graphical interface.\n" "\n" " * \"%s\": if you wish to configure your Internet or local network access,\n" "you can do so now. Refer to the printed documentation or use the\n" "Mandriva Linux Control Center after the installation has finished to " "benefit\n" "from full in-line help.\n" "\n" " * \"%s\": allows to configure HTTP and FTP proxy addresses if the machine\n" "you're installing on is to be located behind a proxy server.\n" "\n" " * \"%s\": this entry allows you to redefine the security level as set in a\n" "previous step ().\n" "\n" " * \"%s\": if you plan to connect your machine to the Internet, it's a good\n" "idea to protect yourself from intrusions by setting up a firewall. Consult\n" "the corresponding section of the ``Starter Guide'' for details about\n" "firewall settings.\n" "\n" " * \"%s\": if you wish to change your bootloader configuration, click this\n" "button. This should be reserved to advanced users. Refer to the printed\n" "documentation or the in-line help about bootloader configuration in the\n" "Mandriva Linux Control Center.\n" "\n" " * \"%s\": through this entry you can fine tune which services will be run\n" "on your machine. If you plan to use this machine as a server it's a good\n" "idea to review this setup." msgstr "" "Som en oppsummering vil DrakX gi deg en oversikt over informasjon som\n" "den har om systemet ditt. Avhengig av installert maskinvare, kan du ha et\n" "eller flere av de følgende punktene. Hvert punkt består av en overskrift " "fulgt\n" "av en kort oppsummering av det nåværende oppsettet. Klikk på\n" "den korresponderende «%s»-knappen for å endre på det.\n" "\n" " * «%s»: sjekk ditt gjeldende tastaturoppsett og endre om nødvendig.\n" "\n" " * «%s»: sjekk ditt gjeldende valg av land. Hvis du ikke er i dette landet,\n" "klikk på «%s»-knappen og velg et annet land. Hvis landet ditt ikke er i\n" "den først viste listen, klikk «%s»-knappen for å få en fullstendig liste " "over land.\n" "\n" " ' «%s»\": som standard bestemmer DrakX din tidssone ut i fra hvilket land " "du\n" "har valgt. Du kan klikke på «%s»-knappen her om dette ikke er korrekt.\n" "\n" " * «%s» :sjekk det gjeldende museoppsettet og klikk på knappen for å endre\n" "om nødvendig.\n" "\n" " * «%s»: ved å klikke på «%s»-knappen åpnes skriveroppsett-veiviseren.\n" "Konsulter det tilhørende kapittelet i oppstartsguiden for mer\n" "informasjon om hvordan en skriver kan settes opp. Grensesnittet som er vist\n" "der er likt det som benyttes under installasjonen.\n" "\n" " * \"%s\": hvis det er funnet et lydkort i ditt system, er det vist her. " "Hvis du\n" "finner ut at lydkortet som er vist ikke stemmer overens med det som faktisk " "er\n" "installert i din maskin, kan du klikke på knappen og velge en annen driver.\n" "\n" " * «%s»: hvis du har ett TV-kort, dette er der informasjonen om oppsettet " "til det\n" "vil blir vist. Hvis du har et TV-kort og det ikke er oppdaget, klikk på «%" "s»\n" "for å forsøke å sette det opp manuelt\n" "\n" " * «%s»: Du kan klikke på «%s» for å forandre parameterene til kortet hvis " "du\n" "syntes at oppsettet er feil.\n" "\n" " * «%s»: Vanligvis setter DrakX opp ditt grafiske grensesnitt i\n" "«800x600» eller «1024x768» oppløsning. Hvis det ikke er det du vil ha\n" "klikk på «%s« for å sette opp ditt grafiske grensesnitt.\n" "\n" " * «%s»: hvis du vil sette opp din internett- eller lokale " "nettverkstilkobling\n" "kan du gjøre det nå. Sjekk den utskrevne dokumentasjonen eller bruk\n" "Mandriva Linux Kontrollsenter etter at installasjonen er ferdig for å\n" "få full hjelp med oppsettet.\n" "\n" " * «%s»: lar deg sette opp HTTP og FTP mellomtjener-adresser hvis maskinen\n" "du installerer på er bak en mellomtjener.\n" "\n" " * «%s»: dette valget lar deg omdefinere sikkerhetsnivået som ble satt i et " "tidligere\n" "steg ().\n" "\n" " * «%s»: hvis du planlegger å koble din maskin til internett er det en god " "idé\n" "å beskytte deg selv fra inntrengere ved å sette opp en brannmur. Se den\n" "korresponderende seksjonen i ``Starter Guiden\" for detaljer om brannmur\n" "innstillinger.\n" "\n" " * «%s»: dersom du ønsker å endre ditt oppstartslaster-oppsett, klikk på " "denne\n" "knappen. Dette er kun for avanserte brukere. Sjekk den utskrevne " "dokumentasjonen\n" "eller innebygd hjelp om oppstartslaster-oppsettet i Mandriva Linux " "Kontrollsenter.\n" "\n" " * «%s»: igjennom dette valget kan du finjustere hvilke tjenester som skal " "kjøre på din\n" "maskin. Hvis du planlegger å bruke maskinen som en tjener er det en god ide " "å se\n" "igjennom dette." #: ../help.pm:858 #, c-format msgid "ISDN card" msgstr "ISDN-kort" #: ../help.pm:858 #, c-format msgid "Graphical Interface" msgstr "Grafisk grensesnitt" #: ../help.pm:861 #, c-format msgid "" "Choose the hard drive you want to erase in order to install your new\n" "Mandriva Linux partition. Be careful, all data on this drive will be lost\n" "and will not be recoverable!" msgstr "" "Velg den harddisken du ønsker å slette for å installere din nye\n" "Mandriva Linux-partisjon. Vær forsiktig, alle data på denne partisjonen vil " "gå tapt\n" "og vil ikke kunne gjenopprettes!" #: ../help.pm:866 #, c-format msgid "" "Click on \"%s\" if you want to delete all data and partitions present on\n" "this hard drive. Be careful, after clicking on \"%s\", you will not be able\n" "to recover any data and partitions present on this hard drive, including\n" "any Windows data.\n" "\n" "Click on \"%s\" to quit this operation without losing data and partitions\n" "present on this hard drive." msgstr "" "Klikk på \"%s\" hvis du ønsker å slette alle data og partisjoner på denne\n" "harddisken. Vær forsiktig, etter at du har klikket på \"%s\" vil du ikke\n" "kunne gjenopprette data og partisjoner på denne harddisken inkludert Windows-" "data.\n" "\n" "Klikk på \"%s\" for å avslutte denne operasjonen uten å miste data og\n" "partisjoner på denne harddisken." #: ../help.pm:872 #, c-format msgid "Next ->" msgstr "Neste ->" #: ../help.pm:872 #, c-format msgid "<- Previous" msgstr "<- Forrige"