Révision 4c291f4c
Ajouté par Renato Botelho il y a plus de 9 ans
usr/local/www/system_usermanager.php | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
/* $Id$ */ |
3 | 3 |
/* |
4 |
system_usermanager.php
|
|
5 |
part of m0n0wall (http://m0n0.ch/wall)
|
|
6 |
|
|
7 |
Copyright (C) 2008 Shrew Soft Inc.
|
|
8 |
All rights reserved.
|
|
9 |
|
|
10 |
Copyright (C) 2005 Paul Taylor <paultaylor@winn-dixie.com>.
|
|
11 |
All rights reserved.
|
|
12 |
|
|
13 |
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
|
14 |
All rights reserved.
|
|
15 |
|
|
16 |
Redistribution and use in source and binary forms, with or without
|
|
17 |
modification, are permitted provided that the following conditions are met:
|
|
18 |
|
|
19 |
1. Redistributions of source code must retain the above copyright notice,
|
|
20 |
this list of conditions and the following disclaimer.
|
|
21 |
|
|
22 |
2. Redistributions in binary form must reproduce the above copyright
|
|
23 |
notice, this list of conditions and the following disclaimer in the
|
|
24 |
documentation and/or other materials provided with the distribution.
|
|
25 |
|
|
26 |
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
27 |
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
28 |
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
29 |
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
|
30 |
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
31 |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
32 |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
33 |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
34 |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
35 |
POSSIBILITY OF SUCH DAMAGE.
|
|
4 |
system_usermanager.php
|
|
5 |
part of m0n0wall (http://m0n0.ch/wall)
|
|
6 |
|
|
7 |
Copyright (C) 2008 Shrew Soft Inc.
|
|
8 |
All rights reserved.
|
|
9 |
|
|
10 |
Copyright (C) 2005 Paul Taylor <paultaylor@winn-dixie.com>.
|
|
11 |
All rights reserved.
|
|
12 |
|
|
13 |
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
|
14 |
All rights reserved.
|
|
15 |
|
|
16 |
Redistribution and use in source and binary forms, with or without
|
|
17 |
modification, are permitted provided that the following conditions are met:
|
|
18 |
|
|
19 |
1. Redistributions of source code must retain the above copyright notice,
|
|
20 |
this list of conditions and the following disclaimer.
|
|
21 |
|
|
22 |
2. Redistributions in binary form must reproduce the above copyright
|
|
23 |
notice, this list of conditions and the following disclaimer in the
|
|
24 |
documentation and/or other materials provided with the distribution.
|
|
25 |
|
|
26 |
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
27 |
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
28 |
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
29 |
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
|
30 |
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
31 |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
32 |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
33 |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
34 |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
35 |
POSSIBILITY OF SUCH DAMAGE.
|
|
36 | 36 |
*/ |
37 | 37 |
/* |
38 | 38 |
pfSense_BUILDER_BINARIES: |
... | ... | |
252 | 252 |
|
253 | 253 |
if (!empty($_POST['name'])) { |
254 | 254 |
$ca = lookup_ca($_POST['caref']); |
255 |
if (!$ca)
|
|
256 |
$input_errors[] = gettext("Invalid internal Certificate Authority") . "\n";
|
|
255 |
if (!$ca) |
|
256 |
$input_errors[] = gettext("Invalid internal Certificate Authority") . "\n";
|
|
257 | 257 |
} |
258 | 258 |
|
259 | 259 |
/* if this is an AJAX caller then handle via JSON */ |
... | ... | |
297 | 297 |
if (!empty($_POST['name'])) { |
298 | 298 |
$cert = array(); |
299 | 299 |
$cert['refid'] = uniqid(); |
300 |
$userent['cert'] = array();
|
|
300 |
$userent['cert'] = array();
|
|
301 | 301 |
|
302 | 302 |
$cert['descr'] = $_POST['name']; |
303 | 303 |
|
304 |
$subject = cert_get_subject_array($ca['crt']);
|
|
304 |
$subject = cert_get_subject_array($ca['crt']);
|
|
305 | 305 |
|
306 |
$dn = array(
|
|
307 |
'countryName' => $subject[0]['v'],
|
|
308 |
'stateOrProvinceName' => $subject[1]['v'],
|
|
309 |
'localityName' => $subject[2]['v'],
|
|
310 |
'organizationName' => $subject[3]['v'],
|
|
311 |
'emailAddress' => $subject[4]['v'],
|
|
312 |
'commonName' => $userent['name']);
|
|
306 |
$dn = array(
|
|
307 |
'countryName' => $subject[0]['v'],
|
|
308 |
'stateOrProvinceName' => $subject[1]['v'],
|
|
309 |
'localityName' => $subject[2]['v'],
|
|
310 |
'organizationName' => $subject[3]['v'],
|
|
311 |
'emailAddress' => $subject[4]['v'],
|
|
312 |
'commonName' => $userent['name']);
|
|
313 | 313 |
|
314 | 314 |
cert_create($cert, $_POST['caref'], $_POST['keylen'], |
315 | 315 |
(int)$_POST['lifetime'], $dn); |
... | ... | |
431 | 431 |
} |
432 | 432 |
|
433 | 433 |
function sshkeyClicked(obj) { |
434 |
if (obj.checked) {
|
|
435 |
document.getElementById("sshkeychck").style.display="none";
|
|
436 |
document.getElementById("sshkey").style.display="";
|
|
437 |
} else {
|
|
438 |
document.getElementById("sshkey").style.display="none";
|
|
439 |
document.getElementById("sshkeychck").style.display="";
|
|
440 |
}
|
|
434 |
if (obj.checked) {
|
|
435 |
document.getElementById("sshkeychck").style.display="none";
|
|
436 |
document.getElementById("sshkey").style.display="";
|
|
437 |
} else {
|
|
438 |
document.getElementById("sshkey").style.display="none";
|
|
439 |
document.getElementById("sshkeychck").style.display="";
|
|
440 |
}
|
|
441 | 441 |
} |
442 | 442 |
//]]> |
443 | 443 |
</script> |
... | ... | |
450 | 450 |
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="user manager"> |
451 | 451 |
<tr> |
452 | 452 |
<td> |
453 |
<?php
|
|
453 |
<?php |
|
454 | 454 |
$tab_array = array(); |
455 | 455 |
$tab_array[] = array(gettext("Users"), true, "system_usermanager.php"); |
456 | 456 |
$tab_array[] = array(gettext("Groups"), false, "system_groupmanager.php"); |
457 | 457 |
$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php"); |
458 | 458 |
$tab_array[] = array(gettext("Servers"), false, "system_authservers.php"); |
459 | 459 |
display_top_tabs($tab_array); |
460 |
?>
|
|
460 |
?> |
|
461 | 461 |
</td> |
462 | 462 |
</tr> |
463 | 463 |
<tr> |
464 | 464 |
<td id="mainarea"> |
465 | 465 |
<div class="tabcont"> |
466 |
|
|
467 |
<?php if ($_GET['act'] == "new" || $_GET['act'] == "edit" || $input_errors): ?>
|
|
468 |
|
|
466 |
<?php |
|
467 |
if ($_GET['act'] == "new" || $_GET['act'] == "edit" || $input_errors):
|
|
468 |
?> |
|
469 | 469 |
<form action="system_usermanager.php" method="post" name="iform" id="iform" onsubmit="presubmit()"> |
470 | 470 |
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area"> |
471 |
<?php
|
|
472 |
$ro = "";
|
|
473 |
if ($pconfig['utype'] == "system")
|
|
474 |
$ro = "readonly=\"readonly\"";
|
|
475 |
?>
|
|
476 |
<tr>
|
|
477 |
<td width="22%" valign="top" class="vncell"><?=gettext("Defined by");?></td>
|
|
478 |
<td width="78%" class="vtable">
|
|
479 |
<strong><?=strtoupper(htmlspecialchars($pconfig['utype']));?></strong>
|
|
471 |
<?php |
|
472 |
$ro = ""; |
|
473 |
if ($pconfig['utype'] == "system") |
|
474 |
$ro = "readonly=\"readonly\""; |
|
475 |
?> |
|
476 |
<tr>
|
|
477 |
<td width="22%" valign="top" class="vncell"><?=gettext("Defined by");?></td>
|
|
478 |
<td width="78%" class="vtable">
|
|
479 |
<strong><?=strtoupper(htmlspecialchars($pconfig['utype']));?></strong>
|
|
480 | 480 |
<input name="utype" type="hidden" value="<?=htmlspecialchars($pconfig['utype'])?>" /> |
481 |
</td>
|
|
482 |
</tr>
|
|
481 |
</td>
|
|
482 |
</tr>
|
|
483 | 483 |
<tr> |
484 | 484 |
<td width="22%" valign="top" class="vncell"><?=gettext("Disabled");?></td> |
485 | 485 |
<td width="78%" class="vtable"> |
... | ... | |
528 | 528 |
<strong><?=gettext("Not Member Of"); ?></strong><br /> |
529 | 529 |
<br /> |
530 | 530 |
<select size="10" style="width: 75%" name="notgroups[]" class="formselect" id="notgroups" onchange="clear_selected('groups')" multiple="multiple"> |
531 |
<?php
|
|
532 |
$rowIndex = 0;
|
|
533 |
foreach ($config['system']['group'] as $group):
|
|
534 |
if ($group['gid'] == 1998) /* all users group */
|
|
535 |
continue;
|
|
536 |
if (is_array($pconfig['groups']) && in_array($group['name'],$pconfig['groups']))
|
|
537 |
continue;
|
|
538 |
$rowIndex++;
|
|
539 |
?>
|
|
531 |
<?php |
|
532 |
$rowIndex = 0; |
|
533 |
foreach ($config['system']['group'] as $group): |
|
534 |
if ($group['gid'] == 1998) /* all users group */ |
|
535 |
continue; |
|
536 |
if (is_array($pconfig['groups']) && in_array($group['name'],$pconfig['groups'])) |
|
537 |
continue; |
|
538 |
$rowIndex++; |
|
539 |
?> |
|
540 | 540 |
<option value="<?=$group['name'];?>" <?=$selected;?>> |
541 | 541 |
<?=htmlspecialchars($group['name']);?> |
542 | 542 |
</option> |
543 |
<?php endforeach; |
|
543 |
<?php |
|
544 |
endforeach; |
|
544 | 545 |
if ($rowIndex == 0) |
545 | 546 |
echo "<option></option>"; |
546 |
?>
|
|
547 |
?> |
|
547 | 548 |
</select> |
548 | 549 |
<br /> |
549 | 550 |
</td> |
... | ... | |
561 | 562 |
<strong><?=gettext("Member Of"); ?></strong><br /> |
562 | 563 |
<br /> |
563 | 564 |
<select size="10" style="width: 75%" name="groups[]" class="formselect" id="groups" onchange="clear_selected('notgroups')" multiple="multiple"> |
564 |
<?php
|
|
565 |
<?php |
|
565 | 566 |
$rowIndex = 0; |
566 |
if (is_array($pconfig['groups'])) {
|
|
567 |
if (is_array($pconfig['groups'])):
|
|
567 | 568 |
foreach ($config['system']['group'] as $group): |
568 | 569 |
if ($group['gid'] == 1998) /* all users group */ |
569 | 570 |
continue; |
570 | 571 |
if (!in_array($group['name'],$pconfig['groups'])) |
571 | 572 |
continue; |
572 | 573 |
$rowIndex++; |
573 |
?>
|
|
574 |
?> |
|
574 | 575 |
<option value="<?=$group['name'];?>"> |
575 | 576 |
<?=htmlspecialchars($group['name']);?> |
576 | 577 |
</option> |
577 |
<?php endforeach; |
|
578 |
} |
|
578 |
<?php |
|
579 |
endforeach; |
|
580 |
endif; |
|
579 | 581 |
if ($rowIndex == 0) |
580 | 582 |
echo "<option></option>"; |
581 |
?>
|
|
583 |
?> |
|
582 | 584 |
</select> |
583 | 585 |
<br /> |
584 | 586 |
</td> |
... | ... | |
587 | 589 |
<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?> |
588 | 590 |
</td> |
589 | 591 |
</tr> |
590 |
|
|
591 |
<?php if (isset($pconfig['uid'])): ?>
|
|
592 |
|
|
592 |
<?php |
|
593 |
if (isset($pconfig['uid'])):
|
|
594 |
?> |
|
593 | 595 |
<tr> |
594 | 596 |
<td width="22%" valign="top" class="vncell"><?=gettext("Effective Privileges");?></td> |
595 | 597 |
<td width="78%" class="vtable"> |
... | ... | |
600 | 602 |
<td width="40%" class="listhdrr"><?=gettext("Description");?></td> |
601 | 603 |
<td class="list"></td> |
602 | 604 |
</tr> |
603 |
<?php |
|
604 |
|
|
605 |
$privdesc = get_user_privdesc($a_user[$id]); |
|
606 |
if(is_array($privdesc)): |
|
607 |
$i = 0; |
|
608 |
foreach ($privdesc as $priv): |
|
609 |
$group = false; |
|
610 |
if ($priv['group']) |
|
611 |
$group = $priv['group']; |
|
612 |
?> |
|
605 |
<?php |
|
606 |
$privdesc = get_user_privdesc($a_user[$id]); |
|
607 |
if(is_array($privdesc)): |
|
608 |
$i = 0; |
|
609 |
foreach ($privdesc as $priv): |
|
610 |
$group = false; |
|
611 |
if ($priv['group']) |
|
612 |
$group = $priv['group']; |
|
613 |
?> |
|
613 | 614 |
<tr> |
614 | 615 |
<td class="listlr"><?=$group;?></td> |
615 | 616 |
<td class="listr"> |
616 | 617 |
<?=htmlspecialchars($priv['name']);?> |
617 | 618 |
</td> |
618 | 619 |
<td class="listbg"> |
619 |
<?=htmlspecialchars($priv['descr']);?>
|
|
620 |
<?=htmlspecialchars($priv['descr']);?> |
|
620 | 621 |
</td> |
621 | 622 |
<td valign="middle" class="list nowrap"> |
622 |
<?php if (!$group): ?> |
|
623 |
<?php |
|
624 |
if (!$group): |
|
625 |
?> |
|
623 | 626 |
<a href="system_usermanager.php?act=delpriv&id=<?=$id?>&privid=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this privilege?");?>')"> |
624 | 627 |
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /> |
625 | 628 |
</a> |
626 |
<?php endif; ?> |
|
629 |
<?php |
|
630 |
endif; |
|
631 |
?> |
|
627 | 632 |
</td> |
628 | 633 |
</tr> |
629 |
<?php
|
|
630 |
/* can only delete user priv indexes */
|
|
631 |
if (!$group)
|
|
632 |
$i++;
|
|
633 |
endforeach;
|
|
634 |
endif;
|
|
635 |
?>
|
|
634 |
<?php |
|
635 |
/* can only delete user priv indexes */ |
|
636 |
if (!$group) |
|
637 |
$i++; |
|
638 |
endforeach; |
|
639 |
endif; |
|
640 |
?> |
|
636 | 641 |
<tr> |
637 | 642 |
<td class="list" colspan="3"></td> |
638 | 643 |
<td class="list"> |
... | ... | |
653 | 658 |
<td width="45%" class="listhdrr"><?=gettext("CA");?></td> |
654 | 659 |
<td class="list"></td> |
655 | 660 |
</tr> |
656 |
<?php |
|
657 |
|
|
658 |
$a_cert = $a_user[$id]['cert']; |
|
659 |
if(is_array($a_cert)): |
|
660 |
$i = 0; |
|
661 |
foreach ($a_cert as $certref): |
|
662 |
$cert = lookup_cert($certref); |
|
663 |
$ca = lookup_ca($cert['caref']); |
|
664 |
?> |
|
661 |
<?php |
|
662 |
$a_cert = $a_user[$id]['cert']; |
|
663 |
if(is_array($a_cert)): |
|
664 |
$i = 0; |
|
665 |
foreach ($a_cert as $certref): |
|
666 |
$cert = lookup_cert($certref); |
|
667 |
$ca = lookup_ca($cert['caref']); |
|
668 |
?> |
|
665 | 669 |
<tr> |
666 | 670 |
<td class="listlr"> |
667 | 671 |
<?=htmlspecialchars($cert['descr']);?> |
668 |
<?php if (is_cert_revoked($cert)): ?> |
|
672 |
<?php |
|
673 |
if (is_cert_revoked($cert)): |
|
674 |
?> |
|
669 | 675 |
(<b>Revoked</b>) |
670 |
<?php endif; ?> |
|
676 |
<?php |
|
677 |
endif; |
|
678 |
?> |
|
671 | 679 |
</td> |
672 | 680 |
<td class="listr"> |
673 | 681 |
<?=htmlspecialchars($ca['descr']);?> |
... | ... | |
684 | 692 |
</a> |
685 | 693 |
</td> |
686 | 694 |
</tr> |
687 |
<?php
|
|
688 |
$i++;
|
|
689 |
endforeach;
|
|
690 |
endif;
|
|
691 |
?>
|
|
695 |
<?php |
|
696 |
$i++; |
|
697 |
endforeach; |
|
698 |
endif; |
|
699 |
?> |
|
692 | 700 |
<tr> |
693 | 701 |
<td class="list" colspan="2"></td> |
694 | 702 |
<td class="list"> |
... | ... | |
701 | 709 |
</td> |
702 | 710 |
</tr> |
703 | 711 |
|
704 |
<?php else : ?> |
|
705 |
<?php if (is_array($config['ca']) && count($config['ca']) > 0): ?> |
|
706 |
<?php $i = 0; foreach( $config['ca'] as $ca) { |
|
707 |
if (!$ca['prv']) |
|
708 |
continue; |
|
709 |
$i++; |
|
710 |
} |
|
711 |
?> |
|
712 |
<?php |
|
713 |
else: |
|
714 |
if (is_array($config['ca']) && count($config['ca']) > 0): |
|
715 |
$i = 0; |
|
716 |
foreach( $config['ca'] as $ca) { |
|
717 |
if (!$ca['prv']) |
|
718 |
continue; |
|
719 |
$i++; |
|
720 |
} |
|
721 |
?> |
|
712 | 722 |
|
713 | 723 |
<tr id="usercertchck"> |
714 | 724 |
<td width="22%" valign="top" class="vncell"><?=gettext("Certificate");?></td> |
715 |
<td width="78%" class="vtable">
|
|
725 |
<td width="78%" class="vtable">
|
|
716 | 726 |
<input type="checkbox" onclick="javascript:usercertClicked(this)" /> <?=gettext("Click to create a user certificate."); ?> |
717 | 727 |
</td> |
718 | 728 |
</tr> |
719 | 729 |
|
720 |
<?php if ($i > 0): ?> |
|
721 |
|
|
730 |
<?php |
|
731 |
if ($i > 0): |
|
732 |
?> |
|
722 | 733 |
<tr id="usercert" style="display:none"> |
723 | 734 |
<td width="22%" valign="top" class="vncell"><?=gettext("Certificate");?></td> |
724 |
<td width="78%" class="vtable"> |
|
725 |
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="certificate"> |
|
726 |
<tr> |
|
727 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td> |
|
728 |
<td width="78%" class="vtable"> |
|
729 |
<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" /> |
|
730 |
</td> |
|
731 |
</tr> |
|
732 |
<tr> |
|
733 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate authority");?></td> |
|
734 |
<td width="78%" class="vtable"> |
|
735 |
<select name='caref' id='caref' class="formselect" onchange='internalca_change()'> |
|
736 |
<?php |
|
737 |
$rowIndex = 0; |
|
738 |
foreach( $config['ca'] as $ca): |
|
739 |
if (!$ca['prv']) |
|
740 |
continue; |
|
741 |
$rowIndex++; |
|
742 |
?> |
|
743 |
<option value="<?=$ca['refid'];?>"><?=$ca['descr'];?></option> |
|
744 |
<?php endforeach; |
|
745 |
if ($rowIndex == 0) |
|
746 |
echo "<option></option>"; |
|
747 |
?> |
|
748 |
</select> |
|
749 |
</td> |
|
750 |
</tr> |
|
751 |
<tr> |
|
752 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Key length");?></td> |
|
753 |
<td width="78%" class="vtable"> |
|
754 |
<select name='keylen' class="formselect"> |
|
755 |
<?php |
|
756 |
$cert_keylens = array( "2048", "512", "1024", "4096"); |
|
757 |
foreach( $cert_keylens as $len): |
|
758 |
?> |
|
759 |
<option value="<?=$len;?>"><?=$len;?></option> |
|
760 |
<?php |
|
761 |
endforeach; |
|
762 |
if (!count($cert_keylens)) |
|
763 |
echo "<option></option>"; |
|
764 |
?> |
|
765 |
</select> |
|
766 |
bits |
|
767 |
</td> |
|
768 |
</tr> |
|
769 |
<tr> |
|
770 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Lifetime");?></td> |
|
771 |
<td width="78%" class="vtable"> |
|
772 |
<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="5" value="<?=htmlspecialchars($pconfig['lifetime']);?>" />days |
|
773 |
</td> |
|
774 |
</tr> |
|
775 |
</table> |
|
735 |
<td width="78%" class="vtable"> |
|
736 |
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="certificate"> |
|
737 |
<tr> |
|
738 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td> |
|
739 |
<td width="78%" class="vtable"> |
|
740 |
<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>" /> |
|
741 |
</td> |
|
742 |
</tr> |
|
743 |
<tr> |
|
744 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate authority");?></td> |
|
745 |
<td width="78%" class="vtable"> |
|
746 |
<select name='caref' id='caref' class="formselect" onchange='internalca_change()'> |
|
747 |
<?php |
|
748 |
$rowIndex = 0; |
|
749 |
foreach( $config['ca'] as $ca): |
|
750 |
if (!$ca['prv']) |
|
751 |
continue; |
|
752 |
$rowIndex++; |
|
753 |
?> |
|
754 |
<option value="<?=$ca['refid'];?>"><?=$ca['descr'];?></option> |
|
755 |
<?php |
|
756 |
endforeach; |
|
757 |
if ($rowIndex == 0) |
|
758 |
echo "<option></option>"; |
|
759 |
?> |
|
760 |
</select> |
|
761 |
</td> |
|
762 |
</tr> |
|
763 |
<tr> |
|
764 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Key length");?></td> |
|
765 |
<td width="78%" class="vtable"> |
|
766 |
<select name='keylen' class="formselect"> |
|
767 |
<?php |
|
768 |
$cert_keylens = array( "2048", "512", "1024", "4096"); |
|
769 |
foreach( $cert_keylens as $len): |
|
770 |
?> |
|
771 |
<option value="<?=$len;?>"><?=$len;?></option> |
|
772 |
<?php |
|
773 |
endforeach; |
|
774 |
if (!count($cert_keylens)) |
|
775 |
echo "<option></option>"; |
|
776 |
?> |
|
777 |
</select> |
|
778 |
bits |
|
779 |
</td> |
|
780 |
</tr> |
|
781 |
<tr> |
|
782 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Lifetime");?></td> |
|
783 |
<td width="78%" class="vtable"> |
|
784 |
<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="5" value="<?=htmlspecialchars($pconfig['lifetime']);?>" />days |
|
785 |
</td> |
|
786 |
</tr> |
|
787 |
</table> |
|
776 | 788 |
</td> |
777 | 789 |
</tr> |
778 |
|
|
779 |
<?php endif; endif; ?> |
|
780 |
<?php endif; ?> |
|
781 |
|
|
790 |
<?php |
|
791 |
endif; |
|
792 |
endif; |
|
793 |
endif; |
|
794 |
?> |
|
782 | 795 |
<tr id="sshkeychck" <?php if(!empty($pconfig['authorizedkeys'])) echo 'style="display:none"'; ?>> |
783 |
<td width="22%" valign="top" class="vncell"><?=gettext("Authorized keys");?></td>
|
|
784 |
<td width="78%" class="vtable">
|
|
785 |
<input type="checkbox" onclick="javascript:sshkeyClicked(this)" /> <?=gettext("Click to paste an authorized key."); ?>
|
|
786 |
</td>
|
|
787 |
</tr>
|
|
796 |
<td width="22%" valign="top" class="vncell"><?=gettext("Authorized keys");?></td>
|
|
797 |
<td width="78%" class="vtable">
|
|
798 |
<input type="checkbox" onclick="javascript:sshkeyClicked(this)" /> <?=gettext("Click to paste an authorized key."); ?>
|
|
799 |
</td>
|
|
800 |
</tr>
|
|
788 | 801 |
<tr id="sshkey" <?php if(empty($pconfig['authorizedkeys'])) echo 'style="display:none"'; ?>> |
789 | 802 |
<td width="22%" valign="top" class="vncell"><?=gettext("Authorized keys");?></td> |
790 | 803 |
<td width="78%" class="vtable"> |
... | ... | |
817 | 830 |
</tr> |
818 | 831 |
</table> |
819 | 832 |
</form> |
820 |
|
|
821 |
<?php else: ?>
|
|
822 |
|
|
833 |
<?php |
|
834 |
else:
|
|
835 |
?> |
|
823 | 836 |
<table class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary=""> |
824 | 837 |
<thead> |
825 | 838 |
<tr> |
... | ... | |
854 | 867 |
</tr> |
855 | 868 |
</tfoot> |
856 | 869 |
<tbody> |
857 |
<?php
|
|
858 |
$i = 0;
|
|
859 |
foreach($a_user as $userent):
|
|
860 |
?>
|
|
870 |
<?php |
|
871 |
$i = 0; |
|
872 |
foreach($a_user as $userent): |
|
873 |
?> |
|
861 | 874 |
<tr ondblclick="document.location='system_usermanager.php?act=edit&id=<?=$i;?>'"> |
862 | 875 |
<td class="listlr"> |
863 | 876 |
<table border="0" cellpadding="0" cellspacing="0" summary="icons"> |
864 | 877 |
<tr> |
865 | 878 |
<td align="left" valign="middle"> |
866 |
<?php
|
|
867 |
if($userent['scope'] != "user")
|
|
868 |
$usrimg = "/themes/{$g['theme']}/images/icons/icon_system-user-grey.png";
|
|
869 |
else
|
|
870 |
$usrimg = "/themes/{$g['theme']}/images/icons/icon_system-user.png";
|
|
871 |
?>
|
|
879 |
<?php |
|
880 |
if($userent['scope'] != "user") |
|
881 |
$usrimg = "/themes/{$g['theme']}/images/icons/icon_system-user-grey.png"; |
|
882 |
else |
|
883 |
$usrimg = "/themes/{$g['theme']}/images/icons/icon_system-user.png"; |
|
884 |
?> |
|
872 | 885 |
<img src="<?=$usrimg;?>" alt="<?=gettext("User"); ?>" title="<?=gettext("User"); ?>" border="0" height="16" width="16" /> |
873 | 886 |
</td> |
874 | 887 |
<td align="left" valign="middle"> |
... | ... | |
880 | 893 |
<td class="listr"><?=htmlspecialchars($userent['descr']);?> </td> |
881 | 894 |
<td class="listr"><?php if(isset($userent['disabled'])) echo "*"; ?></td> |
882 | 895 |
<td class="listbg"> |
883 |
<?=implode(",",local_user_get_groups($userent));?>
|
|
896 |
<?=implode(",",local_user_get_groups($userent));?> |
|
884 | 897 |
|
885 | 898 |
</td> |
886 | 899 |
<td valign="middle" class="list nowrap"> |
887 | 900 |
<a href="system_usermanager.php?act=edit&id=<?=$i;?>"> |
888 | 901 |
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("edit user"); ?>" alt="<?=gettext("edit user"); ?>" width="17" height="17" border="0" /> |
889 | 902 |
</a> |
890 |
<?php if($userent['scope'] != "system"): ?> |
|
903 |
<?php |
|
904 |
if($userent['scope'] != "system"): |
|
905 |
?> |
|
891 | 906 |
|
892 | 907 |
<a href="system_usermanager.php?act=deluser&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this User?");?>')"> |
893 | 908 |
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete user"); ?>" alt="<?=gettext("delete user"); ?>" width="17" height="17" border="0" /> |
894 | 909 |
</a> |
895 |
<?php endif; ?> |
|
910 |
<?php |
|
911 |
endif; |
|
912 |
?> |
|
896 | 913 |
</td> |
897 | 914 |
</tr> |
898 |
<?php
|
|
899 |
$i++;
|
|
900 |
endforeach;
|
|
901 |
?>
|
|
915 |
<?php |
|
916 |
$i++; |
|
917 |
endforeach; |
|
918 |
?> |
|
902 | 919 |
</tbody> |
903 | 920 |
</table> |
904 |
|
|
905 |
<?php endif; ?>
|
|
906 |
|
|
921 |
<?php |
|
922 |
endif;
|
|
923 |
?> |
|
907 | 924 |
</div> |
908 | 925 |
</td> |
909 | 926 |
</tr> |
Formats disponibles : Unified diff
Fix indent and whitespaces